Skip to content

Kamune v0.4.0

Choose a tag to compare

@hossein1376 hossein1376 released this 03 Jun 15:01
v0.4.0
6cf3c8d

v0.4.0

Core Library

  • Conn interface now embeds ReadWriter.
  • Remove Router type; delete router.go, clean up routes.go.
  • Centralize sentinel errors into root errors.go.
  • Add AppVersion to Peer struct; consolidate RemotePeer() method.
  • Add Ping/Pong routes with configurable keep-alive.
  • Add SettingsBucket, GetSettings/SetSettings in 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 duplicate exchange.go.
  • Merge ciphertext and public key into single exchange write (3 messages instead of 4).
  • Add ErrPeerDisconnected sentinel; 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 uint16 overflow in writeLen (check len(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 around closed/listener access).
  • Fix panic recovery in Dialer.handshake and Server.serve (close conn and return error instead of nil).
  • Fix RelayListener.Close data race (lock mu around conn.Close).
  • Fix RelayListener.closeFn double-call guard with sync.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/relayconn with 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 to RelayListener (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 --version output 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 errCh instead of only logging.
  • Fix double-read from exitCh in TCP/TLS-only mode (read into variable).
  • Add 30s context timeout for WebSocket handshake accept (wsAdapter.SetDeadline is a no-op).
  • Enforce MaxMessageSize in TCP and TLS adapters.
  • Log handlePing write errors instead of silent discard.
  • Randomize self-signed TLS certificate serial number.
  • Add // TODO for 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 onMount event 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 ErrPeerDisconnected in receive loop.
  • Update build script output path; add -s -w linker flags.
  • Add keychain error default case (log warning instead of silent fallthrough).
  • Offload ExportLogsToFile to goroutine with error reporting.
  • Extract removeSession helper (DRY, avoid nil-slice panic on shutdown).
  • Guard stale verification channel send with select/default (prevent goroutine leak on slow consumer).
  • Remove hardcoded appVersion test (version now references kamune.AppVersion).
  • Modernize test style: for i := range N, wg.Go in place of manual wg.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 ErrPeerDisconnected in receive loop.

Daemon

  • Initial protocol documentation in docs/DAEMON.md.
  • Handle ErrPeerDisconnected in receive loop.
  • Fix shutdown and connection lifecycle races.
  • Use env var for passphrase instead of interactive prompt.
  • Handle RoutePing with 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.md with stateless relay architecture.
  • Add docs/DAEMON.md with 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