diff --git a/unraid-1/basement.template.xml b/unraid-1/basement.template.xml index 935509e..83d7bd9 100644 --- a/unraid-1/basement.template.xml +++ b/unraid-1/basement.template.xml @@ -4,9 +4,15 @@ Source of truth: pq/scripts on Gitea (https://git.docker.pq.io/pq/scripts). Served via gitea raw URL: https://git.docker.pq.io/pq/scripts/raw/branch/main/unraid-1/basement.template.xml - This file is NOT installed directly. install.sh fetches it, substitutes the - __GARAGE_ADMIN_TOKEN__ placeholder with the same secret used by the garage - container, and writes the result to /boot/config/plugins/dockerMan/templates-user/my-basement.xml. + This file is NOT installed directly. install.sh fetches it, substitutes + __GARAGE_ADMIN_TOKEN__ (shared with the garage container) and + __BASEMENT_JWT_SECRET__ (generated alongside the garage secrets), and + writes the result to /boot/config/plugins/dockerMan/templates-user/my-basement.xml. + + BASEMENT_ADMIN_USER and BASEMENT_ADMIN_PASSWORD_HASH must be set by hand + in the Unraid UI before Apply — install.sh leaves them blank. + Generate a bcrypt hash with: `htpasswd -bnBC 12 "" yourpassword | tr -d ':\n'` + (or use any bcrypt tool; basement-ui expects the standard $2a$/$2b$ format). Caddy on classe reverse-proxies https://basement.pq.io to this container's port 8080. DNS for basement.pq.io and the Caddy vhost are managed on classe, @@ -45,4 +51,9 @@ Publicly served at https://basement.pq.io via Caddy on classe (reverse proxy → http://host.docker.internal:3903 __GARAGE_ADMIN_TOKEN__ + + garage + + + __BASEMENT_JWT_SECRET__ diff --git a/unraid-1/install.sh b/unraid-1/install.sh index b60c886..d00d671 100755 --- a/unraid-1/install.sh +++ b/unraid-1/install.sh @@ -57,15 +57,26 @@ else GARAGE_RPC_SECRET=$(openssl rand -hex 32) GARAGE_ADMIN_TOKEN=$(openssl rand -hex 32) GARAGE_METRICS_TOKEN=$(openssl rand -hex 32) + BASEMENT_JWT_SECRET=$(openssl rand -hex 32) umask 077 cat > "$SECRETS" <> "$SECRETS" + say "backfilled BASEMENT_JWT_SECRET into $SECRETS" +fi + # ── Templates ── # Fetch each, optionally sed-substitute __PLACEHOLDER__ secrets, write to # templates-user/. Secrets are hex chars only — safe in sed delimiters. @@ -94,7 +105,8 @@ fetch_template \ fetch_template \ "$BASE/basement.template.xml" \ "$TEMPLATE_DIR/my-basement.xml" \ - -e "s|__GARAGE_ADMIN_TOKEN__|$GARAGE_ADMIN_TOKEN|" + -e "s|__GARAGE_ADMIN_TOKEN__|$GARAGE_ADMIN_TOKEN|" \ + -e "s|__BASEMENT_JWT_SECRET__|$BASEMENT_JWT_SECRET|" fetch_template \ "$BASE/watchtower.template.xml" \