mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user