fix: 解决 UFW 防火墙启用失败的问题 (#2823)

Refs #2811
This commit is contained in:
ssongliu 2023-11-06 21:27:28 +08:00 committed by GitHub
parent 8d9b21e4a2
commit bb93cb076e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -538,8 +538,10 @@ func (u *FirewallService) addPortsBeforeStart(client firewall.FirewallClient) er
} }
apps := u.loadPortByApp() apps := u.loadPortByApp()
for _, app := range apps { for _, app := range apps {
if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil { if len(app.HttpPort) != 0 && app.HttpPort != "0" {
return err if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil {
return err
}
} }
} }

View file

@ -258,7 +258,6 @@ const onDelete = async (row: Cronjob.CronjobInfo | null) => {
if (hasBackup(row.type)) { if (hasBackup(row.type)) {
showClean.value = true; showClean.value = true;
} }
return;
} else { } else {
for (const item of selects.value) { for (const item of selects.value) {
names.push(item.name); names.push(item.name);