enhance: validate settings value before save

This commit is contained in:
0xJacky 2024-01-27 23:01:07 +08:00
parent d70e37c857
commit d67b8428e4
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
8 changed files with 83 additions and 26 deletions

View file

@ -10,10 +10,10 @@ type Server struct {
Email string `json:"email" protected:"true"`
Database string `json:"database" protected:"true"`
StartCmd string `json:"start_cmd" protected:"true"`
CADir string `json:"ca_dir"`
CADir string `json:"ca_dir" binding:"omitempty,url"`
Demo bool `json:"demo" protected:"true"`
PageSize int `json:"page_size" protected:"true"`
GithubProxy string `json:"github_proxy"`
GithubProxy string `json:"github_proxy" binding:"omitempty,url"`
}
var ServerSettings = Server{