blob: b674377966fe638bd22a12ba4e623c7e27a94545 [file] [log] [blame]
giolekva8aa73e82022-07-09 11:34:39 +04001package soft
2
3type Repository struct {
4 Name string `json:"name"`
5 Repository string `json:"repo"`
6 Private bool `json:"private"`
7 Note string `json:"note"`
8}
9
10type User struct {
11 Name string `json:"name"`
12 Admin bool `json:"admin"`
13 PublicKeys []string `json:"public-keys"`
14}
15
16type Config struct {
17 Name string `json:"name"`
18 Host string `json:"host"`
19 Port int `json:"port"`
20 AnonAccess string `json:"anon-access"`
21 AllowKeyless bool `json:"allow-keyless"`
22 Repositories []Repository `json:"repos"`
23 Users []User `json:"users"`
24}
25
26func DefaultConfig(adminKeys []string) Config {
27 return Config{
28 Name: "PCloud",
29 Host: "localhost",
30 Port: 22,
31 AnonAccess: "no-access",
32 AllowKeyless: false,
33 Repositories: []Repository{
34 {
35 Name: "Home",
36 Repository: "config",
37 Private: true,
38 Note: "Configuration for PCloud SoftServe deployment",
39 },
40 },
41 Users: []User{
42 {
43 Name: "Admin",
44 Admin: true,
45 PublicKeys: adminKeys,
46 },
47 },
48 }
49}