From ca32aef5b06098aa5d3a4e53e77deac66b64fc4d Mon Sep 17 00:00:00 2001 From: Sida Say Date: Tue, 14 Mar 2023 15:48:40 +0700 Subject: [PATCH] fix wrong default pi.config location --- Dockerfile | 5 +++-- rootfs/usr/local/bin/start_privacyidea.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fb3b601..ec265b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ RUN install_packages ca-certificates git supervisor gettext-base nginx # Create directories and user for PrivacyIdea and set ownership RUN mkdir -p /data/privacyidea/keys \ - /var/log/privacyidea && \ + /var/log/privacyidea \ + /etc/privacyidea && \ adduser --gecos "PrivacyIdea User" \ --disabled-password \ --home /home/privacyidea \ @@ -17,7 +18,7 @@ RUN mkdir -p /data/privacyidea/keys \ privacyidea && \ addgroup privacyidea privacyidea && \ usermod -g 1001 privacyidea && \ - chown -R privacyidea:privacyidea /var/log/privacyidea /data/privacyidea + chown -R privacyidea:privacyidea /var/log/privacyidea /data/privacyidea /etc/privacyidea # Set environment variables for uWSGI and Nginx ENV UWSGI_INI=/etc/uwsgi/uwsgi.ini \ diff --git a/rootfs/usr/local/bin/start_privacyidea.sh b/rootfs/usr/local/bin/start_privacyidea.sh index b1144dd..c1860ec 100755 --- a/rootfs/usr/local/bin/start_privacyidea.sh +++ b/rootfs/usr/local/bin/start_privacyidea.sh @@ -61,14 +61,14 @@ function generate_pi_config { fi # Check if the configuration file already exists - if [ ! -f /data/privacyidea/pi.cfg ]; then + if [ ! -f /etc/privacyidea/pi.cfg ]; then # Check if SQLALCHEMY_DATABASE_URI is defined if [ -z "$SQLALCHEMY_DATABASE_URI" ]; then echo "SQLALCHEMY_DATABASE_URI is undefined" else # Use the pi-config.template file as a template and substitute the necessary variables - envsubst < /opt/templates/pi-config.template > /data/privacyidea/pi.cfg + envsubst < /opt/templates/pi-config.template > /etc/privacyidea/pi.cfg fi fi