remove firewall port
This commit is contained in:
@@ -146,7 +146,7 @@ func performSetup(ctx *deploymentContext) error {
|
||||
|
||||
step++
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -280,18 +280,17 @@ func pocketbaseAsset(version, osName, arch string) string {
|
||||
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
|
||||
if ! command -v ufw >/dev/null; then
|
||||
apt-get update -y
|
||||
apt-get install -y ufw
|
||||
fi
|
||||
ufw allow OpenSSH
|
||||
ufw allow %d/tcp
|
||||
ufw allow 80/tcp
|
||||
ufw allow 443/tcp
|
||||
ufw --force enable
|
||||
`, port)
|
||||
`)
|
||||
}
|
||||
|
||||
func caddyScript(domain string, port int, serviceName string) string {
|
||||
|
||||
Reference in New Issue
Block a user