Commit Graph

11 Commits

Author SHA1 Message Date
Pontoporeia
b45e6c50cc fix: admin CSP allow inline scripts
script-src 'self' 'unsafe-inline' added to admin Content-Security-Policy.
default-src 'self' was blocking OverType editor init block and
the dev live-reload poller. Admin section is auth-gated so
unsafe-inline is acceptable.
2026-04-08 14:14:37 +02:00
Pontoporeia
e6960f0c9c fix: RateLimit permission denied — code + deploy scripts
RateLimit.php:
- Silence mkdir() with @ operator
- Guard file_put_contents with is_writable() check (graceful degrade)

scripts/deploy-server.sh + setup-server.sh:
- mkdir -p storage/cache/rate_limit on every deploy
- chown www-data:posterg + chmod 2775 on storage/cache/
  so php-fpm can always write rate limit files
2026-04-06 16:45:14 +02:00
Pontoporeia
756ddb5765 fix: RateLimit graceful degradation on permission denied
Silence mkdir() with @ operator; guard file_put_contents with
is_writable() check. When storage/cache/rate_limit is not writable
by php-fpm, requests are allowed through instead of throwing
warnings that flood the nginx error log.
2026-04-06 16:40:55 +02:00
Pontoporeia
a88e5562f8 fix(config): auto-route test.db locally, posterg.db on production
- config.php: getDatabasePath() detects php built-in CLI server
  (php_sapi_name() === 'cli-server') and routes to test.db; all
  other SAPIs (nginx/fpm) get posterg.db. DB_ENV env-var still
  overrides either way.

- migrate.sh: auto-initialise the target DB from storage/schema.sql
  when the file is absent or has no tables yet. Existing DBs with
  data are left completely untouched (table_count check, no re-run
  of schema on populated DB). Idempotent: safe to run repeatedly.

- justfile: serve still calls migrate (which now handles init too),
  no DB_ENV prefix needed since sapi detection handles routing.
2026-04-01 15:55:12 +02:00
Pontoporeia
72d48c49c3 feat(db): auto-migrate both DBs on serve via scripts/migrate.sh 2026-04-01 15:55:12 +02:00
Pontoporeia
7208292c0e deploy-nginx: add recipe, upload scripts to /tmp, print sudo instructions 2026-03-02 16:08:45 +01:00
Pontoporeia
e4b2205eac fix rsync permissions: setup-server.sh with setgid dirs, exclude .claude/.pi 2026-03-02 16:08:45 +01:00
Pontoporeia
52978aa658 ops: simplify justfile, guard deploy-db, extract scripts, fix .gitignore 2026-03-02 16:08:45 +01:00
Théophile Gervreau-Mercier
7fca85d1c1 refactor: rename database → storage
More semantically accurate: contains SQLite files, schema, fixtures, test data.
Updated all references in code, scripts, docs.
2026-02-12 12:12:58 +01:00
Théophile Gervreau-Mercier
4bbbc58e24 Fix admin CSS not loading and quirks mode issues
Fixed multiple issues in admin panel:

1. CSS path: modern-normalize.css → modern-normalize.min.css
   (File is actually named .min.css)

2. Icon path: assets/icon.svg → /assets/admin_favicon.svg
   (Was relative, now absolute; correct filename)

3. Navigation: /admin/list.php → /admin/
   (list.php was renamed to index.php)

4. Short PHP tags: <? → <?php
   (Better compatibility, some servers don't enable short_open_tag)

5. Quirks mode warning was due to CSS not loading, not DOCTYPE
   (DOCTYPE was already present)

Files modified:
- public/admin/inc/head.php (main fixes)
- public/admin/index.php (short tags)
- public/admin/add.php (short tags)
- public/admin/import.php (short tags)

Need to redeploy for production: just deploy
2026-02-06 13:26:24 +01:00
Théophile Gervreau-Mercier
d2b3c6ca67 Major refactor
- update the structure to have monolithic setup
- updated deployments
- added live-reloading for devops
2026-02-05 20:16:19 +01:00