diff --git a/internal/biz/setting.go b/internal/biz/setting.go index 9458b525..85b4cd82 100644 --- a/internal/biz/setting.go +++ b/internal/biz/setting.go @@ -20,6 +20,8 @@ const ( SettingKeyOfflineMode SettingKey = "offline_mode" SettingKeyAutoUpdate SettingKey = "auto_update" SettingKeyWebserver SettingKey = "webserver" + SettingHiddenMenu SettingKey = "hidden_menu" + SettingKeyCustomLogo SettingKey = "custom_logo" ) type Setting struct { diff --git a/internal/data/website.go b/internal/data/website.go index 12feda48..d53e936e 100644 --- a/internal/data/website.go +++ b/internal/data/website.go @@ -815,6 +815,9 @@ func (r *websiteRepo) reloadWebServer() error { _, err = shell.Execf("apachectl configtest") return err } + default: + return errors.New(r.t.Get("unsupported web server: %s", webServer)) } - return errors.New(r.t.Get("unsupported web server: %s", webServer)) + + return nil } diff --git a/internal/service/cli.go b/internal/service/cli.go index f3b104f2..ef8a9862 100644 --- a/internal/service/cli.go +++ b/internal/service/cli.go @@ -878,6 +878,7 @@ func (s *CliService) Init(ctx context.Context, cmd *cli.Command) error { {Key: biz.SettingKeyWebsitePath, Value: filepath.Join(app.Root, "wwwroot")}, {Key: biz.SettingKeyOfflineMode, Value: "false"}, {Key: biz.SettingKeyAutoUpdate, Value: "true"}, + {Key: biz.SettingHiddenMenu, Value: "[]"}, } if err := s.db.Create(&settings).Error; err != nil { return errors.New(s.t.Get("Initialization failed: %v", err)) diff --git a/pkg/config/config.go b/pkg/config/config.go index 6ac5763a..8f325259 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -29,14 +29,16 @@ type AppConfig struct { } type HTTPConfig struct { - Debug bool `yaml:"debug"` - Port uint `yaml:"port"` - Entrance string `yaml:"entrance"` - TLS bool `yaml:"tls"` - IPHeader string `yaml:"ip_header"` - BindDomain []string `yaml:"bind_domain"` - BindIP []string `yaml:"bind_ip"` - BindUA []string `yaml:"bind_ua"` + Debug bool `yaml:"debug"` + Port uint `yaml:"port"` + Entrance string `yaml:"entrance"` + EntranceError string `yaml:"entrance_error"` + TLS bool `yaml:"tls"` + LoginCaptcha bool `yaml:"login_captcha"` + IPHeader string `yaml:"ip_header"` + BindDomain []string `yaml:"bind_domain"` + BindIP []string `yaml:"bind_ip"` + BindUA []string `yaml:"bind_ua"` } type DatabaseConfig struct {