mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
rename posterg → xamxam throughout: nginx conf, scripts, PHP source, docs
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
*
|
||||
* Usage: php app/migrations/run.php [DB_PATH]
|
||||
*
|
||||
* If no DB_PATH is given, defaults to storage/posterg.db.
|
||||
* If no DB_PATH is given, defaults to storage/xamxam.db.
|
||||
*
|
||||
* Each migration in migrations/pending/ is applied in alphabetical order.
|
||||
* After success, the file is moved to migrations/applied/.
|
||||
*/
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$dbPath = $argv[1] ?? ($root . '/storage/posterg.db');
|
||||
$dbPath = $argv[1] ?? ($root . '/storage/xamxam.db');
|
||||
|
||||
if (!file_exists($dbPath)) {
|
||||
die("Database not found: $dbPath\n");
|
||||
|
||||
@@ -12,7 +12,7 @@ AdminAuth::requireLogin();
|
||||
require_once APP_ROOT . '/src/Controllers/ExportController.php';
|
||||
$controller = ExportController::create();
|
||||
|
||||
$filename = 'posterg-export-' . date('Y-m-d') . '.csv';
|
||||
$filename = 'xamxam-export-' . date('Y-m-d') . '.csv';
|
||||
|
||||
header('Content-Type: text/csv; charset=UTF-8');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
|
||||
@@ -18,7 +18,7 @@ if (!file_exists($dbPath)) {
|
||||
exit('Base de données introuvable.');
|
||||
}
|
||||
|
||||
$filename = 'posterg-db-' . date('Y-m-d') . '.sqlite';
|
||||
$filename = 'xamxam-db-' . date('Y-m-d') . '.sqlite';
|
||||
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
|
||||
@@ -38,7 +38,7 @@ foreach ($watchDirs as $dir) {
|
||||
}
|
||||
|
||||
$fingerprint = md5($hash);
|
||||
$stateFile = sys_get_temp_dir() . '/posterg-live-reload.txt';
|
||||
$stateFile = sys_get_temp_dir() . '/xamxam-live-reload.txt';
|
||||
|
||||
$prev = file_exists($stateFile) ? file_get_contents($stateFile) : null;
|
||||
// First visit: write baseline, don't fire a reload
|
||||
|
||||
@@ -18,7 +18,7 @@ class LiveReloadController {
|
||||
$appRoot . '/config',
|
||||
$appRoot . '/templates',
|
||||
];
|
||||
$this->stateFile = sys_get_temp_dir() . '/posterg-live-reload.txt';
|
||||
$this->stateFile = sys_get_temp_dir() . '/xamxam-live-reload.txt';
|
||||
}
|
||||
|
||||
public function handle(): array {
|
||||
|
||||
@@ -29,7 +29,7 @@ class MediaController
|
||||
}
|
||||
|
||||
// 2. Resolve path + storage jail
|
||||
$storageRoot = defined('STORAGE_ROOT') ? STORAGE_ROOT : '/var/www/posterg/storage';
|
||||
$storageRoot = defined('STORAGE_ROOT') ? STORAGE_ROOT : '/var/www/xamxam/storage';
|
||||
$fullPath = $storageRoot . '/' . $requestedPath;
|
||||
|
||||
$realStorage = realpath($storageRoot);
|
||||
|
||||
@@ -23,17 +23,17 @@ class SystemController
|
||||
// ── Constants ─────────────────────────────────────────────────────────────
|
||||
|
||||
public const LOG_FILES = [
|
||||
'nginx_access' => ['label' => 'nginx — accès', 'path' => '/var/log/nginx/posterg_access.log'],
|
||||
'nginx_error' => ['label' => 'nginx — erreurs', 'path' => '/var/log/nginx/posterg_error.log'],
|
||||
'nginx_access' => ['label' => 'nginx — accès', 'path' => '/var/log/nginx/xamxam_access.log'],
|
||||
'nginx_error' => ['label' => 'nginx — erreurs', 'path' => '/var/log/nginx/xamxam_error.log'],
|
||||
'php_error' => ['label' => 'PHP-FPM — erreurs', 'path' => '/var/log/php8.4-fpm.log'],
|
||||
];
|
||||
|
||||
public const ALLOWED_LINES = [50, 100, 200, 500];
|
||||
|
||||
/** Live deployed nginx config path. */
|
||||
public const NGINX_CONFIG_LIVE = '/etc/nginx/sites-available/posterg';
|
||||
public const NGINX_CONFIG_LIVE = '/etc/nginx/sites-available/xamxam';
|
||||
/** Local reference copy used as fallback in dev. */
|
||||
public const NGINX_CONFIG_LOCAL = APP_ROOT . '/nginx/posterg.conf';
|
||||
public const NGINX_CONFIG_LOCAL = APP_ROOT . '/nginx/xamxam.conf';
|
||||
|
||||
// ── TTLs ──────────────────────────────────────────────────────────────────
|
||||
private const TTL_STATUS = 120; // 2 minutes
|
||||
|
||||
@@ -35,7 +35,7 @@ class Database {
|
||||
|
||||
/**
|
||||
* Determine database path.
|
||||
* Priority: explicit override → APP_ROOT /storage/posterg.db.
|
||||
* Priority: explicit override → APP_ROOT /storage/xamxam.db.
|
||||
* APP_ROOT is defined by bootstrap.php before any controller loads Database.
|
||||
*/
|
||||
private function determineDatabasePath($customPath = null): string {
|
||||
@@ -44,7 +44,7 @@ class Database {
|
||||
}
|
||||
|
||||
$root = defined('APP_ROOT') ? APP_ROOT : __DIR__ . '/..';
|
||||
return $root . '/storage/posterg.db';
|
||||
return $root . '/storage/xamxam.db';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -118,7 +118,7 @@ class SmtpRelay {
|
||||
}
|
||||
|
||||
// Build MIME message
|
||||
$boundary = 'posterg_' . bin2hex(random_bytes(8));
|
||||
$boundary = 'xamxam_' . bin2hex(random_bytes(8));
|
||||
$date = date('r');
|
||||
$fromHdr = ($s['from_name'] ?? '') !== ''
|
||||
? "=?UTF-8?B?" . base64_encode($s['from_name']) . "?= <{$s['from_email']}>"
|
||||
|
||||
@@ -188,7 +188,7 @@ Query `v_theses_public` view with filters:
|
||||
## 🛠️ Development Workflow
|
||||
|
||||
### Local Development
|
||||
1. Use `posterg.db` for development
|
||||
1. Use `xamxam.db` for development
|
||||
2. Create via `just init-db`
|
||||
3. Test queries before deployment
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ try {
|
||||
|
||||
## 🔧 Test Database
|
||||
|
||||
Tests use the main database at `storage/posterg.db`.
|
||||
Tests use the main database at `storage/xamxam.db`.
|
||||
|
||||
### Setup Test Database
|
||||
|
||||
|
||||
Reference in New Issue
Block a user