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

Refs #2811
pull/2827/head
ssongliu 1 year ago committed by GitHub
parent 8d9b21e4a2
commit bb93cb076e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}
}
}

@ -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);

Loading…
Cancel
Save