From bb46b1c10edee637f90209e47c1a9bb69b6a7b17 Mon Sep 17 00:00:00 2001 From: ginnoir Date: Wed, 3 Jun 2026 23:09:53 -0500 Subject: [PATCH] feat: migrate stack to Portainer git-managed, rename project to valhalla-lab - Rename project from htpc-download-box to valhalla-lab (directory + dc alias) - Remove portainer and watchtower from compose; run standalone outside managed stack to prevent self-termination during Portainer-triggered redeployments - Add portainer_proxy external network shared by caddy and standalone portainer so Caddy can route to Portainer via Docker DNS without them being in the same stack - Carve out POST /api/stacks/webhooks/* in Caddyfile so Portainer webhooks can reach through the internal_only guard without exposing the full UI - Update apply-compose.ps1 and sync-prod.ps1 paths from htpc-download-box to valhalla-lab --- Caddyfile | 15 +++++++++++++-- apply-compose.ps1 | 6 +++--- docker-compose.yml | 26 +++----------------------- sync-prod.ps1 | 4 ++-- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/Caddyfile b/Caddyfile index e4be04f..1d4757a 100644 --- a/Caddyfile +++ b/Caddyfile @@ -185,8 +185,19 @@ dev.ginnoir.com { # MANAGEMENT — internal only # ============================================================= portainer.ginnoir.com { - import internal_only - reverse_proxy portainer:9000 + @webhook { + method POST + path /api/stacks/webhooks/* + } + + handle @webhook { + reverse_proxy portainer:9000 + } + + handle { + import internal_only + reverse_proxy portainer:9000 + } } uptime.ginnoir.com { diff --git a/apply-compose.ps1 b/apply-compose.ps1 index 41ab8f2..2bd4b0a 100644 --- a/apply-compose.ps1 +++ b/apply-compose.ps1 @@ -2,7 +2,7 @@ # to the live Docker stack. # # On valhalla, `dc` is aliased (in ~/.bashrc) to: -# docker-compose -f ~/htpc-download-box/docker-compose.yml --env-file ~/htpc-download-box/.env +# docker compose -f ~/valhalla-lab/docker-compose.yml --env-file ~/valhalla-lab/.env # It's a shell alias, so we invoke it over SSH with `bash -ic` to load it. # # Usage (flags combine; no flags = push & apply all three): @@ -33,7 +33,7 @@ if (-not $Compose -and -not $Caddy -and -not $EnvFile) { if ($EnvFile) { Write-Host "Pushing .env ..." - scp $envLocal "${server}:~/htpc-download-box/.env" + scp $envLocal "${server}:~/valhalla-lab/.env" } if ($Caddy) { @@ -45,7 +45,7 @@ if ($Caddy) { if ($Compose) { Write-Host "Pushing docker-compose.yml ..." - scp $composeLocal "${server}:~/htpc-download-box/docker-compose.yml" + scp $composeLocal "${server}:~/valhalla-lab/docker-compose.yml" Write-Host "Pulling latest images ..." ssh $server "bash -ic 'dc pull'" Write-Host "Applying compose changes (recreates only changed containers) ..." diff --git a/docker-compose.yml b/docker-compose.yml index b7a6054..fae3e08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,6 +76,7 @@ services: - famapp - authentik - management + - portainer_proxy ports: - "80:80" - "443:443" @@ -566,18 +567,6 @@ services: # ============================================================ # MANAGEMENT # ============================================================ - portainer: - container_name: portainer - image: portainer/portainer-ce:latest - restart: unless-stopped - networks: - - management - ports: - - "9100:9000" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /config/portainer:/data - uptime-kuma: container_name: uptime_kuma image: louislam/uptime-kuma:2 @@ -618,17 +607,6 @@ services: ports: - "9009:80" - watchtower: - container_name: watchtower - image: containrrr/watchtower:latest - restart: unless-stopped - environment: - - WATCHTOWER_NOTIFICATION_SKIP_TITLE=true - - WATCHTOWER_NOTIFICATION_URL=ntfy://ntfy.ginnoir.com/watchtower?title=WatchtowerUpdates - - DOCKER_API_VERSION=1.40 - volumes: - - /var/run/docker.sock:/var/run/docker.sock - # ============================================================ # FAMAPP # ============================================================ @@ -801,6 +779,8 @@ networks: famapp: authentik: management: + portainer_proxy: + external: true volumes: minio_data: diff --git a/sync-prod.ps1 b/sync-prod.ps1 index f725c46..369bf26 100644 --- a/sync-prod.ps1 +++ b/sync-prod.ps1 @@ -15,8 +15,8 @@ $repoDir = $PSScriptRoot Write-Host "Syncing production configs from $server ..." -scp "${server}:~/htpc-download-box/docker-compose.yml" "$repoDir\docker-compose.yml" -scp "${server}:~/htpc-download-box/.env" "$repoDir\.env" +scp "${server}:~/valhalla-lab/docker-compose.yml" "$repoDir\docker-compose.yml" +scp "${server}:~/valhalla-lab/.env" "$repoDir\.env" scp "${server}:/config/caddy/Caddyfile" "$repoDir\Caddyfile" Write-Host "Done. Files synced:"