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

[ReOpen] Enable Docker image to run TShock server as a non-root user #17

Open
kblaschke opened this issue Aug 16, 2017 · 3 comments · Fixed by #34
Open

[ReOpen] Enable Docker image to run TShock server as a non-root user #17

kblaschke opened this issue Aug 16, 2017 · 3 comments · Fixed by #34

Comments

@kblaschke
Copy link
Contributor

Running a game server as root is fine on a local machine, but on a public server, this might be a security issue. Docker supports the -u parameter, but with the current image, this just won't work because TShock creates a ServerLog.txt file in the /tshock directory. This fails because the directory is not writable to other users.

See pull request #16 for a possible fix.

@kblaschke kblaschke changed the title Enable Docker image to TShock server as a non-root user Enable Docker image to run TShock server as a non-root user Aug 16, 2017
@SharkWipf
Copy link

I know this is an ancient issue, but since I just ran into this, others might as well:
This PR does not 100% allow running as a different -user/group, for some reason the server crashes out without error when trying to generate a new world when not running as root.
Generating a world as root and then switching to user mode (after chowning the files) works fine, so I assume the server tries to create a temp file while generating the world.
It probably needs another symlink, if I can figure out where I might dive into it when I have more time.

@ryansheehan
Copy link
Owner

I know this issue is quite old. I just recently tried to build everything and internally to the container run under non-root privilege. TShock crashed however. I removed the non-root user and everything ran. PR's are welcome on this issue.

@ryansheehan
Copy link
Owner

Had to revert the non-root changes, was running into issues when the terraria user tried to write to a volume

@ryansheehan ryansheehan changed the title Enable Docker image to run TShock server as a non-root user [ReOpen] Enable Docker image to run TShock server as a non-root user May 20, 2020
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 a pull request may close this issue.

3 participants