Skip to content

feat: enable Velocity modern forwarding via -Dminestom-velocity-secret - #205

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/velocity-modern-forwarding
Aug 26, 2026
Merged

feat: enable Velocity modern forwarding via -Dminestom-velocity-secret#205
TheMeinerLP merged 1 commit into
mainfrom
feat/velocity-modern-forwarding

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Problem

Cygnus could not run behind a Velocity proxy at all.

Minestom binds the Auth to the ServerProcess inside MinecraftServer.init(Auth) and offers no way to swap it afterwards — the old extras.velocity.VelocityProxy entry point is gone. ExtensionBootstrap.init() called the no-arg MinecraftServer.init(), which hardcodes Auth.Offline, so there was no point in the startup sequence at which forwarding could be turned on.

Change

  • ServiceBootstrap.resolveAuth() reads -Dminestom-velocity-secret — the forwarding.secret of the proxy in front of the service — and returns Auth.Velocity. Absent or blank falls back to Auth.Offline, which is what a standalone run needs.
  • CygnusLoader and SetupLoader now start via ExtensionBootstrap.init(ServiceBootstrap.resolveAuth()).
  • minestom-extensions bumped to 2.2.0, which adds the init(Auth) overload this needs (feat: allow passing an Auth to ExtensionBootstrap.init minestom-extensions#7, released and published).

A blank value is treated as unset rather than passed through: an empty secret is a start script whose variable did not expand, and Auth.Velocity would reject the empty key with an exception naming neither the property nor its origin. The secret itself is never logged.

Usage

java -Dminestom-velocity-secret="$VELOCITY_SECRET" -jar cygnus.jar

Verification

  • ./gradlew build --refresh-dependencies green against the published 2.2.0.
  • Four new cases in ServiceBootstrapTest: default offline, secret set, secret trimmed, blank falls back to offline.
  • Not covered: a handshake through a running Velocity proxy — the tests pin that the Auth reaches the server process, not the wire protocol.

Minestom binds the Auth to the ServerProcess in MinecraftServer.init(Auth)
and offers no way to swap it afterwards, and ExtensionBootstrap.init() used
to hardcode Auth.Offline - so neither :game nor :setup could ever run behind
a Velocity proxy. minestom-extensions 2.2.0 adds the init(Auth) overload
this needs.

ServiceBootstrap.resolveAuth() reads -Dminestom-velocity-secret, the
forwarding.secret of the proxy in front of the service. Absent or blank, the
server keeps authenticating in offline mode: an empty value is a start
script whose variable did not expand, not a deliberate choice, and Minestom
would reject the empty key with an exception naming neither the property nor
where it came from. The secret itself is never logged.
@github-actions

Copy link
Copy Markdown
Contributor

Test results

  300 files    300 suites   2m 1s ⏱️
  403 tests   398 ✅  5 💤 0 ❌
1 212 runs  1 197 ✅ 15 💤 0 ❌

Results for commit a7668af.

@TheMeinerLP
TheMeinerLP merged commit 0831751 into main Aug 26, 2026
8 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/velocity-modern-forwarding branch August 26, 2026 21:35
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