Skip to content

Allow velocity forwarding secret to be passed as value (minecraft-proxy) #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

skylerspaeth
Copy link
Contributor

@skylerspaeth skylerspaeth commented Oct 28, 2024

Description

This repo indicates support for running a Velocity proxy, but without my proposed changes, I cannot spin one up when player-info-forwarding-mode is set to modern (which I have heard is the only safe way to run Velocity).

This is due to the file at the default forwarding-secret-file path being missing. Since there is no apparent way to provide one without manual customizations, I figured I'd PR the changes I made back to master.

I'm coming into this project completely new, so forgive me if things are done differently than y'all usually do. Happy to make changes if needed. I used the config volume mount (just above my new one) as an example:

- name: config
  mountPath: {{ .Values.minecraftProxy.configFilePath }}
  subPath: config.yml

Hence why my subPath and path under the volumes section are hardcoded too (to forwarding.secret). That said, I assume the implication of doing so is that no matter what the user provides as velocityForwardingSecretFilePath, the filename is going to remain the same, even though its location may change. I'm willing to adjust if needed.

Additionally, I added the example provided in this PR over 3 years ago to the values.yaml file, which will hopefully save others time trying to figure out how to configure Velocity with this chart: #65 (comment)

Thank you @ChipWolf for that info! 🙏

Testing

I ensured both the changes worked together: example Velocity config along with forwarding changes. I couldn't test them individually because, at least in my case and with my knowledge, both are needed to prevent the pod from crashing.

To test them together, I used the following values.yaml, which contains the exact examples added to the upstream values file:

minecraftProxy:
  type: VELOCITY
  velocityVersion: 3.4.0-SNAPSHOT
  serviceType: NodePort
  nodePort: 30565
  velocityForwardingSecret: "CHANGEME!"
  velocityForwardingSecretFilePath: /server/forwarding.secret
  configFilePath: /server/velocity.toml
  config: |-
    config-version = "2.7"
    bind = "0.0.0.0:25577"
    motd = "Hello from Helmified Velocity!"
    show-max-players = 500
    player-info-forwarding-mode = "modern"

The proxy shows up as expected in-game:

image

Even though I didn't mess with anything related to it, I also briefly tested the chart in the default BungeeCord mode just in case, and the MOTD appropriately changed back to the BungeeCord one in my server list.

I did not test these changes on any other sever types but I can't imagine there's any impact.

Related Links

This is a list of helpful PRs and links that I referenced when making this PR (mostly here for my own future reference):

@skylerspaeth skylerspaeth marked this pull request as ready for review October 28, 2024 07:43
Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Thanks! That one was long awaited it seems.

@itzg itzg merged commit d0cdf7d into itzg:master Oct 28, 2024
1 check passed
@skylerspaeth skylerspaeth changed the title Allow velocity forwarding secret to be passed as value Allow velocity forwarding secret to be passed as value (minecraft-proxy) Nov 12, 2024
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