remove firewall port
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user