Commit graph

40 commits

Author SHA1 Message Date
5332f1449d fix: remove NEWBOOK_LOCATION_ID from room-planner deploy — not needed for single-property setup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:11:00 +00:00
7758e67f5b feat: add room-planner to --only deploy (LXC 120)
Adds deploy_room_planner() function for LXC 120 / 10.10.10.120.
Wires it into --only room-planner, postgres init SQL (07-room-planner.sql),
gen_secrets, credentials file template, and the main deploy sequence.
NEWBOOK_LOCATION_ID written to .env with a warning if unset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 13:07:07 +00:00
a35deb40bf Rename twin-optimiser repo: hk-twin-optimiser → twin-optimiser (match slug)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 20:56:52 +00:00
4219a801bf Add twin-optimiser service (LXC 119) to installer and --only mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 20:11:10 +00:00
70ffd218a1 NPM: locate proxy host via python3 JSON parse, not brittle grep
The proxy-host lookup grepped for '"id":N,"domain_names":[...]' in a
fixed field order that NPM's JSON doesn't guarantee, so the host was never
found ("proxy host not found"). Replace both the cashup and hk-planner
inline blocks with a shared npm_add_location() helper that parses the
proxy-hosts list with python3 and matches DOMAIN inside domain_names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:21:01 +00:00
eadbb383e7 NPM: try all creds-file admin pairs + factory default for token
npm_get_token now attempts the sourced NPM_ADMIN_* pair, then every
email/pass pair present in the credentials file, then admin@example.com/
changeme. Makes proxy-host automation resilient to duplicate, reordered,
or placeholder NPM entries regardless of how they got there.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:16:05 +00:00
d4b28dd41b NPM: use stable internal IP 10.10.10.3 for all API calls
The NPM API was reached via NPM_LAN_IP, which breaks when that value is a
placeholder or unset (and the :-10.10.10.103 fallback was wrong — the
internal IP is .3, not .103). NPM listens on all interfaces, so the host
can always reach it at 10.10.10.3:81 over vmbr1. NPM_LAN_IP now only drives
user-facing messages and the NPM LXC's LAN net0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:14:42 +00:00
95632f22c9 Fix --only auth/noticeboard: OFFICE_IP unbound under set -u
In --only mode the creds file provides OFFICE_IP_CHECK, not OFFICE_IP,
so the bare ${OFFICE_IP} tripped 'set -u'. Use the same tolerant
${OFFICE_IP_CHECK:-${OFFICE_IP:-disabled}} form as cashup/hk-planner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 14:11:37 +00:00
95b3741d23 Add hk-planner service (LXC 118) to installer and --only mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:58:51 +00:00
b124abf8c4 Inject SETTINGS_URL/SECRET into auth env and AUTH_URL into noticeboard env at deploy time
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 00:24:11 +00:00
01abc9c10b Fix NPM_LAN_IP unbound and cashup health check path
- Save NPM_LAN_IP to creds file and reload it in --only mode
- npm_get_token and deploy_cashup NPM patch fall back to 10.10.10.103
  (internal vmbr1 IP) when NPM_LAN_IP is unset
- Fix health check URL: /cashup/api/health → /cashup/health
  (nginx proxies /cashup/health to backend:3001/health; /cashup/api/
  proxies to /api/ which has no /health route)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 21:19:27 +00:00
6bf5f09fe8 Add /cashup/ NPM location and npm_get_token helper
- Add manage@hotel.com NPM credentials to creds file template and
  reload block (NPM_ADMIN_EMAIL was missing from the --only path)
- Extract npm_get_token() so both configure_npm_proxy_hosts and
  deploy_cashup share one auth call
- deploy_cashup now patches the live NPM proxy host to add /cashup/
  → 10.10.10.117:3083 after containers are healthy (idempotent)
- /cashup/ also added to the fresh-install locations array

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 21:09:06 +00:00
5f06519a9a Expose docker compose build errors; remove silent &>/dev/null suppression
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 20:04:55 +00:00
8f5ae3af74 Fix deploy_service set -e exit swallowing errors in command substitution
Using 'if ! pct exec ... > tmp 2>&1' avoids the bash set -e + $()
interaction where the shell exits inside the subshell before || fires.
Errors are now captured to a temp file and printed via msg_error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 20:01:49 +00:00
4fe4e30807 Fix deploy_service to expose git clone errors instead of swallowing them
Removed &>/dev/null suppression; output is now captured and shown in
msg_error with a debug command when clone or pull fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:52:40 +00:00
86dd283acd Self-generate missing DB passwords in deploy functions for --only installs 2026-07-01 19:46:08 +00:00
ac846670f3 Fix management .env to include CENTRAL_AUTH_SECRET/AUTH_URL; update add-app summary
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:34:16 +00:00
53caeea318 Add cashup as a first-class stack service with --only support 2026-07-01 19:16:36 +00:00
22a99f804e Generate missing secrets in --only mode for existing installs
SETTINGS_DB_PASS and SETTINGS_SECRET won't be in the credentials file
on stacks installed before settings was added. Generate and append them
automatically so --only settings works without a full reinstall.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:13:19 +00:00
285d6609b1 Fix --only mode credential parsing for values with spaces
Replace source+grep with a safe line-by-line reader so SITE_NAME and
ADMIN_PASS with spaces do not get interpreted as shell commands. Also
quote SITE_NAME and ADMIN_PASS in the written credentials file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:10:25 +00:00
259a1457aa Add --only <service> single-service deploy mode
Sources existing credentials file and redeploys just the named service
without running the full interactive installer. Works for any service:
postgres auth portal npm management noticeboard settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:06:49 +00:00
fde4fa3115 Add settings service to stack installer
Add LXC 116 (settings) to install-stack.sh: generates SETTINGS_DB_PASS and
SETTINGS_SECRET, creates settings_db in postgres init SQL, provisions the
LXC and deploys the service. Step counter updated to 7/7.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:04:52 +00:00
242f170edb Bump build-heavy LXCs (auth/management/noticeboard/add-app) to 1GB — avoid OOM (exit 137) 2026-07-01 14:33:32 +00:00
52e85cfc53 Fix NPM API: correct /api/nginx/proxy-hosts endpoint; drop brittle advanced_config 2026-07-01 14:16:15 +00:00
90d1517f10 Fix set -e abort: ((i++)) at i=0 returns 1; use i=$((i+1)) 2026-07-01 14:06:40 +00:00
9a45e39db6 install_docker: disable apparmor_parser (fixes build+runtime in confined LXC) 2026-07-01 13:46:11 +00:00
2469b94b1f install_docker: idempotent (skip if present), non-interactive gpg 2026-07-01 13:34:15 +00:00
4e72d46bf9 Docker-in-LXC: security_opt in composes; revert LXC apparmor override; doc 2026-07-01 13:28:54 +00:00
69db7d5426 Docker-in-LXC: run containers AppArmor-unconfined (idempotent, fixes existing LXCs) 2026-07-01 13:17:20 +00:00
5fcf1f62e9 Add outbound NAT for internal vmbr1 so LXCs reach the internet 2026-07-01 13:06:29 +00:00
29e38361c8 gen_secrets: reuse existing credentials on re-run (resume-safe) 2026-07-01 13:02:25 +00:00
98c795457f wizard: offer auto/CIDR list for offsite, default 10.4.0.0/22,auto 2026-07-01 12:57:59 +00:00
a9305ba249 check_vmbr1: offer to auto-create the internal bridge 2026-07-01 12:51:13 +00:00
e1ecfba8ac Fix template detection (stderr progress, resolve live filename); banner 2026-07-01 12:46:30 +00:00
4622cc3d45 Prefix LXCs hotel-manage-*; group in Proxmox pool + tag 2026-07-01 12:40:28 +00:00
d052d0bddf Rename installer repo proxmox-helpers → stack-init 2026-07-01 12:31:56 +00:00
31925b61cf Group repos under hotel-manage-stack org; update URLs 2026-07-01 12:28:21 +00:00
c946d08d30 Rename to proxmox-helpers-hotel-manage-stack; repos now public (token optional) 2026-07-01 12:24:00 +00:00
912776ab0b Point installer at jtr/ Forgejo owner; rename stack repo to proxmox-helpers 2026-07-01 12:16:35 +00:00
fe16a07dd7 Initial commit: stack 2026-07-01 12:09:54 +00:00