mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:41:09 +02:00
feat(infra): add Cloudflare fallback plan + self-hosted landing pages
Two infrastructure improvements for tech independence:
1. Cloudflare Fallback Documentation (docs/CLOUDFLARE_FALLBACK.md):
- Plan B: WireGuard + Caddy on Hetzner VPS (€3.79/mo)
- Complete Caddyfile with all 30+ subdomains
- Step-by-step failover checklist (~15 min to switch)
- Plan C: Direct IP with ISP
2. Self-Hosted Landing Pages (eliminates Cloudflare Pages dependency):
- Nginx container (mana-infra-landings) on port 4400
- Multi-site config: each subdomain → separate dist/ folder
- Build script: scripts/mac-mini/build-landings.sh
- Cloudflare Tunnel ingress rules for 10 landing page domains
- Storage: /Volumes/ManaData/landings/ on external SSD
- Domains: it, chats, pics, zitares, presis, clocks,
manadeck, nutriphi, citycorners, docs
Migration path: Build landings locally, set Cloudflare DNS to
tunnel instead of Pages, then decommission CF Pages projects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
954b204bac
commit
e3115b302d
11 changed files with 733 additions and 27 deletions
56
scripts/mac-mini/build-landings.sh
Executable file
56
scripts/mac-mini/build-landings.sh
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash
|
||||
# Build all landing pages and copy dist/ to the shared nginx volume
|
||||
# Run on the Mac Mini after git pull
|
||||
#
|
||||
# Usage: ./scripts/mac-mini/build-landings.sh
|
||||
|
||||
set -e
|
||||
|
||||
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
OUTPUT_DIR="/Volumes/ManaData/landings"
|
||||
|
||||
echo "=== Building Landing Pages ==="
|
||||
echo "Output: $OUTPUT_DIR"
|
||||
echo ""
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
|
||||
# Landing pages to build (filter name → dist path → output name)
|
||||
declare -A LANDINGS=(
|
||||
["it"]="services/it-landing"
|
||||
["chat"]="apps/chat/apps/landing"
|
||||
["picture"]="apps/picture/apps/landing"
|
||||
["zitare"]="apps/zitare/apps/landing"
|
||||
["presi"]="apps/presi/apps/landing"
|
||||
["clock"]="apps/clock/apps/landing"
|
||||
["manadeck"]="apps/manadeck/apps/landing"
|
||||
["nutriphi"]="apps/nutriphi/apps/landing"
|
||||
["citycorners"]="apps/citycorners/apps/landing"
|
||||
)
|
||||
|
||||
cd "$PROJECT_ROOT"
|
||||
|
||||
for name in "${!LANDINGS[@]}"; do
|
||||
dir="${LANDINGS[$name]}"
|
||||
if [ -d "$dir" ]; then
|
||||
echo "Building $name ($dir)..."
|
||||
pnpm --filter "./$dir" build 2>&1 | tail -3
|
||||
|
||||
# Copy dist to output
|
||||
if [ -d "$dir/dist" ]; then
|
||||
rm -rf "$OUTPUT_DIR/$name"
|
||||
cp -r "$dir/dist" "$OUTPUT_DIR/$name"
|
||||
echo " → $OUTPUT_DIR/$name ($(du -sh "$OUTPUT_DIR/$name" | cut -f1))"
|
||||
else
|
||||
echo " ⚠ No dist/ found for $name"
|
||||
fi
|
||||
else
|
||||
echo " ⚠ Directory not found: $dir"
|
||||
fi
|
||||
echo ""
|
||||
done
|
||||
|
||||
echo "=== Done ==="
|
||||
echo ""
|
||||
echo "Restart nginx to pick up changes:"
|
||||
echo " docker restart mana-infra-landings"
|
||||
Loading…
Add table
Add a link
Reference in a new issue