summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorPatrick G <geek1011@outlook.com>2017-10-14 11:51:00 -0400
committerLauris BH <lauris@nix.lv>2017-10-14 18:51:00 +0300
commite89bb7ef6a6848615a56f8c568ae335de0c2e9e7 (patch)
treeaab1716cd9dffc017d27fe91b04364ed5004bd7b /modules/setting/setting.go
parent514006a2e5a33074fba5ac2deab9ab91cf5713a2 (diff)
downloadgitea-e89bb7ef6a6848615a56f8c568ae335de0c2e9e7.tar.gz
gitea-e89bb7ef6a6848615a56f8c568ae335de0c2e9e7.zip
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
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 6b1b269b73..85ffa643a9 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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()