Skip to content

Commit bb93cb0

Browse files
authored
fix: 解决 UFW 防火墙启用失败的问题 (#2823)
Refs #2811
1 parent 8d9b21e commit bb93cb0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

backend/app/service/firewall.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,10 @@ func (u *FirewallService) addPortsBeforeStart(client firewall.FirewallClient) er
538538
}
539539
apps := u.loadPortByApp()
540540
for _, app := range apps {
541-
if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil {
542-
return err
541+
if len(app.HttpPort) != 0 && app.HttpPort != "0" {
542+
if err := client.Port(fireClient.FireInfo{Port: app.HttpPort, Protocol: "tcp", Strategy: "accept"}, "add"); err != nil {
543+
return err
544+
}
543545
}
544546
}
545547

frontend/src/views/cronjob/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ const onDelete = async (row: Cronjob.CronjobInfo | null) => {
258258
if (hasBackup(row.type)) {
259259
showClean.value = true;
260260
}
261-
return;
262261
} else {
263262
for (const item of selects.value) {
264263
names.push(item.name);

0 commit comments

Comments
 (0)