#!/bin/bash # sync-eepsite.sh — Copy clearnet site to eepsite with appropriate modifications # Usage: ./sync-eepsite.sh [--dry-run] # # The eepsite is a simplified version of the clearnet site: # - No blog page (no blog content yet) # - No free-audit page (audit form uses /api which isn't available on I2P) # - Cross-reference links point to clearnet (not eepsite) and vice versa # - Same JS/CSS # - Same footer with I2P/clearnet cross-link set -euo pipefail CLEARNET="/var/www/krustyplanet" EEPSITE="/var/www/eepsite" DRY_RUN=false if [[ "${1:-}" == "--dry-run" ]]; then DRY_RUN=true echo "DRY RUN — no files will be modified" fi # Pages that exist on both sites SHARED_PAGES=("index.html" "services.html" "pricing.html" "contact.html") # Pages only on clearnet (these have backend API dependencies) CLEARNET_ONLY=("blog.html" "free-audit.html") # Copy shared static assets for dir in css js; do echo "Syncing $dir/" if $DRY_RUN; then diff -rq "$CLEARNET/$dir/" "$EEPSITE/$dir/" || true else rsync -av --delete "$CLEARNET/$dir/" "$EEPSITE/$dir/" fi done # Copy favicon echo "Syncing favicon.svg" if ! $DRY_RUN; then cp "$CLEARNET/favicon.svg" "$EEPSITE/favicon.svg" fi # Sync shared pages with I2P-specific modifications for page in "${SHARED_PAGES[@]}"; do echo "Syncing $page" if $DRY_RUN; then echo " Would transform and copy $CLEARNET/$page -> $EEPSITE/$page" else # Start with clearnet version cp "$CLEARNET/$page" "$EEPSITE/$page" # Replace clearnet I2P mirror link with clearnet reference link sed -i 's|🔒 I2P Mirror:.*b32\.i2p

|🌐 Clearnet: https://krustyplanet.org

|' "$EEPSITE/$page" # Remove nav links to clearnet-only pages (free-audit, blog) sed -i '/href="\/free-audit\.html"/d' "$EEPSITE/$page" sed -i '/href="\/blog\.html"/d' "$EEPSITE/$page" fi done echo "Done. Eepsite is in sync with clearnet." echo "" echo "NOTE: The following pages are clearnet-only (require /api backend):" for page in "${CLEARNET_ONLY[@]}"; do echo " - $page" done echo "" echo "NOTE: The eepsite contact form JS still posts to /api/contact" echo " which won't work over I2P. Consider adding a mailto: fallback."