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
|
/*
func main() {
var instanceName string
args := os.Args
if len(args) < 2 {
instanceName = "default"
fmt.Println("Loading default config")
} else {
instanceName = args[1]
fmt.Printf("Loading instance: [%s] config", instanceName)
}
cfg, err := LoadConfig(os.Getenv("HOME") + "/.config/altgit-" + instanceName + ".cfg")
if err != nil {
fmt.Println("Could not load config file", err)
os.Exit(1)
}
fmt.Println(instanceName)
router := gin.Default()
router.SetTrustedProxies([]string{"127.0.0.1"})
router.Use(AddressAllowList(cfg.AllowList))
gin.SetMode(gin.ReleaseMode)
router.GET("/secret/:secretname", ReadSecret(cfg))
if cfg.ServerTLSCertificate == "" || cfg.ServerTLSKey == "" {
router.Run(cfg.Endpoint)
} else {
router.RunTLS(cfg.Endpoint, cfg.ServerTLSCertificate, cfg.ServerTLSKey)
}
}
*/
|