fix/check implementation #6
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_proxy#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We are working on a proxy server, but please check if the following is okay. So the proxy server accepts HTTP, HTTPS, supports Let's Encrypt, OAuth, and can also do self-signed certificates. We can bind the server on an IP address, IPv6 or IPv4, even on a socket. That's for the incoming because it's a proxy, right? Then for managing this server, that's our typical socket mechanism on a UDS Unix socket.
Check all of that and then set up the system and make sure it all works well.
make sure that attaching to an interface (one or more), can be done at runtime over the openrpc interface
make sure openrpc spec and implementation is aligned
use following skills
/hero_proc_service_selfstart
/hero_crates_best_practices_check
Implementation Spec for Issue #6
Objective
Audit and fix the hero_proxy_server so that all described capabilities (HTTP, HTTPS, Let's Encrypt, OAuth, self-signed certs, IPv4/IPv6, socket binding, runtime interface attachment via OpenRPC) are correctly implemented, the OpenRPC spec and its Rust implementation are fully aligned, and the
--start/--stoplifecycle follows hero_proc best practices.Current State Assessment
What Works: HTTP/HTTPS listeners, UDS management socket, proxy routing, TLS (self-signed + ACME), OAuth, DNS CRUD, SQLite DB, hero_proc lifecycle, Admin UI, OpenRPC spec (27 methods).
What Is Missing / Misaligned:
0.0.0.0listenersDB table or OpenRPC methods for listener managementdns.statusreturns onlyenabled, missinglisteningandaddressResponse Key Mismatches:
tls.set/tls.check{"domain": TlsDomain}{"tls": TlsDomain}*.removemethods{"removed": bool}{"deleted": bool}dns.status{enabled, listening, address}{enabled}onlysettings.list{"settings": [{key,value},...]}{"settings": {key: value}}Implementation Plan
Step 1: Fix OpenRPC response key mismatches in main.rs
Fix all response keys to match the OpenRPC spec (
deleted→removed,tls→domain).Step 2: Fix settings.list and dns.status responses
Change
settings.listto return array of{key, value}objects. Addlisteningandaddressfields todns.status.Step 3: Add listeners table and CRUD to db.rs
New
Listenerstruct,CREATE TABLE listeners, CRUD methods, seed default listeners.Step 4: Add listener management to AppState and runtime spawning
Add
active_listenerstoAppState, refactor hardcoded spawning to DB-driven,spawn_listener()/shutdown_listener()functions.Step 5: Add listener.* OpenRPC methods
Add
listener.list,listener.add,listener.remove,listener.statusto spec and handler.Step 6: Regenerate SDK client and update admin UI
Update generated client, add Listeners tab to admin dashboard.
Step 7: Add tests
Unit tests for listener CRUD, response key correctness, settings.list format, dns.status fields.
Acceptance Criteria
listener.list/add/remove/statusmethods work at runtimecargo checkandcargo testpassNotes
[::]accepts both IPv4 and IPv6tls_domainstableEACCESgracefullyImplementation Complete
Test Results
Changes Made
1. Fixed OpenRPC spec/implementation alignment
tls.set/tls.check: response keytls→domain*.removemethods: response keydeleted→removedsettings.list: flat map → array of{key, value}objectsdns.status: added missinglisteningandaddressfields2. Added runtime listener management
listenersSQLite table with CRUD operationsListenerstruct in db.rsListenerHandlestruct with shutdown channel for runtime controlactive_listenersfield in AppStatespawn_listener()function supporting HTTP, HTTPS (selfsigned + letsencrypt)3. Added listener.* OpenRPC methods
listener.list— list all configured listenerslistener.add— add and optionally start a new listenerlistener.remove— stop and remove a listenerlistener.status— show active/inactive status4. Updated SDK client
5. Updated admin UI
6. Fixed ancillary issues
Files Modified
crates/hero_proxy_server/src/main.rscrates/hero_proxy_server/src/db.rscrates/hero_proxy_server/src/proxy.rscrates/hero_proxy_server/openrpc.jsoncrates/hero_proxy_server/openrpc.client.generated.rscrates/hero_proxy_ui/static/admin.htmlcrates/hero_proxy_examples/examples/health.rscrates/hero_proxy_examples/examples/list_services.rscrates/hero_proxy_examples/tests/integration.rscrates/weblib/tests/integration.rscrates/weblib/src/*.rs(doc-test fixes)Implementation committed:
b100394Browse:
b100394