diff options
Diffstat (limited to 'cmd/serve.go')
-rw-r--r-- | cmd/serve.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd/serve.go b/cmd/serve.go index 23909623..28fd4013 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -27,12 +27,20 @@ var CmdServ = cli.Command{ Usage: "This command should only be called by SSH shell", Description: `Serv provide access auth for repositories`, Action: runServ, - Flags: []cli.Flag{}, + Flags: []cli.Flag{ + cli.StringFlag{"config, c", "custom/conf/app.ini", "Custom configuration file path", ""}, + }, } func setup(logPath string) { setting.NewConfigContext() log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath)) + + if setting.DisableSSH { + println("Gogs: SSH has been disabled") + os.Exit(1) + } + models.LoadModelsConfig() if models.UseSQLite3 { @@ -77,6 +85,9 @@ func In(b string, sl map[string]models.AccessType) bool { } func runServ(k *cli.Context) { + if k.IsSet("config") { + setting.CustomConf = k.String("config") + } setup("serv.log") keys := strings.Split(os.Args[2], "-") |