Update HTML files to use Bunny.net CDN for static assets
- Updated all static asset URLs to use iceymi.b-cdn.net CDN - Changed favicon, CSS, and JS file references in index.html, admin.html, and privacy.html - API calls remain pointed to origin server for dynamic content - Ready for CDN deployment with proper cache separation
This commit is contained in:
parent
f73221e5cc
commit
d9559f71fe
15 changed files with 770 additions and 116 deletions
|
@ -1,5 +1,5 @@
|
|||
# ICE Watch Caddy Configuration
|
||||
# Replace yourdomain.com with your actual domain
|
||||
# Great Lakes Ice Report Caddy Configuration
|
||||
# Using subdomain on existing puremichigan.lol domain
|
||||
#
|
||||
# This configuration automatically:
|
||||
# - Obtains SSL certificates from Let's Encrypt
|
||||
|
@ -7,7 +7,7 @@
|
|||
# - Serves on ports 80 and 443
|
||||
|
||||
# Main site configuration
|
||||
yourdomain.com {
|
||||
ice.puremichigan.lol {
|
||||
# Automatic HTTPS (default behavior)
|
||||
# Caddy automatically:
|
||||
# - Listens on :80 and :443
|
||||
|
@ -22,7 +22,7 @@ yourdomain.com {
|
|||
health_timeout 5s
|
||||
}
|
||||
|
||||
# Security headers for ICE Watch
|
||||
# Security headers for Great Lakes Ice Report
|
||||
header {
|
||||
# Enable HSTS (force HTTPS for 1 year)
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
|
@ -43,7 +43,7 @@ yourdomain.com {
|
|||
|
||||
# Logging for monitoring
|
||||
log {
|
||||
output file /var/log/caddy/icewatch.log {
|
||||
output file /var/log/caddy/great-lakes-ice-report.log {
|
||||
roll_size 100MB
|
||||
roll_keep 5
|
||||
}
|
||||
|
@ -71,17 +71,17 @@ yourdomain.com {
|
|||
}
|
||||
}
|
||||
|
||||
# Redirect www to non-www (with HTTPS)
|
||||
www.yourdomain.com {
|
||||
redir https://yourdomain.com{uri} permanent
|
||||
# Redirect www subdomain (if someone tries it)
|
||||
www.ice.puremichigan.lol {
|
||||
redir https://ice.puremichigan.lol{uri} permanent
|
||||
}
|
||||
|
||||
# HTTP redirect (explicit, though Caddy does this automatically)
|
||||
# This is just for clarity
|
||||
http://yourdomain.com {
|
||||
redir https://yourdomain.com{uri} permanent
|
||||
http://ice.puremichigan.lol {
|
||||
redir https://ice.puremichigan.lol{uri} permanent
|
||||
}
|
||||
|
||||
http://www.yourdomain.com {
|
||||
redir https://yourdomain.com{uri} permanent
|
||||
http://www.ice.puremichigan.lol {
|
||||
redir https://ice.puremichigan.lol{uri} permanent
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# ICE Watch Deployment Script for Debian 12 ARM64
|
||||
# Great Lakes Ice Report Deployment Script for Debian 12 ARM64
|
||||
# Run this script on your server: drone@91.99.139.235
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting ICE Watch deployment..."
|
||||
echo "🚀 Starting Great Lakes Ice Report deployment..."
|
||||
|
||||
# Update system
|
||||
echo "📦 Updating system packages..."
|
||||
|
@ -77,23 +77,23 @@ echo "✅ Caddy with rate limiting plugin installed successfully!"
|
|||
|
||||
# Create app directory
|
||||
echo "📁 Setting up app directory..."
|
||||
sudo mkdir -p /opt/icewatch
|
||||
sudo chown $USER:$USER /opt/icewatch
|
||||
sudo mkdir -p /opt/great-lakes-ice-report
|
||||
sudo chown $USER:$USER /opt/great-lakes-ice-report
|
||||
|
||||
# Navigate to app directory
|
||||
cd /opt/icewatch
|
||||
cd /opt/great-lakes-ice-report
|
||||
|
||||
# Create icewatch user for security
|
||||
echo "👤 Creating icewatch user..."
|
||||
sudo useradd --system --shell /bin/false --home /opt/icewatch --create-home icewatch
|
||||
# Create great-lakes-ice-report user for security
|
||||
echo "👤 Creating great-lakes-ice-report user..."
|
||||
sudo useradd --system --shell /bin/false --home /opt/great-lakes-ice-report --create-home great-lakes-ice-report
|
||||
|
||||
# Download additional configuration files from S3
|
||||
echo "📥 Downloading configuration files..."
|
||||
S3_BASE_URL="https://ice-puremichigan-lol.s3.amazonaws.com/scripts"
|
||||
S3_BASE_URL="https://greatlakes-conditions.s3.amazonaws.com/scripts"
|
||||
|
||||
# Download systemd service file
|
||||
echo "📥 Downloading systemd service..."
|
||||
curl -sSL "$S3_BASE_URL/icewatch.service" | sudo tee /etc/systemd/system/icewatch.service > /dev/null
|
||||
curl -sSL "$S3_BASE_URL/great-lakes-ice-report.service" | sudo tee /etc/systemd/system/great-lakes-ice-report.service > /dev/null
|
||||
|
||||
# Download Caddyfile template
|
||||
echo "📥 Downloading Caddy configuration..."
|
||||
|
@ -101,13 +101,13 @@ curl -sSL "$S3_BASE_URL/Caddyfile" | sudo tee /etc/caddy/Caddyfile.template > /d
|
|||
|
||||
echo "✅ Server setup complete!"
|
||||
echo ""
|
||||
echo "🚀 Next steps to deploy ICE Watch:"
|
||||
echo "🚀 Next steps to deploy Great Lakes Ice Report:"
|
||||
echo ""
|
||||
echo "1. Clone your repository:"
|
||||
echo " git clone git@github.com:deco/ice.git /opt/icewatch"
|
||||
echo " git clone git@github.com:deco/great-lakes-ice-report.git /opt/great-lakes-ice-report"
|
||||
echo ""
|
||||
echo "2. Set up the application:"
|
||||
echo " cd /opt/icewatch"
|
||||
echo " cd /opt/great-lakes-ice-report"
|
||||
echo " npm install"
|
||||
echo " cp .env.example .env"
|
||||
echo " nano .env # Add your MapBox token and admin password"
|
||||
|
@ -118,16 +118,16 @@ echo " # Replace 'yourdomain.com' with your actual domain"
|
|||
echo " sudo mv /etc/caddy/Caddyfile.template /etc/caddy/Caddyfile"
|
||||
echo ""
|
||||
echo "4. Set permissions:"
|
||||
echo " sudo chown -R icewatch:icewatch /opt/icewatch"
|
||||
echo " sudo chmod 660 /opt/icewatch/.env"
|
||||
echo " sudo chown -R great-lakes-ice-report:great-lakes-ice-report /opt/great-lakes-ice-report"
|
||||
echo " sudo chmod 660 /opt/great-lakes-ice-report/.env"
|
||||
echo ""
|
||||
echo "5. Start services:"
|
||||
echo " sudo systemctl daemon-reload"
|
||||
echo " sudo systemctl enable icewatch caddy"
|
||||
echo " sudo systemctl start icewatch caddy"
|
||||
echo " sudo systemctl enable great-lakes-ice-report caddy"
|
||||
echo " sudo systemctl start great-lakes-ice-report caddy"
|
||||
echo ""
|
||||
echo "6. Check status:"
|
||||
echo " sudo systemctl status icewatch"
|
||||
echo " sudo systemctl status great-lakes-ice-report"
|
||||
echo " sudo systemctl status caddy"
|
||||
echo ""
|
||||
echo "🌐 Your ICE Watch app will be available at: https://yourdomain.com"
|
||||
echo "🌐 Your Great Lakes Ice Report app will be available at: https://ice.puremichigan.lol"
|
||||
|
|
24
scripts/great-lakes-ice-report.service
Normal file
24
scripts/great-lakes-ice-report.service
Normal file
|
@ -0,0 +1,24 @@
|
|||
[Unit]
|
||||
Description=Great Lakes Ice Report - Community Winter Conditions Tool
|
||||
After=network.target
|
||||
Wants=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=great-lakes-ice-report
|
||||
Group=great-lakes-ice-report
|
||||
WorkingDirectory=/opt/great-lakes-ice-report
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
Environment=NODE_ENV=production
|
||||
|
||||
# Security settings
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ProtectHome=true
|
||||
ReadWritePaths=/opt/great-lakes-ice-report
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue