Skip to content

Commit 06be856

Browse files
authored
immich: 1.119.1 -> 1.120.1 (#354083)
2 parents 6648da3 + a329ca6 commit 06be856

File tree

4 files changed

+46
-19
lines changed

4 files changed

+46
-19
lines changed

nixos/modules/services/web-apps/immich.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ in
116116
description = ''
117117
Configuration for Immich.
118118
See <https://immich.app/docs/install/config-file/> or navigate to
119-
<https://your-immich-domain/admin/system-settings> for
119+
<https://my.immich.app/admin/system-settings> for
120120
options and defaults.
121121
Setting it to `null` allows configuring Immich in the web interface.
122122
'';
@@ -270,7 +270,7 @@ in
270270
let
271271
postgresEnv =
272272
if isPostgresUnixSocket then
273-
{ DB_URL = "socket://${cfg.database.host}?dbname=${cfg.database.name}"; }
273+
{ DB_URL = "postgresql:///${cfg.database.name}?host=${cfg.database.host}"; }
274274
else
275275
{
276276
DB_HOSTNAME = cfg.database.host;
@@ -317,6 +317,11 @@ in
317317
after = [ "network.target" ];
318318
wantedBy = [ "multi-user.target" ];
319319
inherit (cfg) environment;
320+
path = [
321+
# gzip and pg_dumpall are used by the backup service
322+
pkgs.gzip
323+
config.services.postgresql.package
324+
];
320325

321326
serviceConfig = commonServiceConfig // {
322327
ExecStart = lib.getExe cfg.package;

nixos/tests/web-apps/immich.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,30 @@ import ../make-test-python.nix (
3131
machine.succeed("curl --fail http://localhost:2283/")
3232
3333
machine.succeed("""
34-
curl -H 'Content-Type: application/json' --data '{ "email": "[email protected]", "name": "Admin", "password": "admin" }' -X POST http://localhost:2283/api/auth/admin-sign-up
34+
curl -f --json '{ "email": "[email protected]", "name": "Admin", "password": "admin" }' http://localhost:2283/api/auth/admin-sign-up
3535
""")
3636
res = machine.succeed("""
37-
curl -H 'Content-Type: application/json' --data '{ "email": "[email protected]", "password": "admin" }' -X POST http://localhost:2283/api/auth/login
37+
curl -f --json '{ "email": "[email protected]", "password": "admin" }' http://localhost:2283/api/auth/login
3838
""")
3939
token = json.loads(res)['accessToken']
4040
4141
res = machine.succeed("""
42-
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
42+
curl -f -H 'Cookie: immich_access_token=%s' --json '{ "name": "API Key", "permissions": ["all"] }' http://localhost:2283/api/api-keys
4343
""" % token)
4444
key = json.loads(res)['secret']
4545
4646
machine.succeed(f"immich login http://localhost:2283/api {key}")
4747
res = machine.succeed("immich server-info")
4848
print(res)
49+
50+
machine.succeed("""
51+
curl -f -X PUT -H 'Cookie: immich_access_token=%s' --json '{ "command": "start" }' http://localhost:2283/api/jobs/backupDatabase
52+
""" % token)
53+
res = machine.succeed("""
54+
curl -f -H 'Cookie: immich_access_token=%s' http://localhost:2283/api/jobs
55+
""" % token)
56+
assert json.loads(res)["backupDatabase"]["jobCounts"]["active"] == 1
57+
machine.wait_until_succeeds("ls /var/lib/immich/backups/*.sql.gz")
4958
'';
5059
}
5160
)

pkgs/by-name/im/immich/package.nix

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
stdenvNoCC,
44
buildNpmPackage,
55
fetchFromGitHub,
6+
fetchpatch2,
67
python3,
78
nodejs,
89
node-gyp,
@@ -17,12 +18,12 @@
1718
cacert,
1819
unzip,
1920
# runtime deps
21+
exiftool,
2022
jellyfin-ffmpeg, # Immich depends on the jellyfin customizations, see https://github.com/NixOS/nixpkgs/issues/351943
2123
imagemagick,
2224
libraw,
2325
libheif,
2426
vips,
25-
perl,
2627
}:
2728
let
2829
buildNpmPackage' = buildNpmPackage.override { inherit nodejs; };
@@ -146,6 +147,13 @@ buildNpmPackage' {
146147
src = "${src}/server";
147148
inherit (sources.components.server) npmDepsHash;
148149

