summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2026-03-25 18:23:14 +1100
committerSt33v <github@f3rr3t.com>2026-03-25 18:23:14 +1100
commitc132b3985e24e557549544a1d10fb0daababdfb1 (patch)
tree03a22b64a9d0742f3313b23a6ec0acee31fbc4c9 /setup.sh
parent0b7ad7787794e7e0f14eb3e6ada7139fd1b47c78 (diff)
Update cremonde deployment and runtime checks
Diffstat (limited to 'setup.sh')
-rwxr-xr-xsetup.sh26
1 files changed, 17 insertions, 9 deletions
diff --git a/setup.sh b/setup.sh
index 14c2eec..f2707d9 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail
-# Run once on pestrel as root (or with sudo) to install the synoptic service.
+# Run once on cremonde as root (or with sudo) to install the synoptic service.
# Usage: sudo ./setup.sh
if [ "$(id -u)" -ne 0 ]; then
@@ -13,6 +13,12 @@ SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
OWNER=st33v
# ---------------------------------------------------------------------------
+# Packages
+# ---------------------------------------------------------------------------
+echo "==> Installing required packages..."
+pacman -Sy --needed --noconfirm curl imagemagick ghostscript nginx
+
+# ---------------------------------------------------------------------------
# Nginx conflict checks
# ---------------------------------------------------------------------------
echo "==> Checking for nginx conflicts..."
@@ -45,13 +51,15 @@ install -d -o "$OWNER" -g "$OWNER" /opt/synoptic
install -d -o "$OWNER" -g "$OWNER" /var/lib/synoptic
install -d -o "$OWNER" -g "$OWNER" /var/lib/synoptic/archive
install -d -o "$OWNER" -g "$OWNER" /var/lib/synoptic/archive/raw
-install -d -o "$OWNER" -g "$OWNER" /srv/www
+install -d /srv/www
+install -d -o "$OWNER" -g "$OWNER" /srv/www/pestrel
+chown "$OWNER:$OWNER" /srv/www/pestrel
# ---------------------------------------------------------------------------
# Web content
# ---------------------------------------------------------------------------
echo "==> Writing index.html..."
-install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/index.html" /srv/www/index.html
+install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/index.html" /srv/www/pestrel/index.html
# ---------------------------------------------------------------------------
# Systemd units
@@ -69,14 +77,14 @@ systemctl enable --now synoptic.timer
# ---------------------------------------------------------------------------
# Nginx
# ---------------------------------------------------------------------------
-echo "==> Installing nginx config..."
-install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf
+#echo "==> Installing nginx config..."
+#install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf
-echo "==> Testing nginx config..."
-nginx -t
+#echo "==> Testing nginx config..."
+#nginx -t
-echo "==> Reloading nginx..."
-systemctl reload nginx
+#echo "==> Reloading nginx..."
+#systemctl reload nginx
# ---------------------------------------------------------------------------
echo "==> Done."