From 8a91f3db883e48be95c54886877e41a24a8e4488 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 5 May 2026 09:39:07 +0200 Subject: [PATCH] phantom-ship + vps-relay: declare escape-hormuz service + vhost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hara (openclaw) shipped escape_hormuz imperatively — service runs but firewall + Caddy vhost weren't declared, so the public URL didn't resolve and the firewall rule would've been wiped on next dotfiles-rebuild. Bring it under nix: phantom-ship.nix - systemd.services.escape-hormuz on port 8090, binds :: for ZT - 8090 added to zt+ allowedTCPPorts - tmpfiles entry for /home/danny/.local/share/escape_hormuz vps-relay.nix - Caddy vhost escapehormuz.dannydannydanny.me → ZT [::]:8090 --- nixos/hosts/phantom-ship.nix | 38 ++++++++++++++++++++++++++++++++---- nixos/hosts/vps-relay.nix | 2 +- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/nixos/hosts/phantom-ship.nix b/nixos/hosts/phantom-ship.nix index 0465ba0..d78345f 100644 --- a/nixos/hosts/phantom-ship.nix +++ b/nixos/hosts/phantom-ship.nix @@ -49,10 +49,10 @@ in networking.firewall.trustedInterfaces = [ "enp0s31f6" ]; # KomTolk (:8080), Shelfish (:8081), Scuttle (:8082), Bananasimulator - # (:8083), Forgejo (:3000) are reachable only over the ZeroTier mesh — - # the vps-relay Caddy reverse-proxies into them. Same pattern as - # sunken-ship's bbbot. Not in global allowedTCPPorts, so the WAN side - # stays closed. + # (:8083), Forgejo (:3000), Escape Hormuz (:8090) are reachable only + # over the ZeroTier mesh — the vps-relay Caddy reverse-proxies into + # them. Same pattern as sunken-ship's bbbot. Not in global + # allowedTCPPorts, so the WAN side stays closed. networking.firewall.interfaces."zt+".allowedTCPPorts = [ 3000 8080 8081 8082 8083 8090 ]; hardware.enableRedistributableFirmware = true; # iwlwifi (Intel 8260) + GPU + BT firmware @@ -178,6 +178,7 @@ in "d /home/danny/.local/share/komtolk 0755 danny users - -" "d /home/danny/.local/share/escape_hormuz 0755 danny users - -" "d /home/danny/.local/share/scuttle/tiles 0755 danny users - -" + "d /home/danny/.local/share/escape_hormuz 0755 danny users - -" ]; # Hara Gmail MCP server (path 1: IMAP+SMTP). Replaced by an OAuth2 @@ -363,6 +364,35 @@ in }; }; + # Escape Hormuz — turn-based boat-race Mini App (Hara's first build). + # Code lives at /home/danny/escape_hormuz/. Same vps-relay-fronted ZT path + # as the others; binds :: so the ZeroTier IPv6 address is reachable. + systemd.services.escape-hormuz = let + pythonEnv = pkgs.python3.withPackages (ps: with ps; [ + fastapi + uvicorn + python-telegram-bot + ]); + in { + description = "Escape Hormuz FastAPI server (turn-based boat race)"; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ pythonEnv ]; + environment = { + SHIPYARD_BOT_TOKEN_FILE = "/home/danny/.secrets/telegram-bot-token-shipyard"; + DB_PATH = "/home/danny/.local/share/escape_hormuz/escape_hormuz.db"; + MINIAPP_URL = "https://escapehormuz.dannydannydanny.me"; + }; + serviceConfig = { + WorkingDirectory = "/home/danny/escape_hormuz"; + ExecStart = "${pythonEnv}/bin/python -m uvicorn server:app --host :: --port 8090"; + Restart = "on-failure"; + RestartSec = 10; + User = "danny"; + }; + }; + # KomTolk (formerly translate-platform) — Copenhagen translation gigs Mini App. # Code rsync'd from ~/python-projects/26_komtolk/ to /home/danny/komtolk/ systemd.services.komtolk = let diff --git a/nixos/hosts/vps-relay.nix b/nixos/hosts/vps-relay.nix index d9b3edf..24c4d73 100644 --- a/nixos/hosts/vps-relay.nix +++ b/nixos/hosts/vps-relay.nix @@ -123,7 +123,7 @@ "git.dannydannydanny.me".extraConfig = '' reverse_proxy http://[fdd5:53a2:de33:d269:6499:936c:48a:bbdc]:3000 ''; - # Escape Hormuz — turn-based boat race, port 8090. + # Escape Hormuz — turn-based boat-race Mini App, port 8090. "escapehormuz.dannydannydanny.me".extraConfig = '' reverse_proxy http://[fdd5:53a2:de33:d269:6499:936c:48a:bbdc]:8090 '';