gotify / server

A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)
https://gotify.net
Other
11.49k stars 639 forks source link

fix: enable silent mode #733

Closed jmattheis closed 6 days ago

jmattheis commented 6 days ago

Hides this log output

Failed to find configuration /etc/gotify/config.yml
Failed to find configuration config.yml, using example file config.example.yml

Introduced with the #727

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.42%. Comparing base (2eee800) to head (5395112).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #733 +/- ## ======================================= Coverage 79.42% 79.42% ======================================= Files 56 56 Lines 2639 2639 ======================================= Hits 2096 2096 Misses 452 452 Partials 91 91 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eternal-flame-AD commented 6 days ago

I actually intentionally didn't write silent: true... I thought it might not be a good idea someone can just docker run and magically have their server listening on port 80 with admin:admin as the password just because they typoed a config file

I thought this option was originally used because the library produced too many warnings, I think a config fallback warning is useful

jmattheis commented 6 days ago

This is only log, the server starts correctly listening on port 80 with admin:admin in docker without any config. And given that gotify/server should be configured via env vars in docker, the error/warning is misleading.

jmattheis commented 6 days ago

Tho, I'm not really against logging stuff like that, just wanted to have the previous behavior for this release as I hadn't noticed this in the review.

eternal-flame-AD commented 6 days ago

Your call :) IMO logging and warning differences does not count as breaking changes, I just thought it might be confusing or even cause subtle security issues if someone typed config file when running locally, this message clearly states where it expect a config file.

But I agree with you not many people put config in /etc and actually typo it. It might be more likely to happen if they set the workingdir in systemd wrong and missed the config.yml entry