Drop app_local.php from production and show the mail transport in polls remind
app_local.php takes precedence over config/.env, so a copy made from an older template forced the file transport and reminders never left the server. Release package and Docker image now ship without it; app.php reads the database from DATABASE_URL (SQLite default). app_local.example.php keeps development defaults only. polls remind prints the transport and warns when SMTP_HOST is set but SMTP is not used. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f21aead039
commit
7fa33bbbdd
10 files changed
+65
-50
No files matched your search
@@ -5,7 +5,7 @@ Verzeichnisstruktur, Klassen und Tabellen im Detail.
|
||||
```
|
||||
config/
|
||||
app.php Defaults inkl. Block 'Plenario' (Captcha, Throttle, Polling) und Cache 'throttle'
|
||||
app_local.example.php Vorlage für app_local.php (SQLite, FileTransport) – app_local.php ist gitignored
|
||||
app_local.example.php Dev-Defaults (debug, FileTransport), von `composer install` nach app_local.php kopiert (gitignored, nur lokal, nie in Produktion)
|
||||
.env.example Alle Umgebungsvariablen (config/.env wird optional geladen)
|
||||
routes.php Alle Routen benannt, KEINE Fallback-Routen
|
||||
Migrations/ Schema (einzige Quelle der Wahrheit, auch für Tests)
|
||||
|
||||
@@ -11,11 +11,11 @@ Alles andere ist optional und hat einen Standardwert. In der Spalte „Standard
|
||||
|
||||
| Variable | Pflicht? | Standard | Bedeutung |
|
||||
|---|---|---|---|
|
||||
| `DEBUG` | Produktion: ja | `false` (per Composer erzeugte `app_local.php`: `true`) | In Produktion auf `false` setzen, sonst werden Admin-Links direkt angezeigt |
|
||||
| `DEBUG` | Produktion: ja | `false` (lokal: die von Composer erzeugte `app_local.php` setzt `true`) | In Produktion `false` lassen, sonst werden Admin-Links direkt angezeigt |
|
||||
| `APP_FULL_BASE_URL` | Produktion: ja | – (lokal `http://localhost:8765`) | Öffentliche URL inkl. `https://`, wird für Links in E-Mails gebraucht. In Produktion wird außerdem der Host-Header dagegen geprüft |
|
||||
| `SECURITY_SALT` | ja | – (lokal wird er von Composer erzeugt) | Langer Zufallswert. **Nicht nachträglich ändern** – damit werden Admin-Tokens verschlüsselt und Teilnehmer-IDs gehasht |
|
||||
| `DATABASE_URL` | optional | leer = SQLite in `data/` | Sonst z. B. `mysql://user:pw@host/plenario?encoding=utf8mb4` oder `postgres://user:pw@host/plenario` |
|
||||
| `SMTP_HOST` | Produktion: ja | leer = Mails nur als Datei in `tmp/mails/` | Mailserver. Ohne ihn kommt der Admin-Link nie bei den Nutzenden an |
|
||||
| `SMTP_HOST` | Produktion: ja | leer = Mails nur als Datei in `tmp/mails/` (per `app_local.php`), sonst PHP `mail()` | Mailserver. Ohne ihn kommt der Admin-Link nie bei den Nutzenden an. **Achtung:** Eine `config/app_local.php` hat Vorrang vor `.env`; ein `FileTransport` darin (ältere Vorlage) überschreibt SMTP, die Mails landen dann nur in `tmp/mails/`. Auf Servern gehört keine `app_local.php` hin, sie ist nur für die lokale Entwicklung. `bin/cake polls remind` zeigt den verwendeten Transport an und warnt davor |
|
||||
| `SMTP_PORT` | optional | `587` | Port 465 nutzt automatisch SSL |
|
||||
| `SMTP_USER`, `SMTP_PASSWORD` | optional | leer | Zugangsdaten, falls der Mailserver sie verlangt |
|
||||
| `SMTP_TLS` | optional | `true` | `true` = STARTTLS, `false` = unverschlüsselt |
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ sowie [Composer](https://getcomposer.org/).
|
||||
```bash
|
||||
git clone https://gitea.gnilebein.de/gnilebein/Plenario.git
|
||||
cd Plenario
|
||||
composer install # legt config/app_local.php an (SQLite, Mails als Datei)
|
||||
composer install # legt config/app_local.php an (nur Dev-Defaults: debug, Mails als Datei)
|
||||
bin/cake migrations migrate # erstellt data/plenario.sqlite
|
||||
bin/cake server -p 8765 # http://localhost:8765
|
||||
```
|
||||
|
||||
+2
-2
@@ -53,7 +53,7 @@ Beispiel: `docker-compose.yml`. Image und App-Paket entstehen nur bei Releases (
|
||||
|
||||
**Releases (SemVer):** `.gitea/workflows/release.yml` läuft nur bei Tags `vMAJOR.MINOR.PATCH[-suffix]` (kein Build bei normalen
|
||||
Pushes). Job `test` (PHPUnit + phpcs) gatet `package` und `image`. `package` baut `plenario-<version>.tar.gz` (git archive des Tags,
|
||||
`composer install --no-dev --no-scripts`, `app_local.php` aus dem Example, leere `tmp/`/`logs/`/`data/`, Datei `VERSION`; nur per Whitelist: bin, config, plugins, resources, src, templates, webroot, index.php, .htaccess, composer-Dateien;
|
||||
`composer install --no-dev --no-scripts`, **ohne** `app_local.php` (nur `.env`), leere `tmp/`/`logs/`/`data/`, Datei `VERSION`; nur per Whitelist: bin, config, plugins, resources, src, templates, webroot, index.php, .htaccess, composer-Dateien;
|
||||
kein tests/CI/Docker/README) + `SHA256SUMS` und hängt sie an das Gitea-Release (wird angelegt bzw. aktualisiert, Changelog = Commit-Betreffs
|
||||
seit dem letzten Tag, Suffix = Pre-Release). `image` pusht `:<version>`, `:<major>.<minor>`, `:<major>` und `:latest` (die
|
||||
beiden letzten nicht bei Pre-Releases bzw. `v0.`) in die Gitea-Registry (Variablen `DOCKER_REPO`, `IMAGE_NAME`, Secret `PAT`).
|
||||
@@ -63,6 +63,6 @@ Wer das Paket ändert (z. B. weitere Dateien ausschließen), pflegt den Schritt
|
||||
|
||||
Produktiv auf dem Server in `config/.env`: `DEBUG=false`, `APP_FULL_BASE_URL`, `SECURITY_SALT`, SMTP
|
||||
(`SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_TLS` – einzelne Variablen statt URL; `EMAIL_TRANSPORT_DEFAULT_URL` geht weiter als Altlast).
|
||||
Ohne `DEBUG=false` steht die per Composer erzeugte `app_local.php` auf debug=true und zeigt Admin-Links direkt an.
|
||||
Produktion kennt keine `app_local.php`: Paket und Docker-Image liefern sie nicht mit, `app.php` liest alles aus der Umgebung (Standard `DEBUG=false`). Eine `app_local.php` hätte Vorrang vor `.env` und überschreibt still einzelne Werte (z. B. den Mail-Transport); auf bestehenden Servern aus der Zeit vor diesem Stand löschen.
|
||||
Document-Root zeigt idealerweise auf `webroot/`; liegt die App direkt im Document-Root (z. B. `public_html`),
|
||||
leiten `.htaccess` + `index.php` im Projektroot alles nach `webroot/` weiter.
|
||||
Reference in new issue
Block a user