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

Refs #2811
This commit is contained in:
ssongliu
2023-11-06 13:27:28 +00:00
committed by GitHub
parent 8d9b21e4a2
commit bb93cb076e
2 changed files with 4 additions and 3 deletions
+4 -2
View File
@@ -538,8 +538,10 @@ func (u *FirewallService) addPortsBeforeStart(client firewall.FirewallClient) er
}
apps := u.loadPortByApp()
for _, app := range apps {
if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil {
return err
if len(app.HttpPort) != 0 && app.HttpPort != "0" {
if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil {
return err
}
}
}
-1
View File
@@ -258,7 +258,6 @@ const onDelete = async (row: Cronjob.CronjobInfo | null) => {
if (hasBackup(row.type)) {
showClean.value = true;
}
return;
} else {
for (const item of selects.value) {
names.push(item.name);