Skip to content

Commit 1de2152

Browse files
committed
Merge remote-tracking branch 'origin/main' into refactor/asset_grid
2 parents f534eb9 + 798debf commit 1de2152

File tree

265 files changed

+4479
-1567
lines changed

Some content is hidden

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

265 files changed

+4479
-1567
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"userEnvProbe": "loginInteractiveShell",
5656
"remoteEnv": {
5757
// The location where your uploaded files are stored
58-
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./Library}",
58+
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./library}",
5959
// Connection secret for postgres. You should change it to a random password
6060
// Please use only the characters `A-Za-z0-9`, without special characters or spaces
6161
"DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}",

.devcontainer/server/container-common.sh

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,76 @@ export DEV_PORT="${DEV_PORT:-3000}"
77
# Devcontainer: Clone [repository|pull request] in container volumne
88
WORKSPACES_DIR="/workspaces"
99
IMMICH_DIR="$WORKSPACES_DIR/immich"
10+
IMMICH_DEVCONTAINER_LOG="$HOME/immich-devcontainer.log"
11+
12+
log() {
13+
# Display command on console, log with timestamp to file
14+
echo "$*"
15+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >>"$IMMICH_DEVCONTAINER_LOG"
16+
}
17+
18+
run_cmd() {
19+
# Ensure log directory exists
20+
mkdir -p "$(dirname "$IMMICH_DEVCONTAINER_LOG")"
21+
22+
log "$@"
23+
24+
# Execute command: display normally on console, log with timestamps to file
25+
"$@" 2>&1 | tee >(while IFS= read -r line; do
26+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $line" >>"$IMMICH_DEVCONTAINER_LOG"
27+
done)
28+
29+
# Preserve exit status
30+
return "${PIPESTATUS[0]}"
31+
}
1032

1133
# Find directories excluding /workspaces/immich
1234
mapfile -t other_dirs < <(find "$WORKSPACES_DIR" -mindepth 1 -maxdepth 1 -type d ! -path "$IMMICH_DIR" ! -name ".*")
1335

1436
if [ ${#other_dirs[@]} -gt 1 ]; then
15-
echo "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR."
37+
log "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR."
1638
exit 1
1739
elif [ ${#other_dirs[@]} -eq 1 ]; then
1840
export IMMICH_WORKSPACE="${other_dirs[0]}"
1941
else
2042
export IMMICH_WORKSPACE="$IMMICH_DIR"
2143
fi
2244

23-
echo "Found immich workspace in $IMMICH_WORKSPACE"
24-
25-
run_cmd() {
26-
echo "$@"
27-
"$@"
28-
}
45+
log "Found immich workspace in $IMMICH_WORKSPACE"
46+
log ""
2947

3048
fix_permissions() {
3149

32-
echo "Fixing permissions for ${IMMICH_WORKSPACE}"
50+
log "Fixing permissions for ${IMMICH_WORKSPACE}"
3351

3452
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 {} +
3553

36-
run_cmd sudo chown node -R "${IMMICH_WORKSPACE}/.vscode" \
54+
# Change ownership for directories that exist
55+
for dir in "${IMMICH_WORKSPACE}/.vscode" \
3756
"${IMMICH_WORKSPACE}/cli/node_modules" \
3857
"${IMMICH_WORKSPACE}/e2e/node_modules" \
3958
"${IMMICH_WORKSPACE}/open-api/typescript-sdk/node_modules" \
4059
"${IMMICH_WORKSPACE}/server/node_modules" \
4160
"${IMMICH_WORKSPACE}/server/dist" \
4261
"${IMMICH_WORKSPACE}/web/node_modules" \
43-
"${IMMICH_WORKSPACE}/web/dist"
62+
"${IMMICH_WORKSPACE}/web/dist"; do
63+
if [ -d "$dir" ]; then
64+
run_cmd sudo chown node -R "$dir"
65+
fi
66+
done
67+
68+
log ""
4469
}
4570

4671
install_dependencies() {
4772

48-
echo "Installing dependencies"
49-
73+
log "Installing dependencies"
5074
(
5175
cd "${IMMICH_WORKSPACE}" || exit 1
5276
run_cmd make install-server
53-
run_cmd make install-open-api
54-
run_cmd make build-open-api
77+
run_cmd make install-sdk
78+
run_cmd make build-sdk
5579
run_cmd make install-web
5680
)
57-
}
81+
log ""
82+
}

.devcontainer/server/container-compose-overrides.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ services:
1212
- open_api_node_modules:/workspaces/immich/open-api/typescript-sdk/node_modules
1313
- server_node_modules:/workspaces/immich/server/node_modules
1414
- 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
15+
- ${UPLOAD_LOCATION:-upload1-devcontainer-volume}${UPLOAD_LOCATION:+/photos}:/workspaces/immich/server/upload
16+
- ${UPLOAD_LOCATION:-upload2-devcontainer-volume}${UPLOAD_LOCATION:+/photos/upload}:/workspaces/immich/server/upload/upload
1717
- /etc/localtime:/etc/localtime:ro
1818

1919
immich-web:
@@ -29,8 +29,9 @@ services:
2929
POSTGRES_USER: ${DB_USERNAME-postgres}
3030
POSTGRES_DB: ${DB_DATABASE_NAME-immich}
3131
POSTGRES_INITDB_ARGS: '--data-checksums'
32-
volumes:
33-
- ${UPLOAD_LOCATION-./Library}/postgres:/var/lib/postgresql/data
32+
POSTGRES_HOST_AUTH_METHOD: md5
33+
volumes:
34+
- ${UPLOAD_LOCATION:-postgres-devcontainer-volume}${UPLOAD_LOCATION:+/postgres}:/var/lib/postgresql/data
3435

3536
redis:
3637
env_file: !reset []
@@ -42,3 +43,6 @@ volumes:
4243
open_api_node_modules:
4344
server_node_modules:
4445
web_node_modules:
46+
upload1-devcontainer-volume:
47+
upload2-devcontainer-volume:
48+
postgres-devcontainer-volume:

.devcontainer/server/container-start-backend.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6-
echo "Starting Nest API Server"
7-
6+
log "Starting Nest API Server"
7+
log ""
88
cd "${IMMICH_WORKSPACE}/server" || (
9-
echo workspace not found
9+
log "Immich workspace not found"
1010
exit 1
1111
)
1212

1313
while true; do
14-
node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
15-
echo " Nest API Server crashed with exit code $?. Respawning in 3s ..."
14+
run_cmd node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
15+
log "Nest API Server crashed with exit code $?. Respawning in 3s ..."
1616
sleep 3
1717
done

.devcontainer/server/container-start-frontend.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6-
echo "Starting Immich Web Frontend"
7-
6+
log "Starting Immich Web Frontend"
7+
log ""
88
cd "${IMMICH_WORKSPACE}/web" || (
9-
echo Workspace not found
9+
log "Immich Workspace not found"
1010
exit 1
1111
)
1212

1313
until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_PORT}/api/server/config"; do
14-
echo 'waiting for api server...'
14+
log "Waiting for api server..."
1515
sleep 1
1616
done
1717

1818
while true; do
19-
node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
20-
echo "Web crashed with exit code $?. Respawning in 3s ..."
19+
run_cmd node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
20+
log "Web crashed with exit code $?. Respawning in 3s ..."
2121
sleep 3
2222
done

.devcontainer/server/container-start.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,18 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6+
log "Setting up Immich dev container..."
67
fix_permissions
8+
9+
log "Installing npm dependencies (node_modules)..."
710
install_dependencies
11+
12+
log "Setup complete, please wait while backend and frontend services automatically start"
13+
log
14+
log "If necessary, the services may be manually started using"
15+
log
16+
log "$ /immich-devcontainer/container-start-backend.sh"
17+
log "$ /immich-devcontainer/container-start-frontend.sh"
18+
log
19+
log "From different terminal windows, as these scripts automatically restart the server"
20+
log "on error, and will continuously run in a loop"

.github/workflows/test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
if: ${{ !cancelled() }}
102102

103103
- name: Run small tests & coverage
104-
run: npm run test:cov
104+
run: npm test
105105
if: ${{ !cancelled() }}
106106

107107
cli-unit-tests:
@@ -146,7 +146,7 @@ jobs:
146146
if: ${{ !cancelled() }}
147147

148148
- name: Run unit tests & coverage
149-
run: npm run test:cov
149+
run: npm run test
150150
if: ${{ !cancelled() }}
151151

152152
cli-unit-tests-win:
@@ -184,7 +184,7 @@ jobs:
184184
if: ${{ !cancelled() }}
185185

186186
- name: Run unit tests & coverage
187-
run: npm run test:cov
187+
run: npm run test
188188
if: ${{ !cancelled() }}
189189

190190
web-lint:
@@ -262,7 +262,7 @@ jobs:
262262
if: ${{ !cancelled() }}
263263

264264
- name: Run unit tests & coverage
265-
run: npm run test:cov
265+
run: npm run test
266266
if: ${{ !cancelled() }}
267267

268268
i18n-tests:
@@ -644,7 +644,7 @@ jobs:
644644
contents: read
645645
services:
646646
postgres:
647-
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.1
647+
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3
648648
env:
649649
POSTGRES_PASSWORD: postgres
650650
POSTGRES_USER: postgres
@@ -722,6 +722,7 @@ jobs:
722722
run: |
723723
echo "ERROR: Generated SQL files not up to date!"
724724
echo "Changed files: ${CHANGED_FILES}"
725+
git diff
725726
exit 1
726727
727728
# mobile-integration-tests:

cli/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@immich/cli",
3-
"version": "2.2.68",
3+
"version": "2.2.72",
44
"description": "Command Line Interface (CLI) for Immich",
55
"type": "module",
66
"exports": "./dist/index.js",

docker/docker-compose.dev.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ name: immich-dev
1616
services:
1717
immich-server:
1818
container_name: immich_server
19-
command: [ '/usr/src/app/bin/immich-dev' ]
19+
command: ['/usr/src/app/bin/immich-dev']
2020
image: immich-server-dev:latest
2121
# extends:
2222
# file: hwaccel.transcoding.yml
@@ -70,7 +70,7 @@ services:
7070
# user: 0:0
7171
build:
7272
context: ../web
73-
command: [ '/usr/src/app/bin/immich-web' ]
73+
command: ['/usr/src/app/bin/immich-web']
7474
env_file:
7575
- .env
7676
ports:
@@ -122,7 +122,7 @@ services:
122122

123123
database:
124124
container_name: immich_postgres
125-
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.1-pgvectors0.2.0
125+
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
126126
env_file:
127127
- .env
128128
environment:

0 commit comments

Comments
 (0)