Remove static JSON files and seed step; migrate site settings to Postgres

All content (recipes + imprint/privacy settings) now lives exclusively in
Postgres. The app no longer requires a seed step on first deploy.

Changes:
- helpers.php: load_site_settings() returns defaults when site_settings
  table is empty instead of throwing DatabaseUnavailableException; removes
  legacy JSONB migration path
- data/recipes.json, data/site.json: deleted (content already in DB)
- scripts/db-seed.php: deleted (no longer needed)
- docker-compose.yml: remove RUN_DB_SEED env var and data/ volume mount
- docker/entrypoint.sh: remove RUN_DB_SEED seed block
- docs/COOLIFY.md: update deployment guide to reflect seedless workflow
- .claude/launch.json: add dev server configurations for preview tool

Fresh deploys now start with placeholder legal pages and an empty recipe
list; the admin fills in real content via /admin.php without any CLI step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 09:53:39 +02:00
co-authored by Claude Sonnet 4.6
parent 792cbe18c1
commit 86fbd8e4bb
20 changed files with 154 additions and 512 deletions
+3 -2
View File
@@ -78,10 +78,10 @@ if (!$authed) {
try {
$allRecipes = load_recipes();
$siteSettings = load_site_settings();
} catch (DatabaseUnavailableException $e) {
handle_database_unavailable($e);
}
$siteSettings = load_site_settings();
$message = null;
$errors = [];
$editing = null;
@@ -186,9 +186,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'save_
$siteSettings['imprint'] = $imprint;
$siteSettings['privacy'] = $privacy;
if (save_site_settings($siteSettings)) {
$siteSettings = load_site_settings(true);
$message = 'Settings saved.';
} else {
$errors[] = 'Could not save settings. Check permissions on data/site.json.';
$errors[] = 'Could not save settings. Check the database connection.';
}
}
}