Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
Shell
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495#!/bin/bash# Deploy custom landing page to at.aesthetic.computer PDS# Usage: bash deploy-landing-page.sh
LANDING_PAGE_LOCAL="../../landing-page.html"PDS_SERVER="root@138.197.35.160"WEB_ROOT="/var/www/at.aesthetic.computer"SSH_KEY="$HOME/.ssh/aesthetic_pds"
echo "๐ Deploying custom landing page to at.aesthetic.computer"echo ""
# Check if landing page existsif [ ! -f "$LANDING_PAGE_LOCAL" ]; then echo "โ Error: landing-page.html not found at $LANDING_PAGE_LOCAL" exit 1fi
echo "๐ค Uploading landing page to PDS server..."
# SSH into server and create web root if it doesn't existssh -i "$SSH_KEY" "$PDS_SERVER" "mkdir -p $WEB_ROOT"
# Upload the landing pagescp -i "$SSH_KEY" "$LANDING_PAGE_LOCAL" "$PDS_SERVER:$WEB_ROOT/index.html"
if [ $? -ne 0 ]; then echo "โ Failed to upload landing page" exit 1fi
echo "โ
Landing page uploaded successfully"echo ""echo "๐ง Configuring Caddy to serve custom landing page..."
# SSH into server and update Caddyfilessh -i "$SSH_KEY" "$PDS_SERVER" << 'ENDSSH' # Backup existing Caddyfile cp /pds/Caddyfile /pds/Caddyfile.backup # Create new Caddyfile with custom landing page cat > /pds/Caddyfile << 'EOF'{ email mail@aesthetic.computer}
# Main PDS subdomain with custom landing pageat.aesthetic.computer { # Serve custom landing page for root handle / { root * /var/www/at.aesthetic.computer file_server } # Proxy all other requests to PDS handle { reverse_proxy localhost:3000 }}
# Wildcard for user handles*.at.aesthetic.computer { reverse_proxy localhost:3000}
# Legacy pds subdomain (if used)pds.aesthetic.computer { reverse_proxy localhost:3000}
*.pds.aesthetic.computer { reverse_proxy localhost:3000}EOF # Reload Caddy docker exec caddy caddy reload --config /etc/caddy/CaddyfileENDSSH
if [ $? -eq 0 ]; then echo "" echo "โ
Deployment complete!" echo "" echo "๐ Landing page: https://at.aesthetic.computer" echo "๐ Health check: https://at.aesthetic.computer/xrpc/_health" echo "๐ PDS admin: https://pds.aesthetic.computer" echo "" echo "Note: The landing page is served by Caddy at the root URL" echo " All /xrpc/* routes still go to the PDS backend"else echo "" echo "โ Deployment failed" exit 1fi