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

immich: 1.117.0 -> 1.118.1 #348890

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nixos/modules/services/web-apps/immich.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ in
};
port = mkOption {
type = types.port;
default = 3001;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change the default port? Seems it could complicate peoples configs if they never set the port option. I would prefer if this option was kept at the current value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's described in the second commit:

This was always upstream's default but they also change the internal port, i.e. behind the reverse proxy, to 2283 in immich-app/immich#13185.

This could be a breaking change though. Should this be behind a stateVersion flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be behind a stateVersion flag?

I thought about that but I don't think it's necessary since the module hasn't made it to a stable NixOS version yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be behind a stateVersion flag?

I thought about that but I don't think it's necessary since the module hasn't made it to a stable NixOS version yet.

People are still using the unstable branch though. In the end the port number doesn't really matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a breaking change though. Should this be behind a stateVersion flag?

It's too heavy for something not released yet and immich clearly advertises they wont let backward-compatibility in their way.
This worked for me after updating the reverse proxy. Phone app and CLI worked as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some thinking I agree with @dotlambda on this topic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My config is

services.nginx = {
    enable = true;
    virtualHosts."immich.example.com" = {
      enableACME = true;
      forceSSL = true;
      locations."/" = {
        proxyPass = "http://${config.services.immich.host}:${toString config.services.immich.port}";
        proxyWebsockets = true;
      };
      extraConfig = ''
        client_max_body_size 512M;
      '';
    };
  };

so I don't even need to change anything.

Copy link
Contributor

@kevincox kevincox Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that a stateVersion change would likely be too heavy. But I do wonder what the benefit of changing the port at all is. The upstream port choice really has no bearing on what we use in NixOS so I would have just left what was originally assigned.

That being said I also used config.services.immich.port in my config so it won't be a bother for me. But in general I would avoid changing things that don't need changing.

Either way too late now. But may be useful for future changes of similar nature.

default = 2283;
description = "The port that immich will listen on.";
};
openFirewall = mkOption {
Expand Down
12 changes: 6 additions & 6 deletions nixos/tests/web-apps/immich.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ import ../make-test-python.nix (

machine.wait_for_unit("immich-server.service")

machine.wait_for_open_port(3001) # Server
machine.wait_for_open_port(2283) # Server
machine.wait_for_open_port(3003) # Machine learning
machine.succeed("curl --fail http://localhost:3001/")
machine.succeed("curl --fail http://localhost:2283/")

machine.succeed("""
curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "name": "Admin", "password": "admin" }' -X POST http://localhost:3001/api/auth/admin-sign-up
curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "name": "Admin", "password": "admin" }' -X POST http://localhost:2283/api/auth/admin-sign-up
""")
res = machine.succeed("""
curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "password": "admin" }' -X POST http://localhost:3001/api/auth/login
curl -H 'Content-Type: application/json' --data '{ "email": "test@example.com", "password": "admin" }' -X POST http://localhost:2283/api/auth/login
""")
token = json.loads(res)['accessToken']

res = machine.succeed("""
curl -H 'Content-Type: application/json' -H 'Cookie: immich_access_token=%s' --data '{ "name": "API Key", "permissions": ["all"] }' -X POST http://localhost:3001/api/api-keys
curl -H 'Content-Type: application/json' -H 'Cookie: immich_access_token=%s' --data '{ "name": "API Key", "permissions": ["all"] }' -X POST http://localhost:2283/api/api-keys
""" % token)
key = json.loads(res)['secret']

machine.succeed(f"immich login http://localhost:3001/api {key}")
machine.succeed(f"immich login http://localhost:2283/api {key}")
res = machine.succeed("immich server-info")
print(res)
'';
Expand Down
29 changes: 6 additions & 23 deletions pkgs/by-name/im/immich-machine-learning/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,6 @@
let
python = python3.override {
self = python;

packageOverrides = self: super: {
pydantic = super.pydantic_1;

versioningit = super.versioningit.overridePythonAttrs (_: {
doCheck = false;
});

albumentations = super.albumentations.overridePythonAttrs (old: rec {
version = "1.4.3";
src = fetchFromGitHub {
owner = "albumentations-team";
repo = "albumentations";
rev = version;
hash = "sha256-JIBwjYaUP4Sc1bVM/zlj45cz9OWpb/LOBsIqk1m+sQA=";
};
dependencies = old.dependencies ++ [
self.scikit-learn
];
});
};
};
in
python.pkgs.buildPythonApplication rec {
Expand All @@ -44,7 +23,10 @@ python.pkgs.buildPythonApplication rec {
substituteInPlace app/test_main.py --replace-fail ": cv2.Mat" ""
'';

pythonRelaxDeps = [ "setuptools" ];
pythonRelaxDeps = [
"pydantic-settings"
"setuptools"
];
pythonRemoveDeps = [ "opencv-python-headless" ];

build-system = with python.pkgs; [
Expand All @@ -60,6 +42,8 @@ python.pkgs.buildPythonApplication rec {
pillow
fastapi
uvicorn
pydantic
pydantic-settings
aiocache
rich
ftfy
Expand All @@ -69,7 +53,6 @@ python.pkgs.buildPythonApplication rec {
gunicorn
huggingface-hub
tokenizers
pydantic
]
++ uvicorn.optional-dependencies.standard;

Expand Down
7 changes: 6 additions & 1 deletion pkgs/by-name/im/immich/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ buildNpmPackage' {
description = "Self-hosted photo and video backup solution";
homepage = "https://immich.app/";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ jvanbruegge ];
maintainers = with lib.maintainers; [
dotlambda
jvanbruegge
Scrumplex
titaniumtown
];
platforms = lib.platforms.linux;
mainProgram = "server";
};
Expand Down
20 changes: 10 additions & 10 deletions pkgs/by-name/im/immich/sources.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"version": "1.117.0",
"hash": "sha256-v4TxKL+NaaAFxlJx/AG/5JxWnPK9uO6GjM4aoW53nzQ=",
"version": "1.118.1",
"hash": "sha256-rWBW0EwehuWnKk6qEte+dPd9l7FbLzwdkCSKMm22Orw=",
"components": {
"cli": {
"npmDepsHash": "sha256-ARjrBHx4aOiNy2PbHWS7kP9Z8QiNyTeyImSxIsXwPnU=",
"version": "2.2.23"
"npmDepsHash": "sha256-0je82BtDH6cUzoMrmeIS0jLmWPbmkdIQJ/SnmbAMtbw=",
"version": "2.2.25"
},
"server": {
"npmDepsHash": "sha256-RjaTRqfZpDhI8lMVvsgICUn8g4NFnqcPptem/AwRr38=",
"version": "1.117.0"
"npmDepsHash": "sha256-Jxb47Y4x9A6s4zGODIp6rze7iQ/w8Gvt31NHSATLYCM=",
"version": "1.118.1"
},
"web": {
"npmDepsHash": "sha256-TZnpbLJbTNFwI2Kvng88z0T1jFf4Tj2xwR0X0wCLaD0=",
"version": "1.117.0"
"npmDepsHash": "sha256-BUgkdsC6raURkyy6eN31uCMKmBbL+fCbGabfHJgJn8g=",
"version": "1.118.1"
},
"open-api/typescript-sdk": {
"npmDepsHash": "sha256-G+iivJ0jibRCw/RChv5heVwY7c7oY/EG4bL+kpjoADQ=",
"version": "1.117.0"
"npmDepsHash": "sha256-Ga/aU5hojd3SgtoiM5QLsmzS5k7CRvh13a4lkC0BZA8=",
"version": "1.118.1"
}
}
}