Support unix sockets and systemd sockets using anyhttp #775
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
--address
option to listen on socket types supported byanyhttp
. See: docUnix sockets allow secure communication between reverse proxy and pgweb. (unix sockets are protected by filesystem permissions while tcp ports are open to all local users). Also allows to run the service in PrivateNetwork (i.e. no network)
Systemd socket activation has multiple benefits but the most important one is to automatically start the server on new request and shut down when idle. This makes sense for
pgweb
as it needs to be on only when using the app. On idle, it is shutdown cleanly and thereby releasing all database connections.See below for arch linux package which uses systemd socket and service files.
https://gitea.balki.me/balki-aur/pgweb/