Skip to content

v0.10.0: TOML config files + adoption polish - #44

Merged
guyte149 merged 3 commits into
masterfrom
feat/config-toml-and-adoption-polish
May 5, 2026
Merged

v0.10.0: TOML config files + adoption polish#44
guyte149 merged 3 commits into
masterfrom
feat/config-toml-and-adoption-polish

Conversation

@guyte149

@guyte149 guyte149 commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

Two distinct buckets of work that landed together because they share a version bump (CI requires one per PR):

1. TOML config files (--config <PATH>)

rusnel server and rusnel client both gain a --config <PATH> flag pointing at a TOML file with [server] and/or [client] sections. Schema mirrors the CLI flags one-for-one (snake_case); a single file can hold both sections.

  • Precedence: explicit CLI flag > config file > built-in default. Detection of "explicit-on-CLI" uses ArgMatches::value_source (same approach ripgrep / bat use).
  • TLS-mode group is atomic: passing any TLS-mode flag on the CLI (--insecure / --tls-self-signed / --tls-cert / --tls-key / --tls-ca on the server, equivalents on the client) causes all of the file's TLS-mode keys to be ignored — no ambiguous mixing of e.g. tls_self_signed = true with --tls-cert.
  • Unknown keys rejected (#[serde(deny_unknown_fields)]) so typos surface as parse errors.
  • Positional <server> / <remote>... can be supplied by the file when omitted from the CLI; CLI wins when both are present.
  • 6 unit tests in src/config_file.rs cover parsing happy-path + every error mode (typos, invalid enum values, empty file).
  • 6 end-to-end tests in tests/config_file.rs spawn the actual binary and verify the file drives it (including CLI override of file values).
  • Annotated reference at examples/rusnel.toml.

2. Release + adoption infrastructure

  • .github/workflows/release.yml: on v* tag push, builds prebuilt binaries for x86_64/aarch64 Linux (gnu + musl), macOS (Intel + Apple Silicon), Windows x86_64, attaches sha256 checksums to a GitHub Release, and pushes a multi-arch (amd64 + arm64) Docker image to GHCR tagged :vX.Y.Z, :X.Y, :latest.
  • Dockerfile (multi-stage musl builder → distroless runtime, ~10 MB image, runs as non-root) + .dockerignore.
  • README rewrite: tagline, "Why Rusnel?" comparison table vs chisel / frp / ssh -L, concrete benchmark numbers near the top (2.07x throughput vs chisel, 4.3x better p99 latency, pulled from existing benchmark/iperf/results/loopback/results.json), 60-second quickstart, expanded Features list surfacing previously-hidden bits (stdio:, RUSNEL_EMBED_*, rusnel ctl, JSON logs, Happy Eyeballs), Configuration-file section, Docker subsection.
  • ROADMAP.md: extracted from the old README ## TODO so the README stays focused.
  • CONTRIBUTING.md + SECURITY.md: project hygiene that infosec users specifically look for.
  • .github/ISSUE_TEMPLATE/{bug_report,feature_request,config}.yml + .github/PULL_REQUEST_TEMPLATE.md: structured reporting that routes security issues to private disclosure and the version-bump checklist into the PR form.
  • docs/launch-post.md: drafts for HN / r/rust / r/selfhosted / lobste.rs and an awesome-list submission checklist (private to the repo, not user-visible from the README).

Notable design choices

  • The TOML schema is a private module (mod config_file in main.rs-only, not exported from the library) because it's tightly coupled to the CLI shape, not to any library API. tests/config_file.rs exercises it through the real binary instead of through library symbols.
  • Switched from Args::parse_from(...) to try_get_matches_from + from_arg_matches so we can read value_source for the merge logic. Same struct, same parser, just one more layer of indirection.
  • The atomic TLS-mode merge rule was the trickiest call. The alternative — applying file values field-by-field — produces silently surprising results (file says tls_self_signed = true, you pass --tls-cert to override, but resolve_server_tls picks self-signed first and ignores your cert). The atomic rule means the CLI's TLS choice is total whenever it's specified.

Stats

  • 150 tests passing (was 138), cargo fmt --all -- --check clean, cargo clippy --all -- -D warnings clean.
  • Version bumped 0.9.1 -> 0.10.0 (minor — new flag, no breaking changes).

Made with Cursor

guyte149 and others added 3 commits May 5, 2026 16:34
Adds `--config <PATH>` to `rusnel server` and `rusnel client` so
non-trivial deployments don't need 200-character ExecStart lines, and
ships the project hygiene + release infrastructure that lets the
project actually be discovered and adopted.

### TOML config support

- `--config <PATH>` on both subcommands. TOML schema mirrors the CLI
  flags one-for-one (snake_case) under `[server]` / `[client]`
  sections; a single file can hold both.
- Precedence: explicit CLI flag > config file > built-in default.
  Detection of "explicit-on-CLI" uses `ArgMatches::value_source`
  (same pattern ripgrep / bat use).
- TLS-mode group is atomic: any TLS-mode flag on the CLI causes all
  of the file's TLS-mode keys to be ignored, so there's no ambiguity
  when overriding e.g. `tls_self_signed = true` with explicit
  `--tls-cert/--tls-key`.
- Unknown keys are rejected (`#[serde(deny_unknown_fields)]`) so
  typos surface as parse errors instead of silently no-opping.
- Positional `<server>` / `<remote>...` can come from either the
  file or the CLI; CLI wins when both are present.
- 6 unit tests for parsing + 6 end-to-end tests that spawn the real
  binary and assert the config file actually drives it.
- Annotated example at `examples/rusnel.toml` covering every key.

### Release infrastructure

- `.github/workflows/release.yml` — on `v*` tag push, builds
  prebuilt binaries for x86_64/aarch64 Linux (gnu + musl), macOS
  (Intel + Apple Silicon), and Windows x86_64, attaches sha256
  checksums to a GitHub Release, and pushes a multi-arch
  (amd64 + arm64) Docker image to GHCR tagged `:vX.Y.Z`, `:X.Y`,
  `:latest`.
- `Dockerfile` (multi-stage, musl builder → distroless runtime;
  ~10 MB final image, runs as non-root) + `.dockerignore`.

### README + positioning

- New tagline + "Why Rusnel?" comparison table vs chisel / frp /
  `ssh -L`.
- Concrete numbers near the top: 779.55 Mbps vs chisel's 377.42
  (2.07x), p99 latency 0.463 ms vs 2.005 ms (4.3x better),
  pulled from `benchmark/iperf/results/loopback/results.json`.
- 60-second quickstart, expanded Features list surfacing
  previously-hidden selling points (`stdio:`, `RUSNEL_EMBED_*`,
  `rusnel ctl`, JSON logs, SOCKS5-proxy chaining, Happy Eyeballs).
- New "Configuration file" section documenting the schema + the
  TLS-mode override rule.
- Docker install subsection (with the `:8080/udp` reminder
  everyone forgets about QUIC).

### Project hygiene

- `ROADMAP.md` extracted from the old `## TODO` README section so
  the README stays focused.
- `CONTRIBUTING.md` (CI requirements, version-bump rule,
  `clippy::unwrap_used` convention).
- `SECURITY.md` (private disclosure, scope, hardening notes).
- `.github/ISSUE_TEMPLATE/{bug_report,feature_request,config}.yml`
  routing security issues to private reporting and questions to
  Discussions.
- `.github/PULL_REQUEST_TEMPLATE.md` with the version-bump checklist.
- `docs/launch-post.md` with launch drafts for HN / r/rust /
  r/selfhosted / lobste.rs and an awesome-list submission checklist.

Co-authored-by: Cursor <cursoragent@cursor.com>
Per review feedback:

- Remove CONTRIBUTING.md, SECURITY.md, and docs/launch-post.md.
- Restore the original `## Features` bullet list verbatim instead of
  the rewritten one.
- Drop the README's footer Contributing section that linked to the
  removed docs.
- Update the bug-report issue template to point at GitHub's private
  vulnerability reporting URL directly instead of the deleted
  SECURITY.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Remove `## Why Rusnel?` comparison table and `### Numbers` table.
- Replace the multi-line tagline blockquote and the "punches through
  NAT…" paragraph with the original one-line `## Description`.
- Shorten `Quickstart` heading (drop the "60 seconds" suffix) and
  remove the trailing pitch sentence.
- Delete `.github/ISSUE_TEMPLATE/{bug_report,feature_request,config}.yml`
  per review feedback.

Co-authored-by: Cursor <cursoragent@cursor.com>
@guyte149
guyte149 merged commit e89230c into master May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant