From b524cbe232dae83f541c6ddfa493e07e2192465f Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 16 Dec 2025 11:48:35 +0100 Subject: [PATCH] PhotoPrism: export env variables for CLI tools (#10023) --- ct/photoprism.sh | 7 +++++++ install/photoprism-install.sh | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ct/photoprism.sh b/ct/photoprism.sh index cfb30dba8..daa8daca4 100644 --- a/ct/photoprism.sh +++ b/ct/photoprism.sh @@ -31,6 +31,13 @@ function update_script() { msg_info "Stopping PhotoPrism" systemctl stop photoprism msg_ok "Stopped PhotoPrism" + + if ! grep -q "photoprism/config/.env" ~/.bashrc 2>/dev/null; then + msg_info "Adding environment export for CLI tools" + echo '# Load PhotoPrism environment variables for CLI tools' >>~/.bashrc + echo 'export $(grep -v "^#" /opt/photoprism/config/.env | xargs)' >>~/.bashrc + msg_ok "Added environment export" + fi fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz" diff --git a/install/photoprism-install.sh b/install/photoprism-install.sh index 175574ebe..06f0d06fe 100644 --- a/install/photoprism-install.sh +++ b/install/photoprism-install.sh @@ -28,6 +28,8 @@ $STD apt install -y \ lsb-release echo 'export PATH=/usr/local:$PATH' >>~/.bashrc +echo '# Load PhotoPrism environment variables for CLI tools' >>~/.bashrc +echo 'export $(grep -v "^#" /opt/photoprism/config/.env | xargs)' >>~/.bashrc export PATH=/usr/local:$PATH msg_ok "Installed Dependencies"