Files
microdao-daarion/scripts/start-node1-prometheus-tunnel.sh
Apple 3de3c8cb36 feat: Add presence heartbeat for Matrix online status
- matrix-gateway: POST /internal/matrix/presence/online endpoint
- usePresenceHeartbeat hook with activity tracking
- Auto away after 5 min inactivity
- Offline on page close/visibility change
- Integrated in MatrixChatRoom component
2025-11-27 00:19:40 -08:00

22 lines
1.0 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
#
# Створює SSH-тунель до Prometheus на NODE1 (порт 9090).
# Вимоги: налаштований SSH-доступ до root@144.76.224.179 (або іншого користувача з доступом).
set -euo pipefail
SSH_TARGET="${SSH_TARGET:-root@144.76.224.179}"
LOCAL_PORT="${LOCAL_PORT:-19090}"
REMOTE_PORT="${REMOTE_PORT:-9090}"
echo "🔐 Відкриваємо SSH-тунель: localhost:${LOCAL_PORT}${SSH_TARGET} (remote ${REMOTE_PORT})"
if lsof -Pi :"${LOCAL_PORT}" -sTCP:LISTEN -t >/dev/null 2>&1; then
echo "⚠️ Порт ${LOCAL_PORT} вже зайнятий. Завершіть попередній тунель (pkill -f \"ssh .*${LOCAL_PORT}:localhost:${REMOTE_PORT}\")"
exit 1
fi
ssh -fN -L "${LOCAL_PORT}:localhost:${REMOTE_PORT}" "${SSH_TARGET}"
echo "✅ Тунель активний. Prometheus NODE1 доступний на http://localhost:${LOCAL_PORT}"
echo " Закрити тунель: pkill -f \"ssh -fN -L ${LOCAL_PORT}:localhost:${REMOTE_PORT}\""