Skip to content

High performance self-hosted photo and video management solution.

refactor(dev): dockerify auth-server (#24377)

Robert Schäfer573e9b0d5216
diff --git a/e2e-auth-server/Dockerfile b/e2e-auth-server/Dockerfile
new file mode 100644
index 0000000000..aa7527c483
--- /dev/null
+++ b/e2e-auth-server/Dockerfile
@@ -0,0 +1,6 @@
+FROM node:24.1.0-alpine3.20@sha256:8fe019e0d57dbdce5f5c27c0b63d2775cf34b00e3755a7dea969802d7e0c2b25
+RUN corepack enable
+ADD package.json *.ts ./
+RUN pnpm install
+EXPOSE 2286
+CMD ["pnpm", "run", "start"]
diff --git a/e2e/src/setup/auth-server.ts b/e2e-auth-server/auth-server.ts
similarity index 96%
rename from e2e/src/setup/auth-server.ts
rename to e2e-auth-server/auth-server.ts
index 489bda2ee4..a190ecd023 100644
--- a/e2e/src/setup/auth-server.ts
+++ b/e2e-auth-server/auth-server.ts
@@ -125,7 +125,7 @@ const setup = async () => {
],
});
- const onStart = () => console.log(`[auth-server] http://${host}:${port}/.well-known/openid-configuration`);
+ const onStart = () => console.log(`[e2e-auth-server] http://${host}:${port}/.well-known/openid-configuration`);
const app = oidc.listen(port, host, onStart);
return () => app.close();
};
diff --git a/e2e-auth-server/package.json b/e2e-auth-server/package.json
new file mode 100644
index 0000000000..73ede1b7c4
--- /dev/null
+++ b/e2e-auth-server/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "@immich/e2e-auth-server",
+ "version": "0.1.0",
+ "type": "module",
+ "main": "auth-server.ts",
+ "scripts": {
+ "start": "tsx startup.ts"
+ },
+ "devDependencies": {
+ "jose": "^5.6.3",
+ "@types/oidc-provider": "^9.0.0",
+ "oidc-provider": "^9.0.0",
+ "tsx": "^4.20.6"
+ }
+}
diff --git a/e2e-auth-server/startup.ts b/e2e-auth-server/startup.ts
new file mode 100644
index 0000000000..442cf6dfc2
--- /dev/null
+++ b/e2e-auth-server/startup.ts
@@ -0,0 +1,8 @@
+import setup from './auth-server'
+
+const teardown = await setup()
+process.on('exit', () => {
+ teardown()
+ console.log('[e2e-auth-server] stopped')
+ process.exit(0)
+})
diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml
index 867a367d54..a33cb6573c 100644
--- a/e2e/docker-compose.yml
+++ b/e2e/docker-compose.yml
@@ -1,6 +1,12 @@
name: immich-e2e
services:
+ e2e-auth-server:
+ build:
+ context: ../e2e-auth-server
+ ports:
+ - 2286:2286
+
immich-server:
container_name: immich-e2e-server
image: immich-server:latest
@@ -27,8 +33,6 @@ services:
- IMMICH_IGNORE_MOUNT_CHECK_ERRORS=true
volumes:
- ./test-assets:/test-assets
- extra_hosts:
- - 'auth-server:host-gateway'
depends_on:
redis:
condition: service_started
diff --git a/e2e/package.json b/e2e/package.json
index 909556aa99..c42bf6eddb 100644
--- a/e2e/package.json
+++ b/e2e/package.json
@@ -22,12 +22,12 @@
"@eslint/js": "^9.8.0",
"@faker-js/faker": "^10.1.0",
"@immich/cli": "file:../cli",
+ "@immich/e2e-auth-server": "file:../e2e-auth-server",
"@immich/sdk": "file:../open-api/typescript-sdk",
"@playwright/test": "^1.44.1",
"@socket.io/component-emitter": "^3.1.2",
"@types/luxon": "^3.4.2",
"@types/node": "^24.10.4",
- "@types/oidc-provider": "^9.0.0",
"@types/pg": "^8.15.1",
"@types/pngjs": "^6.0.4",
"@types/supertest": "^6.0.2",
@@ -38,9 +38,7 @@
"eslint-plugin-unicorn": "^62.0.0",
"exiftool-vendored": "^34.3.0",
"globals": "^16.0.0",
- "jose": "^5.6.3",
"luxon": "^3.4.4",
- "oidc-provider": "^9.0.0",
"pg": "^8.11.3",
"pngjs": "^7.0.0",
"prettier": "^3.7.4",
diff --git a/e2e/src/api/specs/oauth.e2e-spec.ts b/e2e/src/api/specs/oauth.e2e-spec.ts
index 58fc43a2d5..cbd68c003a 100644
--- a/e2e/src/api/specs/oauth.e2e-spec.ts
+++ b/e2e/src/api/specs/oauth.e2e-spec.ts
@@ -1,3 +1,4 @@
+import { OAuthClient, OAuthUser } from '@immich/e2e-auth-server';
import {
LoginResponseDto,
SystemConfigOAuthDto,
@@ -8,13 +9,12 @@ import {
} from '@immich/sdk';
import { createHash, randomBytes } from 'node:crypto';
import { errorDto } from 'src/responses';
-import { OAuthClient, OAuthUser } from 'src/setup/auth-server';
import { app, asBearerAuth, baseUrl, utils } from 'src/utils';
import request from 'supertest';
import { beforeAll, describe, expect, it } from 'vitest';
const authServer = {
- internal: 'http://auth-server:2286',
+ internal: 'http://e2e-auth-server:2286',
external: 'http://127.0.0.1:2286',
};
diff --git a/e2e/vitest.config.ts b/e2e/vitest.config.ts
index 9c80f25ace..48433eb830 100644
--- a/e2e/vitest.config.ts
+++ b/e2e/vitest.config.ts
@@ -1,7 +1,7 @@
import { defineConfig } from 'vitest/config';
// skip `docker compose up` if `make e2e` was already run
-const globalSetup: string[] = ['src/setup/auth-server.ts'];
+const globalSetup: string[] = [];
try {
await fetch('http://127.0.0.1:2285/api/server-info/ping');
} catch {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a851b1a809..9980023d36 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -67,7 +67,7 @@ importers:
version: 24.10.4
'@vitest/coverage-v8':
specifier: ^3.0.0
byte-size:
specifier: ^9.0.0
version: 9.0.1
@@ -109,16 +109,16 @@ importers:
vite:
specifier: ^7.0.0
vite-tsconfig-paths:
specifier: ^6.0.0
vitest:
specifier: ^3.0.0
vitest-fetch-mock:
specifier: ^0.4.0
yaml:
specifier: ^2.3.1
version: 2.8.2
@@ -169,7 +169,7 @@ importers:
version: 18.3.1([email protected])
tailwindcss:
specifier: ^3.2.4
- version: 3.4.19([email protected])
url:
specifier: ^0.11.0
version: 0.11.4
@@ -201,6 +201,9 @@ importers:
'@immich/cli':
specifier: file:../cli
version: link:../cli
+ '@immich/e2e-auth-server':
+ specifier: file:../e2e-auth-server
+ version: link:../e2e-auth-server
'@immich/sdk':
specifier: file:../open-api/typescript-sdk
version: link:../open-api/typescript-sdk
@@ -216,9 +219,6 @@ importers:
'@types/node':
specifier: ^24.10.4
version: 24.10.4
- '@types/oidc-provider':
- specifier: ^9.0.0
- version: 9.5.0
'@types/pg':
specifier: ^8.15.1
version: 8.16.0
@@ -249,15 +249,9 @@ importers:
globals:
specifier: ^16.0.0
version: 16.5.0
- jose:
- specifier: ^5.6.3
- version: 5.10.0
luxon:
specifier: ^3.4.4
version: 3.7.2
- oidc-provider:
- specifier: ^9.0.0
- version: 9.6.0
pg:
specifier: ^8.11.3
version: 8.16.3
@@ -290,7 +284,22 @@ importers:
version: 5.2.1([email protected])
vitest:
specifier: ^3.0.0
+
+ e2e-auth-server:
+ devDependencies:
+ '@types/oidc-provider':
+ specifier: ^9.0.0
+ version: 9.5.0
+ jose:
+ specifier: ^5.6.3
+ version: 5.10.0
+ oidc-provider:
+ specifier: ^9.0.0
+ version: 9.6.0
+ tsx:
+ specifier: ^4.20.6
+ version: 4.21.0
i18n:
devDependencies:
@@ -552,7 +561,7 @@ importers:
version: 4.8.3
tailwindcss-preset-email:
specifier: ^1.4.0
thumbhash:
specifier: ^0.1.1
version: 0.1.1
@@ -655,7 +664,7 @@ importers:
version: 13.15.10
'@vitest/coverage-v8':
specifier: ^3.0.0
eslint:
specifier: ^9.14.0
version: 9.39.2([email protected])
@@ -694,7 +703,7 @@ importers:
version: 7.1.4
tailwindcss:
specifier: ^3.4.0
- version: 3.4.19([email protected])
testcontainers:
specifier: ^11.0.0
version: 11.11.0
@@ -709,10 +718,10 @@ importers:
vite-tsconfig-paths:
specifier: ^6.0.0
vitest:
specifier: ^3.0.0
web:
dependencies:
@@ -727,7 +736,7 @@ importers:
version: link:../open-api/typescript-sdk
'@immich/ui':
specifier: ^0.54.0
'@mapbox/mapbox-gl-rtl-text':
specifier: 0.2.3
version: 0.2.3([email protected])
@@ -845,25 +854,25 @@ importers:
version: 3.1.2
'@sveltejs/adapter-static':
specifier: ^3.0.8
'@sveltejs/enhanced-img':
specifier: ^0.9.0
'@sveltejs/kit':
specifier: ^2.27.1
'@sveltejs/vite-plugin-svelte':
specifier: 6.2.1
'@tailwindcss/vite':
specifier: ^4.1.7
'@testing-library/jest-dom':
specifier: ^6.4.2
version: 6.9.1
'@testing-library/svelte':
specifier: ^5.2.8
'@testing-library/user-event':
specifier: ^14.5.2
version: 14.6.1(@testing-library/[email protected])
@@ -887,7 +896,7 @@ importers:
version: 1.5.6
'@vitest/coverage-v8':
specifier: ^3.0.0
dotenv:
specifier: ^17.0.0
version: 17.2.3
@@ -947,10 +956,10 @@ importers:
vite:
specifier: ^7.1.2
vitest:
specifier: ^3.0.0
packages:
@@ -7416,6 +7425,9 @@ packages:
resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
engines: {node: '>=10'}
+ resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==}
+
resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==}
@@ -10408,6 +10420,9 @@ packages:
resolution: {integrity: sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==}
+ resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}
+
resolution: {integrity: sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==}
@@ -11369,6 +11384,11 @@ packages:
resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==}
engines: {node: '>=0.6.x'}
+ resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==}
+ engines: {node: '>=18.0.0'}
+ hasBin: true
+
resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}
@@ -15078,12 +15098,12 @@ snapshots:
dependencies:
svelte: 5.46.1
dependencies:
'@immich/svelte-markdown-preprocess': 0.1.0([email protected])
'@internationalized/date': 3.10.0
'@mdi/js': 7.4.47
luxon: 3.7.2
simple-icons: 16.4.0
svelte: 5.46.1
@@ -16688,29 +16708,29 @@ snapshots:
dependencies:
acorn: 8.15.0
dependencies:
dependencies:
magic-string: 0.30.21
sharp: 0.34.5
svelte: 5.46.1
svelte-parse-markup: 0.1.5([email protected])
vite-imagetools: 9.0.2([email protected])
zimmerframe: 1.1.4
transitivePeerDependencies:
- rollup
- supports-color
dependencies:
'@standard-schema/spec': 1.1.0
'@sveltejs/acorn-typescript': 1.0.8([email protected])
'@types/cookie': 0.6.0
acorn: 8.15.0
cookie: 0.6.0
@@ -16723,28 +16743,28 @@ snapshots:
set-cookie-parser: 2.7.2
sirv: 3.0.2
svelte: 5.46.1
optionalDependencies:
'@opentelemetry/api': 1.9.0
dependencies:
debug: 4.4.3
svelte: 5.46.1
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.4.3
deepmerge: 4.3.1
magic-string: 0.30.21
svelte: 5.46.1
transitivePeerDependencies:
- supports-color
@@ -16963,12 +16983,12 @@ snapshots:
'@tailwindcss/oxide-win32-arm64-msvc': 4.1.18
'@tailwindcss/oxide-win32-x64-msvc': 4.1.18
dependencies:
'@tailwindcss/node': 4.1.18
'@tailwindcss/oxide': 4.1.18
tailwindcss: 4.1.18
'@testing-library/[email protected]':
dependencies:
@@ -16994,14 +17014,14 @@ snapshots:
dependencies:
svelte: 5.46.1
dependencies:
'@testing-library/dom': 10.4.1
'@testing-library/svelte-core': 1.0.0([email protected])
svelte: 5.46.1
optionalDependencies:
'@testing-library/[email protected](@testing-library/[email protected])':
dependencies:
@@ -17588,7 +17608,7 @@ snapshots:
'@vercel/[email protected]': {}
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 1.0.2
@@ -17603,11 +17623,11 @@ snapshots:
std-env: 3.10.0
test-exclude: 7.0.1
tinyrainbow: 2.0.0
transitivePeerDependencies:
- supports-color
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 1.0.2
@@ -17622,7 +17642,7 @@ snapshots:
std-env: 3.10.0
test-exclude: 7.0.1
tinyrainbow: 2.0.0
transitivePeerDependencies:
- supports-color
@@ -17634,21 +17654,21 @@ snapshots:
chai: 5.3.3
tinyrainbow: 2.0.0
dependencies:
'@vitest/spy': 3.2.4
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
dependencies:
'@vitest/spy': 3.2.4
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
'@vitest/[email protected]':
dependencies:
@@ -18124,15 +18144,15 @@ snapshots:
dependencies:
'@floating-ui/core': 1.7.3
'@floating-ui/dom': 1.7.4
'@internationalized/date': 3.10.0
esm-env: 1.2.2
svelte: 5.46.1
tabbable: 6.3.0
transitivePeerDependencies:
- '@sveltejs/kit'
@@ -20066,6 +20086,10 @@ snapshots:
+ dependencies:
+ resolve-pkg-maps: 1.0.0
+
@@ -22817,12 +22841,13 @@ snapshots:
optionalDependencies:
postcss: 8.5.6
dependencies:
lilconfig: 3.1.3
optionalDependencies:
jiti: 1.21.7
postcss: 8.5.6
+ tsx: 4.21.0
yaml: 2.8.2
@@ -23661,6 +23686,8 @@ snapshots:
+
dependencies:
protocol-buffers-schema: 3.6.0
@@ -23769,14 +23796,14 @@ snapshots:
dependencies:
queue-microtask: 1.2.3
dependencies:
dequal: 2.0.3
esm-env: 1.2.2
lz-string: 1.5.0
svelte: 5.46.1
optionalDependencies:
@@ -24505,10 +24532,10 @@ snapshots:
dependencies:
svelte-floating-ui: 1.5.8
dependencies:
clsx: 2.1.1
style-to-object: 1.0.14
svelte: 5.46.1
transitivePeerDependencies:
@@ -24575,21 +24602,21 @@ snapshots:
optionalDependencies:
tailwind-merge: 3.4.0
dependencies:
- tailwindcss: 3.4.19([email protected])
+ tailwindcss: 3.4.19([email protected])([email protected])
dependencies:
- tailwindcss: 3.4.19([email protected])
+ tailwindcss: 3.4.19([email protected])([email protected])
dependencies:
- tailwindcss: 3.4.19([email protected])
- tailwindcss-email-variants: 3.0.5([email protected]([email protected]))
- tailwindcss-mso: 2.0.3([email protected]([email protected]))
+ tailwindcss: 3.4.19([email protected])([email protected])
+ tailwindcss-email-variants: 3.0.5([email protected]([email protected])([email protected]))
dependencies:
'@alloc/quick-lru': 5.2.0
arg: 5.0.2
@@ -24608,7 +24635,7 @@ snapshots:
postcss: 8.5.6
postcss-import: 15.1.0([email protected])
postcss-js: 4.1.0([email protected])
postcss-nested: 6.2.0([email protected])
postcss-selector-parser: 6.1.2
resolve: 1.22.11
@@ -24890,6 +24917,13 @@ snapshots:
+ dependencies:
+ esbuild: 0.27.2
+ get-tsconfig: 4.13.0
+ optionalDependencies:
+ fsevents: 2.3.3
+
@@ -25204,13 +25238,13 @@ snapshots:
- rollup
- supports-color
dependencies:
cac: 6.7.14
debug: 4.4.3
es-module-lexer: 1.7.0
pathe: 2.0.3
transitivePeerDependencies:
- '@types/node'
- jiti
@@ -25225,13 +25259,13 @@ snapshots:
- tsx
- yaml
dependencies:
cac: 6.7.14
debug: 4.4.3
es-module-lexer: 1.7.0
pathe: 2.0.3
transitivePeerDependencies:
- '@types/node'
- jiti
@@ -25246,18 +25280,18 @@ snapshots:
- tsx
- yaml
dependencies:
debug: 4.4.3
globrex: 0.1.2
tsconfck: 3.1.6([email protected])
optionalDependencies:
transitivePeerDependencies:
- supports-color
- typescript
dependencies:
esbuild: 0.27.2
fdir: 6.5.0([email protected])
@@ -25272,9 +25306,10 @@ snapshots:
lightningcss: 1.30.2
sass: 1.97.1
terser: 5.44.1
+ tsx: 4.21.0
yaml: 2.8.2
dependencies:
esbuild: 0.27.2
fdir: 6.5.0([email protected])
@@ -25289,21 +25324,22 @@ snapshots:
lightningcss: 1.30.2
sass: 1.97.1
terser: 5.44.1
+ tsx: 4.21.0
yaml: 2.8.2
optionalDependencies:
dependencies:
dependencies:
'@types/chai': 5.2.3
'@vitest/expect': 3.2.4
'@vitest/pretty-format': 3.2.4
'@vitest/runner': 3.2.4
'@vitest/snapshot': 3.2.4
@@ -25321,8 +25357,8 @@ snapshots:
tinyglobby: 0.2.15
tinypool: 1.1.1
tinyrainbow: 2.0.0
why-is-node-running: 2.3.0
optionalDependencies:
'@types/debug': 4.1.12
@@ -25343,11 +25379,11 @@ snapshots:
- tsx
- yaml
dependencies:
'@types/chai': 5.2.3
'@vitest/expect': 3.2.4
'@vitest/pretty-format': 3.2.4
'@vitest/runner': 3.2.4
'@vitest/snapshot': 3.2.4
@@ -25365,8 +25401,8 @@ snapshots:
tinyglobby: 0.2.15
tinypool: 1.1.1
tinyrainbow: 2.0.0
why-is-node-running: 2.3.0
optionalDependencies:
'@types/debug': 4.1.12
@@ -25387,11 +25423,11 @@ snapshots:
- tsx
- yaml
dependencies:
'@types/chai': 5.2.3
'@vitest/expect': 3.2.4
'@vitest/pretty-format': 3.2.4
'@vitest/runner': 3.2.4
'@vitest/snapshot': 3.2.4
@@ -25409,8 +25445,8 @@ snapshots:
tinyglobby: 0.2.15
tinypool: 1.1.1
tinyrainbow: 2.0.0
why-is-node-running: 2.3.0
optionalDependencies:
'@types/debug': 4.1.12
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index c7ec4739ae..f7f22e6f44 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -2,6 +2,7 @@ packages:
- cli
- docs
- e2e
+ - e2e-auth-server
- i18n
- open-api/typescript-sdk
- server