Skip to content

feat: serve each charger on its own URL - #30

Closed
PauloLuan wants to merge 4 commits into
openchargehub:mainfrom
PauloLuan:per-charger-urls
Closed

PauloLuan wants to merge 4 commits into
openchargehub:mainfrom
PauloLuan:per-charger-urls

Conversation

@PauloLuan

Copy link
Copy Markdown

Summary

  • One process serves each charger at /charger/{id} (the id is not an OCPP version; v1.6, v2.0, and v2.0.1 stay on default).
  • Each charger has its own inbound provider socket at /charger/{id}/backend. Providers do not leak across chargers.
  • Admin list and detail live at /, /chargers, and /chargers/{id}. Detail and create require ADMIN_TOKEN (Authorization: Bearer, X-Admin-Token, or ?token=). Missing or wrong token is 401. The public list does not show provider secrets.
  • Also includes the unpushed Rust runtime commits this feature sits on: Coolify runtime, a registry row per charger path, and backend/upstream sockets bound to the station.

This repository's default branch is main. There is no staging or master.

Test plan

  • cargo test --workspace (82 tests) green before commit
  • cargo clippy --workspace --all-targets -- -D warnings clean before commit
  • Charge point connects on /charger/{id} and a second id stays isolated
  • Provider on /charger/{id}/backend reaches only that charger
  • /chargers/{id} returns 401 without ADMIN_TOKEN and 200 with it

Publish the Rust workspace so Coolify can clone it. The default image is a small Alpine runtime; the Home Assistant add-on stays available with docker build --target addon.
Named stations were sharing the default socket. Each id now enrolls its own row and provider services.
Provider traffic was still using the process-wide charger. Each socket now follows the station row that owns it.
One process keeps a path per charger, a provider socket per charger, and an admin list gated by ADMIN_TOKEN.
@PauloLuan PauloLuan closed this by deleting the head repository Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant