mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-10-18 20:15:35 +00:00
Finished Moodle OIDC Login Base
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
FROM bitnami/moodle:{{ applications[application_id].version }}
|
||||
|
||||
{% if applications | is_feature_enabled('oidc',application_id) %}
|
||||
# Install git (required to clone the OIDC plugin)
|
||||
USER root
|
||||
RUN install_packages git unzip
|
||||
|
||||
# Clone the Microsoft OIDC plugin into Moodle's auth directory
|
||||
RUN git clone https://github.com/microsoft/moodle-auth_oidc.git \
|
||||
/opt/bitnami/moodle/auth/oidc && \
|
||||
chown -R www-data:www-data /opt/bitnami/moodle/auth/oidc
|
||||
|
||||
USER 1001
|
||||
{% endif %}
|
||||
{% if applications | is_feature_enabled('oidc', application_id) %}
|
||||
RUN install_packages unzip curl jq \
|
||||
&& VERSION=$(curl -s https://api.github.com/repos/microsoft/moodle-auth_oidc/tags \
|
||||
| jq -r '.[].name' \
|
||||
| grep v{{ applications[application_id].version }} \
|
||||
| sort -Vr \
|
||||
| head -n1) \
|
||||
&& echo "Using version $VERSION" \
|
||||
&& curl -L -o /tmp/oidc.zip https://github.com/microsoft/moodle-auth_oidc/archive/refs/tags/${VERSION}.zip \
|
||||
&& unzip /tmp/oidc.zip -d /tmp \
|
||||
&& mv /tmp/moodle-auth_oidc-* {{ bitnami_oidc_plugin_dir }} \
|
||||
&& chown -R {{ bitnami_user_group }} {{ bitnami_oidc_plugin_dir }} \
|
||||
&& rm -rf /tmp/oidc.zip
|
||||
{% endif %}
|
||||
|
@@ -11,8 +11,8 @@ services:
|
||||
- 127.0.0.1:{{ports.localhost.http[application_id]}}:8080
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
volumes:
|
||||
- 'moodle:/bitnami/moodle'
|
||||
- 'data:/bitnami/moodledata'
|
||||
- 'code:{{ bitnami_code_link }}'
|
||||
- 'data:{{ bitnami_data_dir }}'
|
||||
healthcheck:
|
||||
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q 'HTTP/1.1'"]
|
||||
interval: 30s
|
||||
@@ -22,7 +22,7 @@ services:
|
||||
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||
|
||||
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
||||
moodle:
|
||||
code:
|
||||
data:
|
||||
|
||||
{% include 'templates/docker/compose/networks.yml.j2' %}
|
||||
|
@@ -1,10 +1,7 @@
|
||||
MOODLE_DATABASE_HOST={{database_host}}
|
||||
MOODLE_DATABASE_PORT_NUMBER={{database_port}}
|
||||
MOODLE_DATABASE_USER={{database_username}}
|
||||
MOODLE_DATABASE_NAME={{database_name}}
|
||||
MOODLE_DATABASE_PASSWORD={{database_password}}
|
||||
ALLOW_EMPTY_PASSWORD=no
|
||||
|
||||
# General
|
||||
MOODLE_SITE_NAME="{{applications[application_id].site_titel}}"
|
||||
MOODLE_HOST="{{ domains | get_domain(application_id) }}"
|
||||
MOODLE_SSLPROXY=yes
|
||||
MOODLE_REVERSE_PROXY=yes
|
||||
MOODLE_USERNAME={{applications[application_id].users.administrator.username}}
|
||||
@@ -12,8 +9,15 @@ MOODLE_PASSWORD={{applications[application_id].credentials.user_password}}
|
||||
MOODLE_EMAIL={{applications[application_id].users.administrator.email}}
|
||||
BITNAMI_DEBUG={% if enable_debug | bool %}true{% else %}false{% endif %}
|
||||
|
||||
# Database
|
||||
MOODLE_DATABASE_HOST={{database_host}}
|
||||
MOODLE_DATABASE_PORT_NUMBER={{database_port}}
|
||||
MOODLE_DATABASE_USER={{database_username}}
|
||||
MOODLE_DATABASE_NAME={{database_name}}
|
||||
MOODLE_DATABASE_PASSWORD={{database_password}}
|
||||
|
||||
MOODLE_HOST={{ system_email.host }}
|
||||
# SMTP
|
||||
MOODLE_SMTP_HOST={{ system_email.host }}
|
||||
MOODLE_SMTP_PORT_NUMBER={{ system_email.port }}
|
||||
MOODLE_SMTP_USER={{ users['no-reply'].email }}
|
||||
MOODLE_SMTP_PASSWORD={{ users['no-reply'].mailu_token }}
|
||||
|
Reference in New Issue
Block a user