forked from 4v3ngR/immich-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor generated PKG to include a precompiled Immich release
- Loading branch information
zebrapurring
committed
Nov 30, 2024
1 parent
a26140d
commit 33ed4c3
Showing
16 changed files
with
257 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.DS_Store | ||
|
||
# Build artifacts | ||
/dist/ | ||
/output/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
IMMICH_TAG="v1.121.0" | ||
|
||
IMMICH_INSTALL_DIR="/opt/immich" | ||
IMMICH_SETTINGS_DIR="$IMMICH_INSTALL_DIR/etc" | ||
IMMICH_APP_DIR="$IMMICH_INSTALL_DIR/share" | ||
IMMICH_MEDIA_DIR="$IMMICH_INSTALL_DIR/var/db" | ||
|
||
IMMICH_HOME_DIR="$IMMICH_INSTALL_DIR/home" | ||
IMMICH_USER="immich" | ||
IMMICH_GROUP="immich" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
# Create logs directory | ||
mkdir -p /var/log/immich | ||
chown -R "$IMMICH_USER:$IMMICH_GROUP" /var/log/immich | ||
|
||
# Create media directory | ||
mkdir -p "$IMMICH_MEDIA_DIR" | ||
|
||
# Create custom start scripts | ||
mkdir -p "$IMMICH_SETTINGS_DIR" | ||
cat <<EOF > "$IMMICH_APP_DIR/start.sh" | ||
#!/bin/sh | ||
set -eu | ||
set -a | ||
. "$IMMICH_SETTINGS_DIR/immich_server.env" | ||
set +a | ||
cd "$IMMICH_APP_DIR" | ||
exec node ./dist/main "\$@" | ||
EOF | ||
chmod 700 "$IMMICH_APP_DIR/start.sh" | ||
|
||
cat <<EOF > "$IMMICH_APP_DIR/machine-learning/start.sh" | ||
#!/bin/sh | ||
set -eu | ||
set -a | ||
. "$IMMICH_SETTINGS_DIR/immich_server.env" | ||
set +a | ||
cd "$IMMICH_APP_DIR/machine-learning" | ||
. ./venv/bin/activate | ||
: "\${MACHINE_LEARNING_HOST:=127.0.0.1}" | ||
: "\${MACHINE_LEARNING_PORT:=3003}" | ||
: "\${MACHINE_LEARNING_WORKERS:=1}" | ||
: "\${MACHINE_LEARNING_WORKER_TIMEOUT:=120}" | ||
exec gunicorn app.main:app \\ | ||
-k app.config.CustomUvicornWorker \\ | ||
-w "\$MACHINE_LEARNING_WORKERS" \\ | ||
-b "\$MACHINE_LEARNING_HOST:\$MACHINE_LEARNING_PORT" \\ | ||
-t "\$MACHINE_LEARNING_WORKER_TIMEOUT" \\ | ||
--log-config-json log_conf.json \\ | ||
--graceful-timeout 0 | ||
EOF | ||
chmod 700 "$IMMICH_APP_DIR/machine-learning/start.sh" | ||
|
||
if [ ! -f "$IMMICH_SETTINGS_DIR/immich_server.env" ]; then | ||
cp "$IMMICH_SETTINGS_DIR/build_info.env" "$IMMICH_SETTINGS_DIR/immich_server.env" | ||
cat <<EOF >> "$IMMICH_SETTINGS_DIR/immich_server.env" | ||
# Network binding | ||
IMMICH_HOST="0.0.0.0" | ||
IMMICH_PORT="2283" | ||
# Production settings | ||
NO_COLOR="false" | ||
NODE_ENV="production" | ||
IMMICH_ENV="production" | ||
# Paths configuration | ||
IMMICH_MEDIA_LOCATION="$IMMICH_MEDIA_DIR" | ||
IMMICH_BUILD_DATA="$IMMICH_APP_DIR/build" | ||
# Database connection | ||
DB_HOSTNAME="localhost" | ||
DB_USERNAME="immich" | ||
DB_DATABASE_NAME="immich" | ||
DB_PASSWORD="$POSTGRES_PASSWORD" | ||
DB_VECTOR_EXTENSION="pgvector" | ||
# Redis connection | ||
REDIS_HOSTNAME="localhost" | ||
EOF | ||
fi | ||
|
||
# Adjust permissions | ||
chown -R "$IMMICH_USER:$IMMICH_GROUP" "$IMMICH_INSTALL_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.