mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
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
This commit is contained in:
72
justfile
72
justfile
@@ -25,6 +25,7 @@ serve:
|
||||
@echo ""
|
||||
@echo "📍 Public site: http://localhost:8000"
|
||||
@echo "📍 Admin panel: http://localhost:8000/admin/"
|
||||
@echo "🔒 Serving from public/ directory (matches production)"
|
||||
@echo ""
|
||||
@if [ -d "vendor/php-live-reload" ]; then \
|
||||
echo "✨ Live reload enabled - browser auto-refreshes on file save!"; \
|
||||
@@ -34,7 +35,7 @@ serve:
|
||||
@echo ""
|
||||
@echo "Press Ctrl+C to stop"
|
||||
@echo ""
|
||||
@php -S 127.0.0.1:8000
|
||||
@php -S 127.0.0.1:8000 -t public/
|
||||
|
||||
[group('dev')]
|
||||
stop:
|
||||
@@ -63,47 +64,69 @@ deploy:
|
||||
@echo "📤 Deploying Post-ERG complete site"
|
||||
@echo "===================================="
|
||||
@echo ""
|
||||
@echo "Deploying public site..."
|
||||
@echo "⚠️ First time? Ensure /var/www/posterg/ exists on server with:"
|
||||
@echo " ssh posterg"
|
||||
@echo " sudo mkdir -p /var/www/posterg"
|
||||
@echo " sudo chown www-data:posterg /var/www/posterg"
|
||||
@echo " sudo chmod 775 /var/www/posterg"
|
||||
@echo ""
|
||||
@echo "Step 1: Deploying application to /var/www/posterg/..."
|
||||
rsync -vur --progress \
|
||||
--chown="root:posterg" \
|
||||
--chown="www-data:posterg" \
|
||||
--exclude 'vendor' \
|
||||
--exclude 'tests' \
|
||||
--exclude 'test.db' \
|
||||
--exclude '*.db' \
|
||||
--exclude 'cache' \
|
||||
--exclude '*.md' \
|
||||
--exclude '.git*' \
|
||||
--exclude '.jj' \
|
||||
--exclude '.DS_Store' \
|
||||
--exclude 'database' \
|
||||
--exclude 'database/backup_*' \
|
||||
--exclude 'database/fixtures' \
|
||||
--exclude 'database/docs' \
|
||||
--exclude 'nginx' \
|
||||
--exclude 'docs' \
|
||||
--exclude 'justfile*' \
|
||||
--exclude 'migrate-structure.sh' \
|
||||
--exclude 'setup-dev.sh' \
|
||||
./ posterg:/var/www/html/
|
||||
--exclude 'var/cache/*' \
|
||||
--exclude 'var/logs/*' \
|
||||
./ posterg:/var/www/posterg/
|
||||
@echo ""
|
||||
@echo "Fixing permissions..."
|
||||
ssh posterg "chgrp -R posterg /var/www/html/inc /var/www/html/lib && \
|
||||
chmod 755 /var/www/html/inc && chmod 644 /var/www/html/inc/* && \
|
||||
find /var/www/html/lib -type d -exec chmod 755 {} \; && \
|
||||
find /var/www/html/lib -type f -exec chmod 644 {} \;"
|
||||
@echo "Step 2: Setting up directories and permissions..."
|
||||
ssh posterg "cd /var/www/posterg && \
|
||||
mkdir -p var/{cache,logs,tmp} && \
|
||||
chown -R www-data:posterg . && \
|
||||
chmod -R 755 . && \
|
||||
chmod -R 775 var/ database/ && \
|
||||
chmod 660 database/*.db 2>/dev/null || true"
|
||||
@echo ""
|
||||
@echo "✅ Deployment complete!"
|
||||
@echo ""
|
||||
@echo "📁 Server structure:"
|
||||
@echo " • App root: /var/www/posterg/"
|
||||
@echo " • DocumentRoot: /var/www/posterg/public/"
|
||||
@echo ""
|
||||
@echo "🔍 Verify deployment:"
|
||||
@echo " • Public: https://posterg.erg.be/"
|
||||
@echo " • Admin: https://posterg.erg.be/admin/"
|
||||
@echo ""
|
||||
@echo "⚠️ IMPORTANT: Update nginx config to point to /var/www/posterg/public/"
|
||||
@echo " Run: just deploy-nginx"
|
||||
|
||||
[group('deploy')]
|
||||
test-deploy:
|
||||
deploy-database:
|
||||
@echo "⚠️ Deploying test database (will overwrite remote test.db)"
|
||||
@echo "Creating database directory if needed..."
|
||||
ssh posterg "mkdir -p /var/www/html/database"
|
||||
rsync -vur --progress ./database/test.db posterg:/var/www/html/database/test.db
|
||||
ssh posterg "mkdir -p /var/www/posterg/database"
|
||||
rsync -vur --progress ./database/test.db posterg:/var/www/posterg/database/test.db
|
||||
@echo "Setting correct permissions..."
|
||||
ssh posterg "chgrp posterg /var/www/html/database /var/www/html/database/test.db && chmod 775 /var/www/html/database && chmod 660 /var/www/html/database/test.db"
|
||||
ssh posterg "chown www-data:posterg /var/www/posterg/database /var/www/posterg/database/test.db && chmod 775 /var/www/posterg/database && chmod 660 /var/www/posterg/database/test.db"
|
||||
@echo "✅ Test database deployed and configured"
|
||||
|
||||
# Legacy alias
|
||||
[group('deploy')]
|
||||
test-deploy:
|
||||
@just deploy-database
|
||||
# ============================================================================
|
||||
# Testing
|
||||
# ============================================================================
|
||||
@@ -230,13 +253,28 @@ deploy-test-db:
|
||||
[group('server')]
|
||||
deploy-nginx:
|
||||
@echo "🔧 Deploying nginx configuration..."
|
||||
@echo ""
|
||||
@echo "⚠️ IMPORTANT: Checking nginx config has correct DocumentRoot..."
|
||||
@if ! grep -q "/var/www/posterg/public" nginx/posterg.conf 2>/dev/null; then \
|
||||
echo "❌ ERROR: nginx/posterg.conf must contain '/var/www/posterg/public'"; \
|
||||
echo " Current DocumentRoot needs updating!"; \
|
||||
echo ""; \
|
||||
echo " Edit nginx/posterg.conf and change:"; \
|
||||
echo " root /var/www/html;"; \
|
||||
echo " To:"; \
|
||||
echo " root /var/www/posterg/public;"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "✅ nginx config looks correct"
|
||||
@echo ""
|
||||
rsync -vur --progress ./nginx/posterg.conf posterg:/tmp/posterg.conf
|
||||
rsync -vur --progress ./nginx/deploy-production.sh posterg:/tmp/deploy-production.sh
|
||||
rsync -vur --progress ./nginx/deploy-production-new.sh posterg:/tmp/deploy-production.sh
|
||||
@echo "✅ Files uploaded to /tmp/ on server"
|
||||
@echo ""
|
||||
@echo "Next steps on the server:"
|
||||
@echo " ssh posterg"
|
||||
@echo " sudo bash /tmp/deploy-production.sh"
|
||||
@echo " (This will apply config and show reload command)"
|
||||
|
||||
[group('server')]
|
||||
deploy-admin-tools:
|
||||
|
||||
Reference in New Issue
Block a user