-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Server port and admin server port can end up with the same value #3508
Comments
Generally, a user expects us to stick to one protocol, right? Meanwhile, one way to reduce confusion would be reporting URLs of apps to reach them at instead of just port numbers (and we do have all the info required for it). |
The problem here is the app server binds to Anyway, with #3512 admin server is bound to the same address as main, so specifying the same port results in a runtime error:
Although the above runtime error is rather uninformative. I wonder if I should validate the config and fail if port numbers match, or just add logs, like |
Okay, we actually do diagnostic messages |
This sounds very plausible - but I'm not 100% sure. I can easily imagine scenarios where I don't want this to be the case. Isn't the whole problem here that we only have I think it's quite reasonable to have the admin server listen on So even if it's the same protocol, we probably still need a way to allow setting different hosts.
Agreed, that would be really good. Overall, even given both |
So, to summarize:
I'll cook a PR |
I think it would be fine to block on the same port only. This leads to less confusion and is also much easier to do, because you know the port beforehand. The host could be "localhost" and "127.0.0.1" - and then it becomes much harder to tell whether those are equal or not. You could actually only check after binding to the interface. So I'd like the port-only check at startup, way before trying to open any sockets, more. |
Forbids server-port and admin-server-port from being equal altogether, despite they might not conflict at all in case admin and app are bound to different addresses. Implemented as per the discussion at PostgREST#3508 (comment)
Forbids server-port and admin-server-port from being equal altogether, despite they might not conflict at all in case admin and app are bound to different addresses. Implemented as per the discussion at PostgREST#3508 (comment)
Forbids server-port and admin-server-port from being equal altogether, despite they might not conflict at all in case admin and app are bound to different addresses. Implemented as per the discussion at PostgREST#3508 (comment)
Forbids server-port and admin-server-port from being equal altogether, despite they might not conflict at all in case admin and app are bound to different addresses. Implemented as per the discussion at PostgREST#3508 (comment)
* fix: forbid same server-port and admin-server-port Forbids server-port and admin-server-port from being equal altogether, despite they might not conflict at all in case admin and app are bound to different addresses. Implemented as per the discussion at #3508 (comment)
As found out in #3424 (comment).
Do this:
and observe:
One of them is listening on ipv4, the other on ipv6.
We should probably reject this case on the config level? Admin port should always be different from server port?
The text was updated successfully, but these errors were encountered: