northwood-studios / LocalAdmin-V2

Second version of LocalAdmin for SCP: Secret Laboratory game.
MIT License
22 stars 20 forks source link

New home env var check fails by default on linux #52

Closed P4sca1 closed 1 year ago

P4sca1 commented 1 year ago

Environment.GetFolderPath returns an empty string, when the path does not exist. According to https://jimrich.sk/environment-specialfolder-on-windows-linux-and-os-x/ System.Environment.SpecialFolder.ApplicationData resolves to /home/{user}/.config, which is a directory that does not exist by default (at least on ubuntu).

zabszk commented 1 year ago

I have just tested it on clean Ubuntu 2020.04 LTS and Debian 11 installations and it's not the case. It doesn't return an empty string if the path doesn't exist.

Many SCP:SL communities (including our official ones) run LocalAdmin in Docker containers, where the .config folder doesn't exist and it was never an issue for anyone either.

P4sca1 commented 1 year ago

Weird, I started to get the error can't obtain a valid user home directory path recently. It was fixed after I created the .config folder manually. I'm running from a docker container based on Ubuntu 22.04. The env variable HOME=home/myuser is set.

zabszk commented 1 year ago

Interesting issue. I will retest it on Ubuntu 22.04 LTS then.

If you run it in docker (presumably using pterodactyl), adding a command to create that path shouldn't be an issue as a temporary workaround.

P4sca1 commented 1 year ago

I am using my own docker image from https://GitHub.com/ips-hosting/game-images and did just that to fix the issue. Maybe one of my other command line arguments was causing the issue.

J-Stuff commented 1 year ago

Testing with Ed_PlayZ. This issue is occouring on clean installs of Ubuntu. image

https://nextcloud.j-stuff.net/s/Hinb9SHmNKefBx8

It requires a .config directory to be created manually by the user in the home directory of the host user to remove the error.

zabszk commented 1 year ago

I can't reproduce the issue (even on a clean installation of Ubuntu 2020.04 LTS), but I made a PR that should fix this bug.

zabszk commented 1 year ago

@P4sca1 @J-Stuff Can you test the build from PR (https://github.com/northwood-studios/LocalAdmin-V2/suites/10123726988/artifacts/494040544)? I can't reproduce the issue.

cynthrune commented 1 year ago

@zabszk seems to be fixed in that one.

J-Stuff commented 1 year ago

Fixed in the test build! https://nextcloud.j-stuff.net/s/9aEBJHrPTsp9ayx

zabszk commented 1 year ago

Fixed in the test build! https://nextcloud.j-stuff.net/s/9aEBJHrPTsp9ayx

Thanks for testing.