mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-25 03:38:59 +02:00
Compare commits
5 Commits
f5bacf17b3
...
ceab517dfa
Author | SHA1 | Date | |
---|---|---|---|
ceab517dfa | |||
ada1f84c0b | |||
94dd57d5cd | |||
ae25673853 | |||
19a489b3c5 |
@ -57,6 +57,7 @@ ports:
|
|||||||
presentation: 8039
|
presentation: 8039
|
||||||
espocrm: 8040
|
espocrm: 8040
|
||||||
syncope: 8041
|
syncope: 8041
|
||||||
|
collabora: 8042
|
||||||
bigbluebutton: 48087 # This port is predefined by bbb. @todo Try to change this to a 8XXX port
|
bigbluebutton: 48087 # This port is predefined by bbb. @todo Try to change this to a 8XXX port
|
||||||
# Ports which are exposed to the World Wide Web
|
# Ports which are exposed to the World Wide Web
|
||||||
public:
|
public:
|
||||||
|
@ -84,6 +84,8 @@ defaults_networks:
|
|||||||
subnet: 192.168.103.64/28
|
subnet: 192.168.103.64/28
|
||||||
syncope:
|
syncope:
|
||||||
subnet: 192.168.103.80/28
|
subnet: 192.168.103.80/28
|
||||||
|
collabora:
|
||||||
|
subnet: 192.168.103.96/28
|
||||||
|
|
||||||
# /24 Networks / 254 Usable Clients
|
# /24 Networks / 254 Usable Clients
|
||||||
bigbluebutton:
|
bigbluebutton:
|
||||||
|
@ -28,8 +28,8 @@ defaults_oidc:
|
|||||||
attributes:
|
attributes:
|
||||||
# Attribut to identify the user
|
# Attribut to identify the user
|
||||||
username: "preferred_username"
|
username: "preferred_username"
|
||||||
given_name: "given_name"
|
given_name: "givenName"
|
||||||
family_name: "family_name"
|
family_name: "surname"
|
||||||
email: "email"
|
email: "email"
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
|
30
roles/docker-collabora/README.md
Normal file
30
roles/docker-collabora/README.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Docker Collabora (DRAFT)
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This Ansible role deploys Collabora Online (CODE) in Docker to enable real-time, in-browser document editing for Nextcloud. It automates the setup of the Collabora CODE container, Nginx reverse proxy configuration, network isolation via Docker networks, and environment variable management.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
* **Dockerized Collabora CODE:** Uses the official `collabora/code` image.
|
||||||
|
* **Nginx Reverse Proxy:** Configures a public-facing proxy with TLS termination and WebSocket support for `/cool/` paths.
|
||||||
|
* **Docker Network Management:** Creates an isolated `/28` subnet for Collabora and connects containers securely.
|
||||||
|
* **Environment Configuration:** Generates a `.env` file with domain, credentials, and extra parameters for Collabora's WOPI server.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* Automatic creation of a dedicated Docker network for Collabora.
|
||||||
|
* Proxy configuration template for Nginx with long timeouts and WebSocket upgrades.
|
||||||
|
* Customizable domain names and ports via Ansible variables.
|
||||||
|
* Support for SSL termination at the proxy level.
|
||||||
|
* Integration hooks to restart Nginx and recreate Docker Compose stacks on changes.
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
See the role’s `README.md`, task files, and Jinja2 templates in the `roles/docker-collabora` directory for usage examples and variable definitions.
|
||||||
|
|
||||||
|
## Further Resources
|
||||||
|
|
||||||
|
* [Collabora & Talk Super integration demo](https://www.youtube.com/watch?v=7cRmvTyt1ik)
|
||||||
|
* [Collabora configuration examples archive](https://cloud.thesysadminhub.com/s/FNKyP43y35HGDTJ?dir=/&openfile=true)
|
||||||
|
* [Official Collabora CODE website](https://www.collaboraoffice.com/code/)
|
28
roles/docker-collabora/meta/main.yml
Normal file
28
roles/docker-collabora/meta/main.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: "Kevin Veen-Birkenbach"
|
||||||
|
description: "Deploy Collabora Online CODE in Docker with automated proxy, networking, and environment configuration."
|
||||||
|
license: "CyMaIS NonCommercial License (CNCL)"
|
||||||
|
license_url: "https://s.veen.world/cncl"
|
||||||
|
company: |
|
||||||
|
Kevin Veen-Birkenbach
|
||||||
|
Consulting & Coaching Solutions
|
||||||
|
https://www.veen.world
|
||||||
|
min_ansible_version: "2.9"
|
||||||
|
platforms:
|
||||||
|
- name: Linux
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
|
galaxy_tags:
|
||||||
|
- collabora
|
||||||
|
- docker
|
||||||
|
- nginx
|
||||||
|
- office
|
||||||
|
- wopi
|
||||||
|
- code
|
||||||
|
repository: "https://s.veen.world/cymais"
|
||||||
|
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||||
|
documentation: "https://s.veen.world/cymais/docker-collabora"
|
||||||
|
logo:
|
||||||
|
class: "fa-solid fa-file-code"
|
||||||
|
run_after: []
|
20
roles/docker-collabora/tasks/main.yml
Normal file
20
roles/docker-collabora/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
- name: create nextcloud nginx proxy configuration file
|
||||||
|
template:
|
||||||
|
src: "nginx.conf.j2"
|
||||||
|
dest: "{{nginx.directories.http.servers}}{{domains | get_domain(application_id)}}.conf"
|
||||||
|
notify: restart nginx
|
||||||
|
|
||||||
|
- name: "Include docker-compose role"
|
||||||
|
include_role:
|
||||||
|
name: docker-compose
|
||||||
|
|
||||||
|
- name: Create Docker network for Collabora
|
||||||
|
docker_network:
|
||||||
|
name: central_mariadb
|
||||||
|
state: present
|
||||||
|
ipam_config:
|
||||||
|
- subnet: "{{ networks.local.collabora.subnet }}"
|
||||||
|
when: run_once_docker_mariadb is not defined
|
||||||
|
|
||||||
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
|
|
15
roles/docker-collabora/templates/docker-compose.yml.j2
Normal file
15
roles/docker-collabora/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
|
||||||
|
{% include 'templates/docker/services/redis.yml.j2' %}
|
||||||
|
|
||||||
|
collabora:
|
||||||
|
image: collabora/code
|
||||||
|
container_name: collabora
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
|
||||||
|
|
||||||
|
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||||
|
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
|
||||||
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||||
|
|
||||||
|
{% include 'templates/docker/compose/networks.yml.j2' %}
|
4
roles/docker-collabora/templates/env.j2
Normal file
4
roles/docker-collabora/templates/env.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
domain=nxsrv
|
||||||
|
username=admin
|
||||||
|
password=${COLLABRA_PASSWORD}
|
||||||
|
extra_params=--o:ssl.enable=false --o:ssl.termination=true
|
15
roles/docker-collabora/templates/nginx.conf.j2
Normal file
15
roles/docker-collabora/templates/nginx.conf.j2
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
server {
|
||||||
|
server_name {{domain}};
|
||||||
|
|
||||||
|
{% include 'roles/letsencrypt/templates/ssl_header.j2' %}
|
||||||
|
|
||||||
|
{% include 'roles/nginx-modifier-all/templates/global.includes.conf.j2'%}
|
||||||
|
|
||||||
|
{% include 'roles/nginx-docker-reverse-proxy/templates/headers/content_security_policy.conf.j2' %}
|
||||||
|
|
||||||
|
{% include 'roles/nginx-docker-reverse-proxy/templates/location/proxy_basic.conf.j2' %}
|
||||||
|
|
||||||
|
{% set location = '^~ /cool/' %}
|
||||||
|
|
||||||
|
{% include 'roles/nginx-docker-reverse-proxy/templates/location/proxy_basic.conf.j2' %}
|
||||||
|
}
|
3
roles/docker-collabora/vars/configuration.yml
Normal file
3
roles/docker-collabora/vars/configuration.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
domains:
|
||||||
|
canonical:
|
||||||
|
- "collabora.{{ primary_domain }}"
|
2
roles/docker-collabora/vars/main.yml
Normal file
2
roles/docker-collabora/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
application_id: collabora
|
@ -16,6 +16,8 @@ csp:
|
|||||||
flags:
|
flags:
|
||||||
script-src-elem:
|
script-src-elem:
|
||||||
unsafe-inline: true
|
unsafe-inline: true
|
||||||
|
script-src:
|
||||||
|
unsafe-inline: true
|
||||||
style-src:
|
style-src:
|
||||||
unsafe-inline: true
|
unsafe-inline: true
|
||||||
domains:
|
domains:
|
||||||
|
@ -25,7 +25,7 @@ services:
|
|||||||
interval: 1m
|
interval: 1m
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
{% if bridges | bool %}
|
{% if bridges | length > 0 %}
|
||||||
{% include 'templates/docker/container/depends-on-also-database.yml.j2' %}
|
{% include 'templates/docker/container/depends-on-also-database.yml.j2' %}
|
||||||
{% for item in bridges %}
|
{% for item in bridges %}
|
||||||
mautrix-{{item.bridge_name}}:
|
mautrix-{{item.bridge_name}}:
|
||||||
|
@ -1,6 +1,36 @@
|
|||||||
# Administration
|
# Administration
|
||||||
|
|
||||||
# Radical Erase of Setup
|
## Moodle Docker Directory Path
|
||||||
|
|
||||||
|
Moodle lives in: ``cd /opt/docker/moodle``
|
||||||
|
|
||||||
|
## Upgrade
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec --user daemon moodle php /opt/bitnami/moodle/admin/cli/upgrade.php --non-interactive
|
||||||
|
```
|
||||||
|
|
||||||
|
## Delete Cache
|
||||||
|
|
||||||
|
To clean the cache execute:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec --user daemon moodle php /opt/bitnami/moodle/admin/cli/purge_caches.php
|
||||||
|
docker exec --user root moodle rm -rf \
|
||||||
|
/bitnami/moodledata/cache/* \
|
||||||
|
/bitnami/moodledata/localcache/* \
|
||||||
|
/bitnami/moodledata/temp/* \
|
||||||
|
/bitnami/moodledata/sessions/*
|
||||||
|
docker restart moodle
|
||||||
|
```
|
||||||
|
|
||||||
|
## CLI
|
||||||
|
|
||||||
|
A detailled Guid how to use the CLI in moodle you will find [here](https://docs.moodle.org/500/de/Administration_%C3%BCber_Kommandozeile).
|
||||||
|
|
||||||
|
## General Administration Tasks
|
||||||
|
|
||||||
|
### Radical Erase of Setup
|
||||||
To manually erase the full moodle setup inkluding all data execute:
|
To manually erase the full moodle setup inkluding all data execute:
|
||||||
|
|
||||||
**CLI:**
|
**CLI:**
|
||||||
@ -24,5 +54,5 @@ DROP DATABASE IF EXISTS moodle;
|
|||||||
|
|
||||||
to delete all data in the database related to this role.
|
to delete all data in the database related to this role.
|
||||||
|
|
||||||
# Virgin Setup
|
### Virgin Setup
|
||||||
After the installation you can rerun this role to create a fresh setup of Moodle.
|
After the installation you can rerun this role to create a fresh setup of Moodle.
|
@ -19,4 +19,5 @@ galaxy_info:
|
|||||||
documentation: "https://s.veen.world/cymais"
|
documentation: "https://s.veen.world/cymais"
|
||||||
logo:
|
logo:
|
||||||
class: "fa-solid fa-graduation-cap"
|
class: "fa-solid fa-graduation-cap"
|
||||||
dependencies: []
|
run_after:
|
||||||
|
- "docker-keycloak"
|
@ -12,6 +12,26 @@
|
|||||||
|
|
||||||
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
- include_tasks: "{{ playbook_dir }}/roles/docker-compose/tasks/create-files.yml"
|
||||||
|
|
||||||
|
- name: Wait until the Moodle container is healthy
|
||||||
|
shell: docker inspect --format '{% raw %}{{.State.Health.Status}}{% endraw %}' {{ container_name }}
|
||||||
|
register: health_check
|
||||||
|
until: health_check.stdout.strip() == "healthy"
|
||||||
|
retries: 120
|
||||||
|
delay: 5
|
||||||
|
|
||||||
|
- name: "Include ownership settings tasks for moodle"
|
||||||
|
include_tasks: ownership.yml
|
||||||
|
|
||||||
- name: "Configure OIDC login for Moodle if enabled"
|
- name: "Configure OIDC login for Moodle if enabled"
|
||||||
include_tasks: oidc.yml
|
include_tasks: oidc.yml
|
||||||
when: applications | is_feature_enabled('oidc',application_id)
|
when: applications | is_feature_enabled('oidc',application_id)
|
||||||
|
|
||||||
|
- name: Run Moodle system check
|
||||||
|
command: >
|
||||||
|
docker exec --user {{ bitnami_user }} {{ container_name }}
|
||||||
|
php /opt/bitnami/moodle/admin/cli/checks.php
|
||||||
|
register: moodle_checks
|
||||||
|
changed_when: false
|
||||||
|
failed_when: >
|
||||||
|
moodle_checks.rc != 0 or
|
||||||
|
"OK: All" not in moodle_checks.stdout
|
||||||
|
@ -1,24 +1,60 @@
|
|||||||
---
|
---
|
||||||
- name: "Upgrade Moodle to apply OIDC plugin"
|
|
||||||
command: "docker exec {{ container_name }} php admin/cli/upgrade.php --non-interactive"
|
- name: Check if OIDC plugin is present in container
|
||||||
|
command: >
|
||||||
|
docker exec --user root {{ container_name }} test -d {{ bitnami_oidc_plugin_dir }}
|
||||||
|
register: oidc_plugin_check
|
||||||
|
ignore_errors: true
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Fail if plugin not present to avoid broken auth
|
||||||
|
fail:
|
||||||
|
msg: "OIDC plugin not present – skipping configuration"
|
||||||
|
when: oidc_plugin_check.rc != 0
|
||||||
|
|
||||||
|
#- name: "Upgrade Moodle to apply OIDC plugin"
|
||||||
|
# command: "docker exec --user {{ bitnami_user }} {{ container_name }} php /opt/bitnami/moodle/admin/cli/upgrade.php --non-interactive"
|
||||||
|
#
|
||||||
|
#- name: Clear Moodle cache
|
||||||
|
# command: >
|
||||||
|
# docker exec --user {{ bitnami_user }} {{ container_name }} php /opt/bitnami/moodle/admin/cli/purge_caches.php
|
||||||
|
|
||||||
- name: "Set Moodle OIDC configuration via CLI"
|
- name: "Set Moodle OIDC configuration via CLI"
|
||||||
loop:
|
loop:
|
||||||
- { name: "issuerurl", value: "{{ oidc.client.issuer_url }}" }
|
- { name: "idptype", value: 3 }
|
||||||
|
- { name: "clientauthmethod", value: 1 }
|
||||||
- { name: "clientid", value: "{{ oidc.client.id }}" }
|
- { name: "clientid", value: "{{ oidc.client.id }}" }
|
||||||
- { name: "clientsecret", value: "{{ oidc.client.secret }}" }
|
- { name: "clientsecret", value: "{{ oidc.client.secret }}" }
|
||||||
- { name: "authmethod", value: "oidc" }
|
- { name: "opname", value: "{{oidc.button_text}}" }
|
||||||
- { name: "loginflow", value: "authorization_code" }
|
- { name: "oidcscope", value: "openid profile email" }
|
||||||
- { name: "idpname", value: "Keycloak" }
|
- { name: "authendpoint", value: "{{ oidc.client.authorize_url }}" }
|
||||||
- { name: "scopes", value: "openid profile email" }
|
|
||||||
- { name: "authenticationendpoint", value: "{{ oidc.client.authorize_url }}" }
|
|
||||||
- { name: "tokenendpoint", value: "{{ oidc.client.token_url }}" }
|
- { name: "tokenendpoint", value: "{{ oidc.client.token_url }}" }
|
||||||
- { name: "userinfoendpoint", value: "{{ oidc.client.user_info_url }}" }
|
- { name: "bindingusernameclaim", value: "{{ oidc.attributes.username }}" }
|
||||||
|
- { name: "single_sign_off", value: 1 } # Logs the user out from the IDP
|
||||||
|
- { name: "logouturi", value: "{{ oidc.client.logout_url }}" }
|
||||||
|
- { name: "icon", value: "moodle:t/lock" }
|
||||||
|
- { name: "field_map_firstname", value: "{{ oidc.attributes.given_name }}" }
|
||||||
|
- { name: "field_lock_firstname", value: "locked" }
|
||||||
|
- { name: "field_map_lastname", value: "{{ oidc.attributes.family_name }}" }
|
||||||
|
- { name: "field_lock_lastname", value: "locked" }
|
||||||
|
- { name: "field_map_email", value: "locked" }
|
||||||
|
#- { name: "showloginform", value: 0 } # Deactivate if OIDC is active
|
||||||
|
- { name: "alternateloginurl", value: "{{ web_protocol }}://{{ domains | get_domain(application_id) }}/auth/oidc/" }
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
command: >
|
command: >
|
||||||
docker exec {{ container_name }} php admin/cli/cfg.php --component=auth_oidc
|
docker exec --user {{ bitnami_user }} {{ container_name }} php /opt/bitnami/moodle/admin/cli/cfg.php --component=auth_oidc
|
||||||
--name={{ item.name }} --set="{{ item.value }}"
|
--name={{ item.name }} --set="{{ item.value }}"
|
||||||
|
|
||||||
- name: "Enable OIDC login"
|
- name: "Enable OIDC login"
|
||||||
command: "docker exec {{ container_name }} php admin/cli/cfg.php --name=auth --set=oidc"
|
command: "docker exec --user {{ bitnami_user }} {{ container_name }} php /opt/bitnami/moodle/admin/cli/cfg.php --name=auth --set=oidc"
|
||||||
|
|
||||||
|
- name: Set auth = 'oidc' for all users except guest
|
||||||
|
shell: >
|
||||||
|
docker exec {{ database_instance }} mariadb -u {{ database_username }} -p{{ database_password }}
|
||||||
|
-e "UPDATE moodle.mdl_user SET auth = 'oidc' WHERE username != 'guest';"
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
|
||||||
|
#- name: Prevent Account Creation
|
||||||
|
# command: docker exec --user {{ bitnami_user }} {{ container_name }} php /opt/bitnami/moodle/admin/cli/cfg.php --name=authpreventaccountcreation --set=1
|
19
roles/docker-moodle/tasks/ownership.yml
Normal file
19
roles/docker-moodle/tasks/ownership.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# This file sets the correct ownership rights for Moodle volumes
|
||||||
|
|
||||||
|
- name: Set ownership and permissions on Moodle directories
|
||||||
|
vars:
|
||||||
|
moodle_dirs:
|
||||||
|
- "{{ bitnami_code_dir }}"
|
||||||
|
- "{{ bitnami_data_dir }}"
|
||||||
|
block:
|
||||||
|
- name: Ensure ownership is correct
|
||||||
|
command: "docker exec --user root {{ container_name }} chown -R {{ bitnami_user_group }} {{ item }}"
|
||||||
|
loop: "{{ moodle_dirs }}"
|
||||||
|
|
||||||
|
- name: Set directory permissions (770)
|
||||||
|
command: "docker exec --user root {{ container_name }} find {{ item }} -type d -exec chmod 770 {} \\;"
|
||||||
|
loop: "{{ moodle_dirs }}"
|
||||||
|
|
||||||
|
- name: Set file permissions (660)
|
||||||
|
command: "docker exec --user root {{ container_name }} find {{ item }} -type f -exec chmod 660 {} \\;"
|
||||||
|
loop: "{{ moodle_dirs }}"
|
@ -1,14 +1,16 @@
|
|||||||
FROM bitnami/moodle:{{ applications[application_id].version }}
|
FROM bitnami/moodle:{{ applications[application_id].version }}
|
||||||
|
|
||||||
{% if applications | is_feature_enabled('oidc',application_id) %}
|
{% if applications | is_feature_enabled('oidc', application_id) %}
|
||||||
# Install git (required to clone the OIDC plugin)
|
RUN install_packages unzip curl jq \
|
||||||
USER root
|
&& VERSION=$(curl -s https://api.github.com/repos/microsoft/moodle-auth_oidc/tags \
|
||||||
RUN install_packages git unzip
|
| jq -r '.[].name' \
|
||||||
|
| grep v{{ applications[application_id].version }} \
|
||||||
# Clone the Microsoft OIDC plugin into Moodle's auth directory
|
| sort -Vr \
|
||||||
RUN git clone https://github.com/microsoft/moodle-auth_oidc.git \
|
| head -n1) \
|
||||||
/opt/bitnami/moodle/auth/oidc && \
|
&& echo "Using version $VERSION" \
|
||||||
chown -R www-data:www-data /opt/bitnami/moodle/auth/oidc
|
&& curl -L -o /tmp/oidc.zip https://github.com/microsoft/moodle-auth_oidc/archive/refs/tags/${VERSION}.zip \
|
||||||
|
&& unzip /tmp/oidc.zip -d /tmp \
|
||||||
USER 1001
|
&& mv /tmp/moodle-auth_oidc-* {{ bitnami_oidc_plugin_dir }} \
|
||||||
|
&& chown -R {{ bitnami_user_group }} {{ bitnami_oidc_plugin_dir }} \
|
||||||
|
&& rm -rf /tmp/oidc.zip
|
||||||
{% endif %}
|
{% endif %}
|
@ -11,8 +11,8 @@ services:
|
|||||||
- 127.0.0.1:{{ports.localhost.http[application_id]}}:8080
|
- 127.0.0.1:{{ports.localhost.http[application_id]}}:8080
|
||||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||||
volumes:
|
volumes:
|
||||||
- 'moodle:/bitnami/moodle'
|
- 'code:{{ bitnami_code_link }}'
|
||||||
- 'data:/bitnami/moodledata'
|
- 'data:{{ bitnami_data_dir }}'
|
||||||
healthcheck:
|
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'"]
|
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
|
interval: 30s
|
||||||
@ -22,7 +22,7 @@ services:
|
|||||||
{% include 'templates/docker/container/networks.yml.j2' %}
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||||
|
|
||||||
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
||||||
moodle:
|
code:
|
||||||
data:
|
data:
|
||||||
|
|
||||||
{% include 'templates/docker/compose/networks.yml.j2' %}
|
{% include 'templates/docker/compose/networks.yml.j2' %}
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
MOODLE_DATABASE_HOST={{database_host}}
|
|
||||||
MOODLE_DATABASE_PORT_NUMBER={{database_port}}
|
# General
|
||||||
MOODLE_DATABASE_USER={{database_username}}
|
|
||||||
MOODLE_DATABASE_NAME={{database_name}}
|
|
||||||
MOODLE_DATABASE_PASSWORD={{database_password}}
|
|
||||||
ALLOW_EMPTY_PASSWORD=no
|
|
||||||
MOODLE_SITE_NAME="{{applications[application_id].site_titel}}"
|
MOODLE_SITE_NAME="{{applications[application_id].site_titel}}"
|
||||||
|
MOODLE_HOST="{{ domains | get_domain(application_id) }}"
|
||||||
MOODLE_SSLPROXY=yes
|
MOODLE_SSLPROXY=yes
|
||||||
MOODLE_REVERSE_PROXY=yes
|
MOODLE_REVERSE_PROXY=yes
|
||||||
MOODLE_USERNAME={{applications[application_id].users.administrator.username}}
|
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}}
|
MOODLE_EMAIL={{applications[application_id].users.administrator.email}}
|
||||||
BITNAMI_DEBUG={% if enable_debug | bool %}true{% else %}false{% endif %}
|
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_PORT_NUMBER={{ system_email.port }}
|
||||||
MOODLE_SMTP_USER={{ users['no-reply'].email }}
|
MOODLE_SMTP_USER={{ users['no-reply'].email }}
|
||||||
MOODLE_SMTP_PASSWORD={{ users['no-reply'].mailu_token }}
|
MOODLE_SMTP_PASSWORD={{ users['no-reply'].mailu_token }}
|
||||||
|
@ -3,20 +3,23 @@ users:
|
|||||||
administrator:
|
administrator:
|
||||||
username: "{{users.administrator.username}}"
|
username: "{{users.administrator.username}}"
|
||||||
email: "{{users.administrator.email}}"
|
email: "{{users.administrator.email}}"
|
||||||
version: "latest"
|
version: "4.5" # Latest LTS - Necessary for OIDC
|
||||||
features:
|
features:
|
||||||
matomo: true
|
matomo: true
|
||||||
css: false
|
css: false
|
||||||
portfolio_iframe: false
|
portfolio_iframe: false
|
||||||
central_database: true
|
central_database: true
|
||||||
oidc: false
|
oidc: true
|
||||||
csp:
|
csp:
|
||||||
flags:
|
flags:
|
||||||
script-src-elem:
|
script-src-elem:
|
||||||
unsafe-inline: true
|
unsafe-inline: true
|
||||||
unsafe-eval: true
|
unsafe-eval: true
|
||||||
|
script-src:
|
||||||
|
unsafe-eval: true
|
||||||
style-src:
|
style-src:
|
||||||
unsafe-inline: true
|
unsafe-inline: true
|
||||||
|
unsafe-eval: true
|
||||||
whitelist:
|
whitelist:
|
||||||
font-src:
|
font-src:
|
||||||
- "data:"
|
- "data:"
|
||||||
|
@ -2,3 +2,9 @@
|
|||||||
application_id: "moodle"
|
application_id: "moodle"
|
||||||
database_type: "mariadb"
|
database_type: "mariadb"
|
||||||
container_name: "{{ application_id }}"
|
container_name: "{{ application_id }}"
|
||||||
|
bitnami_code_link: "/bitnami/moodle"
|
||||||
|
bitnami_code_dir: "/opt{{bitnami_code_link}}"
|
||||||
|
bitnami_data_dir: "/bitnami/moodledata"
|
||||||
|
bitnami_oidc_plugin_dir: "{{ bitnami_code_dir }}/auth/oidc"
|
||||||
|
bitnami_user: "daemon"
|
||||||
|
bitnami_user_group: "{{ bitnami_user }}:{{ bitnami_user }}"
|
2
roles/docker-nextcloud/Todo.md
Normal file
2
roles/docker-nextcloud/Todo.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Todo
|
||||||
|
- Implement Collabora and Talk Supper . [See](https://www.youtube.com/watch?v=7cRmvTyt1ik)
|
@ -28,3 +28,7 @@ galaxy_info:
|
|||||||
documentation: "https://s.veen.world/cymais/docker-nextcloud"
|
documentation: "https://s.veen.world/cymais/docker-nextcloud"
|
||||||
logo:
|
logo:
|
||||||
class: "fa-solid fa-cloud"
|
class: "fa-solid fa-cloud"
|
||||||
|
run_after:
|
||||||
|
- docker-collabora
|
||||||
|
- docker-keycloak
|
||||||
|
- docker-mastodon
|
||||||
|
@ -20,6 +20,28 @@ services:
|
|||||||
{% include 'templates/docker/container/networks.yml.j2' %}
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||||
ipv4_address: 192.168.102.69
|
ipv4_address: 192.168.102.69
|
||||||
|
|
||||||
|
# @Todo activate
|
||||||
|
#nc-talk:
|
||||||
|
# image: nextcloud/aio-talk:latest
|
||||||
|
# container_name: talk_hpb
|
||||||
|
# hostname: hpb_yt
|
||||||
|
# restart: unless-stopped
|
||||||
|
# init: true
|
||||||
|
# ports:
|
||||||
|
# - 3478:3478/tcp #TURN TCP
|
||||||
|
# - 3478:3478/udp #TURN UDP
|
||||||
|
# - 8181:8081/tcp #Signaling
|
||||||
|
# environment:
|
||||||
|
# - NC_DOMAIN=cloud.yourdomain.tld
|
||||||
|
# - TALK_HOST=signaling.yourdomain.tld
|
||||||
|
# - TURN_SECRET=${TURN_SECRET}
|
||||||
|
# - SIGNALING_SECRET=${SIGNALING_SECRET}
|
||||||
|
# - TZ=Europe/Berlin
|
||||||
|
# - TALK_PORT=3478
|
||||||
|
# - INTERNAL_SECRET=${INTERNAL_SECRET}
|
||||||
|
# networks:
|
||||||
|
# - nxnetwork_yt
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
container_name: {{applications.nextcloud.container.proxy}}
|
container_name: {{applications.nextcloud.container.proxy}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# This is the nginx configuration file for the proxy server
|
{# This is the nginx configuration file for the proxy server #}
|
||||||
|
|
||||||
server
|
server
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,7 @@ legacy_login_mask:
|
|||||||
container:
|
container:
|
||||||
application: "nextcloud-application" # Nextcloud application container name
|
application: "nextcloud-application" # Nextcloud application container name
|
||||||
proxy: "nextcloud-web" # Nextcloud Proxy Container Name
|
proxy: "nextcloud-web" # Nextcloud Proxy Container Name
|
||||||
|
collabora: "nextcloud-collabora"
|
||||||
performance:
|
performance:
|
||||||
php:
|
php:
|
||||||
memory_limit: "{{ ((ansible_memtotal_mb | int) / 30)|int }}M" # Dynamic set memory limit
|
memory_limit: "{{ ((ansible_memtotal_mb | int) / 30)|int }}M" # Dynamic set memory limit
|
||||||
|
@ -26,3 +26,4 @@ galaxy_info:
|
|||||||
class: "fa-solid fa-database"
|
class: "fa-solid fa-database"
|
||||||
run_after:
|
run_after:
|
||||||
- docker-matomo
|
- docker-matomo
|
||||||
|
- docker-keycloak
|
||||||
|
@ -26,3 +26,4 @@ galaxy_info:
|
|||||||
run_after:
|
run_after:
|
||||||
- docker-ldap
|
- docker-ldap
|
||||||
- docker-matomo
|
- docker-matomo
|
||||||
|
- docker-keycloak
|
||||||
|
@ -28,3 +28,4 @@ galaxy_info:
|
|||||||
run_after:
|
run_after:
|
||||||
- docker-mariadb
|
- docker-mariadb
|
||||||
- docker-matomo
|
- docker-matomo
|
||||||
|
- docker-keycloak
|
@ -28,4 +28,7 @@ galaxy_info:
|
|||||||
documentation: "https://s.veen.world/cymais"
|
documentation: "https://s.veen.world/cymais"
|
||||||
logo:
|
logo:
|
||||||
class: "fa-solid fa-tasks"
|
class: "fa-solid fa-tasks"
|
||||||
dependencies: []
|
run_after:
|
||||||
|
- docker-postgres
|
||||||
|
- docker-matomo
|
||||||
|
- docker-keycloak
|
||||||
|
@ -25,4 +25,7 @@ galaxy_info:
|
|||||||
documentation: "https://s.veen.world/cymais"
|
documentation: "https://s.veen.world/cymais"
|
||||||
logo:
|
logo:
|
||||||
class: "fa-solid fa-link"
|
class: "fa-solid fa-link"
|
||||||
dependencies: []
|
run_after:
|
||||||
|
- docker-mariadb
|
||||||
|
- docker-matomo
|
||||||
|
- docker-keycloak
|
@ -63,7 +63,7 @@
|
|||||||
(current_play_domains |
|
(current_play_domains |
|
||||||
combine(
|
combine(
|
||||||
current_play_domain_mappings_redirect |
|
current_play_domain_mappings_redirect |
|
||||||
items2dict(key_name='target', value_name='source'),
|
items2dict(key_name='source', value_name='source'),
|
||||||
recursive=True
|
recursive=True
|
||||||
)) |
|
)) |
|
||||||
generate_all_domains(
|
generate_all_domains(
|
||||||
|
@ -87,6 +87,17 @@ class TestDomainMappings(unittest.TestCase):
|
|||||||
result = self.filter.domain_mappings(apps, self.primary)
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
self.assertCountEqual(result, expected)
|
self.assertCountEqual(result, expected)
|
||||||
|
|
||||||
|
def test_multiple_aliases(self):
|
||||||
|
apps = {
|
||||||
|
'app1': {'domains': {'aliases': ['a1.com','a2.com']}}
|
||||||
|
}
|
||||||
|
expected = [
|
||||||
|
{'source': 'a1.com', 'target': 'app1.example.com'},
|
||||||
|
{'source': 'a2.com', 'target': 'app1.example.com'}
|
||||||
|
]
|
||||||
|
result = self.filter.domain_mappings(apps, self.primary)
|
||||||
|
self.assertCountEqual(result, expected)
|
||||||
|
|
||||||
def test_invalid_aliases_type(self):
|
def test_invalid_aliases_type(self):
|
||||||
apps = {
|
apps = {
|
||||||
'app1': {'domains': {'aliases': 123}}
|
'app1': {'domains': {'aliases': 123}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user