150+
postPatch = ''
151+
# pg_dumpall fails without database root access
152+
# see https://github.com/immich-app/immich/issues/13971
153+
substituteInPlace src/services/backup.service.ts \
154+
--replace-fail '`pg_dumpall`' '`pg_dump`'
155+
'';
156+
149157
nativeBuildInputs = [
150158
pkg-config
151159
python3
@@ -166,7 +174,7 @@ buildNpmPackage' {
166174
makeCacheWritable = true;
167175

168176
preBuild = ''
169-
cd node_modules/sharp
177+
pushd node_modules/sharp
170178
171179
mkdir node_modules
172180
ln -s ${node-addon-api} node_modules/node-addon-api
@@ -175,8 +183,13 @@ buildNpmPackage' {
175183
176184
rm -r node_modules
177185
178-
cd ../..
186+
popd
179187
rm -r node_modules/@img/sharp*
188+
189+
# If exiftool-vendored.pl isn't found, exiftool is searched for on the PATH
190+
rm -r node_modules/exiftool-vendored.*
191+
substituteInPlace node_modules/exiftool-vendored/dist/DefaultExifToolOptions.js \
192+
--replace-fail "checkPerl: !(0, IsWin32_1.isWin32)()," "checkPerl: false,"
180193
'';
181194

182195
installPhase = ''
@@ -197,7 +210,7 @@ buildNpmPackage' {
197210
--set IMMICH_BUILD_DATA $out/build --set NODE_ENV production \
198211
--suffix PATH : "${
199212
lib.makeBinPath [
200-
perl
213+
exiftool
201214
jellyfin-ffmpeg
202215
]
203216
}"
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"version": "1.119.1",
3-
"hash": "sha256-T+bIL2LaVNgFT3xBUxiEzhyDiLpw/WU7mxttuJD39SQ=",
2+
"version": "1.120.1",
3+
"hash": "sha256-FKPs6BHOXmqnHh2yH+PPBFQoK5ykP716dNvES/45t4g=",
44
"components": {
55
"cli": {
6-
"npmDepsHash": "sha256-kTBlo6eIPswZC0GQG7IoqQZ5b7wPEXFaD/SuuaEQMEg=",
7-
"version": "2.2.28"
6+
"npmDepsHash": "sha256-5JmcDjLAVXhF3TH0M88dKLYPDsSctcOGPz9nV1n3k9c=",
7+
"version": "2.2.30"
88
},
99
"server": {
10-
"npmDepsHash": "sha256-zgzqh3TyafPKuk5RZ2I/haYFzMVlI4jGnwD5XLqTBdg=",
11-
"version": "1.119.1"
10+
"npmDepsHash": "sha256-u2ZQv+z8uyn7z52V+7hNRWgnHVm4xMdhjspPqsLHYek=",
11+
"version": "1.120.1"
1212
},
1313
"web": {
14-
"npmDepsHash": "sha256-LPtsMzF7yYGrrpDoYoba6OQphKY7AvGbJpPc5pS4eFU=",
15-
"version": "1.119.1"
14+
"npmDepsHash": "sha256-EAFUOhcmE1TfUBN0uxzuNkHibdaDRn8Lxvma70UJqDE=",
15+
"version": "1.120.1"
1616
},
1717
"open-api/typescript-sdk": {
18-
"npmDepsHash": "sha256-dyKmDez8jO6p+cmSa2KMe9zzhXn4on3aFUMdep+gjzU=",
19-
"version": "1.119.1"
18+
"npmDepsHash": "sha256-AJcK5NE+ZNAK2FJblY32jtYxY0Z9npH92A3htcPes4A=",
19+
"version": "1.120.1"
2020
}
2121
}
2222
}

0 commit comments

Comments
 (0)