Commit Graph

17 Commits

Author SHA1 Message Date
Daniel Pupius
8130158c1e feat(cache): priority-based eviction with age protection and Bélády approximation
Replace the flat circular buffer with NodeAwareCache, a smarter eviction
strategy for historical mesh packet data:

- Packets younger than 1 hour are never evicted (recent traffic preserved)
- Under pressure, evict from the lowest-priority type first (neighbor-info
  outlasts node-info; chat messages outlast everything)
- Within a priority tier, evict from the most recently active source node —
  that node will resend soonest, so its old packet is cheapest to lose
  (Bélády approximation; protects flaky/distant node history)
- Node retention window still applies: silent nodes' packets are excluded
  from GetAll and pruned proactively before priority eviction runs

Also:
- Add --cache-retention flag (default 3h) and raise --cache-size default to 5000
- Fix decoder error strings (replace verbose Go errors with short codes)
- Add HTTP security headers middleware to server
- Fix broker dispatchLoop deadlock on source channel close
- Fix make gen-proto scanning web/node_modules for .proto files
- Fix tools target always reinstalling protoc-gen-go (handles stale arch binary)
- Move server port from 8080 to 5446; update Dockerfile, docker-compose, moat.yaml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 20:23:50 +00:00
Daniel Pupius
69a31ca406 Split routers and extend mesh traffic retention (#1)
* Split routers on dashboard and extend retention periods

- Add Router node type with 12-hour stale timeout (vs 30 min for regular nodes)
- Create RouterList component to display router nodes separately
- Update NodeList to filter out routers (similar to gateways)
- Add yellow color scheme for router nodes to distinguish from gateways (green) and nodes (blue)
- Extend mesh traffic retention across the board:
  - Client-side packet age filter: 12h → 24h
  - Broker cache size: 50 → 200 packets
  - Messages per channel: 100 → 500

* Update regular node activity threshold to 60 minutes

* Fix TypeScript errors in router filtering logic

* Fix docker-build to use buildx explicitly with --load flag

* Add default empty value for MESHSTREAM_GOOGLE_MAPS_API_KEY in docker-build

* Restructure docker buildx command to fix path argument parsing

* Remove trailing backslash before build context path in docker-build

* Quote build args and separate path argument in docker-build
2026-01-06 12:25:34 -08:00
Daniel Pupius
5b8bee8736 Script for building and pushing docker to ECR 2025-05-02 14:39:38 -07:00
Daniel Pupius
622e37ae53 Another try at fixing proto in CI 2025-05-02 13:04:56 -07:00
Daniel Pupius
1c7bfcd330 Another try at fixing proto in CI 2025-05-02 12:32:09 -07:00
Daniel Pupius
2ef4cf1166 Debug proto in CI 2025-05-02 12:28:04 -07:00
Daniel Pupius
6675c50e97 GitHub actions 2025-05-02 12:22:45 -07:00
Daniel Pupius
e9fa0104e3 Docker set up and fixes for build 2025-05-01 15:34:16 -07:00
Daniel Pupius
ae496ace52 Makefile to make it easier to monitor bay mesh 2025-04-30 12:59:37 -07:00
Daniel Pupius
64b026646d Use env and flags for configuration 2025-04-30 10:36:45 -07:00
Daniel Pupius
6844d575c4 Initial skeleton for web application 2025-04-22 13:26:35 -07:00
Daniel Pupius
86380cccf9 Refactor protos 2025-04-21 15:40:10 -07:00
Daniel Pupius
41ee61b59a Updated logging configuration for dev and json for prod 2025-04-21 14:16:35 -07:00
Daniel Pupius
1c96f0b9f4 Add Logista for JSON log processing
- Add .logista.yaml configuration for prettier log output
- Add github.com/dpup/logista as a go tool
- Update Makefile run target to pipe output through logista
- Configure the format to show timestamp, level, and message with colors
- Add special formatting for different message types
- Display telemetry and position data in readable format
- Add table display for remaining structured fields
2025-04-21 11:56:31 -07:00
Daniel Pupius
93c0e9e94f Refactor decoder to use protocol buffers directly for ServiceEnvelope decoding 2025-04-18 17:48:21 -07:00
Daniel Pupius
5b8d0c6326 Update build process and add proper .gitignore and .env.example 2025-04-18 16:18:16 -07:00
Daniel Pupius
af958ff295 Add protocol buffer generation and packet decoder 2025-04-18 16:13:41 -07:00