docs(dockerhub): Review-Punkte 1, 3-10 umgesetzt (#32)
CI / App (npm ci + Build, ESLint, Stylelint, Jest) (pull_request) Successful in 2m26s
CI / Storage (mongo) (pull_request) Canceled after 12s
CI / Storage (postgres) (pull_request) Canceled after 0s

raw-URLs, OIDC-Discovery-Formulierung, Platzhalter per sed im Workflow, Markdown-Links, Fehlercodes, HB_AUTH_PROVIDERS-Default, exec -T, wc-c-Hinweis, FORK.md-Hinweis.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dev-bot BotandClaude Sonnet 5.5 committed 2026-11-26 11:40:24 +00:00
1 parent 75548d39f3
commit 18f26b7fd6
4 files changed
+22 -16

No files matched your search

@@ -45,6 +45,12 @@ jobs:
- uses: actions/checkout@v7 - uses: actions/checkout@v7
if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
- name: Platzhalter ersetzen (nur in der ausgecheckten Kopie)
if: steps.check.outputs.run == 'true'
env:
HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
run: sed -i "s#<DOCKER_HUB_USER>#${HUB_USER}#g" docs/dockerhub/README.md
- name: Größe prüfen (Docker-Hub-Limit 25.000 Bytes) - name: Größe prüfen (Docker-Hub-Limit 25.000 Bytes)
if: steps.check.outputs.run == 'true' if: steps.check.outputs.run == 'true'
run: | run: |
+1 -1
View File
@@ -79,7 +79,7 @@ merges remain conflict-free.
| `ci.yml` | pull requests, push to `main` | `npm ci` (includes the Vite build via `postinstall`), `npm run lint:dry`, `npm run stylelint:dry`, `npm test`. Upstream currently has ESLint warnings but no errors; warnings do not fail the job. The tests need no MongoDB. | | `ci.yml` | pull requests, push to `main` | `npm ci` (includes the Vite build via `postinstall`), `npm run lint:dry`, `npm run stylelint:dry`, `npm test`. Upstream currently has ESLint warnings but no errors; warnings do not fail the job. The tests need no MongoDB. |
| `image.yml` | push to `main`, tags `v*`, manual | builds `docker/Dockerfile` (same as Compose) and pushes `git.morlana.online/f.weber/homebrewery-oidc`; release tags `vX.Y.Z` additionally go to Docker Hub (`<DOCKER_HUB_USER>/homebrewery-oidc`) | | `image.yml` | push to `main`, tags `v*`, manual | builds `docker/Dockerfile` (same as Compose) and pushes `git.morlana.online/f.weber/homebrewery-oidc`; release tags `vX.Y.Z` additionally go to Docker Hub (`<DOCKER_HUB_USER>/homebrewery-oidc`) |
| `dockerhub-sync.yml` | manual (input `version`) | copies an already built `vX.Y.Z` image from Gitea to Docker Hub without rebuilding (same digest); sets `latest` only if the version is the highest release | | `dockerhub-sync.yml` | manual (input `version`) | copies an already built `vX.Y.Z` image from Gitea to Docker Hub without rebuilding (same digest); sets `latest` only if the version is the highest release |
| `dockerhub-description.yml` | release tag `vX.Y.Z`, push to `main` touching `docs/dockerhub/README.md`, manual | sets the Docker Hub overview from `docs/dockerhub/README.md` (English, < 25,000 bytes, absolute links only) plus a short description (≤ 100 characters), using `peter-evans/dockerhub-description`; skipped with a warning if `DOCKER_HUB_USER`/`DOCKER_HUB_TOKEN` are missing (the token needs Read, Write and Delete) | | `dockerhub-description.yml` | release tag `vX.Y.Z`, push to `main` touching `docs/dockerhub/README.md`, manual | sets the Docker Hub overview from `docs/dockerhub/README.md` (English, < 25,000 bytes, absolute links only) plus a short description (≤ 100 characters), using `peter-evans/dockerhub-description`; skipped with a warning if `DOCKER_HUB_USER`/`DOCKER_HUB_TOKEN` are missing (the token needs Read, Write and Delete); `<DOCKER_HUB_USER>` in the file is replaced by the secret at publish time. A maintenance tag on an older commit overwrites the description with that older text; the first run needs the Hub repository to exist (created by `image.yml`) |
The authoritative image definition is `docker/Dockerfile` with The authoritative image definition is `docker/Dockerfile` with
`docker/Dockerfile.dockerignore` (BuildKit picks it up automatically for `context: .`). `docker/Dockerfile.dockerignore` (BuildKit picks it up automatically for `context: .`).
+14 -14
View File
@@ -2,9 +2,9 @@
[Homebrewery](https://github.com/naturalcrit/homebrewery) fork for self-hosting: **OIDC login** (Keycloak, authentik, any OpenID Connect provider), **PostgreSQL 18** (or MongoDB) storage, a **Git backend** (brews live in your own Git repositories) and **image upload** into those repositories. [Homebrewery](https://github.com/naturalcrit/homebrewery) fork for self-hosting: **OIDC login** (Keycloak, authentik, any OpenID Connect provider), **PostgreSQL 18** (or MongoDB) storage, a **Git backend** (brews live in your own Git repositories) and **image upload** into those repositories.
- Source, issues, docs: https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/README.md (repository: https://git.morlana.online/f.weber/homebrewery-oidc) - Source, issues, docs: [repository](https://git.morlana.online/f.weber/homebrewery-oidc), [README](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/README.md)
- Fork overview and CI/tag details: https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/FORK.md - Fork overview and CI/tag details: [FORK.md](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/FORK.md)
- Upstream: https://github.com/naturalcrit/homebrewery. License: MIT (see https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/license). - Upstream: [naturalcrit/homebrewery](https://github.com/naturalcrit/homebrewery). License: MIT (see the [license file](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/license)).
The image contains no configuration or secrets. Everything is configured with environment variables at runtime. The app listens on port **8000**. The image contains no configuration or secrets. Everything is configured with environment variables at runtime. The app listens on port **8000**.
@@ -23,14 +23,14 @@ The same images are also published to the Gitea registry `git.morlana.online/f.w
```bash ```bash
mkdir homebrewery && cd homebrewery mkdir homebrewery && cd homebrewery
curl -fsSLO https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/deploy/compose.yaml curl -fsSLO https://git.morlana.online/f.weber/homebrewery-oidc/raw/branch/main/docs/deploy/compose.yaml
curl -fsSL https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/deploy/env.example -o .env curl -fsSL https://git.morlana.online/f.weber/homebrewery-oidc/raw/branch/main/docs/deploy/env.example -o .env
``` ```
(The files are also linked in https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/deploy/README.md; the guide there is in German, this page is the English summary.) (Both files are also linked from the [deployment guide](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/deploy/README.md); that guide is in German, this page is the English summary.)
2. Edit `.env`. Required: `POSTGRES_PASSWORD`, `HB_PUBLIC_URL`, `HB_SESSION_SECRET`, `HB_OIDC_ISSUER`, `HB_OIDC_CLIENT_ID`, `HB_OIDC_CLIENT_SECRET`. 2. Edit `.env`. Required: `POSTGRES_PASSWORD`, `HB_PUBLIC_URL`, `HB_SESSION_SECRET`, `HB_OIDC_ISSUER`, `HB_OIDC_CLIENT_ID`, `HB_OIDC_CLIENT_SECRET`.
Set `HB_IMAGE` to pin a release, e.g. `HB_IMAGE=<DOCKER_HUB_USER>/homebrewery-oidc:v1.0.0`. Without it the template uses the Gitea registry image `:latest`. Set `HB_IMAGE` to pin a release, e.g. `HB_IMAGE=<DOCKER_HUB_USER>/homebrewery-oidc:v1.0.0` (`docker pull <DOCKER_HUB_USER>/homebrewery-oidc:v1.0.0`). Without it the template uses the Gitea registry image `:latest`.
Generate secrets with `openssl rand -base64 48` (session secret) and `openssl rand -hex 24` (database password: only URL-safe characters, it ends up in the Postgres URL). Generate secrets with `openssl rand -base64 48` (session secret) and `openssl rand -hex 24` (database password: only URL-safe characters, it ends up in the Postgres URL).
3. Register the redirect URI `<HB_PUBLIC_URL>/auth/oidc/callback` at your identity provider (confidential client, `client_secret_basic`). 3. Register the redirect URI `<HB_PUBLIC_URL>/auth/oidc/callback` at your identity provider (confidential client, `client_secret_basic`).
@@ -44,7 +44,7 @@ The same images are also published to the Gitea registry `git.morlana.online/f.w
curl -I http://localhost:8000/ # HTTP 200 once started curl -I http://localhost:8000/ # HTTP 200 once started
``` ```
TLS and a reverse proxy (nginx, Traefik, Caddy in front of port 8000) are not part of the template. `HB_PUBLIC_URL` must be the externally reachable `https://` URL, without a trailing slash. On startup the app contacts the identity provider (OIDC discovery) and PostgreSQL (version 18 or newer is required, otherwise it aborts with a clear message). Database migrations run automatically. TLS and a reverse proxy (nginx, Traefik, Caddy in front of port 8000) are not part of the template. `HB_PUBLIC_URL` must be the externally reachable `https://` URL, without a trailing slash. On startup the app checks that the required OIDC values are present and well-formed and connects to PostgreSQL (version 18 or newer is required, otherwise it aborts with a clear message). The identity provider itself (OIDC discovery) is only contacted at the first login; if it is unreachable, login answers with 502 but the app keeps running. Database migrations run automatically.
**Important:** the container only sees variables listed under `environment:` (or loaded via `env_file:`). An entry in `.env` alone only fills the `${...}` placeholders of the Compose file. If you write your own Compose file, pass every `HB_*` variable explicitly, especially `HB_GIT_TOKEN_KEY`. **Important:** the container only sees variables listed under `environment:` (or loaded via `env_file:`). An entry in `.env` alone only fills the `${...}` placeholders of the Compose file. If you write your own Compose file, pass every `HB_*` variable explicitly, especially `HB_GIT_TOKEN_KEY`.
@@ -54,7 +54,7 @@ Set `HB_DB_DRIVER=mongo` (the default when unset) and `MONGODB_URI=mongodb://mon
## Configuration ## Configuration
All settings are environment variables. Full reference: https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/auth/README.md (login), https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/storage/README.md (database), https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/git/README.md (Git backend, image upload). All settings are environment variables. Full reference (German): [login](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/auth/README.md), [database](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/storage/README.md), [Git backend and image upload](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/git/README.md).
### Storage ### Storage
@@ -69,7 +69,7 @@ All settings are environment variables. Full reference: https://git.morlana.onli
| Variable | Required | Default | Description | | Variable | Required | Default | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `HB_AUTH_PROVIDERS` | no | see docs | `oidc`, `naturalcrit` (comma separated). Use `oidc` for OIDC only | | `HB_AUTH_PROVIDERS` | no | `oidc,naturalcrit` if `HB_OIDC_ISSUER` is set, otherwise `naturalcrit` | `oidc`, `naturalcrit` (comma separated). Use `oidc` for OIDC only. With your own Compose file, set `HB_AUTH_PROVIDERS=oidc`: otherwise the app refuses to start while `SECRET` has its default value |
| `HB_PUBLIC_URL` | with `oidc` | – | external URL, e.g. `https://brew.example.org` | | `HB_PUBLIC_URL` | with `oidc` | – | external URL, e.g. `https://brew.example.org` |
| `HB_OIDC_ISSUER` | with `oidc` | – | issuer URL (discovery via `/.well-known/openid-configuration`) | | `HB_OIDC_ISSUER` | with `oidc` | – | issuer URL (discovery via `/.well-known/openid-configuration`) |
| `HB_OIDC_CLIENT_ID` | with `oidc` | – | | | `HB_OIDC_CLIENT_ID` | with `oidc` | – | |
@@ -114,17 +114,17 @@ Lets OIDC users link brews to their own Git repositories (HTTPS + personal acces
## Operations ## Operations
- **Update / upgrade:** change the tag (or keep `latest`), then `docker compose pull && docker compose up -d`. Use `up -d`, **not** `restart`: `restart` reuses the old container with its old environment and ignores changes. Migrations run on startup; read the release notes before jumping several versions. - **Update / upgrade:** change the tag (or keep `latest`), then `docker compose pull && docker compose up -d`. Use `up -d`, **not** `restart`: `restart` reuses the old container with its old environment and ignores changes. Migrations run on startup; read the release notes before jumping several versions.
- **Backup:** back up the database (`docker compose exec postgres pg_dump -U homebrewery homebrewery > backup.sql`, adjust user/db to your `.env`) and keep `HB_GIT_TOKEN_KEY` (and any old keys) in your secret store. Brews linked to Git are also in your repositories, but the database holds sharing snapshots, users and stored (encrypted) tokens. - **Backup:** back up the database (`docker compose exec -T postgres pg_dump -U homebrewery homebrewery > backup.sql`, adjust user/db to your `.env`) and keep `HB_GIT_TOKEN_KEY` (and any old keys) in your secret store. Brews linked to Git are also in your repositories, but the database holds sharing snapshots, users and stored (encrypted) tokens.
- **Key rotation:** set the new key as `HB_GIT_TOKEN_KEY`, move the previous one into `HB_GIT_TOKEN_KEYS_OLD` (comma separated), run `docker compose up -d`. Tokens are re-encrypted on next use; drop the old key only after all connections have been used. - **Key rotation:** set the new key as `HB_GIT_TOKEN_KEY`, move the previous one into `HB_GIT_TOKEN_KEYS_OLD` (comma separated), run `docker compose up -d`. Tokens are re-encrypted on next use; drop the old key only after all connections have been used.
- **Logs:** `docker compose logs -f homebrewery`. Look for `Git-Backend aktiv (kid=...)` (on) or `Git-Backend deaktiviert: HB_GIT_TOKEN_KEY ist nicht gesetzt` (off). Logs never contain keys or tokens. - **Logs:** `docker compose logs -f homebrewery`. Look for `Git-Backend aktiv (kid=...)` (on) or `Git-Backend deaktiviert: HB_GIT_TOKEN_KEY ist nicht gesetzt` (off). Logs never contain keys or tokens.
- **Health:** the image has no dedicated health endpoint; `GET /` on port 8000 returning HTTP 200 means the app is up. The container exits at startup if the database or IdP configuration is invalid, so `restart: unless-stopped` shows a restart loop with the reason in the log. - **Health:** the image has no dedicated health endpoint; `GET /` on port 8000 returning HTTP 200 means the app is up. The container exits at startup if the database is unusable or required OIDC values are missing or malformed (IdP reachability is only checked at the first login), so `restart: unless-stopped` shows a restart loop with the reason in the log.
## Troubleshooting ## Troubleshooting
- **Git panel says "Git-Backend auf diesem Server nicht aktiviert" / API returns `503 G10`:** `HB_GIT_TOKEN_KEY` does not reach the container. Check `docker compose exec homebrewery printenv HB_GIT_TOKEN_KEY | wc -c` (a valid key prints 45; `0` or an error means it is not set), make sure it is listed under `environment:`, then `docker compose up -d`. - **Git panel says "Git-Backend auf diesem Server nicht aktiviert" / API returns `503 G10`:** `HB_GIT_TOKEN_KEY` does not reach the container. Check `docker compose exec homebrewery printenv HB_GIT_TOKEN_KEY | wc -c` (a valid key prints 45; `0`, `1` (empty value) or an error means it is not set), make sure it is listed under `environment:`, then `docker compose up -d`.
- **`403 G07`:** the session is not an OIDC account. Only OIDC users can link repositories. - **`403 G07`:** the session is not an OIDC account. Only OIDC users can link repositories.
- **Start aborts with `HB_GIT_TOKEN_KEY muss 32 Byte (base64) lang sein`:** invalid key (also checked in `HB_GIT_TOKEN_KEYS_OLD`). Generate with `openssl rand -base64 32`. - **Start aborts with `HB_GIT_TOKEN_KEY muss 32 Byte (base64) lang sein`:** invalid key (also checked in `HB_GIT_TOKEN_KEYS_OLD`). Generate with `openssl rand -base64 32`.
- **Start aborts about PostgreSQL:** the server must be version 18 or newer and `HB_POSTGRES_URL` must be set. - **Start aborts about PostgreSQL:** the server must be version 18 or newer and `HB_POSTGRES_URL` must be set.
- **Login redirect mismatch:** the IdP redirect URI must be exactly `<HB_PUBLIC_URL>/auth/oidc/callback`. - **Login redirect mismatch:** the IdP redirect URI must be exactly `<HB_PUBLIC_URL>/auth/oidc/callback`.
More error codes (`G01`-`G10`, `A01`-`A07`): https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/git/README.md#fehlercodes More error codes: Git backend `G01`-`G10` in the [Git guide](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/git/README.md#fehlercodes), image upload `A04`-`A07` in the [upload section of the same guide](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/git/README.md), rename `A01`-`A03` in the [auth guide](https://git.morlana.online/f.weber/homebrewery-oidc/src/branch/main/docs/auth/README.md) (guides are in German).
+1 -1
View File
@@ -42,7 +42,7 @@ Mit Docker Compose gilt: Nach einer Änderung der Umgebung `docker compose up -d
Prüfen, in dieser Reihenfolge: Prüfen, in dieser Reihenfolge:
1. **Kommt der Schlüssel im Container an?** `docker compose exec <service> printenv HB_GIT_TOKEN_KEY | wc -c`: `0` oder 1. **Kommt der Schlüssel im Container an?** `docker compose exec <service> printenv HB_GIT_TOKEN_KEY | wc -c`: `0`, `1` (Variable gesetzt, aber leer) oder
Fehler = nicht gesetzt; ein gültiger Schlüssel (32 Byte, base64) hat 45 Zeichen (44 + Zeilenumbruch). Fehler = nicht gesetzt; ein gültiger Schlüssel (32 Byte, base64) hat 45 Zeichen (44 + Zeilenumbruch).
2. **Startlog** (`docker compose logs <service>`): `Git-Backend aktiv (kid=…, alte Schlüssel: n, Host-Allowlist: ja (n)|nein)` = an; 2. **Startlog** (`docker compose logs <service>`): `Git-Backend aktiv (kid=…, alte Schlüssel: n, Host-Allowlist: ja (n)|nein)` = an;
`Git-Backend deaktiviert: HB_GIT_TOKEN_KEY ist nicht gesetzt` = aus. Der Log enthält nie den Schlüssel. `Git-Backend deaktiviert: HB_GIT_TOKEN_KEY ist nicht gesetzt` = aus. Der Log enthält nie den Schlüssel.