Allow custom SSH user in UI for built-in SSH server (#2617) (#2678)

* Allow custom SSH user in UI for built-in SSH server (#2617)

* Some fixes

* Did make fmt

* Updated according to review

- Renamed config to BUILTIN_SSH_SERVER_USER
- Removed unnecessary default string value for config item

* Updated according to review

* Fixed some minor issues
This commit is contained in:
Patrick G 2017-10-14 11:51:00 -04:00 committed by Lauris BH
parent 514006a2e5
commit e89bb7ef6a
3 changed files with 13 additions and 3 deletions

View file

@ -90,6 +90,7 @@ var (
SSH = struct {
Disabled bool `ini:"DISABLE_SSH"`
StartBuiltinServer bool `ini:"START_SSH_SERVER"`
BuiltinServerUser string `ini:"BUILTIN_SSH_SERVER_USER"`
Domain string `ini:"SSH_DOMAIN"`
Port int `ini:"SSH_PORT"`
ListenHost string `ini:"SSH_LISTEN_HOST"`
@ -915,6 +916,8 @@ func NewContext() {
}
}
SSH.BuiltinServerUser = Cfg.Section("server").Key("BUILTIN_SSH_SERVER_USER").MustString(RunUser)
// Determine and create root git repository path.
sec = Cfg.Section("repository")
Repository.DisableHTTPGit = sec.Key("DISABLE_HTTP_GIT").MustBool()