Skip to content

nginx captive-portal probe redirects to /portal but Flask serves /captive-portal (H5 smoke) #230

@mphacker

Description

@mphacker

Discovered during H5 hardware smoke (cybertruckusb.local, 2026-05-21).

config/nginx-teslausb.conf redirects all captive-portal probe URLs to /portal:

ginx location = /hotspot-detect.html { return 302 /portal\\; } location = /library/test/success.html { return 302 /portal\\; } location = /generate_204 { return 302 /portal\\; } location = /gen_204 { return 302 /portal\\; } location = /connecttest.txt { return 302 /portal\\; } location = /ncsi.txt { return 302 /portal\\; } location = /redirect { return 302 /portal\\; }

But the Flask blueprint binds /captive-portal (and /canonical.html), not /portal. Curl test:

  • curl http://cybertruckusb.local/hotspot-detect.html -> 302 /portal
  • curl http://cybertruckusb.local/portal -> 404

Net effect: Tesla nav unit, iOS, Android probes will follow the redirect and land on a 404 white page instead of the AP setup UI. v1 parity broken.

Options:

  1. Change nginx probe redirects to /captive-portal (one-line each)
  2. Add a /portal route alias to teslausb_web/blueprints/captive_portal.py that 301s to /captive-portal
  3. Rebind the captive-portal blueprint URL to /portal (matches the nginx config)

Option 3 is the smallest charter-friendly fix because it matches the explicitly-stated nginx contract. Option 1 fans out across 7 lines.

Found by: H5 hardware smoke test (see ~/.copilot/session-state/.../files/hw-results.md).

Labels: B-1, B-1: phase-6-cleanup, bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-1B-1 Rust+Python rewrite branch (b1-userspace-rust)B-1: phase-6-cleanupPre-Phase-6 cleanup items from Phase 5 close-outbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions