[Feature] Listen on Unix socket #28084
Replies: 3 comments 3 replies
|
I'd like to add motivation as the original poster only described what, not why. It would be cool to support listening on Unix domain socket for cases where for security reasons At the moment one has to expose Please, give this feature some love, especially if its implementation is as easy as the original poster suggests. * besides complexity it also makes certain security mitigations impossible |
|
@Domini your use case is exactly what I had in mind myself! Thank you for sharing! |
|
Let me briefly describe state of the union regarding support of UDS across all the Immich parts as of v3.0.3 while it's still fresh in my mind. In summary it's possible to deploy Immich within one server almost fully air-gapped - mostly conceptually right air-gapped and partly with some hacks. Immich is ready to be fully air-gapped as in it does not require access to internet, but it does not support listening or consuming UDS everywhere yet to realize this goal without hacks. I will quote excerpts from my own deployment, but bear in mind that I deployed it in Podman, hardened it quite a bit (e.g. replaced
This breaks
This breaks Unfortunately, this socket cannot be consumed by Share this socket with reverse proxy and expose it as an Note: Create a separate Now you can air-gap (In my setup Unfortunately, as this feature request postulates, If After that you have fully conceptually properly air-gapped Of course, certain functionality of Immich that requires internet access by design will not work after such brute force air-gapping, such as Google Cast, email notifications, Map feature (Reverse Geocoding works), and Version Check. Also, there is a red text in the left bottom corner "Server Offline - Unknown" that affects nothing. Some if not most of these features can be enabled back in a targeted manner. CC FYI @mmomjian. |
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature
Currently, Immich only allows listening on an interface and port. However, the nodejs listen function called by Immich supports Unix sockets just by passing the file path to the socket. If Immich did not validate the type of the
IMMICH_PORTconfig field, it should in theory be possible to just pass the path to the socket in there, not specifyIMMICH_HOST, and have everything work fine. Unfortunately, Immich does check that this field contains an integer and doesn't provide a dedicated mechanism for listening on a Unix socket instead.Obviously, a dedicated mechanism would be better than removing this validation. Therefore, I propose adding a new
IMMICH_UNIX_SOCKETenvironment variable that, if set, will be listened to instead of an interface and port.Platform
All reactions