Remove hardcoded credentials, harden deployment, optimize OCR
Secrets (S3 keys, PG password, DeerMapper API key) were committed in config.yaml and .env and remain in git history. This removes them from the tracked tree and moves all secrets to env injection. Security: - config.yaml: drop all credentials, keep only non-secret app tunables - untrack .env, add .env.example template; .gitignore excludes .env - main.py: tolerant config lookups + fail-fast validation for missing secrets - docker-compose: env_file injection, no full-repo bind mount, debug port off - Dockerfile: bake config into image, run as non-root user Efficiency: - OCR: run the second (expensive) tesseract pass only when the first is unparsable; identical fallback behavior Docs: - README with operation + security notes - MIGRATION.md runbook: secret rotation, server cutover, decommission, git history purge Note: the leaked secrets are compromised and MUST be rotated; removing them from the tree is not sufficient. See MIGRATION.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
22
.env.example
Normal file
22
.env.example
Normal file
@@ -0,0 +1,22 @@
|
||||
# .env.example - Vorlage fuer die Secrets.
|
||||
#
|
||||
# Auf dem Server eine echte .env daraus erzeugen und mit den NEU ROTIERTEN
|
||||
# Werten befuellen:
|
||||
# cp .env.example .env
|
||||
# chmod 600 .env
|
||||
# Die echte .env wird durch .gitignore ausgeschlossen und darf NIE eingecheckt werden.
|
||||
|
||||
# --- Hetzner Object Storage (S3) ---
|
||||
S3_ENDPOINT=https://fsn1.your-objectstorage.com/
|
||||
S3_BUCKET=trapper-meles
|
||||
S3_ACCESS_KEY=__NEUEN_ACCESS_KEY_EINTRAGEN__
|
||||
S3_SECRET_KEY=__NEUEN_SECRET_KEY_EINTRAGEN__
|
||||
|
||||
# --- PostgreSQL ---
|
||||
# TLS erzwingen (sslmode=require). Host/Port zeigen auf den NEUEN DB-Zugang
|
||||
# (idealerweise ueber privates Netz / SSH-Tunnel, nicht oeffentlich erreichbar).
|
||||
PG_DSN=postgresql://USER:PASSWORT@HOST:PORT/meles?sslmode=require
|
||||
|
||||
# --- DeerMapper API (nur noetig, wenn app.enable_deermapper_api: true) ---
|
||||
DEERMAPPER_API_URL=https://webapp.deermapper.net/api/icu
|
||||
DEERMAPPER_API_KEY=__NEUEN_API_KEY_EINTRAGEN__
|
||||
Reference in New Issue
Block a user