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

Allow HTTP and HTTP servers to be turned off #43

Merged
merged 4 commits into from
Oct 19, 2024
Merged

Allow HTTP and HTTP servers to be turned off #43

merged 4 commits into from
Oct 19, 2024

Conversation

ltratt
Copy link
Owner

@ltratt ltratt commented Sep 29, 2024

The main commit here is e4ed00a, which allows one to set e.g. http_listen = off globally to ensure that only the HTTPS server is running. Both HTTP and HTTPS servers default to on.

@trembel Might you be able to test this and see if it works correctly in your setup?

This will (probably) be useful for those people using pizauth on a
remote machine accessed via ssh.
@trembel
Copy link
Contributor

trembel commented Sep 30, 2024

Not sure if I'm doing something wrong.
I added

http_listen = "off";
https_listen = "off";

to my config. However, no error is shown on pizauth server, and pizauth status shows

ERROR pizauth authenticator not running or not responding

The same appears if one of http_listen or https_listen is set to off. With none of them in my configs, it works as before.

@ltratt
Copy link
Owner Author

ltratt commented Sep 30, 2024

off should be without quotes (to differentiate it from a hostname of "off").

@trembel
Copy link
Contributor

trembel commented Oct 1, 2024

Just tested, works for me.

However I feel its a bit missleading to be without quotes, as everything else is with quotes, but I don't see a better solution either.

@ltratt
Copy link
Owner Author

ltratt commented Oct 1, 2024

Would another keyword have made it clearer? I'm open to suggestions.

@trembel
Copy link
Contributor

trembel commented Oct 5, 2024

What about using None? It is very broadly known as 'not being a string' (be it Rust or Python)

@ltratt
Copy link
Owner Author

ltratt commented Oct 8, 2024

What about using None?

Good idea! Fixed in 925b5a1. Does that still work for you?

The main use case for this is someone who wants to ensure that only the
HTTPS server is active (i.e. that they can't accidentally connect via
HTTP). But making both of them optional keeps the system more
consistent, and someone might have a use for running the HTTP but not
the HTTPS server!
@ltratt ltratt merged commit 1b2ad81 into master Oct 19, 2024
5 checks passed
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 this pull request may close these issues.

2 participants