fix
This commit is contained in:
parent
60b88dd4d4
commit
c24847ec18
|
|
@ -203,6 +203,7 @@ async fn run_check(client: &reqwest::Client, monitor: &Monitor, scheduled_at: Op
|
|||
error: Some(e.clone()),
|
||||
cert_expiry_days: None,
|
||||
cert_issuer: None,
|
||||
response_size: None,
|
||||
meta: None,
|
||||
region: Some(region.to_string()),
|
||||
run_id: Some(run_id.to_string()),
|
||||
|
|
|
|||
|
|
@ -373,6 +373,7 @@
|
|||
if (ping.cert_expiry_days != null) html += `<div class="text-gray-500">Cert expiry</div><div class="text-gray-300">${ping.cert_expiry_days} days</div>`;
|
||||
if (ping.cert_issuer) html += `<div class="text-gray-500">Cert issuer</div><div class="text-gray-300">${escapeHtml(ping.cert_issuer)}</div>`;
|
||||
if (ping.response_size != null) html += `<div class="text-gray-500">Response size</div><div class="text-gray-300">${ping.response_size >= 1024 ? (ping.response_size / 1024).toFixed(1) + ' KB' : ping.response_size + ' B'}</div>`;
|
||||
if (ping.important) html += `<div class="text-gray-500">Important</div><div class="text-yellow-400">Yes</div>`;
|
||||
html += '</div>';
|
||||
|
||||
// Error
|
||||
|
|
|
|||
56
deploy.sh
56
deploy.sh
|
|
@ -31,7 +31,7 @@ nuke_db() {
|
|||
fi
|
||||
echo "[nuke-db] Dropping all tables on database-eu-central..."
|
||||
$SSH $DB_HOST bash << 'REMOTE'
|
||||
sudo -u postgres psql -d pingql -c "DROP TABLE IF EXISTS payment_txs, ping_bodies, payments, pings, api_keys, monitors, accounts CASCADE;"
|
||||
sudo -u postgres psql -d pingql -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public; GRANT ALL ON SCHEMA public TO public;"
|
||||
echo "All tables dropped"
|
||||
REMOTE
|
||||
echo "[nuke-db] Done. Tables will be recreated on next API/web restart."
|
||||
|
|
@ -112,13 +112,67 @@ REMOTE
|
|||
echo "[monitor] All monitors deployed"
|
||||
}
|
||||
|
||||
stop_app() {
|
||||
local app="$1"
|
||||
case "$app" in
|
||||
api)
|
||||
echo "[stop] Stopping pingql-api on api-eu-central..."
|
||||
$SSH $API_HOST "systemctl stop pingql-api && echo 'pingql-api stopped'"
|
||||
;;
|
||||
pay)
|
||||
echo "[stop] Stopping pingql-pay on api-eu-central..."
|
||||
$SSH $API_HOST "systemctl stop pingql-pay && echo 'pingql-pay stopped'"
|
||||
;;
|
||||
web)
|
||||
echo "[stop] Stopping pingql-web on web-eu-central..."
|
||||
$SSH $WEB_HOST "systemctl stop pingql-web && echo 'pingql-web stopped'"
|
||||
;;
|
||||
status)
|
||||
echo "[stop] Stopping pingql-status on web-eu-central..."
|
||||
$SSH $WEB_HOST "systemctl stop pingql-status && echo 'pingql-status stopped'"
|
||||
;;
|
||||
monitor)
|
||||
echo "[stop] Stopping monitors on all hosts..."
|
||||
for host in "${MONITOR_HOSTS[@]}"; do
|
||||
($SSH "$host" 'systemctl stop pingql-monitor && echo "pingql-monitor stopped on $(hostname)"') &
|
||||
done
|
||||
wait
|
||||
;;
|
||||
all)
|
||||
stop_app api; stop_app pay; stop_app web; stop_app status; stop_app monitor
|
||||
;;
|
||||
*)
|
||||
echo "Unknown app: $app (valid: api, pay, web, status, monitor, all)"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Parse args — supports both "./deploy.sh web api" and "./deploy.sh web,api"
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 [web|api|pay|status|monitor|db|all] [...]"
|
||||
echo " $0 stop [api|pay|web|status|monitor|all]"
|
||||
echo " $0 web,api,status (comma-separated)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Handle "stop" action
|
||||
if [ "$1" = "stop" ]; then
|
||||
shift
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 stop [api|pay|web|status|monitor|all]"
|
||||
exit 1
|
||||
fi
|
||||
for arg in "$@"; do
|
||||
IFS=',' read -ra targets <<< "$arg"
|
||||
for target in "${targets[@]}"; do
|
||||
stop_app "$target"
|
||||
done
|
||||
done
|
||||
echo "Stop complete."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sync_time() {
|
||||
echo "[sync] Syncing time on all servers..."
|
||||
ALL_HOSTS=("$DB_HOST" "$API_HOST" "$WEB_HOST" "${MONITOR_HOSTS[@]}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue