fix: use local storage/ in dev, create upload dirs, gitignore uploads

This commit is contained in:
Pontoporeia
2026-04-27 21:06:10 +02:00
parent 48059c2317
commit 46a3c360ec
5 changed files with 14 additions and 2 deletions

View File

@@ -10,7 +10,12 @@ define('APP_ROOT', __DIR__);
// Storage directory for uploaded files — intentionally outside the webroot
// so no uploaded content is ever directly web-accessible (items #3 & #4).
// Files are served through MediaController which validates paths and MIME types.
define('STORAGE_ROOT', '/var/www/posterg/storage');
// In dev (cli-server) use the local storage/ directory; in production use the
// absolute path outside the webroot.
define('STORAGE_ROOT', php_sapi_name() === 'cli-server'
? __DIR__ . '/storage'
: '/var/www/posterg/storage'
);
// Error reporting
if (php_sapi_name() === 'cli-server') {