Skip to content

Commit

Permalink
Merge pull request #241 from Princeton-CDH/htr-cas-auth
Browse files Browse the repository at this point in the history
escriptorium refinements: deploy specific tagged version, enable CAS authentication
  • Loading branch information
rlskoeser authored Oct 15, 2024
2 parents f8722e2 + 3dd7e87 commit b317799
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
9 changes: 9 additions & 0 deletions inventory/group_vars/htr_staging/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ application_url: https://test-htr.princeton.edu

# Git repository (on gitlab instead of github, so need to specify the full repo url)
repo_url: https://gitlab.com/scripta/escriptorium.git
# staging default branch is develop; install a specific tag for testing/documenting
gitref: dev-0.14.2


# repo variable is still needed for checkout file structure
repo: scripta/escriptorium
# name of django application
Expand All @@ -23,6 +27,10 @@ symlink: "{{ app_name }}"
python_version: "3.11"
# nodejs version
node_version: "18"
# install local customizations as an extra package
python_extra_packages:
# 19a3fca = vm-stats branch
- git+https://github.com/Princeton-CDH/htr2hpc.git@19a3fca#egg=htr2hpc

# pul deploy user
deploy_user: "conan"
Expand Down Expand Up @@ -61,6 +69,7 @@ django_local_settings_template: "escriptorium_settings.py.j2"

deploy_env_vars:
DJANGO_SETTINGS_MODULE: escriptorium.local_settings
VERSION_DATE: "{{ gitref }}" # deployed version, for display on home page

# single deploy path - no versioning, no nesting
deploy: "{{ install_root }}"
Expand Down
4 changes: 4 additions & 0 deletions playbooks/escriptorium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
- name: Restart supervisor apps to load any python/django configuration changes
ansible.builtin.command: "sudo supervisorctl restart {{ item.name }}"
loop: "{{ supervisor_programs }}"
- name: Notify handler to restart nginx
ansible.builtin.meta: noop
notify:
- Restart nginx
environment:
# escriptorium local settings REPLACES default settings, must be specified
# via env var for django manage commands to pick up
Expand Down
29 changes: 16 additions & 13 deletions roles/django/templates/escriptorium_settings.py.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from escriptorium.settings import *
from django.utils.translation import gettext_lazy as _

from escriptorium.settings import *
from htr2hpc.settings import *


# DEBUG = True

# enable french and german
Expand Down Expand Up @@ -60,18 +63,18 @@ DATABASES = {
# Princeton CAS configuration (authentication, user account creation)
# https://github.com/Princeton-CDH/django-pucas
{% block cas_config %}
# CAS_SERVER_URL = "https://fed.princeton.edu/cas/"
# CAS_VERSION = "3"
# PUCAS_LDAP.update({
# "SERVERS": [
# "ldap2.princeton.edu",
# "ldap3.princeton.edu",
# "ldap4.princeton.edu",
# "ldap5.princeton.edu"
# ],
# "SEARCH_BASE": "o=Princeton University,c=US",
# "SEARCH_FILTER": "(uid=%(user)s)",
#})
CAS_SERVER_URL = "https://fed.princeton.edu/cas/"
CAS_VERSION = "3"
PUCAS_LDAP.update({
"SERVERS": [
"ldap2.princeton.edu",
"ldap3.princeton.edu",
"ldap4.princeton.edu",
"ldap5.princeton.edu"
],
"SEARCH_BASE": "o=Princeton University,c=US",
"SEARCH_FILTER": "(uid=%(user)s)",
})
{% endblock %}

# Email configuration (error messages, admin notifications)
Expand Down

0 comments on commit b317799

Please sign in to comment.