mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat: add ip whitelist
This commit is contained in:
parent
7a9aa3a33b
commit
3b937ee0f4
17 changed files with 1026 additions and 927 deletions
9
settings/auth.go
Normal file
9
settings/auth.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package settings
|
||||
|
||||
type Auth struct {
|
||||
IPWhiteList []string `ini:",,allowshadow"`
|
||||
BanThresholdMinutes int `json:"ban_threshold_minutes" binding:"min=1"`
|
||||
MaxAttempts int `json:"max_attempts" binding:"min=1"`
|
||||
}
|
||||
|
||||
var AuthSettings = Auth{}
|
|
@ -27,6 +27,7 @@ var sections = map[string]interface{}{
|
|||
"casdoor": &CasdoorSettings,
|
||||
"logrotate": &LogrotateSettings,
|
||||
"cluster": &ClusterSettings,
|
||||
"auth": &AuthSettings,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
@ -62,6 +63,7 @@ func Setup() {
|
|||
parseEnv(&OpenAISettings, "OPENAI_")
|
||||
parseEnv(&CasdoorSettings, "CASDOOR_")
|
||||
parseEnv(&LogrotateSettings, "LOGROTATE_")
|
||||
parseEnv(&AuthSettings, "AUTH_")
|
||||
|
||||
// if in official docker, set the restart cmd of nginx to "nginx -s stop",
|
||||
// then the supervisor of s6-overlay will start the nginx again.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue