5 Commits

Author SHA1 Message Date
smueller
8b029ade77 Merge branch 'dev'
All checks were successful
Docker Image bauen & veröffentlichen / build-and-push (push) Successful in 43s
2026-07-07 14:50:53 +02:00
smueller
8b813c7e20 Update README.md to reflect new Docker image publishing and CI/CD workflow
- Enhance documentation with details on automatic image builds and pushes to Gitea Container Registry.
- Add instructions for pulling and running the container image, including usage in docker-compose.
- Include information on the CI/CD workflow for building and pushing images based on version tags.
2026-07-07 14:50:14 +02:00
smueller
9dd62999bd Remove diagnostic steps for registry login from Docker build workflow
- Eliminate previous checks for registry login credentials, including Basic-Auth and token request diagnostics.
- Streamline the workflow by focusing on essential steps for Gitea Container Registry login.
2026-07-07 14:47:25 +02:00
d7e3545a84 Merge pull request 'Enhance Docker build workflow with additional API tests for registry authentication' (#3) from dev into main
Reviewed-on: #3
2026-07-07 12:40:41 +00:00
smueller
e4150d0bc3 Enhance Docker build workflow with additional API tests for registry authentication
- Introduce new diagnostic steps to validate registry login credentials, including checks for Basic-Auth and token requests.
- Implement curl commands to retrieve and display authentication details, improving debugging capabilities during the Docker build process.
2026-07-07 14:40:20 +02:00
2 changed files with 54 additions and 17 deletions

View File

@@ -28,20 +28,6 @@ jobs:
- name: Docker Buildx einrichten - name: Docker Buildx einrichten
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Registry-Anmeldung prüfen (Diagnose)
env:
REG_USER: ${{ secrets.REGISTRY_USER || github.repository_owner }}
REG_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
echo "Registry: ${REGISTRY}"
echo "Username: '${REG_USER}' (Laenge: ${#REG_USER})"
echo "Token gesetzt: $([ -n "${REG_TOKEN}" ] && echo ja || echo NEIN) (Laenge: ${#REG_TOKEN})"
echo "--- Test 1: /v2/ mit Basic-Auth ---"
curl -s -o /dev/null -w "HTTP %{http_code}\n" -u "${REG_USER}:${REG_TOKEN}" "https://${REGISTRY}/v2/"
echo "--- Test 2: Token-Endpoint (Bearer-Flow) ---"
curl -s -o /dev/null -w "HTTP %{http_code}\n" -u "${REG_USER}:${REG_TOKEN}" \
"https://${REGISTRY}/v2/token?scope=repository:${IMAGE_NAME}:pull,push&service=container_registry" || true
- name: An Gitea Container Registry anmelden - name: An Gitea Container Registry anmelden
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:

View File

@@ -7,8 +7,8 @@ Produktionsnahes internes Tool zur Erstellung von Thomas-Krenn.AG Newslettern au
- Login und Benutzerverwaltung mit RBAC (`admin`, `editor`, `reader`) - Login und Benutzerverwaltung mit RBAC (`admin`, `editor`, `reader`)
- Verpflichtender CSRF-Schutz auf allen POST-Formularen - Verpflichtender CSRF-Schutz auf allen POST-Formularen
- Filter in der Web-UI: - Filter in der Web-UI:
- Zeitraum in Tagen - Zeitraum in Tagen oder „Letzter Monat“
- Nur bearbeitete Artikel - Artikel-Auswahl: alle, nur neue oder nur bearbeitete Artikel
- Kategorie - Kategorie
- Redaktioneller Feinschliff pro Ausgabe: - Redaktioneller Feinschliff pro Ausgabe:
- **Redaktionsnotiz** optionaler Hinweistext, der als eigene Box im Newsletter erscheint - **Redaktionsnotiz** optionaler Hinweistext, der als eigene Box im Newsletter erscheint
@@ -25,7 +25,7 @@ Produktionsnahes internes Tool zur Erstellung von Thomas-Krenn.AG Newslettern au
- Verteilerlisten - Verteilerlisten
- tägliche Zeitplanung - tägliche Zeitplanung
- Versandprotokoll - Versandprotokoll
- Docker/Compose Betrieb - Docker/Compose Betrieb, inkl. automatischem Image-Build & Push in die Gitea Container Registry (per Versions-Tag)
## Start mit Docker ## Start mit Docker
@@ -50,6 +50,57 @@ Produktionsnahes internes Tool zur Erstellung von Thomas-Krenn.AG Newslettern au
4. Zugriff: 4. Zugriff:
- [http://localhost:8080/login](http://localhost:8080/login) (oder dein `HOST_PORT`) - [http://localhost:8080/login](http://localhost:8080/login) (oder dein `HOST_PORT`)
## Container-Image (Gitea Packages)
Fertige Images werden automatisch in die Gitea Container Registry veröffentlicht:
```
git.hexahost.dev/smueller/tk-wiki-newsletter
```
Verfügbare Tags: `latest`, die Version (`X.Y.Z`, `X.Y`, `X`) sowie der kurze Commit-SHA.
Image ziehen und mit vorhandener `.env` starten:
```bash
docker login git.hexahost.dev
docker pull git.hexahost.dev/smueller/tk-wiki-newsletter:latest
docker run -d --name tk-newsletter-admin \
--env-file .env \
-p 8080:8000 \
-v newsletter_data:/app/data \
git.hexahost.dev/smueller/tk-wiki-newsletter:latest
```
Alternativ in `docker-compose.yml` statt `build: .` das Image referenzieren:
```yaml
services:
newsletter-admin:
image: git.hexahost.dev/smueller/tk-wiki-newsletter:latest
# build: . # <- nicht mehr nötig, wenn das fertige Image genutzt wird
```
### Automatischer Build (CI/CD)
Der Workflow `.gitea/workflows/docker-build.yml` baut und pusht das Image über Gitea Actions.
- **Auslöser**: nur beim Setzen eines Versions-Tags `v*` (kein Build bei normalen Pushes auf `dev`/`main`).
- **Release-Ablauf** (Build bei Merge `dev` → `main` mit Version):
```bash
git checkout main
git merge --no-ff dev
git push origin main
git tag v1.0.0
git push origin v1.0.0 # <- startet Build & Push
```
- **Benötigte Repo-Secrets** (Settings → Actions → Secrets):
- `REGISTRY_TOKEN`: Gitea Access-Token mit Scope **Package: Read and write**
- `REGISTRY_USER` (optional): Registry-Benutzername, falls abweichend vom Repo-Owner
- **Optionale Repo-Variable**: `REGISTRY`, um den Registry-Host zu überschreiben (Default `git.hexahost.dev`).
## Sicherheits-Hinweise für Produktion ## Sicherheits-Hinweise für Produktion
- Reverse Proxy (z. B. Nginx/Traefik) mit TLS vor den Container setzen. - Reverse Proxy (z. B. Nginx/Traefik) mit TLS vor den Container setzen.