feat: FilePond production hardening — extension-based validation, server-side size limits (2GB), annexe validation, drop accept attributes, FilePond file styling

This commit is contained in:
Pontoporeia
2026-05-10 20:41:37 +02:00
parent 7b5f3efe40
commit 8db7b6e9eb
23 changed files with 4770 additions and 216 deletions

29
scripts/ensure-db.php Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
/**
* ensure-db.php — Create database from schema.sql if it doesn't exist.
*
* Usage: php scripts/ensure-db.php [DB_PATH]
* Default: storage/xamxam.db
*/
$root = dirname(__DIR__);
$dbPath = $argv[1] ?? ($root . '/storage/xamxam.db');
$schemaPath = $root . '/storage/schema.sql';
if (file_exists($dbPath)) {
echo "Database already exists: $dbPath\n";
exit(0);
}
if (!file_exists($schemaPath)) {
die("Schema not found: $schemaPath\n");
}
$db = new PDO('sqlite:' . $dbPath);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = file_get_contents($schemaPath);
$db->exec($sql);
echo "Database created from schema: $dbPath\n";