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

Adding more user friendly checks #228

Closed

Conversation

Dashboy1998
Copy link
Contributor

@Dashboy1998 Dashboy1998 commented Jan 30, 2024

Context

  • Over all adds more friendly outputs for errors like those found in ./PalServer.sh Not Found #14 & ./PalServer.sh : No such file or directory #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

  • I have performed a self-review of my code
  • I've added documentation about this change to the README.
  • I've not introduced breaking changes.

@Dashboy1998 Dashboy1998 marked this pull request as ready for review January 31, 2024 23:44
@Dashboy1998 Dashboy1998 changed the title Adding more user freely checks Adding more user friendly checks Feb 1, 2024
@Dashboy1998 Dashboy1998 mentioned this pull request Feb 2, 2024
3 tasks
@Dashboy1998
Copy link
Contributor Author

Breaking into smaller PRs.

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

Successfully merging this pull request may close these issues.

1 participant