Files
novaconium/novaconium/config.php
T
code a3b996719a Add SQLite groundwork: Lib\Db, migrations, and a project-owned data dir
Lib\Db (novaconium/lib/Db.php) is a thin, no-ORM PDO wrapper — lazy-connect
like Lib\Csrf, Db::query() as the only query-running helper (prepared
statements only, no interpolation shortcut, per Lib\Input's existing
security stance). Plain .sql migrations under App/migrations/, applied in
filename order and tracked in an auto-created schema_migrations table, run
automatically on first connection or via novaconium/bin/migrate.php.

Data lives in a new top-level data/ directory rather than novaconium/ or
public/ — outside public/ so it's never web-accessible, and outside
novaconium/ since that directory gets wholesale-replaced by the "Updating
the framework" workflow, which would otherwise destroy it on every update.

New config keys: db_driver (only 'sqlite' implemented), db_path,
db_migrations_dir. Documented at /admin/docs/database and in AGENTS.md.
Closes the "SQLite groundwork" backlog item in novaconium/ISSUES.md.
2026-07-14 03:33:38 +00:00

53 lines
2.5 KiB
PHP

<?php
// These are the framework defaults. A project overrides any subset of them
// by creating App/config.php returning an array of just the keys it wants
// to change — novaconium/bootstrap.php shallow-merges it over this file, the
// same App-over-novaconium override pattern used for pages/ and lib/. This
// file itself is not meant to be edited per-project.
return [
// Ordered override roots: App/pages is checked first so a project can
// override any page, sidecar, or layout by placing one at the same
// relative path there; novaconium/pages supplies the framework defaults.
'pages_dirs' => [
__DIR__ . '/../App/pages',
__DIR__ . '/pages',
],
'cache_dir' => __DIR__ . '/../public/cache',
'debug' => true,
// Site name used as the default page title, og:site_name, and the
// footer copyright line in novaconium/pages/_layout/layout.twig.
'site_name' => 'Novaconium Website',
// Matomo analytics. Leave both empty (the default) to disable tracking
// entirely — the layout emits no tracking script at all in that case.
// Set both via App/config.php to enable, e.g.:
// 'matomo_url' => 'https://matomo.example.com/',
// 'matomo_site_id' => '1',
'matomo_url' => '',
'matomo_site_id' => '',
// Gates every /admin/* route (clear-cache, docs, and any future admin
// page) behind HTTP Basic Auth. Leave admin_password_hash empty (the
// default) to disable the gate entirely — matches this project's
// existing wide-open behavior until a project opts in. Generate a hash
// with: php -r "echo password_hash('yourpassword', PASSWORD_DEFAULT), PHP_EOL;"
// and set both via App/config.php, e.g.:
// 'admin_username' => 'admin',
// 'admin_password_hash' => '$2y$10$...',
'admin_username' => 'admin',
'admin_password_hash' => '',
// Lib\Db (see /admin/docs/database). Only 'sqlite' is implemented today
// — MySQL support is tracked as a separate Backlog item in
// novaconium/ISSUES.md. db_path deliberately lives outside both
// public/ (must never be web-accessible) and novaconium/ (gets wholly
// replaced on a framework update — see /admin/docs/getting-started's
// "Updating the framework" section) — a top-level data/ directory,
// project-owned like App/, is the only safe place for it.
'db_driver' => 'sqlite',
'db_path' => __DIR__ . '/../data/novaconium.sqlite',
'db_migrations_dir' => __DIR__ . '/../App/migrations',
];