Skip to content

Commit 895b206

Browse files
authored
Merge branch 'main' into feat/mobile/use-cached-network-image-for-people-image
2 parents c6da5b7 + 15c488c commit 895b206

File tree

402 files changed

+15618
-9079
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

402 files changed

+15618
-9079
lines changed

.devcontainer/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.devcontainer/Dockerfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
11
{
2-
"name": "Immich",
3-
"service": "immich-devcontainer",
2+
"name": "Immich - Backend, Frontend and ML",
3+
"service": "immich-server",
4+
"runServices": [
5+
"immich-server",
6+
"redis",
7+
"database",
8+
"immich-machine-learning"
9+
],
410
"dockerComposeFile": [
5-
"docker-compose.yml",
6-
"../docker/docker-compose.dev.yml"
11+
"../docker/docker-compose.dev.yml",
12+
"./server/container-compose-overrides.yml"
713
],
814
"customizations": {
915
"vscode": {
1016
"extensions": [
11-
"Dart-Code.dart-code",
12-
"Dart-Code.flutter",
1317
"dbaeumer.vscode-eslint",
14-
"dcmdev.dcm-vscode-extension",
1518
"esbenp.prettier-vscode",
16-
"svelte.svelte-vscode"
19+
"svelte.svelte-vscode",
20+
"ms-vscode-remote.remote-containers",
21+
"foxundermoon.shell-format",
22+
"timonwong.shellcheck",
23+
"rvest.vs-code-prettier-eslint",
24+
"bluebrown.yamlfmt",
25+
"vkrishna04.cspell-sync",
26+
"vitest.explorer",
27+
"ms-playwright.playwright",
28+
"ms-azuretools.vscode-docker"
1729
]
1830
}
1931
},
20-
"forwardPorts": [],
21-
"initializeCommand": "bash .devcontainer/scripts/initializeCommand.sh",
22-
"onCreateCommand": "bash .devcontainer/scripts/onCreateCommand.sh",
32+
"forwardPorts": [3000, 9231, 9230, 2283],
33+
"portsAttributes": {
34+
"3000": {
35+
"label": "Immich - Frontend HTTP",
36+
"description": "The frontend of the Immich project",
37+
"onAutoForward": "openBrowserOnce"
38+
},
39+
"2283": {
40+
"label": "Immich - API Server - HTTP",
41+
"description": "The API server of the Immich project"
42+
},
43+
"9231": {
44+
"label": "Immich - API Server - DEBUG",
45+
"description": "The API server of the Immich project"
46+
},
47+
"9230": {
48+
"label": "Immich - Workers - DEBUG",
49+
"description": "The workers of the Immich project"
50+
}
51+
},
2352
"overrideCommand": true,
24-
"workspaceFolder": "/immich",
25-
"remoteUser": "node"
53+
"workspaceFolder": "/workspaces/immich",
54+
"remoteUser": "node",
55+
"userEnvProbe": "loginInteractiveShell",
56+
"remoteEnv": {
57+
// The location where your uploaded files are stored
58+
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./Library}",
59+
// Connection secret for postgres. You should change it to a random password
60+
// Please use only the characters `A-Za-z0-9`, without special characters or spaces
61+
"DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}",
62+
// The database username
63+
"DB_USERNAME": "${localEnv:DB_USERNAME:postgres}",
64+
// The database name
65+
"DB_DATABASE_NAME": "${localEnv:DB_DATABASE_NAME:immich}"
66+
}
2667
}

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
services:
2+
immich-server:
3+
build:
4+
target: dev-container-mobile
5+
environment:
6+
- IMMICH_SERVER_URL=http://127.0.0.1:2283/
7+
volumes: !override # bind mount host to /workspaces/immich
8+
- ..:/workspaces/immich
9+
- cli_node_modules:/workspaces/immich/cli/node_modules
10+
- e2e_node_modules:/workspaces/immich/e2e/node_modules
11+
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
12+
- server_node_modules:/workspaces/immich/server/node_modules
13+
- web_node_modules:/workspaces/immich/web/node_modules
14+
- ${UPLOAD_LOCATION}/photos:/workspaces/immich/server/upload
15+
- ${UPLOAD_LOCATION}/photos/upload:/workspaces/immich/server/upload/upload
16+
- /etc/localtime:/etc/localtime:ro
17+
18+
database:
19+
volumes:
20+
- ${UPLOAD_LOCATION}/postgres:/var/lib/postgresql/data
21+
22+
volumes:
23+
# Node modules for each service to avoid conflicts and ensure consistent dependencies
24+
cli_node_modules:
25+
e2e_node_modules:
26+
open_api_node_modules:
27+
server_node_modules:
28+
web_node_modules:
29+
30+
# UPLOAD_LOCATION must be set to a absolute path or vol-upload
31+
vol-upload:
32+
33+
# DB_DATA_LOCATION must be set to a absolute path or vol-database
34+
vol-database:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "Immich - Mobile",
3+
"service": "immich-server",
4+
"runServices": [
5+
"immich-server",
6+
"redis",
7+
"database",
8+
"immich-machine-learning"
9+
],
10+
"dockerComposeFile": [
11+
"../../docker/docker-compose.dev.yml",
12+
"./container-compose-overrides.yml"
13+
],
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"Dart-Code.dart-code",
18+
"Dart-Code.flutter",
19+
"dcmdev.dcm-vscode-extension",
20+
"esbenp.prettier-vscode",
21+
"dbaeumer.vscode-eslint",
22+
"esbenp.prettier-vscode",
23+
"svelte.svelte-vscode",
24+
"ms-vscode-remote.remote-containers",
25+
"foxundermoon.shell-format",
26+
"timonwong.shellcheck",
27+
"rvest.vs-code-prettier-eslint",
28+
"bluebrown.yamlfmt",
29+
"vkrishna04.cspell-sync",
30+
"vitest.explorer",
31+
"ms-playwright.playwright",
32+
"ms-azuretools.vscode-docker"
33+
]
34+
}
35+
},
36+
"forwardPorts": [],
37+
"overrideCommand": true,
38+
"workspaceFolder": "/workspaces/immich",
39+
"remoteUser": "node",
40+
"userEnvProbe": "loginInteractiveShell",
41+
"remoteEnv": {
42+
// The location where your uploaded files are stored
43+
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./Library}",
44+
// Connection secret for postgres. You should change it to a random password
45+
// Please use only the characters `A-Za-z0-9`, without special characters or spaces
46+
"DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}",
47+
// The database username
48+
"DB_USERNAME": "${localEnv:DB_USERNAME:postgres}",
49+
// The database name
50+
"DB_DATABASE_NAME": "${localEnv:DB_DATABASE_NAME:immich}"
51+
}
52+
}

.devcontainer/scripts/initializeCommand.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.devcontainer/scripts/onCreateCommand.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
export IMMICH_PORT="${DEV_SERVER_PORT:-2283}"
3+
export DEV_PORT="${DEV_PORT:-3000}"
4+
5+
# search for immich directory inside workspace.
6+
# /workspaces/immich is the bind mount, but other directories can be mounted if runing
7+
# Devcontainer: Clone [repository|pull request] in container volumne
8+
WORKSPACES_DIR="/workspaces"
9+
IMMICH_DIR="$WORKSPACES_DIR/immich"
10+
11+
# Find directories excluding /workspaces/immich
12+
mapfile -t other_dirs < <(find "$WORKSPACES_DIR" -mindepth 1 -maxdepth 1 -type d ! -path "$IMMICH_DIR" ! -name ".*")
13+
14+
if [ ${#other_dirs[@]} -gt 1 ]; then
15+
echo "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR."
16+
exit 1
17+
elif [ ${#other_dirs[@]} -eq 1 ]; then
18+
export IMMICH_WORKSPACE="${other_dirs[0]}"
19+
else
20+
export IMMICH_WORKSPACE="$IMMICH_DIR"
21+
fi
22+
23+
echo "Found immich workspace in $IMMICH_WORKSPACE"
24+
25+
run_cmd() {
26+
echo "$@"
27+
"$@"
28+
}
29+
30+
fix_permissions() {
31+
32+
echo "Fixing permissions for ${IMMICH_WORKSPACE}"
33+
34+
run_cmd sudo find "${IMMICH_WORKSPACE}/server/upload" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres/*" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres" -exec chown node {} +
35+
36+
run_cmd sudo chown node -R "${IMMICH_WORKSPACE}/.vscode" \
37+
"${IMMICH_WORKSPACE}/cli/node_modules" \
38+
"${IMMICH_WORKSPACE}/e2e/node_modules" \
39+
"${IMMICH_WORKSPACE}/open-api/typescript-sdk/node_modules" \
40+
"${IMMICH_WORKSPACE}/server/node_modules" \
41+
"${IMMICH_WORKSPACE}/server/dist" \
42+
"${IMMICH_WORKSPACE}/web/node_modules" \
43+
"${IMMICH_WORKSPACE}/web/dist"
44+
}
45+
46+
install_dependencies() {
47+
48+
echo "Installing dependencies"
49+
50+
(
51+
cd "${IMMICH_WORKSPACE}" || exit 1
52+
run_cmd make install-server
53+
run_cmd make install-open-api
54+
run_cmd make build-open-api
55+
run_cmd make install-web
56+
)
57+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
immich-server:
3+
build:
4+
target: dev-container-server
5+
env_file: !reset []
6+
environment:
7+
- IMMICH_SERVER_URL=http://127.0.0.1:2283/
8+
volumes: !override
9+
- ..:/workspaces/immich
10+
- cli_node_modules:/workspaces/immich/cli/node_modules
11+
- e2e_node_modules:/workspaces/immich/e2e/node_modules
12+
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
13+
- server_node_modules:/workspaces/immich/server/node_modules
14+
- web_node_modules:/workspaces/immich/web/node_modules
15+
- ${UPLOAD_LOCATION-./Library}/photos:/workspaces/immich/server/upload
16+
- ${UPLOAD_LOCATION-./Library}/photos/upload:/workspaces/immich/server/upload/upload
17+
- /etc/localtime:/etc/localtime:ro
18+
19+
immich-web:
20+
env_file: !reset []
21+
22+
immich-machine-learning:
23+
env_file: !reset []
24+
25+
database:
26+
env_file: !reset []
27+
environment: !override
28+
POSTGRES_PASSWORD: ${DB_PASSWORD-postgres}
29+
POSTGRES_USER: ${DB_USERNAME-postgres}
30+
POSTGRES_DB: ${DB_DATABASE_NAME-immich}
31+
POSTGRES_INITDB_ARGS: '--data-checksums'
32+
volumes:
33+
- ${UPLOAD_LOCATION-./Library}/postgres:/var/lib/postgresql/data
34+
35+
redis:
36+
env_file: !reset []
37+
38+
volumes:
39+
# Node modules for each service to avoid conflicts and ensure consistent dependencies
40+
cli_node_modules:
41+
e2e_node_modules:
42+
open_api_node_modules:
43+
server_node_modules:
44+
web_node_modules:

0 commit comments

Comments
 (0)