carlos / platform Public

fleet-client-address-1348

Fleet apps see the client the hub saw, not the hub (#1348)

Fleet and -tunnel apps behind a hub saw the hub's address as the client, so Rails request.remote_ip, Rack::Attack and per-IP limits treated every visitor as one. The hub already writes X-Forwarded-For itself for every request it sends down a tunnel (tunnelRewrite); the box's edge threw it away and wrote the tunnel peer.

Now, for a request that arrived over a tunnel the box dialled (tunnelclient's own context mark):

  • the app gets the hub's chain when every entry is an IP (hubVisitor, the rule linked deployments already used), else the peer as before;
  • the password gate's attempt limiter keys on the chain's last entry.

Off a tunnel nothing changes. The hub is unchanged; only fleet boxes need the new build.

Docs: rootfs "The visitor's address", Rails guide pointer (Luna copy pass, delegated). Census proposal fleet-client-address-1348. Tests: internal/edge/tunnelclientaddr_test.go (real hub edge, tunnel loop, box edge; plain HTTP and a WebSocket upgrade; fallbacks and gate keys).

🤖 Generated with Claude Code

Commits 9
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity