Skip to content

Commit

Permalink
add custom pam module templating (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed May 24, 2022
1 parent 6c7ddca commit 4e6cf2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 1 addition & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,9 @@ RUN apt-get install libpam-python pamtester
# Copy scripts and templates
COPY docker-entrypoint.sh files/irods_login.sh \
templates/core.py.template templates/unattended_config.json.j2 \
templates/irods.pam.j2 files/j2-filters.py /
templates/irods.pam.j2 files/j2-filters.py templates/pam_sodar.py.j2 /
RUN chmod +x /docker-entrypoint.sh /irods_login.sh

# Copy PAM auth
COPY files/pam_sodar.py /usr/local/lib/pam-sodar/

# Create iRODS vault dir
RUN mkdir -p $IRODS_RESOURCE_DIRECTORY
RUN chown -cR $IRODS_SERVICE_ACCOUNT_GROUP:$IRODS_SERVICE_ACCOUNT_USER $IRODS_RESOURCE_DIRECTORY
Expand Down
3 changes: 3 additions & 0 deletions docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ if [[ "$1" == "irods-start" ]]; then
touch /etc/irods/.provisioned
fi

echo "Set up custom PAM module"
mkdir -p /usr/local/lib/pam-sodar
j2 -o /usr/local/lib/pam-sodar/pam_sodar.py --undefined /pam_sodar.py.j2
echo "Set up PAM file"
j2 -o /etc/pam.d/irods --undefined /irods.pam.j2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def pam_sm_authenticate(pamh, flags, argv):
pamh.Message(pamh.PAM_PROMPT_ECHO_OFF, 'SODAR password: ')
).resp

sodar_host = os.environ.get('IRODS_SODAR_API_HOST', 'http://sodar-web:8080')
sodar_host = '{{ IRODS_SODAR_API_HOST }}'
url = sodar_host + '/irodsbackend/api/auth'

response = requests.post(url, auth=(pamh.user, a))
Expand Down

0 comments on commit 4e6cf2b

Please sign in to comment.