Skip to content

feat(minestom): read the velocity secret from a file in the demo lobby - #54

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/demo-secret-file
Nov 25, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
feat/demo-secret-file

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Problem

The Grus demo lobby only accepts the Velocity forwarding secret as an environment variable. Lobbies running in Kubernetes get it injected from a secret, but the Grus agent runs on hosts outside Kubernetes and has no way to pass that secret in. Those lobbies either start without forwarding, which breaks player identity behind the proxy, or cannot be started at all.

Approach

The lobby now also accepts a file path. If the secret variable is empty and the file variable is set, the lobby reads the secret from that file, relative to its working directory, and strips surrounding whitespace. If the file is missing, unreadable or blank, startup stops with a message naming the file. The lobby never starts without forwarding when a secret file was requested. The secret itself is never logged.

Testing

Unit tests cover the resolution rules: environment precedence, empty variables, trimming, relative paths, and the failure cases. Run with ./gradlew :grus-demo-minestom:test :grus-demo-minestom:shadowJar.

The demo lobby only accepted the Velocity forwarding secret through the
VELOCITY_SECRET environment variable, which hosts outside Kubernetes
cannot inject. VELOCITY_SECRET_FILE now names a file holding the secret,
read relative to the working directory and trimmed. A requested file that
is missing, unreadable or blank stops startup instead of running without
forwarding.
@TheMeinerLP
TheMeinerLP merged commit 44129f0 into main Nov 25, 2026
7 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/demo-secret-file branch November 25, 2026 10:11
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