Home

ugit @126193aaf4f1d9fcc69b9e3482ed1e0d208c3e38 - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
ugit / cmd / ugitd / args.cue
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import "strings"

// Schema
#Port: int & >0 & <65536
#Link: string & strings.Contains(",")

#Config: {
	"repo-dir":     string
	"show-private": bool
	ssh: {
		enable:            bool
		"authorized-keys": string
		"clone-url":       string
		port:              #Port
		"host-key":        string
	}
	http: {
		enable:      bool
		"clone-url": string
		port:        #Port
	}
	meta: {
		title:       string
		description: string
	}
	profile?: {
		username?: string
		email?:    string
		links?: [...#Link]
	}
	log: {
		json:  bool
		level: "debug" | "info" | "warn" | "warning" | "error"
	}

	// Constraints
	if ssh.port == http.port {
		error("ssh.port and http.port cannot be the same")
	}
}

// Defaults
#Config: {
	"repo-dir":     ".ugit"
	"show-private": false
	ssh: {
		enable:            true
		"authorized-keys": ".ssh/authorized_keys"
		"clone-url":       "ssh://localhost:8448"
		port:              8448
		"host-key":        ".ssh/ugit_ed25519"
	}
	http: {
		enable:      true
		"clone-url": "http://localhost:8449"
		port:        8449
	}
	meta: {
		title:       "uGit"
		description: "Minimal git server"
	}
	log: {
		json:  false
		level: "info"
	}
}

// Apply schema
#Config