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

feat: 添加密码复杂度验证

This commit is contained in:
耗子
2024-10-17 18:40:27 +08:00
parent 2112e86329
commit b36f7f3085
9 changed files with 73 additions and 11 deletions

View File

@@ -147,6 +147,10 @@ func (r *Firewall) Port(rule FireInfo, operation Operation) error {
return r.RichRules(rule, operation)
}
// 未设置协议默认为tcp/udp
if rule.Protocol == "" {
rule.Protocol = ProtocolTCPUDP
}
protocols := strings.Split(string(rule.Protocol), "/")
for protocol := range slices.Values(protocols) {
stdout, err := shell.Execf("firewall-cmd --zone=public --%s-port=%d-%d/%s --permanent", operation, rule.PortStart, rule.PortEnd, protocol)