feat: enable Velocity modern forwarding via -Dminestom-velocity-secret - #205
Merged
Conversation
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.
Contributor
Test results 300 files 300 suites 2m 1s ⏱️ Results for commit a7668af. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Cygnus could not run behind a Velocity proxy at all.
Minestom binds the
Authto theServerProcessinsideMinecraftServer.init(Auth)and offers no way to swap it afterwards — the oldextras.velocity.VelocityProxyentry point is gone.ExtensionBootstrap.init()called the no-argMinecraftServer.init(), which hardcodesAuth.Offline, so there was no point in the startup sequence at which forwarding could be turned on.Change
ServiceBootstrap.resolveAuth()reads-Dminestom-velocity-secret— theforwarding.secretof the proxy in front of the service — and returnsAuth.Velocity. Absent or blank falls back toAuth.Offline, which is what a standalone run needs.CygnusLoaderandSetupLoadernow start viaExtensionBootstrap.init(ServiceBootstrap.resolveAuth()).minestom-extensionsbumped to 2.2.0, which adds theinit(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.Velocitywould reject the empty key with an exception naming neither the property nor its origin. The secret itself is never logged.Usage
Verification
./gradlew build --refresh-dependenciesgreen against the published 2.2.0.ServiceBootstrapTest: default offline, secret set, secret trimmed, blank falls back to offline.Authreaches the server process, not the wire protocol.