mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
deploy: rename deploy path from /var/www/posterg to /var/www/xamxam
This commit is contained in:
7
TODO.md
7
TODO.md
@@ -32,6 +32,13 @@
|
|||||||
- [x] Exclude `storage/theses/` from rsync (not sent locally, not deleted remotely)
|
- [x] Exclude `storage/theses/` from rsync (not sent locally, not deleted remotely)
|
||||||
- [x] Exclude `storage/covers/` from rsync (not sent locally, not deleted remotely)
|
- [x] Exclude `storage/covers/` from rsync (not sent locally, not deleted remotely)
|
||||||
|
|
||||||
|
## Deploy — Rename deploy path to /var/www/xamxam
|
||||||
|
|
||||||
|
- [x] Update rsync destination in `justfile` (`deploy`, `deploy-db` recipes)
|
||||||
|
- [x] Update all `/var/www/posterg` paths in `scripts/deploy-server.sh`
|
||||||
|
- [x] Update `root` directive in `nginx/posterg.conf`
|
||||||
|
- [x] Update `STORAGE_ROOT` production path in `app/bootstrap.php`
|
||||||
|
|
||||||
## File Display in Forms & Recaps
|
## File Display in Forms & Recaps
|
||||||
|
|
||||||
- [x] Add live file preview to `file-field.php` partial (`data-preview` attribute + `.file-preview-list` container)
|
- [x] Add live file preview to `file-field.php` partial (`data-preview` attribute + `.file-preview-list` container)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ define('APP_ROOT', __DIR__);
|
|||||||
// absolute path outside the webroot.
|
// absolute path outside the webroot.
|
||||||
define('STORAGE_ROOT', php_sapi_name() === 'cli-server'
|
define('STORAGE_ROOT', php_sapi_name() === 'cli-server'
|
||||||
? __DIR__ . '/storage'
|
? __DIR__ . '/storage'
|
||||||
: '/var/www/posterg/storage'
|
: '/var/www/xamxam/storage'
|
||||||
);
|
);
|
||||||
|
|
||||||
// Error reporting
|
// Error reporting
|
||||||
|
|||||||
10
justfile
10
justfile
@@ -48,8 +48,8 @@ deploy:
|
|||||||
--exclude 'storage/docs' \
|
--exclude 'storage/docs' \
|
||||||
--exclude 'var/cache/*' \
|
--exclude 'var/cache/*' \
|
||||||
--exclude 'var/logs/*' \
|
--exclude 'var/logs/*' \
|
||||||
app/ posterg:/var/www/posterg/
|
app/ posterg:/var/www/xamxam/
|
||||||
ssh posterg "mkdir -p /var/www/posterg/var/{cache,logs,tmp}"
|
ssh posterg "mkdir -p /var/www/xamxam/var/{cache,logs,tmp}"
|
||||||
|
|
||||||
[group('deploy')]
|
[group('deploy')]
|
||||||
setup-server:
|
setup-server:
|
||||||
@@ -82,9 +82,9 @@ deploy-nginx:
|
|||||||
|
|
||||||
[group('deploy')]
|
[group('deploy')]
|
||||||
deploy-db:
|
deploy-db:
|
||||||
@ssh posterg '[ ! -f /var/www/posterg/storage/posterg.db ]' || (echo "ERROR: remote database already exists. Remove it manually if you intend to overwrite." && exit 1)
|
@ssh posterg '[ ! -f /var/www/xamxam/storage/posterg.db ]' || (echo "ERROR: remote database already exists. Remove it manually if you intend to overwrite." && exit 1)
|
||||||
rsync -v --progress app/storage/posterg.db posterg:/var/www/posterg/storage/posterg.db
|
rsync -v --progress app/storage/posterg.db posterg:/var/www/xamxam/storage/posterg.db
|
||||||
ssh posterg "chown www-data:posterg /var/www/posterg/storage/posterg.db && chmod 660 /var/www/posterg/storage/posterg.db"
|
ssh posterg "chown www-data:posterg /var/www/xamxam/storage/posterg.db && chmod 660 /var/www/xamxam/storage/posterg.db"
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Testing
|
# Testing
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ server {
|
|||||||
server_name posterg.erg.be www.posterg.erg.be;
|
server_name posterg.erg.be www.posterg.erg.be;
|
||||||
|
|
||||||
# Document root points to /public (only web-accessible files)
|
# Document root points to /public (only web-accessible files)
|
||||||
# Deployed structure: /var/www/posterg/
|
# Deployed structure: /var/www/xamxam/
|
||||||
# /public - Web root ← THIS DIRECTORY
|
# /public - Web root ← THIS DIRECTORY
|
||||||
# /admin - Admin interface
|
# /admin - Admin interface
|
||||||
# /assets - CSS, fonts, icons
|
# /assets - CSS, fonts, icons
|
||||||
@@ -28,7 +28,7 @@ server {
|
|||||||
# /tests - Test suites (outside webroot)
|
# /tests - Test suites (outside webroot)
|
||||||
# /bootstrap.php - Application entry point
|
# /bootstrap.php - Application entry point
|
||||||
# /router.php - Dev server URL rewriter
|
# /router.php - Dev server URL rewriter
|
||||||
root /var/www/posterg/public;
|
root /var/www/xamxam/public;
|
||||||
|
|
||||||
# Add index.php to the list
|
# Add index.php to the list
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|||||||
@@ -27,25 +27,25 @@ printf "==================================\n\n"
|
|||||||
printf "📋 Step 1: Fixing file permissions...\n"
|
printf "📋 Step 1: Fixing file permissions...\n"
|
||||||
echo "--------------------------------------"
|
echo "--------------------------------------"
|
||||||
|
|
||||||
chown -R www-data:posterg /var/www/posterg/
|
chown -R www-data:posterg /var/www/xamxam/
|
||||||
ok "Ownership: www-data:posterg"
|
ok "Ownership: www-data:posterg"
|
||||||
|
|
||||||
find /var/www/posterg -type d -exec chmod 2775 {} \;
|
find /var/www/xamxam -type d -exec chmod 2775 {} \;
|
||||||
ok "Directories: 2775 (setgid)"
|
ok "Directories: 2775 (setgid)"
|
||||||
|
|
||||||
find /var/www/posterg -type f -exec chmod 664 {} \;
|
find /var/www/xamxam -type f -exec chmod 664 {} \;
|
||||||
ok "Files: 664"
|
ok "Files: 664"
|
||||||
|
|
||||||
if [ -d "/var/www/posterg/storage" ]; then
|
if [ -d "/var/www/xamxam/storage" ]; then
|
||||||
chmod 2775 /var/www/posterg/storage
|
chmod 2775 /var/www/xamxam/storage
|
||||||
find /var/www/posterg/storage -name "*.db" -exec chmod 660 {} \;
|
find /var/www/xamxam/storage -name "*.db" -exec chmod 660 {} \;
|
||||||
ok "Storage: 2775, databases: 660"
|
ok "Storage: 2775, databases: 660"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure writable cache subdirectories exist for php-fpm (www-data)
|
# Ensure writable cache subdirectories exist for php-fpm (www-data)
|
||||||
mkdir -p /var/www/posterg/storage/cache/rate_limit
|
mkdir -p /var/www/xamxam/storage/cache/rate_limit
|
||||||
chown -R www-data:posterg /var/www/posterg/storage/cache
|
chown -R www-data:posterg /var/www/xamxam/storage/cache
|
||||||
chmod -R 2775 /var/www/posterg/storage/cache
|
chmod -R 2775 /var/www/xamxam/storage/cache
|
||||||
ok "Cache dirs: created and owned by www-data:posterg"
|
ok "Cache dirs: created and owned by www-data:posterg"
|
||||||
|
|
||||||
# ── Step 2: Nginx config ──────────────────────────────────────────────────────
|
# ── Step 2: Nginx config ──────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user