From a40bf2f8cf0139288dffd2a247d64b9b1b79631b Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Mon, 20 Jul 2026 10:36:08 +0000 Subject: [PATCH] Replace forecasting_db grants with FORECASTING_API_KEY in reports deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- install-stack.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/install-stack.sh b/install-stack.sh index 06e5bf3..ee8ddb3 100755 --- a/install-stack.sh +++ b/install-stack.sh @@ -1446,10 +1446,8 @@ deploy_reports() { \"CREATE DATABASE reports_db OWNER reports;\" 2>/dev/null || true docker exec hotel-manage-postgres psql -U postgres -d reports_db -c \ \"GRANT ALL ON SCHEMA public TO reports;\" 2>/dev/null || true - docker exec hotel-manage-postgres psql -U postgres -d forecasting_db -c \ - \"GRANT SELECT ON newbook_bookings_stats, newbook_net_revenue_data, forecasts, monthly_budgets, daily_budgets TO reports;\" 2>/dev/null || true " &>/dev/null - msg_ok "Database reports_db ready + read access to forecasting_db" + msg_ok "Database reports_db ready" msg_info "Deploying reports" deploy_service 122 "reports" "${REPO_ROOT}/reports" /opt/reports @@ -1458,7 +1456,8 @@ deploy_reports() { NODE_ENV=production APP_SLUG=reports DATABASE_URL=postgresql://reports:${REPORTS_DB_PASS}@10.10.10.100:5432/reports_db -FORECAST_DATABASE_URL=postgresql://reports:${REPORTS_DB_PASS}@10.10.10.100:5432/forecasting_db +FORECASTING_URL=http://10.10.10.113:3080 +FORECASTING_API_KEY=${FORECASTING_API_KEY:-} CENTRAL_AUTH_SECRET=${CENTRAL_AUTH_SECRET} SETTINGS_URL=http://10.10.10.116:3080 SETTINGS_SECRET=${SETTINGS_SECRET}