💾 Archived View for gemini.rmf-dev.com › repo › Vaati › Gemigit › files › f007271af9f4aff3655544c317… captured on 2023-03-20 at 18:02:50. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
0 package config
1
2 import "github.com/kkyr/fig"
3
4 var Cfg Config
5
6 type Config struct {
7 Title string `validate:"required"`
8 Database struct {
9 Type string `validate:"required"`
10 Url string `validate:"required"`
11 }
12 Gemini struct {
13 Certificate string `validate:"required"`
14 Key string `validate:"required"`
15 Address string `validate:"required"`
16 Port string `validate:"required"`
17 Templates string `validate:"required"`
18 }
19 Git struct {
20 Https bool
21 Domain string `validate:"required"`
22 Remote struct {
23 Enabled bool
24 Url string
25 Address string
26 Key string
27 }
28 Address string `validate:"required"`
29 Port int `validate:"required"`
30 Key string
31 }
32 Ldap struct {
33 Enabled bool
34 Url string
35 Attribute string
36 Binding string
37 }
38 Users struct {
39 Registration bool
40 }
41 Protection struct {
42 Ip int `validate:"required"`
43 Account int `validate:"required"`
44 Reset int `validate:"required"`
45 }
46 }
47
48 func LoadConfig() error {
49 err := fig.Load(
50 &Cfg,
51 fig.File("config.yaml"),
52 fig.Dirs(".", "/etc/gemigit", "/usr/local/etc/gemigit"),
53 )
54 if err == nil && Cfg.Ldap.Enabled {
55 Cfg.Users.Registration = false
56 }
57 return err
58 }
59