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

Expose config file locations as env vars #356

Closed
SQLJames opened this issue Jan 18, 2021 · 2 comments · May be fixed by #422
Closed

Expose config file locations as env vars #356

SQLJames opened this issue Jan 18, 2021 · 2 comments · May be fixed by #422

Comments

@SQLJames
Copy link

In the factorio-server-charts, to allow us to specify the config values we are using configmaps, which creates the json file and mounts it to the proper location, however they are Read only files. This poses an issue when the server-id.json is needed to create a public server because it needs rw operations. I am currently looking into creating a sidecar to copy the files into the proper directory so we can properly rw to the directory.

But in my digging to resolve this issue, this solution did come up as a potential fix, so I had to ask if your project would be open to accepting a pull request that allows users to specify the location of config files as an ENV variable.

For example, in the docker-entrypoint.sh file, we could check to see if the ENV is specified and if so, we would use that value instead of the location put in the flag arg list. For example:

#-z string True if the string is null
if [ -z "${FACTORIO_SERVER_ID_LOCATION}" ]; then
    FACTORIO_SERVER_ID_LOCATION="/factorio/config/server-id.json"
fi

FLAGS=(\
  --port "$PORT" \
  --server-settings "$CONFIG/server-settings.json" \
  --server-banlist "$CONFIG/server-banlist.json" \
  --rcon-port "$RCON_PORT" \
  --server-whitelist "$CONFIG/server-whitelist.json" \
  --use-server-whitelist \
  --server-adminlist "$CONFIG/server-adminlist.json" \
  --rcon-password "$(cat "$CONFIG/rconpw")" \
  --server-id $FACTORIO_SERVER_ID_LOCATION \
)
@SuperSandro2000
Copy link
Member

Would be fine for me.

@SQLJames
Copy link
Author

solved this with SQLJames/factorio-server-charts#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants