diff options
author | zeripath <art27@cantab.net> | 2019-11-14 22:39:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 22:39:48 +0000 |
commit | dd1beee2ef907527d0b046f78bab70b2bd868c55 (patch) | |
tree | 80b8bf73916143d0dd082ee9600935eb6301b9fd /modules/setting | |
parent | 3621944c2d381d159cf2622328927cf282f0b3e0 (diff) | |
download | gitea-dd1beee2ef907527d0b046f78bab70b2bd868c55.tar.gz gitea-dd1beee2ef907527d0b046f78bab70b2bd868c55.zip |
Enforce Gitea environment for pushes (#8982)
* Enforce Gitea environment for pushes
* Update custom/conf/app.ini.sample
Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f3dd45d7bf..c0b9b99e3c 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -140,18 +140,19 @@ var ( } // Security settings - InstallLock bool - SecretKey string - LogInRememberDays int - CookieUserName string - CookieRememberName string - ReverseProxyAuthUser string - ReverseProxyAuthEmail string - MinPasswordLength int - ImportLocalPaths bool - DisableGitHooks bool - PasswordComplexity []string - PasswordHashAlgo string + InstallLock bool + SecretKey string + LogInRememberDays int + CookieUserName string + CookieRememberName string + ReverseProxyAuthUser string + ReverseProxyAuthEmail string + MinPasswordLength int + ImportLocalPaths bool + DisableGitHooks bool + OnlyAllowPushIfGiteaEnvironmentSet bool + PasswordComplexity []string + PasswordHashAlgo string // UI settings UI = struct { @@ -778,6 +779,7 @@ func NewContext() { MinPasswordLength = sec.Key("MIN_PASSWORD_LENGTH").MustInt(6) ImportLocalPaths = sec.Key("IMPORT_LOCAL_PATHS").MustBool(false) DisableGitHooks = sec.Key("DISABLE_GIT_HOOKS").MustBool(false) + OnlyAllowPushIfGiteaEnvironmentSet = sec.Key("ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET").MustBool(true) PasswordHashAlgo = sec.Key("PASSWORD_HASH_ALGO").MustString("pbkdf2") CSRFCookieHTTPOnly = sec.Key("CSRF_COOKIE_HTTP_ONLY").MustBool(true) |