Kamune v0.4.0
v0.4.0
Core Library
Conninterface now embedsReadWriter.- Remove
Routertype; deleterouter.go, clean uproutes.go. - Centralize sentinel errors into root
errors.go. - Add
AppVersiontoPeerstruct; consolidateRemotePeer()method. - Add Ping/Pong routes with configurable keep-alive.
- Add
SettingsBucket,GetSettings/SetSettingsin storage (encrypted at rest). - Add deterministic
Pseudonym(seed)with expanded word pools. - Expand fingerprint emoji pool from 64 to 96 entries.
- Delegate HPKE exchange from root to
pkg/exchange; remove duplicateexchange.go. - Merge ciphertext and public key into single exchange write (3 messages instead of 4).
- Add
ErrPeerDisconnectedsentinel;Transport.Close()returns gracefully instead of abrupt disconnect. - Use local-time keys and versioned value envelope in chat storage.
- Remove QR code fingerprint display.
- Fix
uint16overflow inwriteLen(checklen(data)before cast). - Track current read/write deadlines to prevent Ping timeout from being overwritten by read timeout.
- Fix data race in
Server.ListenAndServe(lock aroundclosed/listeneraccess). - Fix panic recovery in
Dialer.handshakeandServer.serve(close conn and return error instead of nil). - Fix
RelayListener.Closedata race (lockmuaroundconn.Close). - Fix
RelayListener.closeFndouble-call guard withsync.Once.
Relay
- Full service layer rewrite: replace with hub + session architecture.
- Remove old storage layer (command/logger/query/queue/store) and model packages.
- Add TCP adapter and TCP handler for direct connections.
- Extract
pkg/relayconnwith auth, dial, listener, transport modules. - Add token+password authentication flow.
- Replace box proto with updated relay proto.
- Update config, router, and WebSocket handler for new architecture.
- Add
Stop()method toRelayListener(prevents new accepts without killing active connections). - Auto-generate self-signed TLS certificates as PEM; enable by default.
- Close peer channel on disconnect to prevent blocking.
- Add cross-platform build script; simplify Makefile.
- Simplify
--versionoutput to show kamune dependency version. - Fix expired session goroutine leak (close listener/dialer channels before delete in
purgeExpired). - Fix TOCTOU in session
Recipient(hold lock through switch instead of releasing early). - Send TCP/TLS startup errors to
errChinstead of only logging. - Fix double-read from
exitChin TCP/TLS-only mode (read into variable). - Add 30s context timeout for WebSocket handshake accept (
wsAdapter.SetDeadlineis a no-op). - Enforce
MaxMessageSizein TCP and TLS adapters. - Log
handlePingwrite errors instead of silent discard. - Randomize self-signed TLS certificate serial number.
- Add
// TODOfor unimplemented rate limiting.
Bus
- Fingerprint computed on demand from public key (remove stored emojiFP/b64FP/hexFP fields).
- Native OS menu bar with Fingerprint submenu (Copy as Hex/Sum/Base64) with toast feedback.
- Session naming and version display.
- Persist name and verification mode across restarts; add MyName editing.
- KAMUNE_DB_PATH and KAMUNE_DB_PASSPHRASE env var support.
- Keychain UX improvements for relay credentials.
- Update relay.go for new relayconn API (token + password).
- Redesign frontend for multi-token relay, inline rename, and continuous session management.
- Add multi-token relay support with start cancellation and TLS toggle.
- Add native dialog confirmations and server restart on setting changes.
- Restructure
onMountevent registration to fix duplicate Wails event handlers. - Use
Stop()for graceful relay token consumption. - Add server transport tracking, verifying connection state, and log export to file.
- Refresh history session list on session close; add missing fields to session info dialog.
- Handle
ErrPeerDisconnectedin receive loop. - Update build script output path; add
-s -wlinker flags. - Add keychain error
defaultcase (log warning instead of silent fallthrough). - Offload
ExportLogsToFileto goroutine with error reporting. - Extract
removeSessionhelper (DRY, avoid nil-slice panic on shutdown). - Guard stale verification channel send with
select/default(prevent goroutine leak on slow consumer). - Remove hardcoded
appVersiontest (version now referenceskamune.AppVersion). - Modernize test style:
for i := range N,wg.Goin place of manualwg.Add/go/wg.Done.
TUI
- Full rewrite from CLI flag dispatch to interactive bubbletea menu TUI.
- Multi-state architecture (welcome, input, connecting, verify, chat, history).
- Interactive DB path and passphrase prompts before alt-screen.
- Direct TCP client/server, relay client/server, and chat history browsing.
- Peer verification screen with emoji + hex fingerprint display.
- Chat with viewport/textarea, message history loading, and send/receive.
- Version mismatch warning during connection.
- Handle
ErrPeerDisconnectedin receive loop.
Daemon
- Initial protocol documentation in
docs/DAEMON.md. - Handle
ErrPeerDisconnectedin receive loop. - Fix shutdown and connection lifecycle races.
- Use env var for passphrase instead of interactive prompt.
- Handle
RoutePingwith pong response. - Consistent base64 encoding for public keys.
Documentation
- SPEC.md updated to v0.4.0 with Ping/Pong, Server/Dialer, Keep-Alive.
- Add
docs/RELAY.mdwith stateless relay architecture. - Add
docs/DAEMON.mdwith daemon protocol documentation. - Update README with revised project status.
Miscellaneous
- Regenerate protobuf bindings for relay and box schemas.
- Fix Zed debug launch configuration paths.
- Bump module version to v0.4.0.
- Add build targets for relay and bus in root Makefile.
Full Changelog: v0.3.0...v0.4.0