Files
proxmox/scripts/nginx-proxy-manager/complete-dapp-npmplus-from-lan.sh
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

34 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# Complete NPMplus setup for dapp.d-bis.org: add proxy host, then remind to request SSL in UI.
# Run from a host that can reach NPMplus (192.168.11.167:81), e.g. your machine on the same LAN.
#
# Usage (from proxmox repo root):
# source .env && bash scripts/nginx-proxy-manager/complete-dapp-npmplus-from-lan.sh
# Or with explicit password:
# NPM_PASSWORD=xxx source .env && bash scripts/nginx-proxy-manager/complete-dapp-npmplus-from-lan.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
source config/ip-addresses.conf 2>/dev/null || true
[ -f .env ] && set +u && source .env 2>/dev/null || true && set -u
NPM_URL="${NPM_URL:-https://192.168.11.167:81}"
DAPP_IP="${IP_DAPP_LXC:-192.168.11.58}"
# Check reachability
if ! curl -sk --connect-timeout 5 -o /dev/null -w "%{http_code}" "$NPM_URL/" 2>/dev/null | grep -q '[0-9]'; then
echo "Cannot reach NPMplus at $NPM_URL (not on LAN or firewall)."
echo "Run this script from a host on 192.168.11.x that can reach $NPM_URL"
echo "Or add the proxy manually: NPM UI → Proxy Hosts → Add: dapp.d-bis.org → $DAPP_IP:80, then request SSL."
exit 1
fi
[ -z "${NPM_PASSWORD:-}" ] && echo "Set NPM_PASSWORD (e.g. source .env)" && exit 1
echo "Adding dapp.d-bis.org -> $DAPP_IP:80 on NPMplus..."
bash scripts/nginx-proxy-manager/add-dapp-proxy-host.sh
echo ""
echo "Next: In NPMplus UI (https://192.168.11.167:81) open the proxy for dapp.d-bis.org, request SSL, and enable Force SSL."