mmmaxwwwell / space-engineers-dedicated-docker-linux

Space Engineers Dedicated Server running in Docker for Linux
MIT License
177 stars 43 forks source link

Server does not work with user 1000 #32

Closed UseAfterFreee closed 2 years ago

UseAfterFreee commented 2 years ago

In the latest commit you changed all the mkdirs to use sudo in the start script. This means that the directories are created with the root user. You then added a check if the UID is not 1000 and do a chown (which fixes this problem). However for the user 1000 this chown is not done. This means that if the user has UID 1000 that the appdata folder is owned by root:root instead of 1000:1000.

mmmaxwwwell commented 2 years ago

Did this cause a problem for you?

UseAfterFreee commented 2 years ago

Yes it did, i got the following error:

space-engineers-dedicated-docker-linux | ls: cannot access '/appdata/space-engineers/Plugins/*.dll': No such file or directory space-engineers-dedicated-docker-linux | mkdir: cannot create directory '/home/wine/.steam/steamcmd': Permission denied space-engineers-dedicated-docker-linux | cp: cannot create regular file '/home/wine/.steam/steamcmd/': Not a directory space-engineers-dedicated-docker-linux | cp: cannot create regular file '/home/wine/.steam/steamcmd/linux32/': No such file or directory space-engineers-dedicated-docker-linux | /usr/games/steamcmd: 24: exec: /home/wine/.steam/steamcmd/steamcmd.sh: not found space-engineers-dedicated-docker-linux | /entrypoint-space_engineers.bash: line 3: /home/wine/.bash_profile: No such file or directory space-engineers-dedicated-docker-linux | /entrypoint-space_engineers.bash: line 4: cd: /appdata/space-engineers/SpaceEngineersDedicated/DedicatedServer64/: No such file or directory space-engineers-dedicated-docker-linux | wine: cannot find L"/appdata/space-engineers/SpaceEngineersDedicated/DedicatedServer64/SpaceEngineersDedicated.exe"

After removing the if check in the start script it worked fine (so always chowning the appdata folder to 1000), but it is probably better to check the actual permissions of the appdata folder rather than the UID variable

mmmaxwwwell commented 2 years ago

Thanks, appreciate the input!

mmmaxwwwell commented 2 years ago

Merged the updated permissions check to main. I added a shoutouts section in the readme for people who improve the repo through issues. Really appreciate it!