2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 09:13:49 +08:00

fix: 修复一些遗留问题

This commit is contained in:
2026-01-09 21:48:21 +08:00
parent 97a15b7dd4
commit 52df9c8955
2 changed files with 15 additions and 9 deletions

View File

@@ -3,15 +3,21 @@ app:
key: a-long-string-with-32-characters
locale: zh_CN
timezone: Asia/Shanghai
root: /opt/ace
api_endpoint: api.acepanel.net
download_endpoint: dl.acepanel.net
http:
debug: false
port: 8888
entrance: /
entrance_error: ""
tls: true
ip_header: ''
bind_domain: []
bind_ip: []
bind_ua: []
acme: true
login_captcha: true
ip_header: ""
bind_domain: [ ]
bind_ip: [ ]
bind_ua: [ ]
database:
debug: false
session:

View File

@@ -660,8 +660,8 @@ func (r *backupRepo) FixPanel() error {
}
// 下载服务文件
if !io.Exists("/etc/systemd/system/panel.service") {
if _, err = shell.Execf(`wget -O /etc/systemd/system/panel.service https://%s/panel.service && sed -i "s|/opt/ace|%s|g" /etc/systemd/system/panel.service`, r.conf.App.DownloadEndpoint, app.Root); err != nil {
if !io.Exists("/etc/systemd/system/acepanel.service") {
if _, err = shell.Execf(`wget -O /etc/systemd/system/acepanel.service https://%s/acepanel.service && sed -i "s|/opt/ace|%s|g" /etc/systemd/system/acepanel.service`, r.conf.App.DownloadEndpoint, app.Root); err != nil {
return err
}
}
@@ -676,7 +676,7 @@ func (r *backupRepo) FixPanel() error {
if err = io.Chmod(filepath.Join(app.Root, "panel", "storage", "panel.db"), 0600); err != nil {
return err
}
if err = io.Chmod("/etc/systemd/system/panel.service", 0644); err != nil {
if err = io.Chmod("/etc/systemd/system/acepanel.service", 0644); err != nil {
return err
}
if err = io.Chmod("/usr/local/sbin/acepanel", 0700); err != nil {
@@ -792,7 +792,7 @@ func (r *backupRepo) UpdatePanel(version, url, checksum string) error {
return errors.New(r.t.Get("|-Run post-update script failed: %v", err))
}
if _, err := shell.Execf(
`wget -O /etc/systemd/system/panel.service https://%s/panel.service && sed -i "s|/www|%s|g" /etc/systemd/system/panel.service`,
`wget -O /etc/systemd/system/acepanel.service https://%s/acepanel.service && sed -i "s|/www|%s|g" /etc/systemd/system/acepanel.service`,
r.conf.App.DownloadEndpoint, app.Root,
); err != nil {
return errors.New(r.t.Get("|-Download panel service file failed: %v", err))
@@ -808,7 +808,7 @@ func (r *backupRepo) UpdatePanel(version, url, checksum string) error {
fmt.Println(r.t.Get("|-Set key file permissions..."))
}
_ = io.Chmod("/usr/local/sbin/acepanel", 0700)
_ = io.Chmod("/etc/systemd/system/panel.service", 0644)
_ = io.Chmod("/etc/systemd/system/acepanel.service", 0644)
_ = io.Chmod(filepath.Join(app.Root, "panel"), 0700)
if app.IsCli {