github aeroxy/tunnix 0.4.0
tunnix v0.4.0

5 hours ago

1. High-Level Summary (TL;DR)

  • Impact: High
  • Key Changes:
    • File Transfer: Introduced tunnix push and tunnix pull subcommands, allowing users to securely upload and download files or directories over the encrypted tunnel.
    • Streaming Compression: Transfers are packed into tar archives and compressed with zstd on-the-fly, reducing network footprint.
    • Opt-in Security: File transfers provide arbitrary read/write access and must be explicitly enabled on the server via the --allow-transfer flag or allow_transfer = true in the configuration.
    • Global Config Resolution: Added automatic config file discovery that falls back from explicit flags to ./config.toml, and finally to ~/.config/tunnix/config.toml, improving user ergonomics.

2. Visual Overview (Code & Logic Map)

Client-Server Data Transfer-2026-06-06-092220

3. Detailed Change Analysis

Configuration & Tooling

  • What Changed: Added global config resolution paths, defaulting to the XDG config path. Updated CLI flags and config structs to support allow_transfer. (Source: src/main.rs, src/config.rs)

Configuration Changes:

Key Old Value New Value Description
allow_transfer N/A false (default) Opt-in server setting to permit clients to read/write files via push/pull.

Dependencies:

Package Old Ver New Ver
zstd N/A 0.13
tar N/A 0.4

Network Protocol & Server

  • What Changed: Expanded the Message enum to include Push and Pull intents. The server intercepts these in handle_send(), checks if transfers are enabled, and spawns the appropriate relay tasks. Added robust error handling, reconnect retries, and watchdogs to tear down broken transfer streams gracefully without deadlocking. (Source: src/protocol.rs, src/server.rs)

Protocol Additions:

Param Type Required Description
Message::Pull Protocol Yes Client asks to download paths. Server streams back a zstd-compressed tar archive.
Message::Push Protocol Yes Client announces an upload. Client streams a zstd-compressed tar archive.

Archive Pipeline (Sync-to-Async Bridge)

  • What Changed: Because tar and zstd operate on synchronous Read/Write traits, the application spawns blocking threads to compress and decompress data. This is bridged to the async networking world using bounded tokio::sync::mpsc channels. This ensures a bounded memory footprint and proper backpressure across the network. (Source: src/archive.rs)

4. Impact & Risk Assessment

  • Breaking Changes: None. The updates are fully backward compatible as new commands and protocol messages are purely additive.
  • Security Risks: ⚠️ The file transfer feature grants arbitrary file read/write permissions to anyone with the password. This is effectively RCE-adjacent. Mitigation is in place by making it strictly opt-in (--allow-transfer) and displaying a loud warning upon startup.

Don't miss a new tunnix release

NewReleases is sending notifications on new releases.