test iroh and add to UI #2
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?
see also geomind_code/hero_codescalers#1
put the kvs as tab in the _ui
and show the kvs we know, make it filterable
also show statistics in admin about iroh, does it work, how many peers do we know ...
also in admin allow whitelisting of source mycelium ip addresses (ipv6)
check they are well formed and warn we will lose access if not well done
check they exist, we show as default (if not there yet) the ip address we come from, might be already the right one ipv6
then admin stuff can only be done when whitelisted ipv6
Implementation Spec for Issue #2
Objective
Extend the
hero_codescalersadmin UI and backend to:Requirements
kv.list_keyswith the typed prefix.statsresponse fieldmy_ipv6and pre-populate the "add admin" input.my_ipv6, display a confirmation warning that removing it will lock the operator out.kv.statsmust be added to the server that returns peer count, connectivity, and namespace metadata in a single call.require_admin. This is already implemented; no change required.Files to Modify or Create
crates/hero_codescalers_server/src/main.rskv.statsRPC method dispatcher branch; expose peer connectivity via irohEndpoint::remote_info_itercrates/hero_codescalers_server/openrpc.jsonkv.statsmethodcrates/hero_codescalers_ui/templates/index.htmlcrates/hero_codescalers_ui/templates/base.htmlcrates/hero_codescalers_ui/static/js/dashboard.jsloadKvs(),filterKvs(),loadIrohStats(), IPv6 validation helpers, whitelist warning logicImplementation Plan
Step 1: Add
kv.statsRPC method to the serverFiles:
crates/hero_codescalers_server/src/main.rsrequire_adminDependencies: none
Step 2: Document
kv.statsin openrpc.jsonFiles:
crates/hero_codescalers_server/openrpc.jsonDependencies: Step 1
Step 3: Add the KVS tab button to the navbar
Files:
crates/hero_codescalers_ui/templates/base.htmlDependencies: none
Step 4: Add the KVS tab pane in index.html
Files:
crates/hero_codescalers_ui/templates/index.htmlDependencies: Step 3
Step 5: Add iroh statistics section to the Admin tab in index.html
Files:
crates/hero_codescalers_ui/templates/index.htmlDependencies: none
Step 6: Add whitelist warning UX to the Admin tab in index.html
Files:
crates/hero_codescalers_ui/templates/index.htmlDependencies: none
Step 7: Implement KVS tab JavaScript logic in dashboard.js
Files:
crates/hero_codescalers_ui/static/js/dashboard.jsDependencies: Steps 3, 4
Step 8: Implement iroh statistics JavaScript in dashboard.js
Files:
crates/hero_codescalers_ui/static/js/dashboard.jsDependencies: Steps 1, 5
Step 9: Implement whitelist validation JavaScript in dashboard.js
Files:
crates/hero_codescalers_ui/static/js/dashboard.jsDependencies: Steps 6
Acceptance Criteria
kv.list_keys(debounced, 300 ms)kv.sync_onceand shows a toaststats.my_ipv6my_ipv6my_ipv6, a yellow warning explains the risk of losing accesskv.statsRPC method returns all required fieldskv.statsis documented inopenrpc.jsoncargo buildsucceeds with no errorsNotes
detect_mycelium_addr()on interfacetun9, stored inAppState::my_ipv6and returned in thestatsRPC response.require_adminis a no-op whenadmin_count() == 0to allow bootstrap; this is intentional.peer_count: 0with a TODO if the API is not easily accessible without blocking.kv.list_keysandkv.getare admin-gated server-side.alert()as a placeholder; a proper Bootstrap modal can follow.Build & Test Results
cargo build
Status: success
Warnings:
hero_codescalers_ui: fieldversionis never read (src/main.rs:99)cargo test
Test suites run:
hero_codescalers_kvs(roundtrip): 5 passed (list_skips_tombstones, put_get_roundtrip, list_returns_sorted, overwrite_returns_latest, delete_hides_key)hero_codescalers_kvs(two_node_sync): 3 passed (tombstone_beats_older_put, lww_later_write_wins, two_nodes_converge_on_put)hero_codescalers_sdk(doc-tests): 1 passednu_exec(doc-tests): 2 passedAdditional warning during test build:
hero_codescalers_server: associated functionopen_memoryis never used (src/model/state.rs:26)Pull request opened: geomind_code/hero_codescalers#3
This PR implements the changes discussed in this issue.