mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: shell scripts (#7186)
* fix: bash scripts * pr feedback * wrong variable * ci: add shellcheck workflow * fix: missing scripts
This commit is contained in:
parent
4b46bb49d7
commit
ddae707ea9
13 changed files with 65 additions and 37 deletions
|
|
@ -1,35 +1,42 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export LD_PRELOAD=/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2
|
||||
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
|
||||
export LD_PRELOAD="$lib_path"
|
||||
|
||||
if [ "$DB_URL_FILE" ]; then
|
||||
export DB_URL=$(cat $DB_URL_FILE)
|
||||
DB_URL_CONTENT=$(cat "$DB_URL_FILE")
|
||||
export DB_URL="$DB_URL_CONTENT"
|
||||
unset DB_URL_FILE
|
||||
fi
|
||||
|
||||
if [ "$DB_HOSTNAME_FILE" ]; then
|
||||
export DB_HOSTNAME=$(cat $DB_HOSTNAME_FILE)
|
||||
DB_HOSTNAME_CONTENT=$(cat "$DB_HOSTNAME_FILE")
|
||||
export DB_HOSTNAME="$DB_HOSTNAME_CONTENT"
|
||||
unset DB_HOSTNAME_FILE
|
||||
fi
|
||||
|
||||
if [ "$DB_DATABASE_NAME_FILE" ]; then
|
||||
export DB_DATABASE_NAME=$(cat $DB_DATABASE_NAME_FILE)
|
||||
DB_DATABASE_CONTENT=$(cat "$DB_DATABASE_NAME_FILE")
|
||||
export DB_DATABASE_NAME="$DB_DATABASE_CONTENT"
|
||||
unset DB_DATABASE_NAME_FILE
|
||||
fi
|
||||
|
||||
if [ "$DB_USERNAME_FILE" ]; then
|
||||
export DB_USERNAME=$(cat $DB_USERNAME_FILE)
|
||||
DB_USERNAME_CONTENT=$(cat "$DB_USERNAME_FILE")
|
||||
export DB_USERNAME="$DB_USERNAME_CONTENT"
|
||||
unset DB_USERNAME_FILE
|
||||
fi
|
||||
|
||||
if [ "$DB_PASSWORD_FILE" ]; then
|
||||
export DB_PASSWORD=$(cat $DB_PASSWORD_FILE)
|
||||
DB_PASSWORD_CONTENT=$(cat "$DB_PASSWORD_FILE")
|
||||
export DB_PASSWORD="$DB_PASSWORD_CONTENT"
|
||||
unset DB_PASSWORD_FILE
|
||||
fi
|
||||
|
||||
if [ "$REDIS_PASSWORD_FILE" ]; then
|
||||
export REDIS_PASSWORD=$(cat $REDIS_PASSWORD_FILE)
|
||||
REDIS_PASSWORD_CONTENT=$(cat "$REDIS_PASSWORD_FILE")
|
||||
export DB_PASSWORD="$REDIS_PASSWORD_CONTENT"
|
||||
unset REDIS_PASSWORD_FILE
|
||||
fi
|
||||
|
||||
exec node /usr/src/app/dist/main $@
|
||||
exec node /usr/src/app/dist/main "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue