wg-portal
wg-portal copied to clipboard
Docker container refuses to find/load config.yml when not mapped directly to the file
I'm using v2 and if I map the config directory to a local folder with config.yml inside it refuses to start citing the config can't be found, even with completely open permissions.
time="2024-07-20T19:57:48Z" level=info msg="Starting WireGuard Portal V2..."
time="2024-07-20T19:57:48Z" level=info msg="WireGuard Portal version: master-f1f5280"
panic: failed to load config from yaml: EOF
goroutine 1 [running]:
github.com/h44z/wg-portal/internal.AssertNoError(...)
/build/internal/util.go:44
main.main()
/build/cmd/wg-portal/main.go:35 +0xb46
There is no way to debug this from within the container because it keeps restarting indefinitely, so a shell isn't able to be obtained.
Right before I decided to post this, I decided to map the config file directly...and that worked without issue, so it appears it's probably a problem with the file location in the code. I noticed here that you have the filename hardcoded to config/config.yml, shouldn't it be config.yml instead?
Also, I think it would be a good idea to create a default config.yml in the case that one can't be found so the container will at least run and the user can see why it's not finding their specified config file.
Even though the webserver is running now, I can't sign in with the credentials specified in the config file. So, it appears that the container is completely broken.