mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 14:57:16 +08:00
feat: 添加一些默认设置
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user