forked from forgejo/forgejo
Merge pull request #905 from phsmit/conf_on_cli
Add option to provide configuration file on command line
This commit is contained in:
commit
cd0ee35b3f
8 changed files with 37 additions and 13 deletions
|
@ -27,7 +27,9 @@ 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", "Configuration file", ""},
|
||||
},
|
||||
}
|
||||
|
||||
func setup(logPath string) {
|
||||
|
@ -83,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], "-")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue