refactor: codebase opschoning — type safety, error handling, central config, page splits
- categorie A: alle catch(e: any) → catch(e: unknown) met instanceof check - categorie B: stille .catch() logging toegevoegd (SWRegister, admin, upload, auth) - categorie C: hardcoded 192.168.1.176 IPs vervangen door env var defaults - categorie D: page files >250L gesplitst (history, settings, explorer, admin/payment, ipns, users, upload, dashboard) in helpers/components - categorie E: eslint-disable vervangen in SearchInput.tsx - src/lib/config.ts centrale config module (localhost defaults) - CSP in next.config.ts dynamisch via env var - deploy.sh: geen hardcoded IP meer (REQUIRED arg) - lib/api/ lib/auth/ lib/wallet/ lib/search-index/ lib/storage/ gesplitst in modules - ongebruikte bestanden verwijderd: api.ts, auth.tsx, wallet.ts, search-index.ts, PaymentPanel.tsx, SearchBar.tsx, proxy.ts, serve-static.js
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# ── IPFS Portal Deploy Script ──
|
||||
# Usage: ./deploy.sh [remote_host] [remote_port]
|
||||
# remote_host: SSH target (default: maik@192.168.1.176)
|
||||
# remote_host: SSH target (required — e.g. maik@your-server)
|
||||
# remote_port: SSH port (default: 22)
|
||||
#
|
||||
# Builds Docker image locally, pushes to Docker Hub or saves as tar,
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
REMOTE_HOST="${1:-maik@192.168.1.176}"
|
||||
REMOTE_HOST="${1:?Usage: $0 <user@host> [port]}"
|
||||
REMOTE_PORT="${2:-22}"
|
||||
IMAGE_NAME="maos/ipfs-portal"
|
||||
TAG="$(date +%Y%m%d-%H%M%S)"
|
||||
@@ -81,10 +81,12 @@ services:
|
||||
- NODE_ENV=production
|
||||
- PORT=3445
|
||||
- NEXT_TELEMETRY_DISABLED=1
|
||||
- USER_API_BASE=http://192.168.1.176:8444
|
||||
- USER_API_ADMIN_KEY=maos-admin-2024
|
||||
- KUBO_API_URL=http://192.168.1.176:8443
|
||||
- KUBO_BASIC_AUTH=portal:ipfs-portal-2024
|
||||
# ── Set these via .env.production or environment ──
|
||||
- USER_API_BASE=${USER_API_BASE:-http://localhost:8444}
|
||||
# - USER_API_ADMIN_KEY= # ← REQUIRED: set this!
|
||||
# - KUBO_API_URL= # ← Kubo RPC if behind proxy
|
||||
# - KUBO_BASIC_AUTH= # ← Kubo basic auth credentials
|
||||
# - JWT_SECRET= # ← REQUIRED: generate a random string
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3445/api/health"]
|
||||
interval: 30s
|
||||
@@ -111,4 +113,4 @@ REMOTESHELL
|
||||
|
||||
echo ""
|
||||
echo "═══ Deploy complete ═══"
|
||||
echo " URL: https://maos.dedyn.io (via nginx) or http://192.168.1.176:3445"
|
||||
echo " URL: https://maos.dedyn.io (via nginx)"
|
||||
|
||||
Reference in New Issue
Block a user