Skip to content

Commit

Permalink
Fix non-root user execution of ckan-pycsw
Browse files Browse the repository at this point in the history
- Also add pycsw.conf INSPIRE extended info.
  • Loading branch information
mjanez authored Sep 22, 2023
1 parent eea2a8b commit f86e1be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckan-pycsw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ WORKDIR ${APP_DIR}
# Update files if needed
COPY pycsw/conf/pycsw.conf.template docker-entrypoint.d/entrypoint.sh ./

USER $USERNAME
USER root

ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
7 changes: 7 additions & 0 deletions ckan-pycsw/docker-entrypoint.d/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

set -xeuo pipefail

# Change ownership of log and metadata directories
chown -R $USERNAME:$USERNAME ${APP_DIR}/log
chown -R $USERNAME:$USERNAME ${APP_DIR}/metadata

# Switch to the non-root user
su - $USERNAME

envsubst < pycsw.conf.template > pycsw.conf

#TODO: -Xfrozen_modules=off from: https://bugs.python.org/issue1666807
Expand Down
2 changes: 1 addition & 1 deletion ckan-pycsw/pycsw/conf/pycsw.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ database=sqlite:///${PWD}/cite.db
table=records
#filter=type='http://purl.org/dc/dcmitype/Dataset'

#[metadata:inspire]
[metadata:inspire]
enabled=true
languages_supported=eng,spa
default_language=eng
Expand Down

0 comments on commit f86e1be

Please sign in to comment.