Skip to content

[Bug Report] Environment variable settings do not apply if PalWorldSettings.ini does not contain the variable #195

Description

@Callum027

Have you read the Important information text above

  • Yes i did

Current behavior

When a configuration field is not defined in PalWorldSettings.ini, the container cannot apply any values set using the environment variables, since the sed commands used to apply the settings only do in-place edits of existing fields, not inserts. Since PalWorldSettings.ini already exists, the container doesn't override it.

[/Script/Pal.PalGameWorldSettings]
OptionSettings=(PublicIP="192.0.2.1",PublicPort=8211,AdminPassword="<snip1>",ServerPassword="<snip2>",ServerName="SnippetServer",ExpRate=1.300000,PalCaptureRate=2.000000,PlayerDamageRateAttack=1.500000,PlayerDamageRateDefense=0.700000,CollectionDropRate=2.000000,EnemyDropItemRate=2.000000,DeathPenalty=None,PalEggDefaultHatchingTime=2.000000)

I tried to set RCONEnabled and RCONPort using environment variables, but since they weren't defined in PalWorldSettings.ini they were ignored.

Desired behavior

All values set by environment variables should be actually applied, regardless of the current state of the configuration file.

I think there are two possible solutions:

  • Always overwrite PalWorldSettings.ini with DefaultPalWorldSettings.ini on startup, and overwrite the defaults with values set in the environment variables.
    • This will ensure any configuration parameters managed by the container are always correct, but any manual changes made by the user will be lost.
  • Reimplement config file management to insert configuration fields into the file if they exist.
    • This takes much more work, but would preserve any manual modifications made by the user. Palworld uses default values if fields are not defined in PalWorldSettings.ini, so this would basically be the ideal solution.

Links to screenshots

No response

To Reproduce

Steps to reproduce the behavior:

  1. Remove a configuration field definition from PalWorldSettings.ini.
  2. Try to override the setting using the environment variable.

Software setup

  • OS: Ubuntu 22.04 LTS
  • Docker: Docker v25.0.3, Docker Compose v2.24.5

Hardware setup

  • vCPU: 4 vCPU
  • RAM: 16GB
  • Disk: 10GB root volume, 10GB dedicated volume for Palworld (both NVMe high IOPS virtual volumes)

Additional context

I migrated my Palworld Dedicated Server setup over from a non-containerised installation, where in PalWorldSettings.ini I only set the values I wanted to override. This is why the PalWorldSettings.ini file is not a complete copy of the defaults file.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions