diff options
| author | St33v <github@f3rr3t.com> | 2026-06-09 13:04:04 +1000 |
|---|---|---|
| committer | St33v <github@f3rr3t.com> | 2026-06-09 13:04:04 +1000 |
| commit | f058e83da43b0b661b45a7bd4c82b49c57e61d93 (patch) | |
| tree | effc21ef57b00b45c8caa29424772f7fbbde03d8 /setup.sh | |
| parent | c132b3985e24e557549544a1d10fb0daababdfb1 (diff) | |
Add IDR713 radar fetch and APNG loop
radarFetch.sh fetches BOM IDR713 transparencies (24h cache) and the
last six 6-minute echo frames, composites them via cached lower/upper
plates, and publishes an APNG loop to /srv/www/radar/.
systemd: radar.{service,timer} on a 6-min cadence, with retry units
mirroring the synoptic pattern.
nginx: new radar.pestrel.com vhost (still commented in setup.sh until
DNS propagation is confirmed).
setup.sh provisions radar dirs, installs radar units, enables timer.
deploy.sh accepts synoptic|radar arg.
Parameterised on product code; adding another radar is a one-line
config change.
Spec: doc/bom-radar-spec.md.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'setup.sh')
| -rwxr-xr-x | setup.sh | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -30,6 +30,11 @@ if grep -rl "server_name.*pestrel\.com" /etc/nginx/ 2>/dev/null; then CONFLICT=1 fi +if grep -rl "server_name.*radar\.pestrel\.com" /etc/nginx/ 2>/dev/null; then + echo "WARNING: The above nginx config(s) already reference radar.pestrel.com — check for duplicate server blocks." + CONFLICT=1 +fi + if grep -rl "listen.*80.*default_server" /etc/nginx/ 2>/dev/null; then echo "WARNING: The above nginx config(s) define a default_server on port 80 — may intercept traffic intended for this site." CONFLICT=1 @@ -55,30 +60,41 @@ install -d /srv/www install -d -o "$OWNER" -g "$OWNER" /srv/www/pestrel chown "$OWNER:$OWNER" /srv/www/pestrel +install -d -o "$OWNER" -g "$OWNER" /opt/radar +install -d -o "$OWNER" -g "$OWNER" /var/lib/radar +install -d -o "$OWNER" -g "$OWNER" /srv/www/radar + # --------------------------------------------------------------------------- # Web content # --------------------------------------------------------------------------- echo "==> Writing index.html..." install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/index.html" /srv/www/pestrel/index.html +install -o "$OWNER" -g "$OWNER" -m 644 "$SCRIPT_DIR/radar.index.html" /srv/www/radar/index.html + +echo "==> Installing radarFetch.sh..." +install -o "$OWNER" -g "$OWNER" -m 755 "$SCRIPT_DIR/radarFetch.sh" /opt/radar/radarFetch.sh # --------------------------------------------------------------------------- # Systemd units # --------------------------------------------------------------------------- echo "==> Installing systemd unit files..." -for unit in synoptic.service synoptic.timer synoptic-retry.service synoptic-retry.timer; do +for unit in synoptic.service synoptic.timer synoptic-retry.service synoptic-retry.timer \ + radar.service radar.timer radar-retry.service radar-retry.timer; do install -m 644 "$SCRIPT_DIR/systemd/${unit}" "/etc/systemd/system/${unit}" echo " installed ${unit}" done -echo "==> Reloading systemd and enabling timer..." +echo "==> Reloading systemd and enabling timers..." systemctl daemon-reload systemctl enable --now synoptic.timer +systemctl enable --now radar.timer # --------------------------------------------------------------------------- # Nginx # --------------------------------------------------------------------------- -#echo "==> Installing nginx config..." -#install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf +#echo "==> Installing nginx configs..." +#install -m 644 "$SCRIPT_DIR/nginx/pestrel.com.conf" /etc/nginx/conf.d/synoptic.conf +#install -m 644 "$SCRIPT_DIR/nginx/radar.pestrel.com.conf" /etc/nginx/conf.d/radar.conf #echo "==> Testing nginx config..." #nginx -t |
