Commit Graph
9 Commits
Author SHA1 Message Date
ssbg04 e3452099cd fix(tunnel): separate health states, remove fake inferred-connected logic, add origin polling
- Remove INFERRED_CONNECT_MS: tunnelConnected is now only set true when
  cloudflared logs 'Registered tunnel connection' — never inferred from
  process uptime.

- Add four independent health dimensions:
    cloudflaredRunning  — child process alive/exited
    tunnelConnected     — actual cloudflared connection registered
    originHealthy       — http://127.0.0.1:18484/ reachable (polled every 20s)
    publicEndpointStatus — diagnostic only, never triggers restart

- Add checkOriginHealth(): polls 127.0.0.1:18484 with explicit IPv4
  (family:4) to avoid Windows localhost/IPv6 ambiguity.

- Restart cloudflared ONLY on process exit. A public 502/503/504/530
  is never a restart trigger.

- Add 90s startup connection timeout: logs 'degraded' warning with full
  diagnostics if no connection registered, but does NOT kill the process.

- Improve structured [Tunnel] logging: clearly distinguishes origin,
  process, connection, and public endpoint health in every log line.

- Token: never log the full value; log first 6 chars only as proof of
  configuration. Fail fast with clear error if token is missing.

- Duplicate process guard: explicit log when skipping a second spawn.

- start_tunnel.bat: add prominent warning not to run while backend is
  active; suppress token echo; add --no-autoupdate flag.
2026-09-01 16:49:10 +08:00
ssbg04 fb99ed0fb8 refactor(backend): clean cloudflare tunnel service and sanitize batch runner 2026-09-01 06:14:43 +08:00
ssbg04 3dcad8878b fix: tunnel stability, NSSM service installer, cleanup old service scripts 2026-09-01 00:49:23 +08:00
ssbg04 02645de474 fix(tunnel): synchronize valid tunnel token in start_tunnel.bat 2026-09-01 00:07:07 +08:00
ssbg04 7c4bff2191 fix(tunnel): stabilize cloudflared on Windows with QUIC protocol, non-blocking process management, and resilient connectivity checks 2026-08-31 23:54:57 +08:00
ssbg04 8c82db71e7 fix(tunnel): resolve Windows tunnel protocol delay and sync start_tunnel token 2026-08-31 23:48:22 +08:00
ssbg04 b4b4df9d1f feat(tunnel): configure Cloudflare tunnel runner script with token 2026-08-18 18:24:37 +08:00
ssbg04 14951a31a7 feat(tunnel): replace localtunnel with Cloudflare Tunnel (zero sign-in, fast edge routing) 2026-08-18 17:18:17 +08:00
ssbg04 5f1a2789a4 feat(backend): add localtunnel dependency and start_tunnel script 2026-08-18 17:05:17 +08:00