Files
ChatApp/scripts/migrate/config.sh
T
byGalax 5bc30c950c feat(infra): migrate self-hosted backend to netralax.de
Move Supabase + LiveKit from the netralax.cloud VPS to a new netralax.de server. Adds the migration runbook (docs/), one-time move scripts (scripts/migrate/), and prod Caddy/LiveKit config templates (infra/). Repoints the desktop publish/changelog URLs and prod ops config to .de. JWT_SECRET + VAPID copied identically so already-installed clients keep working; the new server also serves the legacy .cloud hostnames.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 19:39:04 +02:00

52 lines
1.8 KiB
Bash

#!/usr/bin/env bash
# Shared config for the one-time netralax.cloud -> netralax.de server move.
#
# This is SEPARATE from scripts/prod/config.sh on purpose: the migration knows
# BOTH the old (.cloud) and the new (.de) host, whereas scripts/prod/config.sh
# only ever points at the live server. Source this in each migrate script:
# source "$(dirname "$0")/config.sh"
#
# Fill NEW_HOST once the netralax.de VPS exists. OLD_HOST is the .cloud VPS.
# Old, currently-live VPS (Supabase + LiveKit on *.netralax.cloud).
export OLD_HOST="46.225.156.249"
export OLD_USER="prox"
# New, empty VPS that will serve *.netralax.de (and keep serving *.netralax.cloud
# for already-installed clients). Fill in the IP before running 02-migrate-data.sh.
# NOTE: the login user on the new .de VPS is "debian" (the old .cloud VPS uses "prox").
export NEW_HOST="141.95.34.204"
export NEW_USER="debian"
# Paths on BOTH servers (same layout on old and new).
export SUPABASE_DIR="/opt/supabase"
export LIVEKIT_DIR="/opt/livekit"
# SSH helper opts: accept new host keys on first connect without prompting.
# Override SSH_OPTS from the environment if you need a jumphost etc.
export SSH_OPTS="${SSH_OPTS:--o StrictHostKeyChecking=accept-new}"
# Convenience SSH targets.
export OLD_SSH="${OLD_USER}@${OLD_HOST}"
export NEW_SSH="${NEW_USER}@${NEW_HOST}"
# Run a command on the OLD server.
old_remote() {
# shellcheck disable=SC2086
ssh ${SSH_OPTS} "${OLD_SSH}" "$@"
}
# Run a command on the NEW server.
new_remote() {
# shellcheck disable=SC2086
ssh ${SSH_OPTS} "${NEW_SSH}" "$@"
}
# Guard: refuse to run anything against the unfilled new-host placeholder.
require_new_host() {
if [[ "${NEW_HOST}" == "__NETRALAX_DE_SERVER_IP__" || -z "${NEW_HOST}" ]]; then
echo "NEW_HOST is still the placeholder — edit scripts/migrate/config.sh first." >&2
exit 1
fi
}