Skip to content
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

[Feature] Allow for the secret config to point to forwarding.secret file #33

Open
ChristopherHaws opened this issue Nov 23, 2022 · 3 comments
Labels
type: feature New feature

Comments

@ChristopherHaws
Copy link

I like to keep my config files in source control. Currently I have to keep FabricProxy-Lite.toml in my .gitignore file because it contains the private key. If I could configure FabricProxy-Lite to read the secret directly from a file, I could then point it to the forwarding.secret so the config file doesn't contain any secret data.

Thanks! :)

@james58899 james58899 added the type: feature New feature label Nov 23, 2022
@james58899
Copy link
Member

Currently supports setting secrets through environment variables FABRIC_PROXY_SECRET.

@ryleu
Copy link

ryleu commented Nov 16, 2023

I use velocity in docker and I'd love to be able to add that one file to both containers without fussing with ansible.

@NorskNoobing
Copy link

@ryleu If you're using itzg/minecraft-server for the server image and itzg/mc-proxy for Velocity, it's already possible.

Both of these images allow for interpolation in the config files in order to replace env-vars with values.

I use this in conjunction with the optional config mount-point, and the following env-vars in the docker-compose.yml and .env files. Note! the forwarding secret requires the double quotes around the value.:

environment:
  - REPLACE_ENV_DURING_SYNC=true
  - REPLACE_ENV_VARIABLES=true
  - CFG_FABRIC_PROXY_FORWARDING_SECRET="$VELOCITY_FORWARDING_SECRET"
  - CFG_FABRIC_PROXY_HACK_EARLY_SEND=true
  - CFG_FABRIC_PROXY_HACK_MESSAGE_CHAIN=true

Then in the FabricProxy-Lite.toml file which is inside a persistent volume to the containers /config dir, you'd set the variables like so:

hackOnlineMode = true
hackEarlySend = ${CFG_FABRIC_PROXY_HACK_EARLY_SEND}
hackMessageChain = ${CFG_FABRIC_PROXY_HACK_MESSAGE_CHAIN}
disconnectMessage = "This server requires you to connect with Velocity."
secret = ${CFG_FABRIC_PROXY_FORWARDING_SECRET}

These images are pretty neat, because they allow for automation like this, and e.g. installing mods/plugins automatically from CurseForge, Modrinth, or any site with a direct .jar download link.

Documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature
Projects
None yet
Development

No branches or pull requests

4 participants