palworld-server-docker
palworld-server-docker copied to clipboard
Adding more user friendly checks
Context
- Over all adds more friendly outputs for errors like those found in #14 & #198
- Currently the only output message with an exit is if you start with PUID or PGID set to 0.
- Adds check for the existence and permissions of directories/files that are needed.
- Makes UPDATE_ON_BOOT, COMMUNITY, MULTITHREADING, BACKUP_ENABLED, AUTO_UPDATE_ENABLED case insensitive
- Checks if an expected boolean is indeed a boolean
In the future I plan to add check for integers, floats, and if the port is valid.
Choices
- Disable container restart
- Using functions as it's checked many times.
Test instructions
Start the container after each step.
| # | Action Outside Container | Expected Output |
|---|---|---|
| 1 | chmod 444 palworld/ |
/palworld/ is not writable. |
| 2 | chmod 644 palworld/ |
/palworld/ is not executable. |
| 3 | chmod 755 palworld/ |
Server Starts |
| 4 | chmod 755 palworld/PalServer.sh |
Server Starts |
| 5 | chmod 000 palworld/PalServer.sh |
./PalServer.sh is not readable. |
| 6 | chmod 444 palworld/PalServer.sh |
./PalServer.sh is not executable. |
| 7 | rm -f palworld/PalServer.sh & Start with UPDATE_ON_BOOT=false |
./PalServer.sh does not exist, Try restarting with UPDATE_ON_BOOT=true |
| 8 | chmod 444 palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini |
/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini is not writable. |
| 9 | chmod 755 palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini |
Server Starts |
| 10 | Test case insensitive boolean values | Server starts |
| 11 | Test none true/false strings in place of boolean values | Server starts, outputs that the variable was not a boolean |
Checklist before requesting a review
- [x] I have performed a self-review of my code
- [x] I've added documentation about this change to the README.
- [x] I've not introduced breaking changes.