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

nixos/immich: fix .host option not working #347815

Closed
wants to merge 1 commit into from

Conversation

Zocker1999NET
Copy link
Contributor

@Zocker1999NET Zocker1999NET commented Oct 10, 2024

Things done

This PR fixes the services.immich.host option, which does not work with the current version of Immich in unstable (1.117.0). I verified that the current version does not work by using following configuration & checking the journal of the immich service:

services.immich = {
  enable = true;
  host = "0.0.0.0"; # IPv6 as well
  openFirewall = true;
  port = 3001;
};
Oct 10 23:00:33 immich server[993]: [Nest] 993  - 10/10/2024, 11:00:33 PM     LOG [Api:Bootstrap] Immich Server is listening on http://127.0.0.1:3001 [v1.117.0] [PRODUCTION] 

The Immich doc says the correct environment variable is called IMMICH_HOST, see https://immich.app/docs/install/environment-variables/#ports.
I tested that this works in my configuration, which looks like this (extract):

services.immich = {
  enable = true;
  # TODO (until PR) host option not working
  environment.IMMICH_HOST = "0.0.0.0"; # IPv6 as well
  openFirewall = true;
  port = 3001;
};
Oct 10 23:03:45 immich server[1606]: [Nest] 1606  - 10/10/2024, 11:03:45 PM     LOG [Api:Bootstrap] Immich Server is listening on http://[::1]:3001 [v1.117.0] [PRODUCTION] 
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

The Immich doc says the correct environment variable is called `IMMICH_HOST`, see https://immich.app/docs/install/environment-variables/#ports.
@Zocker1999NET
Copy link
Contributor Author

ups, sorry for the premature PR. I assumed that my fix was working as I misread http://[::1]:3001 in the latest log for http://[::]:3001 & together with what I found in the Immich docs, I now assumed that my router VM was creating the connectivity issues. Now after finding my mistake & digging further in the Immich code, the current module implementation could be already working, assuming this is the affecting code:
https://github.com/immich-app/immich/blob/8daa8073ae3a8e69ba410d0184006915995bf6ad/server/src/workers/api.ts#L18

But nontheless I do not get Immich to listen to all interfaces instead of localhost (I want to avoid to hardcode the VM’s IP there). When I find success, I will update the docs of the module accordingly (but in a new PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant