172 lines
4.6 KiB
Bash
172 lines
4.6 KiB
Bash
#!/bin/bash
|
|
|
|
echo "🍎 Safari HTTPS-Warnung beheben"
|
|
echo "=============================="
|
|
|
|
# 1. .env komplett für HTTPS konfigurieren
|
|
echo "📝 Konfiguriere .env komplett für HTTPS..."
|
|
cat > .env << 'EOF'
|
|
APP_NAME="NeoNail DB"
|
|
APP_ENV=production
|
|
APP_KEY=base64:+LTZYPKjkZ+O3iFTgU2sS+9bNvxxvG8Kw8JSEPiG7Rs=
|
|
APP_DEBUG=false
|
|
APP_URL=https://neonail.vogt.de.com
|
|
|
|
LOG_CHANNEL=stack
|
|
LOG_DEPRECATIONS_CHANNEL=null
|
|
LOG_LEVEL=debug
|
|
|
|
DB_CONNECTION=sqlite
|
|
DB_DATABASE=database.sqlite
|
|
|
|
BROADCAST_DRIVER=log
|
|
CACHE_DRIVER=file
|
|
FILESYSTEM_DISK=local
|
|
QUEUE_CONNECTION=sync
|
|
SESSION_DRIVER=file
|
|
SESSION_LIFETIME=120
|
|
SESSION_SECURE_COOKIE=true
|
|
SESSION_SAME_SITE=lax
|
|
|
|
MEMCACHED_HOST=127.0.0.1
|
|
|
|
REDIS_HOST=127.0.0.1
|
|
REDIS_PASSWORD=null
|
|
REDIS_PORT=6379
|
|
|
|
MAIL_MAILER=smtp
|
|
MAIL_HOST=mailpit
|
|
MAIL_PORT=1025
|
|
MAIL_USERNAME=null
|
|
MAIL_PASSWORD=null
|
|
MAIL_ENCRYPTION=null
|
|
MAIL_FROM_ADDRESS="hello@example.com"
|
|
MAIL_FROM_NAME="${APP_NAME}"
|
|
|
|
AWS_ACCESS_KEY_ID=
|
|
AWS_SECRET_ACCESS_KEY=
|
|
AWS_DEFAULT_REGION=us-east-1
|
|
AWS_BUCKET=
|
|
AWS_USE_PATH_STYLE_ENDPOINT=false
|
|
|
|
PUSHER_APP_ID=
|
|
PUSHER_APP_KEY=
|
|
PUSHER_APP_SECRET=
|
|
PUSHER_HOST=
|
|
PUSHER_PORT=443
|
|
PUSHER_SCHEME=https
|
|
PUSHER_APP_CLUSTER=mt1
|
|
|
|
VITE_APP_NAME="${APP_NAME}"
|
|
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
|
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
|
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
|
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
|
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
|
EOF
|
|
|
|
# 2. Laravel Cache komplett leeren
|
|
echo "🧹 Leere Laravel Cache komplett..."
|
|
php artisan config:clear 2>/dev/null || echo "⚠️ config:clear übersprungen"
|
|
php artisan cache:clear 2>/dev/null || echo "⚠️ cache:clear übersprungen"
|
|
php artisan route:clear 2>/dev/null || echo "⚠️ route:clear übersprungen"
|
|
php artisan view:clear 2>/dev/null || echo "⚠️ view:clear übersprungen"
|
|
|
|
# 3. HTTPS-Header in .htaccess hinzufügen
|
|
echo "🔒 Füge HTTPS-Header hinzu..."
|
|
cat > public/.htaccess << 'EOF'
|
|
<IfModule mod_rewrite.c>
|
|
<IfModule mod_negotiation.c>
|
|
Options -MultiViews -Indexes
|
|
</IfModule>
|
|
|
|
RewriteEngine On
|
|
|
|
# Force HTTPS
|
|
RewriteCond %{HTTPS} off
|
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
|
|
|
# Handle Authorization Header
|
|
RewriteCond %{HTTP:Authorization} .
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
|
|
# Redirect Trailing Slashes If Not A Folder...
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_URI} (.+)/$
|
|
RewriteRule ^ %1 [L,R=301]
|
|
|
|
# Send Requests To Front Controller...
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteRule ^ index.php [L]
|
|
</IfModule>
|
|
|
|
# Security Headers
|
|
<IfModule mod_headers.c>
|
|
Header always set X-Content-Type-Options nosniff
|
|
Header always set X-Frame-Options DENY
|
|
Header always set X-XSS-Protection "1; mode=block"
|
|
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
|
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
Header always set Content-Security-Policy "upgrade-insecure-requests"
|
|
</IfModule>
|
|
|
|
# Protect sensitive files
|
|
<Files ".env">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
|
|
<Files "database.sqlite">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
|
|
<Files "*.sqlite">
|
|
Order allow,deny
|
|
Deny from all
|
|
</Files>
|
|
|
|
# Compression
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/plain
|
|
AddOutputFilterByType DEFLATE text/html
|
|
AddOutputFilterByType DEFLATE text/xml
|
|
AddOutputFilterByType DEFLATE text/css
|
|
AddOutputFilterByType DEFLATE application/xml
|
|
AddOutputFilterByType DEFLATE application/xhtml+xml
|
|
AddOutputFilterByType DEFLATE application/rss+xml
|
|
AddOutputFilterByType DEFLATE application/javascript
|
|
AddOutputFilterByType DEFLATE application/x-javascript
|
|
</IfModule>
|
|
|
|
# Cache Control
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive on
|
|
ExpiresByType text/css "access plus 1 year"
|
|
ExpiresByType application/javascript "access plus 1 year"
|
|
ExpiresByType image/png "access plus 1 year"
|
|
ExpiresByType image/jpg "access plus 1 year"
|
|
ExpiresByType image/jpeg "access plus 1 year"
|
|
ExpiresByType image/gif "access plus 1 year"
|
|
ExpiresByType image/svg+xml "access plus 1 year"
|
|
</IfModule>
|
|
EOF
|
|
|
|
# 4. Apache neu laden
|
|
echo "🔄 Lade Apache neu..."
|
|
systemctl reload apache2
|
|
|
|
# 5. Test
|
|
echo "🧪 Teste HTTPS-Konfiguration..."
|
|
curl -I https://neonail.vogt.de.com
|
|
|
|
echo ""
|
|
echo "✅ Safari HTTPS-Warnung behoben!"
|
|
echo "📋 Testen Sie: https://neonail.vogt.de.com"
|
|
echo ""
|
|
echo "📋 Falls Warnung bleibt:"
|
|
echo "1. Safari-Cache leeren (Cmd+Shift+R)"
|
|
echo "2. Private-Fenster testen"
|
|
echo "3. Safari-Einstellungen: Entwickler > Leere Caches"
|