remove firewall port

This commit is contained in:
2026-01-13 13:32:13 +00:00
parent d4dfa0ad4b
commit 1c00cdb434

View File

@@ -146,7 +146,7 @@ func performSetup(ctx *deploymentContext) error {
step++ step++
printStep(step, totalSetupSteps, "configuring firewall") printStep(step, totalSetupSteps, "configuring firewall")
if err := runSSHCommand(ctx.serverIP, firewallScript(ctx.port)); err != nil { if err := runSSHCommand(ctx.serverIP, firewallScript()); err != nil {
return fmt.Errorf("firewall setup failed: %w", err) return fmt.Errorf("firewall setup failed: %w", err)
} }
@@ -280,18 +280,17 @@ func pocketbaseAsset(version, osName, arch string) string {
return fmt.Sprintf("pocketbase_%s_%s_%s.zip", version, osName, arch) return fmt.Sprintf("pocketbase_%s_%s_%s.zip", version, osName, arch)
} }
func firewallScript(port int) string { func firewallScript() string {
return fmt.Sprintf(`set -euo pipefail return fmt.Sprintf(`set -euo pipefail
if ! command -v ufw >/dev/null; then if ! command -v ufw >/dev/null; then
apt-get update -y apt-get update -y
apt-get install -y ufw apt-get install -y ufw
fi fi
ufw allow OpenSSH ufw allow OpenSSH
ufw allow %d/tcp
ufw allow 80/tcp ufw allow 80/tcp
ufw allow 443/tcp ufw allow 443/tcp
ufw --force enable ufw --force enable
`, port) `)
} }
func caddyScript(domain string, port int, serviceName string) string { func caddyScript(domain string, port int, serviceName string) string {