Thread MQTT admin credentials into settings, reorder broker before it
deploy_settings() now copies the shared deploy SSH key (same as deploy_management()) so settings can SSH into LXC 104 to manage dynamic-security clients, and writes MQTT_BROKER_HOST/MQTT_ADMIN_USER/ MQTT_ADMIN_PASS into its .env from the credentials file. Moved deploy_mqtt_broker() before deploy_settings() in the full-install sequence so a fresh install has the admin credentials already generated by the time settings needs them — previously only worked via a later `--only settings` redeploy after the broker existed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
8b2dce9714
commit
c6c67be8af
1 changed files with 13 additions and 1 deletions
|
|
@ -909,6 +909,13 @@ deploy_settings() {
|
||||||
install_mgmt_key 116
|
install_mgmt_key 116
|
||||||
msg_ok "Docker + SSH ready"
|
msg_ok "Docker + SSH ready"
|
||||||
|
|
||||||
|
# Copy the shared deploy SSH key so settings can SSH into the MQTT broker
|
||||||
|
# LXC (104) to manage dynamic-security clients — same mechanism management
|
||||||
|
# uses for its Shell/exec tab, just consumed by a second container.
|
||||||
|
pct exec 116 -- mkdir -p /root/.ssh
|
||||||
|
pct push 116 /root/.ssh/hotel-manage_deploy /root/.ssh/hotel-manage_deploy &>/dev/null
|
||||||
|
pct exec 116 -- chmod 600 /root/.ssh/hotel-manage_deploy
|
||||||
|
|
||||||
msg_info "Deploying settings service"
|
msg_info "Deploying settings service"
|
||||||
deploy_service 116 "settings" "${REPO_ROOT}/settings" /opt/settings
|
deploy_service 116 "settings" "${REPO_ROOT}/settings" /opt/settings
|
||||||
|
|
||||||
|
|
@ -917,6 +924,9 @@ NODE_ENV=production
|
||||||
DATABASE_URL=postgresql://settings:${SETTINGS_DB_PASS}@10.10.10.100:5432/settings_db
|
DATABASE_URL=postgresql://settings:${SETTINGS_DB_PASS}@10.10.10.100:5432/settings_db
|
||||||
SETTINGS_SECRET=${SETTINGS_SECRET}
|
SETTINGS_SECRET=${SETTINGS_SECRET}
|
||||||
AUTH_URL=http://10.10.10.101:3001
|
AUTH_URL=http://10.10.10.101:3001
|
||||||
|
MQTT_BROKER_HOST=10.10.10.104
|
||||||
|
MQTT_ADMIN_USER=${MQTT_ADMIN_USER:-}
|
||||||
|
MQTT_ADMIN_PASS=${MQTT_ADMIN_PASS:-}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
pct exec 116 -- bash -c "cd /opt/settings && docker compose up -d --build" &>/dev/null
|
pct exec 116 -- bash -c "cd /opt/settings && docker compose up -d --build" &>/dev/null
|
||||||
|
|
@ -2488,6 +2498,9 @@ deploy_portal
|
||||||
deploy_npm
|
deploy_npm
|
||||||
deploy_management
|
deploy_management
|
||||||
deploy_noticeboard
|
deploy_noticeboard
|
||||||
|
# mqtt-broker before settings: settings' own deploy threads MQTT_ADMIN_USER/PASS
|
||||||
|
# into its .env, which only exist in the creds file once the broker has run.
|
||||||
|
deploy_mqtt_broker
|
||||||
deploy_settings
|
deploy_settings
|
||||||
deploy_cashup
|
deploy_cashup
|
||||||
deploy_hk_planner
|
deploy_hk_planner
|
||||||
|
|
@ -2501,7 +2514,6 @@ deploy_reports
|
||||||
deploy_kitchen
|
deploy_kitchen
|
||||||
deploy_kds
|
deploy_kds
|
||||||
deploy_wages
|
deploy_wages
|
||||||
deploy_mqtt_broker
|
|
||||||
deploy_hvac
|
deploy_hvac
|
||||||
deploy_calendar
|
deploy_calendar
|
||||||
configure_npm_proxy_hosts
|
configure_npm_proxy_hosts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue