Retire quartz, hasura and autoheal into .deprecated/
Deploy with Docker Compose / deploy (push) Successful in 1m1s
Deploy with Docker Compose / deploy (push) Successful in 1m1s
Quartz was already replaced by silverbullet-public; its build context moves to .deprecated/quartz. Hasura and autoheal are removed from the stack, with their compose services (and Hasura's nginx blocks) kept verbatim under .deprecated/ alongside a README on how to bring each back. Removes the /hasura/ route from both nginx templates and the envsubst allow-list, and updates the docs and comments that referred to the three services. With autoheal gone nothing restarts an unhealthy container; the healthchecks are now informational only, and the docs say so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
# .deprecated
|
||||||
|
|
||||||
|
STATUS: nothing in here is live. No compose file, nginx template or script
|
||||||
|
references this directory. It is kept, not deleted, in line with the repo's
|
||||||
|
"legacy is kept" convention; the full history is also in git.
|
||||||
|
|
||||||
|
## quartz/
|
||||||
|
|
||||||
|
The static-site build that used to serve `/notes/`. Replaced by the read-only
|
||||||
|
`silverbullet-public` service (PR #6). Its compose service and nginx route were
|
||||||
|
removed at that point; only the build context survives here.
|
||||||
|
|
||||||
|
## hasura/
|
||||||
|
|
||||||
|
Admin-only DB console that was proxied at `/hasura/`.
|
||||||
|
|
||||||
|
- `docker-compose.hasura.yml` — the service, verbatim.
|
||||||
|
- `nginx-locations.conf` — the upstream variable and `location` blocks that
|
||||||
|
were in both `nginx.conf.template` and `nginx_dev_common.conf.template`.
|
||||||
|
|
||||||
|
To bring it back: layer the compose file
|
||||||
|
(`docker compose -f docker-compose.yml -f .deprecated/hasura/docker-compose.hasura.yml up`),
|
||||||
|
paste the nginx blocks back into both templates, re-add `${HASURA_HOST}
|
||||||
|
${HASURA_PORT}` to `ENVSUBST_VARS` in `nginx/entrypoint.sh`, and set
|
||||||
|
`HASURA_HOST`, `HASURA_PORT` and `HASURA_GRAPHQL_ADMIN_SECRET` in `.env`. Dev
|
||||||
|
mode additionally set `HASURA_GRAPHQL_ENABLE_CONSOLE` and
|
||||||
|
`HASURA_GRAPHQL_DEV_MODE` to `"true"`.
|
||||||
|
|
||||||
|
## autoheal/
|
||||||
|
|
||||||
|
Watchdog that restarted any container docker marked `unhealthy` (only `backend`
|
||||||
|
and `python` define healthchecks). It mounts the docker socket, which is
|
||||||
|
effectively root on the host. To bring it back, layer
|
||||||
|
`docker-compose.autoheal.yml` the same way as above.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# STATUS: deprecated — not part of the stack. See ../README.md for how to bring
|
||||||
|
# it back. Kept verbatim from docker-compose.yml.
|
||||||
|
services:
|
||||||
|
# Watchdog: docker itself marks a container `unhealthy` but never acts on it.
|
||||||
|
# autoheal polls the docker socket and restarts anything that goes unhealthy.
|
||||||
|
# AUTOHEAL_CONTAINER_LABEL=all means "watch every container that defines a
|
||||||
|
# healthcheck" (i.e. backend and python) rather than only labelled ones.
|
||||||
|
# It mounts the docker socket, which is effectively root on the host — that
|
||||||
|
# is the price of the feature. Because of that the image is pinned BY DIGEST,
|
||||||
|
# not by a floating tag: `:latest` meant any future push to Docker Hub would
|
||||||
|
# silently gain root on the Pi at the next `docker compose pull`/`up`. The
|
||||||
|
# digest below is a multi-arch index (it includes linux/arm64, which is what
|
||||||
|
# the Pi pulls) and was the content of `willfarrell/autoheal:latest` at the
|
||||||
|
# time of pinning. To bump it: pull the new tag, `docker image inspect
|
||||||
|
# willfarrell/autoheal:<tag> --format '{{index .RepoDigests 0}}'`, and paste
|
||||||
|
# the digest here — never go back to a bare tag.
|
||||||
|
# Deliberately NOT on app-network: it talks only to the socket.
|
||||||
|
autoheal:
|
||||||
|
image: willfarrell/autoheal@sha256:4ce976e9033b41426d44633295d6a08f9bc5929b27866352d91b31d4f6b26447
|
||||||
|
container_name: autoheal
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- AUTOHEAL_CONTAINER_LABEL=all
|
||||||
|
- AUTOHEAL_INTERVAL=30
|
||||||
|
- AUTOHEAL_START_PERIOD=60
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# STATUS: deprecated — not part of the stack. See ../README.md for how to bring
|
||||||
|
# it back. Kept verbatim from docker-compose.yml, so it still relies on that
|
||||||
|
# file's `db` service and `app-network`, and must be layered on top of it.
|
||||||
|
services:
|
||||||
|
# Admin-only DB browser, reached at /hasura/. Console and dev mode are OFF in
|
||||||
|
# production (turned on by the dev override). It is additionally gated in
|
||||||
|
# nginx by an `auth_request` subrequest to the backend's /auth/validate-admin,
|
||||||
|
# so an admin cookie is required before the request ever reaches Hasura —
|
||||||
|
# the admin secret alone is not the only line of defence.
|
||||||
|
hasura:
|
||||||
|
image: hasura/graphql-engine:v2.44.0
|
||||||
|
container_name: "${HASURA_HOST}"
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
environment:
|
||||||
|
HASURA_GRAPHQL_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
|
||||||
|
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
|
||||||
|
HASURA_GRAPHQL_ENABLE_CONSOLE: "false"
|
||||||
|
HASURA_GRAPHQL_DEV_MODE: "false"
|
||||||
|
HASURA_GRAPHQL_ENABLED_LOG_TYPES: "startup, http-log, webhook-log, websocket-log, query-log"
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# STATUS: deprecated. The /hasura/ blocks removed from nginx.conf.template and
|
||||||
|
# nginx_dev_common.conf.template (identical in both). See ../README.md.
|
||||||
|
set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT;
|
||||||
|
|
||||||
|
location /hasura {
|
||||||
|
return 301 /hasura/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /hasura/ {
|
||||||
|
auth_request /internal/auth/admin-validate;
|
||||||
|
error_page 401 403 = @auth_denied;
|
||||||
|
rewrite ^/hasura/(.*)$ /$1 break;
|
||||||
|
proxy_pass $upstream_hasura;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
+1
-8
@@ -5,7 +5,7 @@
|
|||||||
# same file, and it is worth knowing which is which:
|
# same file, and it is worth knowing which is which:
|
||||||
# 1. ${VAR} interpolation in docker-compose.yml. Done by the compose CLI when
|
# 1. ${VAR} interpolation in docker-compose.yml. Done by the compose CLI when
|
||||||
# it parses the file, before any container exists. This is how container
|
# it parses the file, before any container exists. This is how container
|
||||||
# names, published ports and the Hasura database URL are built.
|
# names and published ports are built.
|
||||||
# 2. `env_file: ./.env` on a service. Injects the WHOLE file as environment
|
# 2. `env_file: ./.env` on a service. Injects the WHOLE file as environment
|
||||||
# variables inside that container. nginx, backend, db, icecast2,
|
# variables inside that container. nginx, backend, db, icecast2,
|
||||||
# certbot and gitea all do this.
|
# certbot and gitea all do this.
|
||||||
@@ -158,13 +158,6 @@ CLAUDE_API_KEY=
|
|||||||
STEAM_API_KEY=
|
STEAM_API_KEY=
|
||||||
STEAM_ID=
|
STEAM_ID=
|
||||||
|
|
||||||
# --- Hasura (admin-only DB console at /hasura/) ------------------------------
|
|
||||||
# Additionally gated by an nginx auth_request against the backend's admin check,
|
|
||||||
# so the admin secret is not the only barrier.
|
|
||||||
HASURA_GRAPHQL_ADMIN_SECRET=
|
|
||||||
HASURA_HOST=hasura
|
|
||||||
HASURA_PORT=8080
|
|
||||||
|
|
||||||
# --- Development-only switch -------------------------------------------------
|
# --- Development-only switch -------------------------------------------------
|
||||||
# Leave EMPTY/false in production. docker-compose.dev.yml sets SEED_DB=true for
|
# Leave EMPTY/false in production. docker-compose.dev.yml sets SEED_DB=true for
|
||||||
# local work; setting it on the Pi would inject test data into the live site.
|
# local work; setting it on the Pi would inject test data into the live site.
|
||||||
|
|||||||
+13
-18
@@ -29,13 +29,13 @@ Only three things are reachable from outside the Pi: nginx on 80/443, Gitea on
|
|||||||
--------------------------------------------- | (same container
|
--------------------------------------------- | (same container
|
||||||
| | | | | | | as icecast2)
|
| | | | | | | as icecast2)
|
||||||
v v v v v v | |
|
v v v v v v | |
|
||||||
/api/ /radio/ /gitea/ /hasura/ /notes/ /py/ | |
|
/api/ /radio/ /gitea/ /sb/ /notes/ /py/ | |
|
||||||
backend icecast2 gitea hasura sb-pub python | |
|
backend icecast2 gitea sb sb-pub python | |
|
||||||
| ^ | | |
|
| ^ | |
|
||||||
| | | | |
|
| | | |
|
||||||
| +------------------|--------------------|---------------+
|
| +---------------------------------------|---------------+
|
||||||
| | |
|
| |
|
||||||
+----------+-----------------+--------------------+
|
+----------+--------------------------------------+
|
||||||
v
|
v
|
||||||
+------+
|
+------+
|
||||||
| db | postgres:16
|
| db | postgres:16
|
||||||
@@ -43,7 +43,6 @@ backend icecast2 gitea hasura sb-pub python | |
|
|||||||
|
|
||||||
vue one-shot build container -> writes vue_dist volume -> nginx serves it
|
vue one-shot build container -> writes vue_dist volume -> nginx serves it
|
||||||
certbot no ports; shares ./certbot/conf and ./certbot/www with nginx
|
certbot no ports; shares ./certbot/conf and ./certbot/www with nginx
|
||||||
autoheal no network; watches the docker socket and restarts unhealthy containers
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Who listens where
|
### Who listens where
|
||||||
@@ -53,7 +52,6 @@ backend icecast2 gitea hasura sb-pub python | |
|
|||||||
| nginx | `nginx` | 80, 443 | — | **80, 443** |
|
| nginx | `nginx` | 80, 443 | — | **80, 443** |
|
||||||
| backend (Go) | `${BACKEND_HOST}` | `${BACKEND_PORT}` (8080) | `${BACKEND_ENDPOINT}` = `/api/` | no |
|
| backend (Go) | `${BACKEND_HOST}` | `${BACKEND_PORT}` (8080) | `${BACKEND_ENDPOINT}` = `/api/` | no |
|
||||||
| db (Postgres 16) | `${POSTGRES_HOST}` | 5432 | none | no |
|
| db (Postgres 16) | `${POSTGRES_HOST}` | 5432 | none | no |
|
||||||
| hasura | `${HASURA_HOST}` | `${HASURA_PORT}` | `/hasura/` (admin-gated) | no |
|
|
||||||
| silverbullet (editor) | `${SILVERBULLET_HOST}` | `${SILVERBULLET_PORT}` | `/sb/` (admin-gated) | no |
|
| silverbullet (editor) | `${SILVERBULLET_HOST}` | `${SILVERBULLET_PORT}` | `/sb/` (admin-gated) | no |
|
||||||
| silverbullet-public (notes site) | `${SILVERBULLET_PUBLIC_HOST}` | `${SILVERBULLET_PUBLIC_PORT}` | `/notes/` (**public**, read-only) | no |
|
| silverbullet-public (notes site) | `${SILVERBULLET_PUBLIC_HOST}` | `${SILVERBULLET_PUBLIC_PORT}` | `/notes/` (**public**, read-only) | no |
|
||||||
| silverbullet-git | n/a | n/a | none (timer loop) | no |
|
| silverbullet-git | n/a | n/a | none (timer loop) | no |
|
||||||
@@ -62,7 +60,6 @@ backend icecast2 gitea hasura sb-pub python | |
|
|||||||
| gitea | `${GITEA_HOST}` | 3000, 2222 | `/gitea/` | **3000, 2222** |
|
| gitea | `${GITEA_HOST}` | 3000, 2222 | `/gitea/` | **3000, 2222** |
|
||||||
| vue | `vue` | 5173 (dev only) | `/` (dev only) | no |
|
| vue | `vue` | 5173 (dev only) | `/` (dev only) | no |
|
||||||
| certbot | `certbot` | — | — | no |
|
| certbot | `certbot` | — | — | no |
|
||||||
| autoheal | `autoheal` | — | — | no |
|
|
||||||
|
|
||||||
Container names come from `.env`, and nginx builds its upstreams from the same
|
Container names come from `.env`, and nginx builds its upstreams from the same
|
||||||
variables. **Renaming a `*_HOST` value renames the container and repoints nginx
|
variables. **Renaming a `*_HOST` value renames the container and repoints nginx
|
||||||
@@ -80,7 +77,7 @@ in one step — never change one without the other.**
|
|||||||
- **Per-request DNS.** Upstreams go through `set $upstream_* ...` variables with
|
- **Per-request DNS.** Upstreams go through `set $upstream_* ...` variables with
|
||||||
`resolver 127.0.0.11`, so names resolve per request. nginx boots fine with a
|
`resolver 127.0.0.11`, so names resolve per request. nginx boots fine with a
|
||||||
backend down (502s until it appears) instead of refusing to start.
|
backend down (502s until it appears) instead of refusing to start.
|
||||||
- **Admin gate.** `/hasura/`, `/sb/`, `/radio/admin/` and `/uploads/private/` are protected by an `auth_request`
|
- **Admin gate.** `/sb/`, `/radio/admin/` and `/uploads/private/` are protected by an `auth_request`
|
||||||
subrequest to the backend's `/auth/validate-admin`; a failure redirects to the
|
subrequest to the backend's `/auth/validate-admin`; a failure redirects to the
|
||||||
SPA login. None of these services has any auth of its own at that path.
|
SPA login. None of these services has any auth of its own at that path.
|
||||||
- **Public notes privacy boundary.** `/notes/` is public, and the only thing
|
- **Public notes privacy boundary.** `/notes/` is public, and the only thing
|
||||||
@@ -139,7 +136,6 @@ The override layer changes five services and disables one:
|
|||||||
`:443` serve the whole site, no HSTS, no HTTP→HTTPS redirect.
|
`:443` serve the whole site, no HSTS, no HTTP→HTTPS redirect.
|
||||||
- **backend** — `DEV_MODE`, GraphQL playground and introspection on, a localhost
|
- **backend** — `DEV_MODE`, GraphQL playground and introspection on, a localhost
|
||||||
Spotify redirect URI, and **`SEED_DB=true`**.
|
Spotify redirect URI, and **`SEED_DB=true`**.
|
||||||
- **hasura** — console and dev mode on.
|
|
||||||
- **python** — `uvicorn --reload` with `python/app` bind-mounted.
|
- **python** — `uvicorn --reload` with `python/app` bind-mounted.
|
||||||
- **certbot** — put in the `disabled` profile, so it never starts. Let's Encrypt
|
- **certbot** — put in the `disabled` profile, so it never starts. Let's Encrypt
|
||||||
cannot validate localhost anyway.
|
cannot validate localhost anyway.
|
||||||
@@ -235,7 +231,7 @@ All configuration lives in **`./.env`** at the repo root, which is gitignored.
|
|||||||
Two distinct mechanisms read it, and services use both:
|
Two distinct mechanisms read it, and services use both:
|
||||||
|
|
||||||
- **`${VAR}` in `docker-compose.yml`** — substituted by the compose CLI at parse
|
- **`${VAR}` in `docker-compose.yml`** — substituted by the compose CLI at parse
|
||||||
time. Builds container names, published ports, the Hasura database URL.
|
time. Builds container names and published ports.
|
||||||
- **`env_file: ./.env`** — injects the whole file into the container. Used by
|
- **`env_file: ./.env`** — injects the whole file into the container. Used by
|
||||||
nginx, backend, db, icecast2, certbot.
|
nginx, backend, db, icecast2, certbot.
|
||||||
|
|
||||||
@@ -377,9 +373,10 @@ icecast source password. liquidsoap pre-empts the fallback playlist immediately
|
|||||||
silence. Adding MP3s to `icecast2/fallback_music/` is picked up live
|
silence. Adding MP3s to `icecast2/fallback_music/` is picked up live
|
||||||
(`reload_mode="watch"`) with no restart.
|
(`reload_mode="watch"`) with no restart.
|
||||||
|
|
||||||
**Unhealthy containers** are restarted automatically by `autoheal`, which polls
|
**Unhealthy containers are not restarted automatically.** `backend` and `python`
|
||||||
the docker socket every 30s. Only `backend` and `python` define healthchecks, so
|
define healthchecks, but the `autoheal` watchdog that acted on them was retired
|
||||||
only they are covered.
|
(`.deprecated/autoheal`), so `unhealthy` is only visible in `docker ps`.
|
||||||
|
`restart: always` still brings back a container whose process exits.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -405,5 +402,3 @@ Documented, not fixed — each would change deploy behaviour.
|
|||||||
today (neither contains whitespace) but a latent quoting bug.
|
today (neither contains whitespace) but a latent quoting bug.
|
||||||
7. **`UPTIMEKUMA_*` and `WALLABAG_*` are substituted by nginx but no compose
|
7. **`UPTIMEKUMA_*` and `WALLABAG_*` are substituted by nginx but no compose
|
||||||
service provides them** — leftovers from removed services.
|
service provides them** — leftovers from removed services.
|
||||||
8. **`autoheal` mounts the docker socket**, which is effectively root on the
|
|
||||||
host, and uses the `:latest` tag.
|
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ silverbullet (3000) ── Obsidian Notes Editor (SilverBullet 2.11.0)
|
|||||||
silverbullet-public (3000) ── Public read-only notes site (same image, SB_READ_ONLY)
|
silverbullet-public (3000) ── Public read-only notes site (same image, SB_READ_ONLY)
|
||||||
silverbullet-git ── Commits/pushes notes edits to the notes repo
|
silverbullet-git ── Commits/pushes notes edits to the notes repo
|
||||||
python (8000) ── Python API (FastAPI)
|
python (8000) ── Python API (FastAPI)
|
||||||
hasura (8080) ── Hasura GraphQL Engine (Docker profile: hasura)
|
|
||||||
autoheal ── Auto-restart unhealthy containers
|
|
||||||
certbot ── SSL Certificate Management (disabled in dev)
|
certbot ── SSL Certificate Management (disabled in dev)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -57,11 +55,10 @@ certbot ── SSL Certificate Management (disabled in dev)
|
|||||||
- Printable CV with role-specific sections
|
- Printable CV with role-specific sections
|
||||||
- Job application tracker with status workflow and CSV export (admin-only, `/cv/jobs`)
|
- Job application tracker with status workflow and CSV export (admin-only, `/cv/jobs`)
|
||||||
- Database-backed bookmarks grouped by category, managed via GraphQL (admin-only)
|
- Database-backed bookmarks grouped by category, managed via GraphQL (admin-only)
|
||||||
- Hasura GraphQL console (admin-only)
|
- Admin-gated routes: `/notes`, `/sb` require admin JWT via Nginx `auth_request`
|
||||||
- Admin-gated routes: `/notes`, `/sb`, `/hasura` require admin JWT via Nginx `auth_request`
|
|
||||||
- Landing page with animated stamps section
|
- Landing page with animated stamps section
|
||||||
- Route transitions (slide/fade) and performance optimizations (gzip, WOFF2 fonts, lazy loading)
|
- Route transitions (slide/fade) and performance optimizations (gzip, WOFF2 fonts, lazy loading)
|
||||||
- Backend healthcheck with autoheal container for automatic recovery
|
- Backend healthcheck (reported in `docker ps`; nothing restarts on it)
|
||||||
|
|
||||||
## Pages
|
## Pages
|
||||||
|
|
||||||
@@ -183,13 +180,12 @@ Access tokens are valid for 7 days; refresh tokens for 365 days. `ValidateAdmin`
|
|||||||
| `/api` | backend:8080 | API (rate limited: 30r/s) |
|
| `/api` | backend:8080 | API (rate limited: 30r/s) |
|
||||||
| `/radio` | icecast:8000 | Audio streaming |
|
| `/radio` | icecast:8000 | Audio streaming |
|
||||||
| `/gitea` | gitea:3000 | Git service |
|
| `/gitea` | gitea:3000 | Git service |
|
||||||
| `/hasura` | hasura:8080 | GraphQL console + WebSocket (admin-only) |
|
|
||||||
| `/notes` | silverbullet-public:3000 | Obsidian notes (public, read-only) |
|
| `/notes` | silverbullet-public:3000 | Obsidian notes (public, read-only) |
|
||||||
| `/sb` | silverbullet:3000 | Obsidian notes editor (admin-only) |
|
| `/sb` | silverbullet:3000 | Obsidian notes editor (admin-only) |
|
||||||
| `/py` | python:8000 | Python API (FastAPI; docs at `/py/docs`) |
|
| `/py` | python:8000 | Python API (FastAPI; docs at `/py/docs`) |
|
||||||
| `/uploads` | local alias | User-uploaded files |
|
| `/uploads` | local alias | User-uploaded files |
|
||||||
|
|
||||||
`/hasura` and `/sb` are protected by `auth_request` to `GET /api/auth/validate-admin`. Requests without a valid admin JWT are rejected with 401.
|
`/sb` is protected by `auth_request` to `GET /api/auth/validate-admin`. Requests without a valid admin JWT are rejected with 401.
|
||||||
|
|
||||||
### Deprecated Endpoints
|
### Deprecated Endpoints
|
||||||
|
|
||||||
@@ -249,9 +245,6 @@ Create a `.env` file in the project root. All services read from this file.
|
|||||||
| `CLAUDE_API_KEY` | Anthropic Claude API key |
|
| `CLAUDE_API_KEY` | Anthropic Claude API key |
|
||||||
| `STEAM_API_KEY` | Steam Web API key |
|
| `STEAM_API_KEY` | Steam Web API key |
|
||||||
| `STEAM_ID` | Steam user ID |
|
| `STEAM_ID` | Steam user ID |
|
||||||
| `HASURA_GRAPHQL_ADMIN_SECRET` | Hasura admin secret |
|
|
||||||
| `HASURA_HOST` | Hasura hostname (use `hasura` for Docker) |
|
|
||||||
| `HASURA_PORT` | Hasura port (typically `8080`) |
|
|
||||||
| `PYTHON_HOST` | Python API hostname (defaults to `python`) |
|
| `PYTHON_HOST` | Python API hostname (defaults to `python`) |
|
||||||
| `PYTHON_PORT` | Python API port (defaults to `8000`) |
|
| `PYTHON_PORT` | Python API port (defaults to `8000`) |
|
||||||
| `SEED_DB` | Set to `true` to seed test data on startup |
|
| `SEED_DB` | Set to `true` to seed test data on startup |
|
||||||
@@ -319,7 +312,6 @@ This:
|
|||||||
- Disables certbot
|
- Disables certbot
|
||||||
- Seeds the database with test data (`SEED_DB=true`)
|
- Seeds the database with test data (`SEED_DB=true`)
|
||||||
- Enables GraphQL playground and introspection
|
- Enables GraphQL playground and introspection
|
||||||
- Enables Hasura console and dev mode
|
|
||||||
|
|
||||||
Visit `http://localhost` to test.
|
Visit `http://localhost` to test.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -46,8 +46,8 @@ FROM debian:bookworm-slim
|
|||||||
|
|
||||||
# wget is not just for humans: the compose healthcheck probes the server with
|
# wget is not just for humans: the compose healthcheck probes the server with
|
||||||
# `wget -qO- http://localhost:8080/`, and without it in the image every probe
|
# `wget -qO- http://localhost:8080/`, and without it in the image every probe
|
||||||
# fails as "executable file not found" — Docker then marks the container
|
# fails as "executable file not found" and Docker marks the container
|
||||||
# unhealthy and autoheal kills it in a ~90s restart loop.
|
# unhealthy.
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install --yes --no-install-recommends ca-certificates wget \
|
&& apt-get install --yes --no-install-recommends ca-certificates wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
# - backend : dev flags on, including database seeding.
|
# - backend : dev flags on, including database seeding.
|
||||||
# - nginx : DEV_MODE=true, which makes its entrypoint render
|
# - nginx : DEV_MODE=true, which makes its entrypoint render
|
||||||
# nginx_dev.conf.template and self-sign a localhost certificate.
|
# nginx_dev.conf.template and self-sign a localhost certificate.
|
||||||
# - hasura : console and dev mode enabled so the GraphQL console is usable.
|
|
||||||
# - python : uvicorn --reload with the app source bind-mounted.
|
# - python : uvicorn --reload with the app source bind-mounted.
|
||||||
# - certbot : disabled entirely.
|
# - certbot : disabled entirely.
|
||||||
#
|
#
|
||||||
@@ -68,10 +67,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
- 443:443
|
- 443:443
|
||||||
hasura:
|
|
||||||
environment:
|
|
||||||
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
|
|
||||||
HASURA_GRAPHQL_DEV_MODE: "true"
|
|
||||||
python:
|
python:
|
||||||
# Same command as the Dockerfile's CMD plus --reload, paired with the
|
# Same command as the Dockerfile's CMD plus --reload, paired with the
|
||||||
# source bind mount below so editing python/app/ restarts uvicorn.
|
# source bind mount below so editing python/app/ restarts uvicorn.
|
||||||
|
|||||||
+7
-51
@@ -21,7 +21,7 @@
|
|||||||
# app config from env_file.
|
# app config from env_file.
|
||||||
#
|
#
|
||||||
# Required by this file: POSTGRES_{USER,PASSWORD,DB,PORT,HOST},
|
# Required by this file: POSTGRES_{USER,PASSWORD,DB,PORT,HOST},
|
||||||
# POSTGRES_GITEA_DB, BACKEND_HOST, HASURA_HOST, HASURA_GRAPHQL_ADMIN_SECRET,
|
# POSTGRES_GITEA_DB, BACKEND_HOST,
|
||||||
# ICECAST_HOST, GITEA_HOST, OBSIDIAN_DIR, and the GITEA_*
|
# ICECAST_HOST, GITEA_HOST, OBSIDIAN_DIR, and the GITEA_*
|
||||||
# secrets. PYTHON_HOST/PYTHON_PORT/TFL_APP_KEY/LIQUIDSOAP_HARBOR_PORT have
|
# secrets. PYTHON_HOST/PYTHON_PORT/TFL_APP_KEY/LIQUIDSOAP_HARBOR_PORT have
|
||||||
# inline defaults.
|
# inline defaults.
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
# WHAT IS PUBLISHED TO THE HOST
|
# WHAT IS PUBLISHED TO THE HOST
|
||||||
# Only nginx (80, 443), gitea (3000 HTTP, 2222 SSH) and the liquidsoap harbor
|
# Only nginx (80, 443), gitea (3000 HTTP, 2222 SSH) and the liquidsoap harbor
|
||||||
# port. Everything else is reachable only from inside app-network, which is
|
# port. Everything else is reachable only from inside app-network, which is
|
||||||
# why the backend, db, hasura, silverbullet and python have no `ports:` — they are
|
# why the backend, db, silverbullet and python have no `ports:` — they are
|
||||||
# deliberately not exposed and are reached through nginx.
|
# deliberately not exposed and are reached through nginx.
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
|
||||||
@@ -111,7 +111,6 @@ services:
|
|||||||
- backend
|
- backend
|
||||||
- icecast2
|
- icecast2
|
||||||
- gitea
|
- gitea
|
||||||
- hasura
|
|
||||||
- silverbullet
|
- silverbullet
|
||||||
- silverbullet-public
|
- silverbullet-public
|
||||||
- python
|
- python
|
||||||
@@ -187,9 +186,11 @@ services:
|
|||||||
# Shared with icecast2, which plays these as the radio fallback playlist;
|
# Shared with icecast2, which plays these as the radio fallback playlist;
|
||||||
# the backend reads them to report what is queued.
|
# the backend reads them to report what is queued.
|
||||||
- ./icecast2/fallback_music:/backend/fallback_music
|
- ./icecast2/fallback_music:/backend/fallback_music
|
||||||
# Reported to docker (and therefore to autoheal, below), which restarts the
|
# Reported to docker only: nothing acts on `unhealthy` since the autoheal
|
||||||
# container after 3 consecutive failures ~90s apart. start_period gives the
|
# watchdog was retired (.deprecated/autoheal), so this just shows up in
|
||||||
# Go process 10s to bind before failures start counting.
|
# `docker ps`. `restart: always` covers a crashed process, not a hung one.
|
||||||
|
# start_period gives the Go process 10s to bind before failures start
|
||||||
|
# counting.
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-qO-", "http://localhost:8080/"]
|
test: ["CMD", "wget", "-qO-", "http://localhost:8080/"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
@@ -197,31 +198,6 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
|
||||||
# Watchdog: docker itself marks a container `unhealthy` but never acts on it.
|
|
||||||
# autoheal polls the docker socket and restarts anything that goes unhealthy.
|
|
||||||
# AUTOHEAL_CONTAINER_LABEL=all means "watch every container that defines a
|
|
||||||
# healthcheck" (i.e. backend and python) rather than only labelled ones.
|
|
||||||
# It mounts the docker socket, which is effectively root on the host — that
|
|
||||||
# is the price of the feature. Because of that the image is pinned BY DIGEST,
|
|
||||||
# not by a floating tag: `:latest` meant any future push to Docker Hub would
|
|
||||||
# silently gain root on the Pi at the next `docker compose pull`/`up`. The
|
|
||||||
# digest below is a multi-arch index (it includes linux/arm64, which is what
|
|
||||||
# the Pi pulls) and was the content of `willfarrell/autoheal:latest` at the
|
|
||||||
# time of pinning. To bump it: pull the new tag, `docker image inspect
|
|
||||||
# willfarrell/autoheal:<tag> --format '{{index .RepoDigests 0}}'`, and paste
|
|
||||||
# the digest here — never go back to a bare tag.
|
|
||||||
# Deliberately NOT on app-network: it talks only to the socket.
|
|
||||||
autoheal:
|
|
||||||
image: willfarrell/autoheal@sha256:4ce976e9033b41426d44633295d6a08f9bc5929b27866352d91b31d4f6b26447
|
|
||||||
container_name: autoheal
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- AUTOHEAL_CONTAINER_LABEL=all
|
|
||||||
- AUTOHEAL_INTERVAL=30
|
|
||||||
- AUTOHEAL_START_PERIOD=60
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
|
|
||||||
# Single Postgres instance serving TWO databases: ${POSTGRES_DB} for the Go
|
# Single Postgres instance serving TWO databases: ${POSTGRES_DB} for the Go
|
||||||
# backend and ${POSTGRES_GITEA_DB} for Gitea. The postgres image only creates
|
# backend and ${POSTGRES_GITEA_DB} for Gitea. The postgres image only creates
|
||||||
# POSTGRES_DB on first init, so the Gitea database was created by hand once;
|
# POSTGRES_DB on first init, so the Gitea database was created by hand once;
|
||||||
@@ -259,26 +235,6 @@ services:
|
|||||||
retries: 10
|
retries: 10
|
||||||
start_period: 90s
|
start_period: 90s
|
||||||
|
|
||||||
# Admin-only DB browser, reached at /hasura/. Console and dev mode are OFF in
|
|
||||||
# production (turned on by the dev override). It is additionally gated in
|
|
||||||
# nginx by an `auth_request` subrequest to the backend's /auth/validate-admin,
|
|
||||||
# so an admin cookie is required before the request ever reaches Hasura —
|
|
||||||
# the admin secret alone is not the only line of defence.
|
|
||||||
hasura:
|
|
||||||
image: hasura/graphql-engine:v2.44.0
|
|
||||||
container_name: "${HASURA_HOST}"
|
|
||||||
restart: always
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
environment:
|
|
||||||
HASURA_GRAPHQL_DATABASE_URL: "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
|
|
||||||
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
|
|
||||||
HASURA_GRAPHQL_ENABLE_CONSOLE: "false"
|
|
||||||
HASURA_GRAPHQL_DEV_MODE: "false"
|
|
||||||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: "startup, http-log, webhook-log, websocket-log, query-log"
|
|
||||||
|
|
||||||
# Internet radio: one container running BOTH icecast2 (the streaming server
|
# Internet radio: one container running BOTH icecast2 (the streaming server
|
||||||
# listeners connect to, proxied at /radio/) and liquidsoap (the source that
|
# listeners connect to, proxied at /radio/) and liquidsoap (the source that
|
||||||
# feeds it). See icecast2/entrypoint.sh.
|
# feeds it). See icecast2/entrypoint.sh.
|
||||||
|
|||||||
+1
-2
@@ -67,7 +67,6 @@
|
|||||||
# BACKEND_ENDPOINT URL prefix the API is mounted at (e.g. /api)
|
# BACKEND_ENDPOINT URL prefix the API is mounted at (e.g. /api)
|
||||||
# ICECAST_HOST / ICECAST_PORT radio stream upstream
|
# ICECAST_HOST / ICECAST_PORT radio stream upstream
|
||||||
# GITEA_HOST / GITEA_PORT git server upstream
|
# GITEA_HOST / GITEA_PORT git server upstream
|
||||||
# HASURA_HOST / HASURA_PORT Hasura console upstream
|
|
||||||
# SILVERBULLET_HOST / _PORT notes editor upstream (defaulted below)
|
# SILVERBULLET_HOST / _PORT notes editor upstream (defaulted below)
|
||||||
# SILVERBULLET_PUBLIC_HOST / _PORT
|
# SILVERBULLET_PUBLIC_HOST / _PORT
|
||||||
# public notes viewer upstream (defaulted below)
|
# public notes viewer upstream (defaulted below)
|
||||||
@@ -96,7 +95,7 @@ export SILVERBULLET_PUBLIC_PORT="${SILVERBULLET_PUBLIC_PORT:-3000}"
|
|||||||
# The envsubst allow-list, defined once and reused by both full-config branches
|
# The envsubst allow-list, defined once and reused by both full-config branches
|
||||||
# so the two lists cannot drift apart. It MUST stay single-quoted here and be
|
# so the two lists cannot drift apart. It MUST stay single-quoted here and be
|
||||||
# passed as "$ENVSUBST_VARS" (one argument) below.
|
# passed as "$ENVSUBST_VARS" (one argument) below.
|
||||||
ENVSUBST_VARS='${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${HASURA_HOST} ${HASURA_PORT} ${SILVERBULLET_HOST} ${SILVERBULLET_PORT} ${SILVERBULLET_PUBLIC_HOST} ${SILVERBULLET_PUBLIC_PORT} ${PYTHON_HOST} ${PYTHON_PORT}'
|
ENVSUBST_VARS='${DOMAIN} ${BACKEND_HOST} ${BACKEND_PORT} ${BACKEND_ENDPOINT} ${ICECAST_HOST} ${ICECAST_PORT} ${GITEA_HOST} ${GITEA_PORT} ${SILVERBULLET_HOST} ${SILVERBULLET_PORT} ${SILVERBULLET_PUBLIC_HOST} ${SILVERBULLET_PUBLIC_PORT} ${PYTHON_HOST} ${PYTHON_PORT}'
|
||||||
|
|
||||||
# Check if DEV_MODE
|
# Check if DEV_MODE
|
||||||
if [ "$DEV_MODE" = "true" ]; then
|
if [ "$DEV_MODE" = "true" ]; then
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# TEMPLATING
|
# TEMPLATING
|
||||||
# Only the names in the envsubst allow-list in nginx/entrypoint.sh are
|
# Only the names in the envsubst allow-list in nginx/entrypoint.sh are
|
||||||
# substituted: DOMAIN, BACKEND_HOST/PORT/ENDPOINT, ICECAST_*, GITEA_*,
|
# substituted: DOMAIN, BACKEND_HOST/PORT/ENDPOINT, ICECAST_*, GITEA_*,
|
||||||
# HASURA_*, SILVERBULLET_*, PYTHON_*, UPTIMEKUMA_*, WALLABAG_*. Every other dollar
|
# SILVERBULLET_*, PYTHON_*, UPTIMEKUMA_*, WALLABAG_*. Every other dollar
|
||||||
# token in this file is an nginx RUNTIME variable (host, remote_addr, uri,
|
# token in this file is an nginx RUNTIME variable (host, remote_addr, uri,
|
||||||
# http_upgrade, proxy_add_x_forwarded_for, binary_remote_addr, request_uri,
|
# http_upgrade, proxy_add_x_forwarded_for, binary_remote_addr, request_uri,
|
||||||
# scheme, http_cookie) and must be left alone — that restriction is the whole
|
# scheme, http_cookie) and must be left alone — that restriction is the whole
|
||||||
@@ -164,7 +164,6 @@ http {
|
|||||||
set $upstream_backend http://$BACKEND_HOST:$BACKEND_PORT;
|
set $upstream_backend http://$BACKEND_HOST:$BACKEND_PORT;
|
||||||
set $upstream_icecast http://$ICECAST_HOST:$ICECAST_PORT;
|
set $upstream_icecast http://$ICECAST_HOST:$ICECAST_PORT;
|
||||||
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
||||||
set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT;
|
|
||||||
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
||||||
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
||||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
||||||
@@ -205,7 +204,7 @@ http {
|
|||||||
# PRIVATE attachments (admin-only). Attachments on *private* chat
|
# PRIVATE attachments (admin-only). Attachments on *private* chat
|
||||||
# messages are written by the backend to /backend/uploads/private/ and
|
# messages are written by the backend to /backend/uploads/private/ and
|
||||||
# must not be readable by the public, so this subpath is put behind the
|
# must not be readable by the public, so this subpath is put behind the
|
||||||
# same admin `auth_request` used for /hasura/ and /sb/. nginx picks
|
# same admin `auth_request` used for /sb/. nginx picks
|
||||||
# the LONGEST matching prefix location, so this block wins over the
|
# the LONGEST matching prefix location, so this block wins over the
|
||||||
# public /uploads/ block below for /uploads/private/* regardless of
|
# public /uploads/ block below for /uploads/private/* regardless of
|
||||||
# ordering. Same three hardening headers as the public block, because
|
# ordering. Same three hardening headers as the public block, because
|
||||||
@@ -376,7 +375,7 @@ http {
|
|||||||
# surface — kick sources, change metadata — protected only by the
|
# surface — kick sources, change metadata — protected only by the
|
||||||
# icecast admin password, and it was reachable from the public
|
# icecast admin password, and it was reachable from the public
|
||||||
# internet through this proxy. Put it behind the same admin
|
# internet through this proxy. Put it behind the same admin
|
||||||
# `auth_request` as /hasura/ and /sb/ so an admin session cookie is
|
# `auth_request` as /sb/ so an admin session cookie is
|
||||||
# required before the request ever reaches icecast. Longest-prefix
|
# required before the request ever reaches icecast. Longest-prefix
|
||||||
# matching means this wins over /radio/ below; listener traffic
|
# matching means this wins over /radio/ below; listener traffic
|
||||||
# (/radio/$ICECAST_MOUNT, /radio/status.xsl) is untouched.
|
# (/radio/$ICECAST_MOUNT, /radio/status.xsl) is untouched.
|
||||||
@@ -413,24 +412,6 @@ http {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /hasura {
|
|
||||||
return 301 /hasura/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /hasura/ {
|
|
||||||
auth_request /internal/auth/admin-validate;
|
|
||||||
error_page 401 403 = @auth_denied;
|
|
||||||
rewrite ^/hasura/(.*)$ /$1 break;
|
|
||||||
proxy_pass $upstream_hasura;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
location /notes {
|
location /notes {
|
||||||
return 301 /notes/;
|
return 301 /notes/;
|
||||||
}
|
}
|
||||||
@@ -551,7 +532,7 @@ http {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---- Admin gate (/hasura/, /sb/, /radio/admin/, /uploads/private/) ----
|
# ---- Admin gate (/sb/, /radio/admin/, /uploads/private/) ----
|
||||||
# `auth_request` makes nginx fire a subrequest here before serving the
|
# `auth_request` makes nginx fire a subrequest here before serving the
|
||||||
# real one; a 2xx lets it through, 401/403 triggers error_page ->
|
# real one; a 2xx lets it through, 401/403 triggers error_page ->
|
||||||
# @auth_denied -> redirect to the SPA login. This puts the Go backend's
|
# @auth_denied -> redirect to the SPA login. This puts the Go backend's
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
set $upstream_backend http://$BACKEND_HOST:$BACKEND_PORT;
|
set $upstream_backend http://$BACKEND_HOST:$BACKEND_PORT;
|
||||||
set $upstream_icecast http://$ICECAST_HOST:$ICECAST_PORT;
|
set $upstream_icecast http://$ICECAST_HOST:$ICECAST_PORT;
|
||||||
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
set $upstream_gitea http://$GITEA_HOST:$GITEA_PORT;
|
||||||
set $upstream_hasura http://$HASURA_HOST:$HASURA_PORT;
|
|
||||||
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
set $upstream_silverbullet http://$SILVERBULLET_HOST:$SILVERBULLET_PORT;
|
||||||
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
set $upstream_silverbullet_public http://$SILVERBULLET_PUBLIC_HOST:$SILVERBULLET_PUBLIC_PORT;
|
||||||
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
set $upstream_python http://$PYTHON_HOST:$PYTHON_PORT;
|
||||||
@@ -35,7 +34,7 @@
|
|||||||
# PRIVATE attachments (admin-only). Attachments on *private* chat
|
# PRIVATE attachments (admin-only). Attachments on *private* chat
|
||||||
# messages are written by the backend to /backend/uploads/private/ and
|
# messages are written by the backend to /backend/uploads/private/ and
|
||||||
# must not be readable by the public, so this subpath is put behind the
|
# must not be readable by the public, so this subpath is put behind the
|
||||||
# same admin `auth_request` used for /hasura/ and /sb/. nginx picks
|
# same admin `auth_request` used for /sb/. nginx picks
|
||||||
# the LONGEST matching prefix location, so this block wins over the
|
# the LONGEST matching prefix location, so this block wins over the
|
||||||
# public /uploads/ block below for /uploads/private/* regardless of
|
# public /uploads/ block below for /uploads/private/* regardless of
|
||||||
# ordering. Same three hardening headers as the public block, because
|
# ordering. Same three hardening headers as the public block, because
|
||||||
@@ -118,7 +117,7 @@
|
|||||||
# surface — kick sources, change metadata — protected only by the
|
# surface — kick sources, change metadata — protected only by the
|
||||||
# icecast admin password, and it was reachable from the public
|
# icecast admin password, and it was reachable from the public
|
||||||
# internet through this proxy. Put it behind the same admin
|
# internet through this proxy. Put it behind the same admin
|
||||||
# `auth_request` as /hasura/ and /sb/ so an admin session cookie is
|
# `auth_request` as /sb/ so an admin session cookie is
|
||||||
# required before the request ever reaches icecast. Longest-prefix
|
# required before the request ever reaches icecast. Longest-prefix
|
||||||
# matching means this wins over /radio/ below; listener traffic
|
# matching means this wins over /radio/ below; listener traffic
|
||||||
# (/radio/$ICECAST_MOUNT, /radio/status.xsl) is untouched.
|
# (/radio/$ICECAST_MOUNT, /radio/status.xsl) is untouched.
|
||||||
@@ -155,24 +154,6 @@
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /hasura {
|
|
||||||
return 301 /hasura/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /hasura/ {
|
|
||||||
auth_request /internal/auth/admin-validate;
|
|
||||||
error_page 401 403 = @auth_denied;
|
|
||||||
rewrite ^/hasura/(.*)$ /$1 break;
|
|
||||||
proxy_pass $upstream_hasura;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
location /notes {
|
location /notes {
|
||||||
return 301 /notes/;
|
return 301 /notes/;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The `?redirect=` is set by two different gates: the SPA router guard
|
* The `?redirect=` is set by two different gates: the SPA router guard
|
||||||
* (`meta.requiresAdmin`) and nginx's `auth_request` gate in front of the
|
* (`meta.requiresAdmin`) and nginx's `auth_request` gate in front of the
|
||||||
* proxied containers (/notes/, /sb/, /hasura/). The latter means the
|
* proxied containers (/notes/, /sb/). The latter means the
|
||||||
* destination is frequently NOT a Vue route, so see goTo() below.
|
* destination is frequently NOT a Vue route, so see goTo() below.
|
||||||
*
|
*
|
||||||
* auth.logIn() never throws — it swallows the error — so success is detected by
|
* auth.logIn() never throws — it swallows the error — so success is detected by
|
||||||
@@ -26,7 +26,7 @@ const errorMsg = ref("");
|
|||||||
|
|
||||||
// Send the browser to `dest`, choosing SPA navigation vs. a real page load.
|
// Send the browser to `dest`, choosing SPA navigation vs. a real page load.
|
||||||
//
|
//
|
||||||
// nginx bounces /notes/, /sb/ and /hasura/ here when the admin cookie is
|
// nginx bounces /notes/ and /sb/ here when the admin cookie is
|
||||||
// missing; those paths belong to other containers, so router.push() would just
|
// missing; those paths belong to other containers, so router.push() would just
|
||||||
// match the catch-all 404 route and never leave the SPA. Resolving the path
|
// match the catch-all 404 route and never leave the SPA. Resolving the path
|
||||||
// first tells us which it is: the catch-all matches everything, so landing on
|
// first tells us which it is: the catch-all matches everything, so landing on
|
||||||
|
|||||||
Reference in New Issue
Block a user