v1.5.0: utf8mb4-Migration, Rollen, phpMyAdmin, DB-Bereinigung

- Datenbank auf utf8mb4_unicode_ci migriert (migrate_to_utf8mb4.sh)
- beos: Spalte 'role' (kommagetrennte Rollen: guide, admin, key, deleted)
- BEO-Auswahl im Formular filtert nur noch role='guide'
- logbuch_objekte: ObjektName-Spalte entfernt, stattdessen JOIN auf objekte
- lib/db.ts: charset utf8mb4 in Connection-Pool
- Session und Auth um role-Feld erweitert
- compose.yml: phpMyAdmin mit Traefik unter /myadmin
- compose.yml: MySQL auf 127.0.0.1:3336 für SSH-Tunnel (lokale Entwicklung)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 09:34:38 +02:00
parent 8bff795247
commit 3fc5c9ff7a
12 changed files with 278 additions and 10 deletions
+99
View File
@@ -0,0 +1,99 @@
services:
logbuch_mysql:
image: mysql:lts
container_name: logbuch_mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
volumes:
- db_data:/var/lib/mysql
ports:
- "127.0.0.1:3336:3306"
networks:
- proxy
healthcheck:
test:
- CMD
- mysqladmin
- ping
- -h
- localhost
- -uroot
- -p${DB_ROOT_PASS}
interval: 10s
timeout: 5s
retries: 10
# Kein Port nach außen — nur internes Netzwerk
logbuch_phpmyadmin:
image: phpmyadmin:latest
container_name: logbuch_phpmyadmin
restart: unless-stopped
environment:
PMA_HOST: logbuch_mysql
PMA_PORT: 3306
PMA_ABSOLUTE_URI: https://logbuch.fuerst-stuttgart.de/myadmin/
depends_on:
logbuch_mysql:
condition: service_healthy
labels:
- traefik.enable=true
- traefik.http.routers.logbuch-pma.entrypoints=http
- traefik.http.routers.logbuch-pma.rule=Host(`logbuch.fuerst-stuttgart.de`) && PathPrefix(`/myadmin`)
- traefik.http.middlewares.logbuch-pma-https-redirect.redirectscheme.scheme=https
- traefik.http.routers.logbuch-pma.middlewares=logbuch-pma-https-redirect
- traefik.http.routers.logbuch-pma-secure.entrypoints=https
- traefik.http.routers.logbuch-pma-secure.rule=Host(`logbuch.fuerst-stuttgart.de`) && PathPrefix(`/myadmin`)
- traefik.http.routers.logbuch-pma-secure.tls=true
- traefik.http.routers.logbuch-pma-secure.middlewares=logbuch-pma-slash,logbuch-pma-strip
- traefik.http.middlewares.logbuch-pma-slash.redirectregex.regex=^https://logbuch\.fuerst-stuttgart\.de/myadmin$$
- traefik.http.middlewares.logbuch-pma-slash.redirectregex.replacement=https://logbuch.fuerst-stuttgart.de/myadmin/
- traefik.http.middlewares.logbuch-pma-strip.stripprefix.prefixes=/myadmin
- traefik.http.routers.logbuch-pma-secure.service=logbuch-pma
- traefik.http.services.logbuch-pma.loadbalancer.server.port=80
networks:
- proxy
logbuch_app:
image: docker.citysensor.de/logbuch:latest
container_name: logbuch_app
restart: unless-stopped
environment:
DB_HOST: logbuch_mysql
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
DB_NAME: ${DB_NAME}
DB_PORT: 3306
AUTH_SECRET: ${AUTH_SECRET}
NODE_ENV: production
ports:
- 127.0.0.1:${APP_PORT:-3000}:3000
depends_on:
logbuch_mysql:
condition: service_healthy
labels:
- traefik.enable=true
- traefik.http.routers.logbuch.entrypoints=http
- traefik.http.routers.logbuch.rule=Host(`logbuch.fuerst-stuttgart.de`)
- traefik.http.middlewares.logbuch-https-redirect.redirectscheme.scheme=https
- traefik.http.routers.logbuch.middlewares=logbuch-https-redirect
- traefik.http.routers.logbuch-secure.entrypoints=https
- traefik.http.routers.logbuch-secure.rule=Host(`logbuch.fuerst-stuttgart.de`)
- traefik.http.routers.logbuch-secure.tls=true
- traefik.http.routers.logbuch-secure.service=logbuch
- traefik.http.services.logbuch.loadbalancer.server.port=3000
networks:
- proxy
- gitea-internal
networks:
proxy:
name: dockge_default
external: true
gitea-internal:
name: gitea_gitea-internal
external: true
volumes:
db_data: null