mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] skip trusted-proxies
warning if ip excepted from rate limiting (#3699)
* [chore] skip `trusted-proxies` warning if ip excepted from rate limiting * weep * typo * fix env parsing test
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
"time"
|
||||
|
||||
"codeberg.org/gruf/go-bytesize"
|
||||
@@ -2681,6 +2682,35 @@ func GetAdvancedRateLimitExceptions() []string { return global.GetAdvancedRateLi
|
||||
// SetAdvancedRateLimitExceptions safely sets the value for global configuration 'AdvancedRateLimitExceptions' field
|
||||
func SetAdvancedRateLimitExceptions(v []string) { global.SetAdvancedRateLimitExceptions(v) }
|
||||
|
||||
// GetAdvancedRateLimitExceptionsParsed safely fetches the Configuration value for state's 'AdvancedRateLimitExceptionsParsed' field
|
||||
func (st *ConfigState) GetAdvancedRateLimitExceptionsParsed() (v []netip.Prefix) {
|
||||
st.mutex.RLock()
|
||||
v = st.config.AdvancedRateLimitExceptionsParsed
|
||||
st.mutex.RUnlock()
|
||||
return
|
||||
}
|
||||
|
||||
// SetAdvancedRateLimitExceptionsParsed safely sets the Configuration value for state's 'AdvancedRateLimitExceptionsParsed' field
|
||||
func (st *ConfigState) SetAdvancedRateLimitExceptionsParsed(v []netip.Prefix) {
|
||||
st.mutex.Lock()
|
||||
defer st.mutex.Unlock()
|
||||
st.config.AdvancedRateLimitExceptionsParsed = v
|
||||
st.reloadToViper()
|
||||
}
|
||||
|
||||
// AdvancedRateLimitExceptionsParsedFlag returns the flag name for the 'AdvancedRateLimitExceptionsParsed' field
|
||||
func AdvancedRateLimitExceptionsParsedFlag() string { return "" }
|
||||
|
||||
// GetAdvancedRateLimitExceptionsParsed safely fetches the value for global configuration 'AdvancedRateLimitExceptionsParsed' field
|
||||
func GetAdvancedRateLimitExceptionsParsed() []netip.Prefix {
|
||||
return global.GetAdvancedRateLimitExceptionsParsed()
|
||||
}
|
||||
|
||||
// SetAdvancedRateLimitExceptionsParsed safely sets the value for global configuration 'AdvancedRateLimitExceptionsParsed' field
|
||||
func SetAdvancedRateLimitExceptionsParsed(v []netip.Prefix) {
|
||||
global.SetAdvancedRateLimitExceptionsParsed(v)
|
||||
}
|
||||
|
||||
// GetAdvancedThrottlingMultiplier safely fetches the Configuration value for state's 'AdvancedThrottlingMultiplier' field
|
||||
func (st *ConfigState) GetAdvancedThrottlingMultiplier() (v int) {
|
||||
st.mutex.RLock()
|
||||
|
Reference in New Issue
Block a user