Skip to content

feat: replace Rust implementation with C#/.NET rewrite - #16

Merged
pysio2007 merged 2 commits into
mainfrom
csharp
Jul 25, 2026
Merged

feat: replace Rust implementation with C#/.NET rewrite#16
pysio2007 merged 2 commits into
mainfrom
csharp

Conversation

@pysio2007

@pysio2007 pysio2007 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Wholesale replacement of the Rust whois-server with the .NET 10 rewrite developed in the standalone whois-server-c-sharp repository, squashed from that repo's Phase 1-7 history (10 commits, HEAD 4ad975e).

Removed:

  • the entire Rust tree (src/, Cargo.toml, Cargo.lock, examples/)
  • the Lua plugin system (plugins/) — replaced by native C# plugins
  • Rust-era docs (ADVANCED_FEATURES.md, LIBRARY_USAGE.md, RUST_LIBRARY.md, DEPLOYED.md, AGENTS.md)
  • LICENSE_HEADER (the C# sources carry no per-file license banner)

Added:

  • WhoisServer.Core — query engine, suffix dispatcher, SQLite key/value stores, response-patch DSL, WHOIS colour protocol
  • WhoisServer.Services(+.Dn42) — network/package/entertainment services
  • WhoisServer.Plugins — native plugin host with isolated load contexts
  • WhoisServer.Host — TCP:43 server and web dashboard/REST API
  • test projects for Core, Plugins, and integration (61 tests)

Kept unchanged from the Rust tree: patches/ and its two maintenance scripts. That directory is not a build artifact — PatchManager's manifest URL points at patches/patches.json on this repository's main branch, so it is the published source of truth every deployed server fetches from, and dropping it would silently break patch updates in the field. All three patch digests still verify against the manifest.

Licence: unchanged AGPL-3.0. The full text carries over byte-identical, renamed LICENSE.txt -> LICENSE for the conventional filename, alongside the existing COPYRIGHT notice.

Versioning: VersionPrefix 0.0.1 in Directory.Build.props stamps every assembly, overridable from CI. RdapClient's outbound User-Agent now reads that off the assembly instead of carrying a hardcoded literal, so it can no longer drift out of step with the declared version.

Docs and pipelines replacing the Cargo-tied ones:

  • README.md, written against a Release publish rather than the migration plan: CLI flags, the nine environment variables the code actually reads, the cache/ layout, all 60 registered query suffixes, the seven HTTP endpoints, DN42 sync, the patch DSL, the plugin manifest/permission model, and feature-flag cut builds. Two easily-missed behaviours are called out: the host reads process environment variables only and never parses a .env file (only plugins/.plugins.env, and only for plugins), and Feature_Web=false still binds the web port and 404s rather than not listening.
  • Dockerfile, two-stage on the .NET 10 SDK/ASP.NET images: project-file-only restore for a cacheable NuGet layer; framework-dependent publish since the runtime stage already carries ASP.NET Core; cross-build via --platform=$BUILDPLATFORM + -a $TARGETARCH so the arm64 image compiles natively rather than under QEMU; git installed because the DN42 backend shells out to it; a FEATURES build arg so cut builds work through docker build; LICENSE/COPYRIGHT carried since the image redistributes AGPL-3.0 work.
  • ci.yml — warning-free Release build (-warnaserror), the two offline test projects as the blocking gate, dotnet format --verify-no-changes, and a cut-build matrix. The every-feature-off job derives its flag list from Directory.Build.props rather than hardcoding it, so a newly added flag is covered without touching the workflow. The live-network integration suite runs continue-on-error, since a red mark there is as likely to be an upstream registry rate-limiting the runner as a real regression.
  • docker.yml — buildx to GHCR for linux/amd64 + linux/arm64, pushed on main and v* tags, built-but-not-pushed on pull requests.
  • release.yml — on v* tags, self-contained linux-x64/arm64 tarballs with sha256 sums, the example plugin and the licence, attached to a GitHub Release; the tag drives VersionPrefix. Not trimmed, as the DI/JSON paths are reflection-heavy enough to make PublishTrimmed a correctness risk.

Also fixes plugins-src/Weather so -p:Feature_Plugins=false builds at all. The example plugin is a solution member but was the one project missing the gate that WhoisServer.Plugins and WhoisServer.Plugins.Tests both carry, so it kept referencing IWhoisPlugin after that contract assembly was deliberately emptied and the solution build failed with CS0234/CS0246 — the exact failure WhoisServer.Plugins.Tests' own .csproj comment describes avoiding. Its plugins/ copy target is gated to match, and the no-plugins entry in the CI matrix now covers the combination.

Feature parity notes carried over from the rewrite plan: the SSH server (port 2222) and the Lua plugin system are intentionally dropped, the DN42 online-HTTP-fetch backend is replaced by a single git-backed implementation, and LMDB is replaced by SQLite behind the same IKvStore abstraction. RDAP stays opt-in (Feature_RdapBackend defaults false) to match upstream's real default, though the explicit -RDAP suffix now works in every build instead of requiring a recompile.

Verified: Release build warning-free, all 61 tests pass, dotnet format clean, every CI matrix combination plus all-44-features-off builds green, and the published output serves real WHOIS, RDAP and HTTP queries with patches applying end-to-end. The container image itself is not build-tested — no container runtime was available in this environment.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Wholesale replacement of the Rust whois-server with the .NET 10 rewrite
developed in the standalone whois-server-c-sharp repository, squashed from
that repo's Phase 1-7 history (10 commits, HEAD 4ad975e).

Removed:
- the entire Rust tree (src/, Cargo.toml, Cargo.lock, examples/)
- the Lua plugin system (plugins/) — replaced by native C# plugins
- Rust-era docs (ADVANCED_FEATURES.md, LIBRARY_USAGE.md, RUST_LIBRARY.md,
  DEPLOYED.md, AGENTS.md)
- LICENSE_HEADER (the C# sources carry no per-file license banner)

Added:
- WhoisServer.Core — query engine, suffix dispatcher, SQLite key/value
  stores, response-patch DSL, WHOIS colour protocol
- WhoisServer.Services(+.Dn42) — network/package/entertainment services
- WhoisServer.Plugins — native plugin host with isolated load contexts
- WhoisServer.Host — TCP:43 server and web dashboard/REST API
- test projects for Core, Plugins, and integration (61 tests)

Kept unchanged from the Rust tree: patches/ and its two maintenance
scripts. That directory is not a build artifact — PatchManager's manifest
URL points at patches/patches.json on this repository's main branch, so it
is the published source of truth every deployed server fetches from, and
dropping it would silently break patch updates in the field. All three
patch digests still verify against the manifest.

Licence: unchanged AGPL-3.0. The full text carries over byte-identical,
renamed LICENSE.txt -> LICENSE for the conventional filename, alongside the
existing COPYRIGHT notice.

Versioning: VersionPrefix 0.0.1 in Directory.Build.props stamps every
assembly, overridable from CI. RdapClient's outbound User-Agent now reads
that off the assembly instead of carrying a hardcoded literal, so it can no
longer drift out of step with the declared version.

Docs and pipelines replacing the Cargo-tied ones:
- README.md, written against a Release publish rather than the migration
  plan: CLI flags, the nine environment variables the code actually reads,
  the cache/ layout, all 60 registered query suffixes, the seven HTTP
  endpoints, DN42 sync, the patch DSL, the plugin manifest/permission
  model, and feature-flag cut builds. Two easily-missed behaviours are
  called out: the host reads process environment variables only and never
  parses a .env file (only plugins/.plugins.env, and only for plugins), and
  Feature_Web=false still binds the web port and 404s rather than not
  listening.
- Dockerfile, two-stage on the .NET 10 SDK/ASP.NET images: project-file-only
  restore for a cacheable NuGet layer; framework-dependent publish since the
  runtime stage already carries ASP.NET Core; cross-build via
  --platform=$BUILDPLATFORM + `-a $TARGETARCH` so the arm64 image compiles
  natively rather than under QEMU; `git` installed because the DN42 backend
  shells out to it; a FEATURES build arg so cut builds work through
  `docker build`; LICENSE/COPYRIGHT carried since the image redistributes
  AGPL-3.0 work.
- ci.yml — warning-free Release build (-warnaserror), the two offline test
  projects as the blocking gate, dotnet format --verify-no-changes, and a
  cut-build matrix. The every-feature-off job derives its flag list from
  Directory.Build.props rather than hardcoding it, so a newly added flag is
  covered without touching the workflow. The live-network integration suite
  runs continue-on-error, since a red mark there is as likely to be an
  upstream registry rate-limiting the runner as a real regression.
- docker.yml — buildx to GHCR for linux/amd64 + linux/arm64, pushed on main
  and v* tags, built-but-not-pushed on pull requests.
- release.yml — on v* tags, self-contained linux-x64/arm64 tarballs with
  sha256 sums, the example plugin and the licence, attached to a GitHub
  Release; the tag drives VersionPrefix. Not trimmed, as the DI/JSON paths
  are reflection-heavy enough to make PublishTrimmed a correctness risk.

Also fixes plugins-src/Weather so -p:Feature_Plugins=false builds at all.
The example plugin is a solution member but was the one project missing the
<Compile Remove> gate that WhoisServer.Plugins and WhoisServer.Plugins.Tests
both carry, so it kept referencing IWhoisPlugin after that contract assembly
was deliberately emptied and the solution build failed with CS0234/CS0246 —
the exact failure WhoisServer.Plugins.Tests' own .csproj comment describes
avoiding. Its plugins/ copy target is gated to match, and the no-plugins
entry in the CI matrix now covers the combination.

Feature parity notes carried over from the rewrite plan: the SSH server
(port 2222) and the Lua plugin system are intentionally dropped, the DN42
online-HTTP-fetch backend is replaced by a single git-backed
implementation, and LMDB is replaced by SQLite behind the same IKvStore
abstraction. RDAP stays opt-in (Feature_RdapBackend defaults false) to
match upstream's real default, though the explicit -RDAP suffix now works
in every build instead of requiring a recompile.

Verified: Release build warning-free, all 61 tests pass, dotnet format
clean, every CI matrix combination plus all-44-features-off builds green,
and the published output serves real WHOIS, RDAP and HTTP queries with
patches applying end-to-end. The container image itself is not build-tested
— no container runtime was available in this environment.
fix(dn42): update registry URL for DN42 repository
Copilot AI review requested due to automatic review settings July 25, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@pysio2007
pysio2007 merged commit d7feb94 into main Jul 25, 2026
22 checks passed
@pysio2007
pysio2007 deleted the csharp branch July 25, 2026 17:56
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.

2 participants