Runs before deploy_reports so UTILITIES_API_KEY exists when reports'
.env is written on a fresh install.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Creates wages_db and deploys the wages app on LXC 124 (10.10.10.124).
Wired into --only wages dispatch, _append_secret, and full deploy sequence.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reports no longer queries forecasting_db directly — it calls the
forecasting public API. Remove GRANT SELECT and FORECAST_DATABASE_URL;
add FORECASTING_URL and FORECASTING_API_KEY (provisioned separately in
the forecasting app's API key manager).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reports LXC now gets SELECT grants on forecasting_db tables (bookings
stats, net revenue, forecasts, budgets) and the FORECAST_DATABASE_URL
env var so the Directors Forecast section can cross-query the forecasting
DB. Also adds 'edit' capability to the auth seeding block.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously the management .env was missing SETTINGS_SECRET (needed by
the backup service to fetch Nextcloud creds) and used stale variable
names (BACKUP_PG_PASS, BACKUP_REMOTE) that the docker-compose never read.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- deploy_kitchen: 2 GB RAM, 10 GB disk; creates kitchen_db (shared with kds);
FastAPI backend with MSSQL ODBC drivers (~5 min build); seeds 10 caps into auth DB
- deploy_kds: 1 GB RAM; connects to kitchen_db (no separate DB — KDS shares schema);
slim FastAPI build (httpx only, no MSSQL ODBC); seeds 3 caps + Staff role grants
- KITCHEN_DB_PASS added to _append_secret section for --only deploys
- Both added to case dispatch and full deploy sequence
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates reports_db, deploys reports app to LXC 122, seeds auth DB with
app entry and capabilities, registers /reports/ location in NPM.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The docker run approach failed (image tag/context issues); use the same
direct-psql pattern as add-app.sh which is proven reliable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
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>
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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
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>
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>