Skip to content

Commit

Permalink
Merge pull request #64 from mr-ssd/fix-wrong-pi-config-dir
Browse files Browse the repository at this point in the history
fix wrong default pi.cfg location
  • Loading branch information
mr-ssd authored Mar 14, 2023
2 parents 25702f1 + ca32aef commit 874a248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ 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 \
--uid 1001 \
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 \
Expand Down
4 changes: 2 additions & 2 deletions rootfs/usr/local/bin/start_privacyidea.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 874a248

Please sign in to comment.