mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 09:15:05 +03:00
feat: support config via systemd credentials (#20406)
feat: Support config via Systemd Credentials See https://systemd.io/CREDENTIALS/. This is used as a fallback, so will only be used if the `$*_FILE` var is empty. This could also be used to implicitly use Docker Secrets by settings `CREDENTIALS_DIRECTORY=/run/secrets` rather than setting individual `$_*FILE` environment variables.
This commit is contained in:
@@ -11,8 +11,12 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/jellyfin-ffmpeg/lib"
|
||||
SERVER_HOME=/usr/src/app/server
|
||||
|
||||
read_file_and_export() {
|
||||
if [ -n "${!1}" ]; then
|
||||
content="$(cat "${!1}")"
|
||||
fname="${!1}"
|
||||
if [[ -z $fname ]] && [[ -e "$CREDENTIALS_DIRECTORY/$2" ]]; then
|
||||
fname="${CREDENTIALS_DIRECTORY}/$2"
|
||||
fi
|
||||
if [[ -n $fname ]]; then
|
||||
content="$(< "$fname")"
|
||||
export "$2"="${content}"
|
||||
unset "$1"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user