lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.91k stars 269 forks source link

Setting SERVER_PASS to empty value when VPLUS PW is disabled #572

Closed JackTheFragger closed 1 year ago

JackTheFragger commented 1 year ago

Fix for Issue #568

Setting SERVER_PASS to empty value if variable 'VPCFG_Server_disableServerPassword' is true

lloesche commented 1 year ago

@JackTheFragger thank you for the PR! I added a comment to the code above.

JackTheFragger commented 1 year ago

shellcheck is complaining about accessing VPCFG_Server_disableServerPassword without defining it.

You could reduce the code to something like:

SERVER_PASS=${SERVER_PASS-secret}
if [ "${VPCFG_Server_disableServerPassword:-}" = true ]; then
  SERVER_PASS=""
fi

Where do I define it?

lloesche commented 1 year ago

In defaults. At the same point where you made the current changes.