diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-09-07 16:31:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-07 08:31:46 +0000 |
commit | e97e883ad50774f249c8c694598c25a17227299b (patch) | |
tree | ad48381f40d2be7cb14265625f2fe7138f509537 /modules/setting | |
parent | 1221221595122c212ace8bc50f2904bead8d2655 (diff) | |
download | gitea-e97e883ad50774f249c8c694598c25a17227299b.tar.gz gitea-e97e883ad50774f249c8c694598c25a17227299b.zip |
Add reverseproxy auth for API back with default disabled (#26703)
This feature was removed by #22219 to avoid possible CSRF attack.
This PR takes reverseproxy auth for API back but with default disabled.
To prevent possbile CSRF attack, the responsibility will be the
reverseproxy but not Gitea itself.
For those want to enable this `ENABLE_REVERSE_PROXY_AUTHENTICATION_API`,
they should know what they are doing.
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/service.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/service.go b/modules/setting/service.go index 74a7e90f7c..3ea1501236 100644 --- a/modules/setting/service.go +++ b/modules/setting/service.go @@ -46,6 +46,7 @@ var Service = struct { EnableNotifyMail bool EnableBasicAuth bool EnableReverseProxyAuth bool + EnableReverseProxyAuthAPI bool EnableReverseProxyAutoRegister bool EnableReverseProxyEmail bool EnableReverseProxyFullName bool @@ -157,6 +158,7 @@ func loadServiceFrom(rootCfg ConfigProvider) { Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool() Service.EnableBasicAuth = sec.Key("ENABLE_BASIC_AUTHENTICATION").MustBool(true) Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool() + Service.EnableReverseProxyAuthAPI = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION_API").MustBool() Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool() Service.EnableReverseProxyEmail = sec.Key("ENABLE_REVERSE_PROXY_EMAIL").MustBool() Service.EnableReverseProxyFullName = sec.Key("ENABLE_REVERSE_PROXY_FULL_NAME").MustBool() |