This commit is contained in:
@@ -129,7 +129,7 @@ PROD_ADMIN_CREDENTIAL_FILE="$ADMIN_CREDENTIAL_FILE" node tools/deploy/ensure-pro
|
||||
chmod 600 "$ADMIN_CREDENTIAL_FILE" || true
|
||||
|
||||
echo "[deploy] Ensuring runtime log directories"
|
||||
install -d -m 0755 "$APP_DIR/logs/api" "$APP_DIR/logs/send-worker" "$APP_DIR/logs/report-material-worker" "$APP_DIR/logs/submit-outbox" "$APP_DIR/logs/gateway-callback" "$APP_DIR/logs/protocol-log-worker" "$APP_DIR/logs/gateway"
|
||||
install -d -m 0755 "$APP_DIR/logs/api" "$APP_DIR/logs/send-worker" "$APP_DIR/logs/report-material-worker" "$APP_DIR/logs/sending-monitor" "$APP_DIR/logs/submit-outbox" "$APP_DIR/logs/gateway-callback" "$APP_DIR/logs/protocol-log-worker" "$APP_DIR/logs/gateway"
|
||||
|
||||
echo "[deploy] Installing split API and send-worker services"
|
||||
node_bin="$(command -v node)"
|
||||
@@ -175,6 +175,31 @@ RestartSec=5
|
||||
StandardOutput=append:$APP_DIR/logs/report-material-worker/stdout.log
|
||||
StandardError=append:$APP_DIR/logs/report-material-worker/stderr.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat >/etc/systemd/system/cmpp-sending-monitor.service <<EOF
|
||||
[Unit]
|
||||
Description=CMPP sending quality projection and evaluation worker
|
||||
After=network.target postgresql.service
|
||||
|
||||
[Service]
|
||||
User=cmpp-api
|
||||
Group=cmpp-security
|
||||
WorkingDirectory=$APP_DIR/api
|
||||
EnvironmentFile=$ENV_FILE
|
||||
Environment=TZ=UTC
|
||||
NoNewPrivileges=true
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=$APP_DIR/logs/sending-monitor
|
||||
ExecStart=$node_bin dist/sending-monitor-worker.js
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=append:$APP_DIR/logs/sending-monitor/stdout.log
|
||||
StandardError=append:$APP_DIR/logs/sending-monitor/stderr.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
@@ -241,6 +266,7 @@ EOF
|
||||
|
||||
echo "[deploy] Installing restricted security boundary"
|
||||
bash "$APP_DIR/tools/security/install-security-agent.sh"
|
||||
install -d -o cmpp-api -g cmpp-security -m 0750 "$APP_DIR/logs/sending-monitor"
|
||||
|
||||
echo "[deploy] Ensuring HTTP response compression"
|
||||
compression_config=/etc/nginx/conf.d/cmpp-compression.conf
|
||||
@@ -294,6 +320,8 @@ systemctl restart cmpp-gateway
|
||||
systemctl restart cmpp-api
|
||||
systemctl restart cmpp-send-worker
|
||||
systemctl restart cmpp-report-material-worker
|
||||
systemctl enable --now cmpp-sending-monitor
|
||||
systemctl restart cmpp-sending-monitor
|
||||
systemctl restart nginx
|
||||
|
||||
echo "[deploy] Health checks"
|
||||
@@ -314,6 +342,7 @@ wait_for_http() {
|
||||
wait_for_http "API" "http://127.0.0.1:${API_PORT:-3000}/api/health"
|
||||
wait_for_http "Send worker metrics" "http://127.0.0.1:${API_WORKER_METRICS_PORT:-9465}/metrics"
|
||||
systemctl is-active --quiet cmpp-report-material-worker
|
||||
systemctl is-active --quiet cmpp-sending-monitor
|
||||
if [[ "${SEND_SUBMIT_OUTBOX_SEPARATE_PROCESS_ENABLED:-false}" == "true" ]]; then
|
||||
wait_for_http "Submit Outbox metrics" "http://127.0.0.1:${API_OUTBOX_METRICS_PORT:-9467}/metrics"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user