jammsen / docker-palworld-dedicated-server

Docker container to easily provision and manage Palworld Dedicated Server
https://hub.docker.com/r/jammsen/palworld-dedicated-server
MIT License
898 stars 151 forks source link

[Suggestion] Allow rcon.yaml to be modified even when SERVER_SETTINGS_MODE is manual #221

Closed Jadiction closed 4 months ago

Jadiction commented 4 months ago

Have you read the Important information text above

Describe the feature

In includes/config.sh, I suggest the function setup_rcon_yaml still gets ran on the else condition.

This way you can still automate the rconcli setup without needing to modify any server settings, for those who choose not to use environment variables for the server config.

For example: I personally prefer to modify any server configuration through the .ini, but I still want to use the RCON features that require the yaml configuration. It would make it easier to setup if you only had to specify the necessary environment variables: RCON_ENABLED = true, RCON_PORT = port, ADMIN_PASSWORD = password

Additional information

Final checks

Jadiction commented 4 months ago

Off topic: I'd also like a way to customize/remove the "content": "Status update" in includes/webhook.sh. For Discord webhooks, the message would look better without the content message. image

jammsen commented 4 months ago

Hey @Jadiction - This are 2 topics.

For the second topic:

Off topic: I'd also like a way to customize/remove the "content": "Status update" in includes/webhook.sh. For Discord webhooks, the message would look better without the content message. image

Create a new Feature-Request and explain in as much detail what you want and how it would look like with screenshots and i will look at it.

Regarding topic 1:

For example: I personally prefer to modify any server configuration through the .ini, but I still want to use the RCON features that require the yaml configuration. It would make it easier to setup if you only had to specify the necessary environment variables: RCON_ENABLED = true, RCON_PORT = port, ADMIN_PASSWORD = password

Right now we have either completely automated or totally manual. What you are suggestions is a 3rd mode that only sets a few vars? What is the value of this addition and how would the "vars" that are semi-manual identified that would be set, because i guess after i add a 3rd mode, many new issues arise and say, oh for semi-manual or semi-auto X and Y and Z is a must too.

How could we get this addition and context more solid?

Jadiction commented 4 months ago

What you are suggestions is a 3rd mode that only sets a few vars?

My suggestion is to allow RCON variables to be modified still even if you're not using the SERVER_SETTINGS_MODE set to auto.

No need for a new mode at all. RCON (/home/steam/steamcmd/rcon.yaml) and server setting (/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini) configs aren't the same thing, so having SERVER_SETTINGS_MODE set to the manual shouldn't mean you don't get your RCON values updated in "/home/steam/steamcmd/rcon.yaml".

The solution:

Simply add RCON value modifications (the rsetup_rcon_yaml function) to the else statement when setting up configs OR just add the rsetup_rcon_yaml function right below setup_configs() in includes/server.sh since the logic is always being ran.

Current:

function setup_configs() {
    if [[ -n ${SERVER_SETTINGS_MODE} ]] && [[ ${SERVER_SETTINGS_MODE} == "auto" ]]; then
        ew ">>> SERVER_SETTINGS_MODE is set to '${SERVER_SETTINGS_MODE}', using environment variables to configure the server"
        setup_engine_ini
        setup_palworld_settings_ini
        setup_rcon_yaml
    else
        ew ">>> SERVER_SETTINGS_MODE is set to '${SERVER_SETTINGS_MODE}', NOT using environment variables to configure the server!"
        ew ">>> ALL SETTINGS including setup of rcon.yaml has to be done manually by the user!"
    fi
}

After:

function setup_configs() {
    if [[ -n ${SERVER_SETTINGS_MODE} ]] && [[ ${SERVER_SETTINGS_MODE} == "auto" ]]; then
        ew ">>> SERVER_SETTINGS_MODE is set to '${SERVER_SETTINGS_MODE}', using environment variables to configure the server"
        setup_engine_ini
        setup_palworld_settings_ini
        setup_rcon_yaml
    else
        ew ">>> SERVER_SETTINGS_MODE is set to '${SERVER_SETTINGS_MODE}', NOT using environment variables to configure the server!"
        ew ">>> ALL SETTINGS including setup of rcon.yaml has to be done manually by the user!"
        setup_rcon_yaml # Still modify rcon yml file if user has set ENV variables
    fi
}

This would work perfectly fine if your server settings are set to manual because the setup_rcon_yaml already has checks for the environment variables needed to update the file.

jammsen commented 4 months ago

Hey @Jadiction - I think i do understand more of what you like to have.

But solving it this way is dirty and hacky, i dont operate like that. I know its only to move 1 line, but its intransparent and the software-architecture should be good and not bad and shady, also documentation would be missing or very confusing...

I think a "rcononly" option would do the trick ....

jammsen commented 4 months ago

Hey @Jadiction - I have added this function on the develop image tag, please go ahead and test this out and give me feedback on this.

See https://github.com/jammsen/docker-palworld-dedicated-server/commit/575e2a104d9a3c94877b3308b57ca2c4e66c43a3

Jadiction commented 4 months ago

Hey @Jadiction - I have added this function on the develop image tag, please go ahead and test this out and give me feedback on this.

See 575e2a1

This works for me, thanks for the implementation!

jammsen commented 4 months ago

Glad it works! Will release that to "latest" soon'ish, keep watch of the announcement/release channel in Discord.