aboutsummaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2026-07-31 21:12:16 +0200
committerKaran Jayachandra <mail@karanjayachandra.com>2026-07-31 21:12:16 +0200
commit2144d31a0455ba32a7a0b655afdef33632a8724d (patch)
treea5bb01f93649511360dabdfb13524082d3e4edfc /deploy.sh
parentabfbee7c9b2632dcbd07e7940f8805942a93d14c (diff)
Hardened the server by blocking port 53 and added a deploy script
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh
new file mode 100755
index 0000000..c5ae6b6
--- /dev/null
+++ b/deploy.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -euo pipefail
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+if [ ! -f .env ]; then
+ echo "Missing .env - copy .env.example to .env and set SERVER_IP (the server's Tailscale IP)." >&2
+ exit 1
+fi
+
+set -a
+source .env
+set +a
+
+: "${SERVER_IP:?SERVER_IP must be set in .env}"
+
+nixos-rebuild switch --flake .#eurovm \
+ --target-host "admin@${SERVER_IP}" \
+ --build-host "admin@${SERVER_IP}" \
+ --elevate=sudo