Restructure and cleaned up in preparation of new backup logic

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-15 23:51:51 +02:00
parent c8054ffbc3
commit af3ea9039c
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
106 changed files with 703 additions and 429 deletions

View File

@ -55,7 +55,19 @@ certbot_cert_path: "/etc/letsencrypt/live" # Path contain
docker_restart_policy: "unless-stopped" docker_restart_policy: "unless-stopped"
# helper # helper
_applications_nextcloud_oidc_flavor: "{{ applications.nextcloud.oidc.flavor | default('oidc_login' if applications.nextcloud.features.ldap | default(true) else 'sociallogin') }}" _applications_nextcloud_oidc_flavor: >-
{{
applications
| get_app_conf(
'web-app-nextcloud',
'oidc.flavor',
False,
'oidc_login'
if applications
| get_app_conf('web-app-nextcloud','features.ldap',False)
else 'sociallogin'
)
}}
# default value if not set via CLI (-e) or in playbook vars # default value if not set via CLI (-e) or in playbook vars
allowed_applications: [] allowed_applications: []

View File

@ -6,46 +6,46 @@ ports:
svc-db-mariadb: 3306 svc-db-mariadb: 3306
# https://developer.mozilla.org/de/docs/Web/API/WebSockets_API # https://developer.mozilla.org/de/docs/Web/API/WebSockets_API
websocket: websocket:
mastodon: 4001 web-app-mastodon: 4001
espocrm: 4002 espocrm: 4002
oauth2_proxy: oauth2_proxy:
phpmyadmin: 4181 phpmyadmin: 4181
lam: 4182 lam: 4182
openproject: 4183 web-app-openproject: 4183
yourls: 4184 yourls: 4184
pgadmin: 4185 pgadmin: 4185
phpldapadmin: 4186 phpldapadmin: 4186
fusiondirectory: 4187 fusiondirectory: 4187
gitea: 4188 web-app-gitea: 4188
snipe-it: 4189 snipe-it: 4189
ldap: ldap:
svc-db-openldap: 389 svc-db-openldap: 389
http: http:
nextcloud: 8001 web-app-nextcloud: 8001
gitea: 8002 web-app-gitea: 8002
wordpress: 8003 web-app-wordpress: 8003
mediawiki: 8004 web-app-mediawiki: 8004
mybb: 8005 web-app-mybb: 8005
yourls: 8006 yourls: 8006
mailu: 8007 mailu: 8007
elk: 8008 web-app-elk: 8008
mastodon: 8009 web-app-mastodon: 8009
pixelfed: 8010 web-app-pixelfed: 8010
peertube: 8011 web-app-peertube: 8011
funkwhale: 8012 funkwhale: 8012
roulette-wheel: 8013 roulette-wheel: 8013
joomla: 8014 web-app-joomla: 8014
attendize: 8015 attendize: 8015
pgadmin: 8016 pgadmin: 8016
baserow: 8017 web-app-baserow: 8017
web-app-matomo: 8018 web-app-matomo: 8018
listmonk: 8019 web-app-listmonk: 8019
discourse: 8020 web-app-discourse: 8020
matrix_synapse: 8021 web-app-matrix_synapse: 8021
matrix_element: 8022 web-app-matrix_element: 8022
openproject: 8023 web-app-openproject: 8023
gitlab: 8024 gitlab: 8024
akaunting: 8025 web-app-akaunting: 8025
moodle: 8026 moodle: 8026
taiga: 8027 taiga: 8027
friendica: 8028 friendica: 8028
@ -73,11 +73,13 @@ ports:
public: public:
# The following ports should be changed to 22 on the subdomain via stream mapping # The following ports should be changed to 22 on the subdomain via stream mapping
ssh: ssh:
gitea: 2201 web-app-gitea: 2201
gitlab: 2202 gitlab: 2202
ldaps: ldaps:
svc-db-openldap: 636 svc-db-openldap: 636
stun: stun:
bigbluebutton: 3478 # Not sure if it's right placed here or if it should be moved to localhost section bigbluebutton: 3478 # Not sure if it's right placed here or if it should be moved to localhost section
web-app-nextcloud: 3479
turn: turn:
bigbluebutton: 5349 # Not sure if it's right placed here or if it should be moved to localhost section bigbluebutton: 5349 # Not sure if it's right placed here or if it should be moved to localhost section
web-app-nextcloud: 5350 # Not used yet

View File

@ -8,11 +8,11 @@ defaults_networks:
# This should be sufficient for the most cases # This should be sufficient for the most cases
# /28 Networks, 14 Usable Ip Addresses # /28 Networks, 14 Usable Ip Addresses
akaunting: web-app-akaunting:
subnet: 192.168.101.0/28 subnet: 192.168.101.0/28
attendize: attendize:
subnet: 192.168.101.16/28 subnet: 192.168.101.16/28
baserow: web-app-baserow:
subnet: 192.168.101.32/28 subnet: 192.168.101.32/28
mobilizon: mobilizon:
subnet: 192.168.101.48/28 subnet: 192.168.101.48/28
@ -22,25 +22,25 @@ defaults_networks:
subnet: 192.168.101.80/28 subnet: 192.168.101.80/28
funkwhale: funkwhale:
subnet: 192.168.101.96/28 subnet: 192.168.101.96/28
gitea: web-app-gitea:
subnet: 192.168.101.112/28 subnet: 192.168.101.112/28
gitlab: gitlab:
subnet: 192.168.101.128/28 subnet: 192.168.101.128/28
joomla: web-app-joomla:
subnet: 192.168.101.144/28 subnet: 192.168.101.144/28
keycloak: keycloak:
subnet: 192.168.101.160/28 subnet: 192.168.101.160/28
#svc-db-openldap: web-app-wordpress:
# subnet: 192.168.101.176/28 subnet: 192.168.101.176/28
listmonk: web-app-listmonk:
subnet: 192.168.101.192/28 subnet: 192.168.101.192/28
# Free: # Free:
# subnet: 192.168.101.208/28 # subnet: 192.168.101.208/28
web-app-matomo: web-app-matomo:
subnet: 192.168.101.224/28 subnet: 192.168.101.224/28
mastodon: web-app-mastodon:
subnet: 192.168.101.240/28 subnet: 192.168.101.240/28
matrix: web-app-matrix:
subnet: 192.168.102.0/28 subnet: 192.168.102.0/28
mailu: mailu:
# Use one of the last container ips for dns resolving so that it isn't used # Use one of the last container ips for dns resolving so that it isn't used
@ -48,17 +48,17 @@ defaults_networks:
subnet: 192.168.102.16/28 subnet: 192.168.102.16/28
moodle: moodle:
subnet: 192.168.102.32/28 subnet: 192.168.102.32/28
mybb: web-app-mybb:
subnet: 192.168.102.48/28 subnet: 192.168.102.48/28
nextcloud: web-app-nextcloud:
subnet: 192.168.102.64/28 subnet: 192.168.102.64/28
openproject: web-app-openproject:
subnet: 192.168.102.80/28 subnet: 192.168.102.80/28
peertube: web-app-peertube:
subnet: 192.168.102.96/28 subnet: 192.168.102.96/28
phpmyadmin: phpmyadmin:
subnet: 192.168.102.112/28 subnet: 192.168.102.112/28
pixelfed: web-app-pixelfed:
subnet: 192.168.102.128/28 subnet: 192.168.102.128/28
pgadmin: pgadmin:
subnet: 192.168.102.144/28 subnet: 192.168.102.144/28
@ -68,7 +68,7 @@ defaults_networks:
subnet: 192.168.102.176/28 subnet: 192.168.102.176/28
yourls: yourls:
subnet: 192.168.102.192/28 subnet: 192.168.102.192/28
discourse: web-app-discourse:
subnet: 192.168.102.208/28 subnet: 192.168.102.208/28
sphinx: sphinx:
subnet: 192.168.102.224/28 subnet: 192.168.102.224/28

View File

@ -20,12 +20,12 @@ defaults_service_provider:
{{ ('@' ~ users.contact.username ~ '.' ~ domains.bluesky.api) {{ ('@' ~ users.contact.username ~ '.' ~ domains.bluesky.api)
if 'bluesky' in group_names else '' }} if 'bluesky' in group_names else '' }}
email: "{{ users.contact.username ~ '@' ~ primary_domain if 'mailu' in group_names else '' }}" email: "{{ users.contact.username ~ '@' ~ primary_domain if 'mailu' in group_names else '' }}"
mastodon: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('mastodon') if 'mastodon' in group_names else '' }}" mastodon: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('web-app-mastodon') if 'web-app-mastodon' in group_names else '' }}"
matrix: "{{ '@' ~ users.contact.username ~ ':' ~ domains.matrix.synapse if 'matrix' in group_names else '' }}" matrix: "{{ '@' ~ users.contact.username ~ ':' ~ domains['web-app-matrix'].synapse if 'web-app-matrix' in group_names else '' }}"
peertube: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('peertube') if 'peertube' in group_names else '' }}" peertube: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('web-app-peertube') if 'web-app-peertube' in group_names else '' }}"
pixelfed: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('pixelfed') if 'pixelfed' in group_names else '' }}" pixelfed: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain(web-app-pixelfed) if web-app-pixelfed in group_names else '' }}"
phone: "+0 000 000 404" phone: "+0 000 000 404"
wordpress: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('wordpress') if 'wordpress' in group_names else '' }}" wordpress: "{{ '@' ~ users.contact.username ~ '@' ~ domains | get_domain('web-app-wordpress') if 'web-app-wordpress' in group_names else '' }}"
legal: legal:
editorial_responsible: "Johannes Gutenberg" editorial_responsible: "Johannes Gutenberg"

View File

@ -1,6 +1,3 @@
## Enable Storage Optimizer for Docker Volumes
enable_system_storage_optimizer: true
backups_folder_path: "/Backups/" # Path to the backups folder backups_folder_path: "/Backups/" # Path to the backups folder
# Storage Space-Related Configurations # Storage Space-Related Configurations

View File

@ -0,0 +1,2 @@
# Todos
- Implement the schema

View File

@ -0,0 +1 @@
cloud_fqdn: # @todo Add detailled scheme for this entry

View File

@ -2,7 +2,7 @@
## Description ## Description
This Ansible role automates the process of backing up Docker volumes to a local folder. It pulls the [sys-bkp-docker-2-loc repository](https://github.com/kevinveenbirkenbach/sys-bkp-docker-2-loc.git), installs required software, configures systemd services for both standard and "everything" backup modes, and seeds backup database entries as needed. This Ansible role automates the process of backing up Docker volumes to a local folder. It pulls the [backup-docker-to-local](https://github.com/kevinveenbirkenbach/backup-docker-to-local), installs required software, configures systemd services for both standard and "everything" backup modes, and seeds backup database entries as needed.
## Overview ## Overview
@ -20,7 +20,7 @@ Backup Docker Volumes to Local is a comprehensive solution that leverages rsync
## Features ## Features
- **Required Software Installation:** Installs necessary packages (e.g., lsof, python-pandas) via pacman. - **Required Software Installation:** Installs necessary packages (e.g., lsof, python-pandas) via pacman.
- **Git Repository Pull:** Automatically pulls the latest version of the [sys-bkp-docker-2-loc repository](https://github.com/kevinveenbirkenbach/sys-bkp-docker-2-loc.git). - **Git Repository Pull:** Automatically pulls the latest version of the [backup-docker-to-local](https://github.com/kevinveenbirkenbach/backup-docker-to-local).
- **Systemd Service Configuration:** Deploys and reloads two systemd service templates to manage backup tasks. - **Systemd Service Configuration:** Deploys and reloads two systemd service templates to manage backup tasks.
- **Database Seeding:** Includes tasks to seed and manage a backup database (`databases.csv`) for tracking backup details. - **Database Seeding:** Includes tasks to seed and manage a backup database (`databases.csv`) for tracking backup details.
- **Dependency Integration:** Works in conjunction with the dependent roles listed above to verify and manage backups. - **Dependency Integration:** Works in conjunction with the dependent roles listed above to verify and manage backups.

View File

@ -0,0 +1,36 @@
def dict_to_cli_args(data):
"""
Convert a dictionary into CLI argument string.
Example:
{
"backup-dir": "/mnt/backups",
"shutdown": True,
"ignore-volumes": ["redis", "memcached"]
}
becomes:
--backup-dir=/mnt/backups --shutdown --ignore-volumes="redis memcached"
"""
if not isinstance(data, dict):
raise TypeError("Expected a dictionary for CLI argument conversion")
args = []
for key, value in data.items():
cli_key = f"--{key}"
if isinstance(value, bool):
if value:
args.append(cli_key)
elif isinstance(value, list):
items = " ".join(map(str, value))
args.append(f'{cli_key}="{items}"')
elif value is not None:
args.append(f'{cli_key}={value}')
return " ".join(args)
class FilterModule(object):
def filters(self):
return {
'dict_to_cli_args': dict_to_cli_args
}

View File

@ -130,8 +130,8 @@ def update_discourse(directory):
os.chdir(docker_repository_directory ) os.chdir(docker_repository_directory )
if git_pull(): if git_pull():
print("Start Discourse update procedure.") print("Start Discourse update procedure.")
update_procedure("docker stop {{applications.discourse.container}}") update_procedure("docker stop {{applications.discourse.docker.service.discourse.name}}")
update_procedure("docker rm {{applications.discourse.container}}") update_procedure("docker rm {{applications.discourse.docker.service.discourse.name}}")
try: try:
update_procedure("docker network connect {{applications.discourse.network}} {{ applications['bpostgres'].hostname }}") update_procedure("docker network connect {{applications.discourse.network}} {{ applications['bpostgres'].hostname }}")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
@ -140,7 +140,7 @@ def update_discourse(directory):
print("Network connection already exists. Skipping...") print("Network connection already exists. Skipping...")
else: else:
raise raise
update_procedure("./launcher rebuild {{applications.discourse.container}}") update_procedure("./launcher rebuild {{applications.discourse.docker.service.discourse.name}}")
else: else:
print("Discourse update skipped. No changes in git repository.") print("Discourse update skipped. No changes in git repository.")

View File

@ -1,7 +1,6 @@
images: company:
akaunting: "docker.io/akaunting/akaunting:latest" name: "Akaunting on {{ primary_domain | upper }}" # @todo load automatic based on service_provider infos, this will fail
company_name: "{{primary_domain}}" email: "{{ users.administrator.email }}" # @todo load automatic based on service_provider infos, this will fail
company_email: "{{ users.administrator.email }}"
setup_admin_email: "{{ users.administrator.email }}" setup_admin_email: "{{ users.administrator.email }}"
features: features:
matomo: true matomo: true
@ -15,5 +14,12 @@ docker:
services: services:
database: database:
enabled: true enabled: true
akaunting:
no_stop_required: true
image: docker.io/akaunting/akaunting
version: latest
name: akaunting
volumes:
data: akaunting_data
credentials: {} credentials: {}

View File

@ -2,8 +2,8 @@
application: application:
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
container_name: {{ akaunting_name }}
image: "{{ applications | get_app_conf(application_id, 'images.' ~ application_id, True) }}" image: "{{ akaunting_image }}:{{ akaunting_version }}"
build: build:
context: . context: .
ports: ports:
@ -17,5 +17,7 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ akaunting_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -14,8 +14,8 @@ DB_PASSWORD={{database_password}}
DB_PREFIX=asd_ DB_PREFIX=asd_
# These define the first company to exist on this instance. They are only used during setup. # These define the first company to exist on this instance. They are only used during setup.
COMPANY_NAME={{applications | get_app_conf(application_id, 'company_name', True)}} COMPANY_NAME={{applications | get_app_conf(application_id, 'company.name', True)}}
COMPANY_EMAIL={{applications | get_app_conf(application_id, 'company_email', True)}} COMPANY_EMAIL={{applications | get_app_conf(application_id, 'company.email', True)}}
# This will be the first administrative user created on setup. # This will be the first administrative user created on setup.
ADMIN_EMAIL={{applications.akaunting.setup_admin_email}} ADMIN_EMAIL={{applications.akaunting.setup_admin_email}}

View File

@ -1,4 +1,8 @@
application_id: "akaunting" application_id: "web-app-akaunting"
database_type: "mariadb" database_type: "mariadb"
database_password: "applications | get_app_conf(application_id, 'credentials.database_password', True)" database_password: "applications | get_app_conf(application_id, 'credentials.database_password', True)"
docker_repository_address: "https://github.com/akaunting/docker.git" docker_repository_address: "https://github.com/akaunting/docker.git"
akaunting_version: "{{ applications | get_app_conf(application_id, 'docker.services.akaunting.version', True) }}"
akaunting_image: "{{ applications | get_app_conf(application_id, 'docker.services.akaunting.image', True) }}"
akaunting_name: "{{ applications | get_app_conf(application_id, 'docker.services.akaunting.name', True) }}"
akaunting_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -1,5 +1,3 @@
images:
baserow: "baserow/baserow:latest"
features: features:
matomo: true matomo: true
css: true css: true
@ -11,3 +9,10 @@ docker:
enabled: true enabled: true
database: database:
enabled: true enabled: true
baserow:
no_stop_required: true
image: "baserow/baserow"
version: "latest"
name: "baserow"
volumes:
data: "baserow_data"

View File

@ -2,8 +2,8 @@
application: application:
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: "{{ applications | get_app_conf(application_id, 'images.baserow', True) }}" image: "{{ baserow_image }}:{{ baserow_version }}"
container_name: baserow-application container_name: {{ baserow_name }}
volumes: volumes:
- data:/baserow/data - data:/baserow/data
ports: ports:
@ -13,6 +13,7 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ baserow_volume }}
redis: redis:
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,3 +1,7 @@
application_id: "baserow" application_id: "web-app-baserow"
database_password: "{{ baserow_database_password }}" database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
database_type: "postgres" database_type: "postgres"
baserow_version: "{{ applications | get_app_conf(application_id, 'docker.services.baserow.version', True) }}"
baserow_image: "{{ applications | get_app_conf(application_id, 'docker.services.baserow.image', True) }}"
baserow_name: "{{ applications | get_app_conf(application_id, 'docker.services.baserow.name', True) }}"
baserow_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -1,24 +1,8 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
{% include 'roles/docker-container/templates/base.yml.j2' %}
image: "gitea/gitea:{{applications.gitea.version}}"
ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}"
- "{{ports.public.ssh[application_id]}}:22"
volumes:
- data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data:
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
coturn: coturn:
{% include 'roles/docker-container/templates/base.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
image: coturn/coturn image: coturn/coturn
restart: always restart: always
network_mode: "host" # Nutzt die Host-IP für externe Erreichbarkeit (optional) network_mode: "host" # Nutzt die Host-IP für externe Erreichbarkeit (optional)
@ -58,6 +42,8 @@
--denied-peer-ip=203.0.113.0-203.0.113.255 --denied-peer-ip=203.0.113.0-203.0.113.255
--denied-peer-ip=240.0.0.0-255.255.255.255 --denied-peer-ip=240.0.0.0-255.255.255.255
volumes: {% include 'roles/docker-compose/templates/networks.yml.j2' %}
nextcloud:
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
coturn-config: coturn-config:

View File

@ -1,3 +1,2 @@
application_id: "coturn" application_id: "web-app-coturn"
container_port: 3000 container_port: 3000
#database_type: "mariadb"

View File

@ -1,5 +1,3 @@
network: "discourse_default" # Name of the docker network
container: "discourse_application" # Name of the container application
repository: "discourse_repository" # Name of the repository folder repository: "discourse_repository" # Name of the repository folder
features: features:
matomo: true matomo: true
@ -26,3 +24,12 @@ docker:
enabled: true enabled: true
redis: redis:
enabled: true enabled: true
# This container is propably wrong name.
# Chance is high that the name is discourse_application.
# @todo check this out and repair it if necessary
discourse:
name: "discourse"
no_stop_required: true
volumes:
data: discourse_data
network: discourse

View File

@ -1,7 +1,7 @@
--- ---
- name: "stop and remove discourse container if it exist" - name: "stop and remove discourse container if it exist"
docker_container: docker_container:
name: "{{applications | get_app_conf(application_id, 'container', True)}}" name: "{{ discourse_name }}"
state: absent state: absent
register: container_action register: container_action
failed_when: container_action.failed and 'No such container' not in container_action.msg failed_when: container_action.failed and 'No such container' not in container_action.msg
@ -17,7 +17,7 @@
listen: recreate discourse listen: recreate discourse
- name: rebuild discourse - name: rebuild discourse
shell: ./launcher rebuild {{applications | get_app_conf(application_id, 'container', True)}} shell: ./launcher rebuild {{ discourse_name }}
args: args:
executable: /bin/bash executable: /bin/bash
chdir: "{{docker_repository_directory }}" chdir: "{{docker_repository_directory }}"

View File

@ -43,26 +43,26 @@
meta: flush_handlers meta: flush_handlers
when: run_once_docker_discourse is not defined when: run_once_docker_discourse is not defined
- name: "Connect {{ applications | get_app_conf(application_id, 'container', True) }} to network {{ applications['svc-db-postgres'].network }}" - name: "Connect {{ discourse_name }} to network {{ applications['svc-db-postgres'].network }}"
command: > command: >
docker network connect {{ applications['svc-db-postgres'].network }} {{ applications | get_app_conf(application_id, 'container', True) }} docker network connect {{ applications['svc-db-postgres'].network }} {{ discourse_name }}
register: network_connect register: network_connect
failed_when: > failed_when: >
network_connect.rc != 0 and network_connect.rc != 0 and
'Error response from daemon: endpoint with name {{ applications | get_app_conf(application_id, 'container', True) }} already exists in network {{ applications["svc-db-postgres"].network }}' 'Error response from daemon: endpoint with name {{ discourse_name }} already exists in network {{ applications["svc-db-postgres"].network }}'
not in network_connect.stderr not in network_connect.stderr
changed_when: network_connect.rc == 0 changed_when: network_connect.rc == 0
when: when:
- applications | get_app_conf(application_id, 'features.central_database', False) - applications | get_app_conf(application_id, 'features.central_database', False)
- run_once_docker_discourse is not defined - run_once_docker_discourse is not defined
- name: "Remove {{ applications | get_app_conf(application_id, 'network', True) }} from {{ database_host }}" - name: "Remove {{ discourse_network }} from {{ database_host }}"
command: > command: >
docker network disconnect {{ applications | get_app_conf(application_id, 'network', True) }} {{ database_host }} docker network disconnect {{ discourse_network }} {{ database_host }}
register: network_disconnect register: network_disconnect
failed_when: > failed_when: >
network_disconnect.rc != 0 and network_disconnect.rc != 0 and
'is not connected to network {{ applications | get_app_conf(application_id, 'network', True) }}' not in network_disconnect.stderr 'is not connected to network {{ discourse_network }}' not in network_disconnect.stderr
changed_when: network_disconnect.rc == 0 changed_when: network_disconnect.rc == 0
when: when:
- applications | get_app_conf(application_id, 'features.central_database', False) - applications | get_app_conf(application_id, 'features.central_database', False)

View File

@ -90,7 +90,7 @@ env:
## The Docker container is stateless; all data is stored in /shared ## The Docker container is stateless; all data is stored in /shared
volumes: volumes:
- volume: - volume:
host: discourse_data host: {{ discourse_volume }}
guest: /shared guest: /shared
- volume: - volume:
host: /var/discourse/shared/standalone/log/var-log host: /var/discourse/shared/standalone/log/var-log
@ -178,4 +178,4 @@ run:
docker_args: docker_args:
- --network={{application_id}}_default - --network={{application_id}}_default
- --name={{applications | get_app_conf(application_id, 'container', True)}} - --name={{ discourse_name }}

View File

@ -1,6 +1,15 @@
application_id: "discourse" application_id: "web-app-discourse"
# Database
database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}" database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
database_type: "postgres" database_type: "postgres"
# Discourse
discourse_name: "{{ applications | get_app_conf(application_id, 'docker.services.discourse.name', True) }}"
discourse_application_yml_destination: "{{ docker_repository_directory }}containers/{{discourse_name }}.yml"
discourse_network: "{{ applications | get_app_conf(application_id, 'docker.network', True) }}"
discourse_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
# General Docker Configuration
docker_repository_directory : "{{ docker_compose.directories.services}}{{applications | get_app_conf(application_id, 'repository', True) }}/" docker_repository_directory : "{{ docker_compose.directories.services}}{{applications | get_app_conf(application_id, 'repository', True) }}/"
discourse_application_yml_destination: "{{docker_repository_directory }}containers/{{applications | get_app_conf(application_id, 'container', True)}}.yml"
docker_compose_flush_handlers: false docker_compose_flush_handlers: false

View File

@ -1,2 +1,3 @@
--- ---
docker_elk_compose_path: "/srv/github.com/kevinveenbirkenbach/web-app-elk/" docker_elk_compose_path: "/srv/github.com/kevinveenbirkenbach/web-app-elk/"
elastic_search_password: '' # Just defined to pass the integration test. this role is old and hadn't been used since ages so @todo delete it as soon as you implement it productive

View File

@ -1 +1 @@
application_id: elk application_id: web-app-elk

View File

@ -1,6 +1,4 @@
title: "CyMaIS Code Hub" title: "CyMaIS Code Hub" # @todo load automatic based on service_porvider infos
images:
gitea: "gitea/gitea:latest"
configuration: configuration:
repository: repository:
enable_push_create_user: True # Allow users to push local repositories to Gitea and have them automatically created for a user. enable_push_create_user: True # Allow users to push local repositories to Gitea and have them automatically created for a user.
@ -16,7 +14,7 @@ features:
oidc: false # Deactivated because users aren't auto-created. oidc: false # Deactivated because users aren't auto-created.
oauth2_proxy: oauth2_proxy:
application: "application" application: "application"
port: "3000" port: "<< defaults_applications[web-app-gitea].docker.services.gitea.port >>"
acl: acl:
blacklist: blacklist:
- "/user/login" - "/user/login"
@ -41,3 +39,11 @@ docker:
services: services:
database: database:
enabled: true enabled: true
gitea:
image: "gitea/gitea"
version: "latest"
no_stop_required: true
port: 3000
name: "gitea"
volumes:
data: "gitea_data"

View File

@ -2,7 +2,8 @@
application: application:
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: "{{ applications | get_app_conf(application_id, 'images.gitea', True) }}" image: "{{ gitea_image }}:{{ gitea_version }}"
name: "{{ gitea_name }}"
ports: ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}" - "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}"
- "{{ports.public.ssh[application_id]}}:22" - "{{ports.public.ssh[application_id]}}:22"
@ -16,5 +17,6 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ gitea_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,5 +1,4 @@
application_id: "gitea" application_id: "web-app-gitea"
container_port: 3000
database_type: "mariadb" database_type: "mariadb"
gitea_ldap_auth_args: gitea_ldap_auth_args:
- '--name "LDAP ({{ primary_domain }})"' - '--name "LDAP ({{ primary_domain }})"'
@ -16,3 +15,9 @@ gitea_ldap_auth_args:
- '--email-attribute "{{ ldap.user.attributes.mail }}"' - '--email-attribute "{{ ldap.user.attributes.mail }}"'
- '--public-ssh-key-attribute "{{ ldap.user.attributes.ssh_public_key }}"' - '--public-ssh-key-attribute "{{ ldap.user.attributes.ssh_public_key }}"'
- '--synchronize-users' - '--synchronize-users'
gitea_version: "{{ applications | get_app_conf(application_id, 'docker.services.gitea.version', True) }}"
gitea_image: "{{ applications | get_app_conf(application_id, 'docker.services.gitea.image', True) }}"
gitea_name: "{{ applications | get_app_conf(application_id, 'docker.services.gitea.name', True) }}"
gitea_volume: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
container_port: "{{ applications | get_app_conf(application_id, 'docker.services.gitea.port', True) }}"

View File

@ -11,3 +11,5 @@ docker:
enabled: true enabled: true
database: database:
enabled: true enabled: true
credentials:
initial_root_password: "{{ users.administrator.password }}"

View File

@ -1,2 +1,3 @@
application_id: "gitlab" application_id: "gitlab"
database_type: "postgres" database_type: "postgres"
gitlab_initial_root_password: "{{ applications | get_app_conf(application_id, 'credentials.initial_root_password') }}"

View File

@ -1,3 +1,2 @@
application_id: "joomla" application_id: "web-app-joomla"
database_password: "{{joomla_database_password}}"
database_type: "postgres" database_type: "postgres"

View File

@ -1,7 +1,4 @@
images: public_api_activated: False # Security hole. Can be used for spaming # Docker Image version
listmonk: "listmonk/listmonk:latest"
public_api_activated: False # Security hole. Can be used for spaming
version: "latest" # Docker Image version
features: features:
matomo: true matomo: true
css: false css: false
@ -15,3 +12,9 @@ docker:
services: services:
database: database:
enabled: true enabled: true
listmonk:
image: listmonk/listmonk
version: latest
no_stop_required: true
name: listmonk
port: 9000

View File

@ -2,7 +2,8 @@
application: application:
{% set container_healthcheck = 'health' %} {% set container_healthcheck = 'health' %}
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: "{{ applications | get_app_conf(application_id, 'images.listmonk', True) }}" image: "{{ listmonk_image }}:{{ listmonk_version }}"
container_name: "{{ listmonk_name }}"
ports: ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}" - "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}"
volumes: volumes:

View File

@ -1,6 +1,10 @@
application_id: "listmonk" application_id: "web-app-listmonk"
database_type: "postgres" database_type: "postgres"
container_port: "9000"
container_port: "{{ applications | get_app_conf(application_id, 'docker.services.listmonk.port', True) }}"
listmonk_version: "{{ applications | get_app_conf(application_id, 'docker.services.listmonk.version', True) }}"
listmonk_image: "{{ applications | get_app_conf(application_id, 'docker.services.listmonk.image', True) }}"
listmonk_name: "{{ applications | get_app_conf(application_id, 'docker.services.listmonk.name', True) }}"
listmonk_settings: listmonk_settings:
- key: "app.root_url" - key: "app.root_url"

View File

@ -1,8 +1,5 @@
images:
mastodon: "ghcr.io/mastodon/mastodon:latest"
streaming: "ghcr.io/mastodon/mastodon-streaming:latest"
single_user_mode: false # Set true for initial setup single_user_mode: false # Set true for initial setup
setup: false # Set true in inventory file to execute the setup and initializing procedures setup: false # Set true in inventory file to execute the setup and initializing procedures, don't know if this is still necessary @todo test it
features: features:
matomo: true matomo: true
css: true css: true
@ -22,3 +19,13 @@ docker:
enabled: true enabled: true
database: database:
enabled: true enabled: true
mastodon:
image: "ghcr.io/mastodon/mastodon"
version: latest
no_stop_required: true
name: "mastodon"
streaming:
image: "ghcr.io/mastodon/mastodon-streaming"
version: latest
volumes:
data: "mastodon_data"

View File

@ -18,13 +18,13 @@
- name: flush docker service - name: flush docker service
meta: flush_handlers meta: flush_handlers
when: applications.mastodon.setup |bool when: mastodon_setup |bool
- name: setup routine for mastodon - name: setup routine for mastodon
command: command:
cmd: "docker-compose run --rm web bundle exec rails db:migrate" cmd: "docker-compose run --rm web bundle exec rails db:migrate"
chdir: "{{docker_compose.directories.instance}}" chdir: "{{docker_compose.directories.instance}}"
when: applications.mastodon.setup |bool when: mastodon_setup |bool
- name: "include create-administrator.yml for mastodon" - name: "include create-administrator.yml for mastodon"
include_tasks: create-administrator.yml include_tasks: create-administrator.yml

View File

@ -3,7 +3,8 @@
web: web:
{% set container_port = 3000 %} {% set container_port = 3000 %}
{% set container_healthcheck = 'health' %} {% set container_healthcheck = 'health' %}
image: "{{ applications | get_app_conf(application_id, 'images.' ~ application_id, True) }}" container_name: {{ mastodon_name }}
image: "{{ mastodon_image }}:{{ mastodon_version }}"
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p {{ container_port }}" command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p {{ container_port }}"
{% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %} {% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %}
@ -17,7 +18,8 @@
streaming: streaming:
{% set container_port = 4000 %} {% set container_port = 4000 %}
{% set container_healthcheck = 'api/v1/streaming/health' %} {% set container_healthcheck = 'api/v1/streaming/health' %}
image: "{{ applications | get_app_conf(application_id, 'images.streaming', True) }}" container_name: {{ mastodon_streaming_name }}
image: "{{ mastodon_streaming_image }}:{{ mastodon_streaming_version }}"
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: node ./streaming command: node ./streaming
{% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %} {% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %}
@ -27,7 +29,8 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
sidekiq: sidekiq:
image: "{{ applications | get_app_conf(application_id, 'images.mastodon', True) }}" container_name: {{ mastodon_sidekiq_name }}
image: "{{ mastodon_image }}:{{ mastodon_version }}"
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: bundle exec sidekiq command: bundle exec sidekiq
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %} {% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
@ -40,5 +43,5 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
redis: redis:
data: data:
name: "{{ mastodon_volume }}"
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -5,7 +5,7 @@
LOCAL_DOMAIN={{domains | get_domain(application_id)}} LOCAL_DOMAIN={{domains | get_domain(application_id)}}
ALTERNATE_DOMAINS="{{ domains.mastodon[1:] | join(',') }}" ALTERNATE_DOMAINS="{{ domains.mastodon[1:] | join(',') }}"
SINGLE_USER_MODE={{applications.mastodon.single_user_mode}} SINGLE_USER_MODE={{ applications | get_app_conf(application_id, 'single_user_mode', True) }}
# Credentials # Credentials
@ -13,15 +13,15 @@ SINGLE_USER_MODE={{applications.mastodon.single_user_mode}}
# ------- # -------
# Make sure to use `bundle exec rails secret` to generate secrets # Make sure to use `bundle exec rails secret` to generate secrets
# ------- # -------
SECRET_KEY_BASE= {{applications.mastodon.credentials.secret_key_base}} SECRET_KEY_BASE= {{ applications | get_app_conf(application_id, 'credentials.secret_key_base') }}
OTP_SECRET= {{applications.mastodon.credentials.otp_secret}} OTP_SECRET= {{ applications | get_app_conf(application_id, 'credentials.otp_secret') }}
# Web Push # Web Push
# -------- # --------
# Generate with `bundle exec rails mastodon:webpush:generate_vapid_key` # Generate with `bundle exec rails mastodon:webpush:generate_vapid_key`
# -------- # --------
VAPID_PRIVATE_KEY= {{applications.mastodon.credentials.vapid_private_key}} VAPID_PRIVATE_KEY= {{ applications | get_app_conf(application_id, 'credentials.vapid_private_key') }}
VAPID_PUBLIC_KEY= {{applications.mastodon.credentials.vapid_public_key}} VAPID_PUBLIC_KEY= {{ applications | get_app_conf(application_id, 'credentials.vapid_public_key') }}
# Encryption secrets # Encryption secrets
# ------------------ # ------------------
@ -29,9 +29,9 @@ VAPID_PUBLIC_KEY= {{applications.mastodon.credentials.vapid_public_key}}
# These are private/secret values, do not share outside hosting environment # These are private/secret values, do not share outside hosting environment
# Use `bin/rails db:encryption:init` to generate fresh secrets # Use `bin/rails db:encryption:init` to generate fresh secrets
# Do NOT change these secrets once in use, as this would cause data loss and other issues # Do NOT change these secrets once in use, as this would cause data loss and other issues
ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= {{applications.mastodon.credentials.active_record_encryption_deterministic_key}} ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY= {{ applications | get_app_conf(application_id, 'credentials.active_record_encryption_deterministic_key') }}
ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT= {{applications.mastodon.credentials.active_record_encryption_key_derivation_salt}} ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT= {{ applications | get_app_conf(application_id, 'credentials.active_record_encryption_key_derivation_salt') }}
ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY= {{applications.mastodon.credentials.active_record_encryption_primary_key}} ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY= {{ applications | get_app_conf(application_id, 'credentials.active_record_encryption_primary_key') }}
DB_HOST={{ database_host }} DB_HOST={{ database_host }}
DB_PORT={{ database_port }} DB_PORT={{ database_port }}

View File

@ -1,2 +1,11 @@
application_id: "mastodon" application_id: "web-app-mastodon"
database_type: "postgres" database_type: "postgres"
mastodon_version: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.version', True) }}"
mastodon_image: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.image', True) }}"
mastodon_name: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.name', True) }}"
mastodon_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"
mastodon_streaming_version: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.version', True) }}"
mastodon_streaming_image: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.image', True) }}"
mastodon_streaming_name: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.name', True) }}_streaming"
mastodon_sidekiq_name: "{{ applications | get_app_conf(application_id, 'docker.services.mastodon.name', True) }}_sidekiq"
mastodon_setup: "{{ applications | get_app_conf(application_id, 'setup', True) }}"

View File

@ -33,8 +33,13 @@ excluded_ips: "{{ networks.internet.values() | list }}"
docker: docker:
services: services:
matomo: matomo:
image: "matomo:latest" image: "matomo"
version: "latest"
name: "matomo"
no_stop_required: true
database: database:
enabled: true enabled: true
redis: redis:
enabled: false enabled: false
volumes:
data: matomo_data

View File

@ -2,7 +2,7 @@
application: application:
{% set container_port = 80 %} {% set container_port = 80 %}
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.image', True) }}" image: "{{ matomo_image }}:{{ matomo_version }}"
ports: ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}" - "127.0.0.1:{{ports.localhost.http[application_id]}}:{{ container_port }}"
volumes: volumes:
@ -12,5 +12,6 @@
{% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %} {% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ matomo_data }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -4,7 +4,9 @@ database_type: "mariadb"
matomo_excluded_ips: "{{ applications | get_app_conf(application_id, 'excluded_ips', True) }}" matomo_excluded_ips: "{{ applications | get_app_conf(application_id, 'excluded_ips', True) }}"
matomo_index_php_url: "{{ domains | get_url(application_id, web_protocol) }}/index.php" matomo_index_php_url: "{{ domains | get_url(application_id, web_protocol) }}/index.php"
matomo_auth_token: "{{ applications | get_app_conf(application_id, 'credentials.auth_token', True) }}" matomo_auth_token: "{{ applications | get_app_conf(application_id, 'credentials.auth_token', True) }}"
matomo_version: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.version', True) }}"
matomo_image: "{{ applications | get_app_conf(application_id, 'docker.services.matomo.image', True) }}"
matomo_data: "{{ applications | get_app_conf(application_id, 'docker.volumes.data', True) }}"
# I don't know if this is still necessary # I don't know if this is still necessary
domain: "{{ domains | get_domain(application_id) }}" domain: "{{ domains | get_domain(application_id) }}"

View File

@ -3,8 +3,8 @@
include_role: include_role:
name: srv-proxy-6-6-domain name: srv-proxy-6-6-domain
loop: loop:
- "{{domains.matrix.element}}" - "{{ domains[application_id].element }}"
- "{{domains.matrix.synapse}}" - "{{ domains[application_id].synapse }}"
loop_control: loop_control:
loop_var: domain loop_var: domain
@ -80,7 +80,7 @@
become: false become: false
- name: play matrix-web-app-ansible-deploy - name: play matrix-web-app-ansible-deploy
local_action: "command ansible-playbook -i {{hosts_path}} {{local_repository_directory}}/setup.yml -vvv --tags={{applications.matrix.playbook_tags}}" local_action: "command ansible-playbook -i {{hosts_path}} {{local_repository_directory}}/setup.yml -vvv --tags={{ applications | get_app_conf(application_id, 'playbook_tags')}}"
become: false become: false
@ -129,13 +129,13 @@
#- name: add log.config #- name: add log.config
# template: # template:
# src: "log.config.j2" # src: "log.config.j2"
# dest: "{{docker_compose.directories.instance}}{{domains.matrix.synapse}}.log.config" # dest: "{{docker_compose.directories.instance}}{{domains[application_id].synapse}}.log.config"
# notify: recreate matrix # notify: recreate matrix
# #
## https://github.com/matrix-org/synapse/issues/6303 ## https://github.com/matrix-org/synapse/issues/6303
#- name: set correct folder permissions #- name: set correct folder permissions
# command: # command:
# cmd: "docker run --rm --mount type=volume,src=matrix_synapse_data,dst=/data -e SYNAPSE_SERVER_NAME={{domains.matrix.synapse}} -e SYNAPSE_REPORT_STATS=no --entrypoint /bin/sh matrixdotorg/synapse:latest -c 'chown -vR 991:991 /data'" # cmd: "docker run --rm --mount type=volume,src=matrix_synapse_data,dst=/data -e SYNAPSE_SERVER_NAME={{domains[application_id].synapse}} -e SYNAPSE_REPORT_STATS=no --entrypoint /bin/sh matrixdotorg/synapse:latest -c 'chown -vR 991:991 /data'"
# #
#- name: add docker-compose.yml #- name: add docker-compose.yml
# template: # template:

View File

@ -8,7 +8,7 @@
# because you can't change the Domain after deployment. # because you can't change the Domain after deployment.
# #
# Example value: example.com # Example value: example.com
matrix_domain: "{{domains.matrix.synapse}}" matrix_domain: "{{domains[application_id].synapse}}"
# The Matrix homeserver software to install. # The Matrix homeserver software to install.
# See: # See:

View File

@ -2,15 +2,19 @@ docker:
services: services:
database: database:
enabled: true enabled: true
images: synapse:
synapse: "matrixdotorg/synapse:latest" version: latest
element: "vectorim/element-web:latest" image: matrixdotorg/synapse
name: matrix-synapse
no_stop_required: true
element:
version: latest
image: vectorim/element-web
name: matrix-element
volumes:
synapse: "matrix_synapse_data"
playbook_tags: "setup-all,start" # For the initial update use: install-all,ensure-matrix-users-created,start playbook_tags: "setup-all,start" # For the initial update use: install-all,ensure-matrix-users-created,start
server_name: "{{ primary_domain }}" # Adress for the account names etc. server_name: "{{ primary_domain }}" # Adress for the account names etc.
synapse:
version: "latest"
element:
version: "latest"
setup: false # Set true in inventory file to execute the setup and initializing procedures setup: false # Set true in inventory file to execute the setup and initializing procedures
features: features:
matomo: false # Deactivated, because in html CSP restricts use matomo: false # Deactivated, because in html CSP restricts use

View File

@ -16,8 +16,8 @@
include_role: include_role:
name: srv-web-7-6-composer name: srv-web-7-6-composer
vars: vars:
domain: "{{domains.matrix.synapse}}" domain: "{{domains[application_id].synapse}}"
http_port: "{{ports.localhost.http.matrix_synapse}}" http_port: "{{ports.localhost.http['web-app-matrix_synapse']}}"
- name: create {{well_known_directory}} - name: create {{well_known_directory}}
file: file:
@ -30,21 +30,21 @@
src: "well-known.j2" src: "well-known.j2"
dest: "{{well_known_directory}}server" dest: "{{well_known_directory}}server"
- name: create {{domains.matrix.synapse}}.conf - name: create {{domains[application_id].synapse}}.conf
template: template:
src: "templates/nginx.conf.j2" src: "templates/nginx.conf.j2"
dest: "{{nginx.directories.http.servers}}{{domains.matrix.synapse}}.conf" dest: "{{nginx.directories.http.servers}}{{domains[application_id].synapse}}.conf"
vars: vars:
domain: "{{domains.matrix.synapse}}" # Didn't work in the past. May it works now. This does not seem to work @todo Check how to solve without declaring set_fact, seems a bug at templates domain: "{{domains[application_id].synapse}}" # Didn't work in the past. May it works now. This does not seem to work @todo Check how to solve without declaring set_fact, seems a bug at templates
http_port: "{{ports.localhost.http.matrix_synapse}}" http_port: "{{ports.localhost.http['web-app-matrix_synapse']}}"
notify: restart nginx notify: restart nginx
- name: "include role srv-proxy-6-6-domain for {{application_id}}" - name: "include role srv-proxy-6-6-domain for {{application_id}}"
include_role: include_role:
name: srv-proxy-6-6-domain name: srv-proxy-6-6-domain
vars: vars:
domain: "{{domains.matrix.element}}" domain: "{{domains[application_id].element}}"
http_port: "{{ports.localhost.http.matrix_element}}" http_port: "{{ports.localhost.http['web-app-matrix_element']}}"
- name: include create-and-seed-database.yml for multiple bridges - name: include create-and-seed-database.yml for multiple bridges
include_tasks: create-and-seed-database.yml include_tasks: create-and-seed-database.yml
@ -94,13 +94,13 @@
- name: add synapse log configuration - name: add synapse log configuration
template: template:
src: "synapse/log.config.j2" src: "synapse/log.config.j2"
dest: "{{docker_compose.directories.instance}}{{domains.matrix.synapse}}.log.config" dest: "{{docker_compose.directories.instance}}{{domains[application_id].synapse}}.log.config"
notify: docker compose up notify: docker compose up
# https://github.com/matrix-org/synapse/issues/6303 # https://github.com/matrix-org/synapse/issues/6303
- name: set correct folder permissions - name: set correct folder permissions
command: command:
cmd: "docker run --rm --mount type=volume,src=matrix_synapse_data,dst=/data -e SYNAPSE_SERVER_NAME={{domains.matrix.synapse}} -e SYNAPSE_REPORT_STATS=no --entrypoint /bin/sh matrixdotorg/synapse:latest -c 'chown -vR 991:991 /data'" cmd: "docker run --rm --mount type=volume,src=matrix_synapse_data,dst=/data -e SYNAPSE_SERVER_NAME={{domains[application_id].synapse}} -e SYNAPSE_REPORT_STATS=no --entrypoint /bin/sh matrixdotorg/synapse:latest -c 'chown -vR 991:991 /data'"
- name: add docker-compose.yml - name: add docker-compose.yml
template: template:

View File

@ -1,23 +1,23 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
synapse: synapse:
{% set container_port = 8008 %} {% set container_port = 8008 %}
image: "{{ applications | get_app_conf(application_id, 'images.synapse', True) }}" image: "{{ matrix_synapse_image }}:{{ matrix_synapse_version }}"
container_name: matrix-synapse container_name: {{ matrix_synapse_name }}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
logging: logging:
driver: journald driver: journald
volumes: volumes:
- synapse_data:/data - synapse_data:/data
- ./homeserver.yaml:/data/homeserver.yaml:ro - ./homeserver.yaml:/data/homeserver.yaml:ro
- ./{{domains.matrix.synapse}}.log.config:/data/{{domains.matrix.synapse}}.log.config:ro - ./{{domains[application_id].synapse}}.log.config:/data/{{domains[application_id].synapse}}.log.config:ro
{% for item in bridges %} {% for item in bridges %}
- {{docker_compose.directories.instance}}mautrix/{{item.bridge_name}}/registration.yaml:{{registration_file_folder}}{{item.bridge_name}}.registration.yaml:ro - {{docker_compose.directories.instance}}mautrix/{{item.bridge_name}}/registration.yaml:{{registration_file_folder}}{{item.bridge_name}}.registration.yaml:ro
{% endfor %} {% endfor %}
environment: environment:
- SYNAPSE_SERVER_NAME={{domains.matrix.synapse}} - SYNAPSE_SERVER_NAME={{domains[application_id].synapse}}
- SYNAPSE_REPORT_STATS=no - SYNAPSE_REPORT_STATS=no
ports: ports:
- "127.0.0.1:{{ports.localhost.http.matrix_synapse}}:{{ container_port }}" - "127.0.0.1:{{ports.localhost.http['web-app-matrix_synapse']}}:{{ container_port }}"
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %} {% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% if bridges | length > 0 %} {% if bridges | length > 0 %}
{% for item in bridges %} {% for item in bridges %}
@ -30,13 +30,13 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
element: element:
{% set container_port = 80 %} {% set container_port = 80 %}
image: "{{ applications | get_app_conf(application_id, 'images.element', True) }}" image: "{{ matrix_element_image }}:{{ matrix_element_version }}"
container_name: matrix-element container_name: {{ matrix_element_name }}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
volumes: volumes:
- ./element-config.json:/app/config.json - ./element-config.json:/app/config.json
ports: ports:
- "127.0.0.1:{{ports.localhost.http.matrix_element}}:{{ container_port }}" - "127.0.0.1:{{ports.localhost.http['web-app-matrix_element']}}:{{ container_port }}"
{% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %} {% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
@ -81,7 +81,7 @@
KEYV_URL: '' KEYV_URL: ''
KEYV_BOT_ENCRYPTION: 'false' KEYV_BOT_ENCRYPTION: 'false'
KEYV_BOT_STORAGE: 'true' KEYV_BOT_STORAGE: 'true'
MATRIX_HOMESERVER_URL: 'https://{{domains.matrix.synapse}}' MATRIX_HOMESERVER_URL: '{{ web_protocol }}://{{ domains[application_id].synapse }}'
MATRIX_BOT_USERNAME: '@chatgptbot:{{applications | get_app_conf(application_id, 'server_name', True)}}' MATRIX_BOT_USERNAME: '@chatgptbot:{{applications | get_app_conf(application_id, 'server_name', True)}}'
MATRIX_ACCESS_TOKEN: '{{ applications | get_app_conf(application_id, 'credentials.chatgpt_bridge_access_token', True) | default('') }}' MATRIX_ACCESS_TOKEN: '{{ applications | get_app_conf(application_id, 'credentials.chatgpt_bridge_access_token', True) | default('') }}'
MATRIX_BOT_PASSWORD: '{{applications | get_app_conf(application_id, 'credentials.chatgpt_bridge_user_password', True)}}' MATRIX_BOT_PASSWORD: '{{applications | get_app_conf(application_id, 'credentials.chatgpt_bridge_user_password', True)}}'
@ -98,6 +98,7 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
synapse_data: synapse_data:
name: {{ matrix_synapse_data }}
{% if applications | get_app_conf(application_id, 'plugins.chatgpt', True) | bool %} {% if applications | get_app_conf(application_id, 'plugins.chatgpt', True) | bool %}
chatgpt_data: chatgpt_data:
{% endif %} {% endif %}

View File

@ -1,8 +1,8 @@
{ {
"default_server_config": { "default_server_config": {
"m.homeserver": { "m.homeserver": {
"base_url": "{{ web_protocol }}://{{domains.matrix.synapse}}", "base_url": "{{ web_protocol }}://{{domains[application_id].synapse}}",
"server_name": "{{domains.matrix.synapse}}" "server_name": "{{domains[application_id].synapse}}"
}, },
"m.identity_server": { "m.identity_server": {
"base_url": "{{ web_protocol }}://{{primary_domain}}" "base_url": "{{ web_protocol }}://{{primary_domain}}"

View File

@ -143,7 +143,7 @@ bridge:
sync_direct_chat_list: false sync_direct_chat_list: false
# Servers to always allow double puppeting from # Servers to always allow double puppeting from
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: {{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{domains[application_id].synapse}}
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth

View File

@ -134,7 +134,7 @@ bridge:
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Servers to allow double puppeting from, even if double_puppet_allow_discovery is false. # Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: https://{{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{ web_protocol }}://{{ domains[application_id].synapse }}
# Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
# #
# If set, custom puppets will be enabled automatically for local users # If set, custom puppets will be enabled automatically for local users

View File

@ -141,7 +141,7 @@ bridge:
federate_rooms: true federate_rooms: true
# Servers to always allow double puppeting from # Servers to always allow double puppeting from
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: https://{{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{ web_protocol }}://{{ domains[application_id].synapse }}
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth

View File

@ -118,7 +118,7 @@ bridge:
# Servers to always allow double puppeting from # Servers to always allow double puppeting from
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: https://{{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{ web_protocol }}://{{ domains[application_id].synapse }}
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth

View File

@ -198,7 +198,7 @@ bridge:
sync_direct_chat_list: false sync_direct_chat_list: false
# Servers to always allow double puppeting from # Servers to always allow double puppeting from
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: https://{{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{ web_protocol }}://{{ domains[application_id].synapse }}
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth

View File

@ -236,7 +236,7 @@ bridge:
force_active_delivery_receipts: false force_active_delivery_receipts: false
# Servers to always allow double puppeting from # Servers to always allow double puppeting from
double_puppet_server_map: double_puppet_server_map:
{{applications | get_app_conf(application_id, 'server_name', True)}}: https://{{domains.matrix.synapse}} {{applications | get_app_conf(application_id, 'server_name', True)}}: {{ web_protocol }}://{{ domains[application_id].synapse }}
# Allow using double puppeting from any server with a valid client .well-known file. # Allow using double puppeting from any server with a valid client .well-known file.
double_puppet_allow_discovery: false double_puppet_allow_discovery: false
# Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth

View File

@ -1,10 +1,10 @@
server { server {
{# Somehow .j2 doesn't interpretate the passed variable right. For this reasons this redeclaration is necessary #} {# Somehow .j2 doesn't interpretate the passed variable right. For this reasons this redeclaration is necessary #}
{# Could be that this is related to the set_fact use #} {# Could be that this is related to the set_fact use #}
{% set domain = domains.matrix.synapse %} {% set domain = domains[application_id].synapse %}
{% set http_port = ports.localhost.http.matrix_synapse %} {% set http_port = ports.localhost.http['web-app-matrix_synapse'] %}
server_name {{domains.matrix.synapse}}; server_name {{domains[application_id].synapse}};
{% include 'roles/srv-web-7-7-letsencrypt/templates/ssl_header.j2' %} {% include 'roles/srv-web-7-7-letsencrypt/templates/ssl_header.j2' %}
# For the federation port # For the federation port

View File

@ -17,15 +17,15 @@ database:
host: "{{database_host}}" host: "{{database_host}}"
cp_min: 5 cp_min: 5
cp_max: 10 cp_max: 10
log_config: "/data/{{domains.matrix.synapse}}.log.config" log_config: "/data/{{domains[application_id].synapse}}.log.config"
media_store_path: "/data/media_store" media_store_path: "/data/media_store"
registration_shared_secret: "{{applications | get_app_conf(application_id, 'credentials.registration_shared_secret', True)}}" registration_shared_secret: "{{applications | get_app_conf(application_id, 'credentials.registration_shared_secret', True)}}"
report_stats: true report_stats: true
macaroon_secret_key: "{{applications | get_app_conf(application_id, 'credentials.macaroon_secret_key', True)}}" macaroon_secret_key: "{{applications | get_app_conf(application_id, 'credentials.macaroon_secret_key', True)}}"
form_secret: "{{applications | get_app_conf(application_id, 'credentials.form_secret', True)}}" form_secret: "{{applications | get_app_conf(application_id, 'credentials.form_secret', True)}}"
signing_key_path: "/data/{{domains.matrix.synapse}}.signing.key" signing_key_path: "/data/{{domains[application_id].synapse}}.signing.key"
web_client_location: "{{ web_protocol }}://{{domains.matrix.element}}" web_client_location: "{{ web_protocol }}://{{domains[application_id].element}}"
public_baseurl: "{{ web_protocol }}://{{domains.matrix.synapse}}" public_baseurl: "{{ web_protocol }}://{{domains[application_id].synapse}}"
trusted_key_servers: trusted_key_servers:
- server_name: "matrix.org" - server_name: "matrix.org"
admin_contact: 'mailto:{{ users.administrator.email }}' admin_contact: 'mailto:{{ users.administrator.email }}'
@ -39,10 +39,10 @@ email:
#require_transport_security: true #require_transport_security: true
enable_tls: "{{ system_email.tls | upper }}" enable_tls: "{{ system_email.tls | upper }}"
notif_from: "Your Friendly %(app)s homeserver <{{ users['no-reply'].email }}>" notif_from: "Your Friendly %(app)s homeserver <{{ users['no-reply'].email }}>"
app_name: "Matrix on {{domains.matrix.synapse}}" app_name: "Matrix on {{domains[application_id].synapse}}"
enable_notifs: true enable_notifs: true
notif_for_new_users: false notif_for_new_users: false
client_base_url: "{{domains.matrix.synapse}}" client_base_url: "{{domains[application_id].synapse}}"
validation_token_lifetime: 15m validation_token_lifetime: 15m
{% if applications | get_app_conf(application_id, 'features.oidc', False) %} {% if applications | get_app_conf(application_id, 'features.oidc', False) %}

View File

@ -8,7 +8,7 @@ handlers:
file: file:
class: logging.handlers.RotatingFileHandler class: logging.handlers.RotatingFileHandler
formatter: precise formatter: precise
filename: /data/{{domains.matrix.synapse}}.homeserver.log filename: /data/{{domains[application_id].synapse}}.homeserver.log
maxBytes: 10485760 maxBytes: 10485760
backupCount: 3 backupCount: 3
console: console:

View File

@ -1,3 +1,3 @@
{ {
"m.server": "{{domains.matrix.synapse}}:{{ WEB_PORT }}" "m.server": "{{domains[application_id].synapse}}:{{ WEB_PORT }}"
} }

View File

@ -1,5 +1,12 @@
--- ---
application_id: "matrix" application_id: "web-app-matrix"
database_type: "postgres" database_type: "postgres"
registration_file_folder: "/data/" registration_file_folder: "/data/"
well_known_directory: "{{nginx.directories.data.well_known}}/matrix/" well_known_directory: "{{nginx.directories.data.well_known}}/matrix/"
matrix_synapse_version: "{{ applications | get_app_conf(application_id, 'docker.services.synapse.version', True) }}"
matrix_synapse_image: "{{ applications | get_app_conf(application_id, 'docker.services.synapse.image', True) }}"
matrix_synapse_name: "{{ applications | get_app_conf(application_id, 'docker.services.synapse.name', True) }}"
matrix_synapse_data: "{{ applications | get_app_conf(application_id, 'docker.volumes.synapse', True) }}"
matrix_element_version: "{{ applications | get_app_conf(application_id, 'docker.services.element.version', True) }}"
matrix_element_image: "{{ applications | get_app_conf(application_id, 'docker.services.element.image', True) }}"
matrix_element_name: "{{ applications | get_app_conf(application_id, 'docker.services.element.name', True) }}"

View File

@ -1,2 +1,3 @@
# Todo # Todo
- This role needs to be updated to the new role structure - This role needs to be updated to the new role structure
- It needs to be tested - Really antique role which wasn't used since ages, because I used discourse in production instead and just updated the refactored and restructure stuff here.

View File

@ -1,3 +1,12 @@
domains: domains:
canonical: canonical:
- "wiki.{{ primary_domain }}" - "wiki.{{ primary_domain }}"
docker:
services:
mediawiki:
image: mediawiki
version: latest
no_stop_required: true
name: mediawiki
volumes:
data: mediawiki_data

View File

@ -1,12 +1,10 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
application: application:
# Seems like image tag got lost. @todo Check and implement if necessary {% include 'roles/docker-container/templates/base.yml.j2' %}
log_driver: journald container_name: "{{ mediawiki_name }}"
restart: "{{docker_restart_policy}}" image: "{{ mediawiki_image }}:{{ mediawiki_version }}"
depends_on:
- database
volumes: volumes:
- "mediawiki-data:/var/www/html/" - "data:/var/www/html/"
ports: ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80" - "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
@ -14,5 +12,5 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ mediawiki_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,3 +1,6 @@
application_id: "mediawiki" application_id: "web-app-mediawiki"
database_password: "{{mediawiki_database_password}}"
database_type: "mariadb" database_type: "mariadb"
mediawiki_version: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.version', True) }}"
mediawiki_image: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.image', True) }}"
mediawiki_name: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.name', True) }}"
mediawiki_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -3,6 +3,5 @@ application_id: mobilizon
database_type: "postgres" database_type: "postgres"
database_gis_enabled: true database_gis_enabled: true
mobilizon_oidc_callback_url: "{{ domains | get_url(application_id, web_protocol) }}/auth/openid_connect/callback"
container_port: 4000 container_port: 4000
mobilizon_host_conf_exs_file: "{{docker_compose.directories.config}}config.exs" mobilizon_host_conf_exs_file: "{{docker_compose.directories.config}}config.exs"

View File

@ -1,12 +1,16 @@
version: "latest"
features: features:
matomo: true matomo: true
css: true css: true
port-ui-desktop: true port-ui-desktop: true
central_database: true central_database: true
docker: docker:
services: services:
database: database:
enabled: true enabled: true
mybb:
image: "mybb/mybb"
version: "latest"
name: "mybb"
volumes:
data: "mybb_data"

View File

@ -4,7 +4,8 @@
driver: journald driver: journald
options: options:
tag: "mybb_application" tag: "mybb_application"
image: mybb/mybb:{{applications.mybb.version}} image: {{ mybb_image }}:{{ mybb_version }}
container_name: {{ mybb_name }}
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
volumes: volumes:
- data:/var/www/html - data:/var/www/html
@ -27,5 +28,6 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ mybb_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,8 +1,11 @@
--- ---
application_id: "mybb" application_id: "web-app-mybb"
docker_compose_instance_confd_directory: "{{docker_compose.directories.instance}}conf.d/" docker_compose_instance_confd_directory: "{{docker_compose.directories.instance}}conf.d/"
docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf" docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf"
target_mount_conf_d_directory: "{{nginx.directories.http.servers}}" target_mount_conf_d_directory: "{{nginx.directories.http.servers}}"
source_domain: "mybb.{{primary_domain}}" source_domain: "mybb.{{primary_domain}}"
database_password: "{{mybb_database_password}}"
database_type: "mariadb" database_type: "mariadb"
mybb_version: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.version', True) }}"
mybb_image: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.image', True) }}"
mybb_name: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.name', True) }}"
mybb_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -10,15 +10,37 @@ csp:
- "data:" - "data:"
domains: domains:
canonical: canonical:
- "cloud.{{ primary_domain }}" nextcloud: "cloud.{{ primary_domain }}"
# talk: "talk.{{ primary_domain }}" @todo needs to be activated
docker: docker:
services: services:
redis: redis:
enabled: true enabled: true
database: database:
enabled: true enabled: true
nextcloud:
name: "nextcloud"
image: "nextcloud"
version: "latest-fpm-alpine"
no_stop_required: true
proxy:
name: "nextcloud-proxy"
image: "nginx"
version: "alpine"
cron:
name: "nextcloud-cron"
talk:
name: "nextcloud-talk"
image: "nextcloud/aio-talk"
version: "latest"
enabled: false # Not enabled yet, because just implemented during refactoring and not tested yet. if tested activate
# Its in a own role. @todo remove it if it gets implemented via the other role
#collabora:
# name: "nextcloud-collabora"
# image: "nextcloud-collabora"
# version: "latest"
oidc: oidc:
enabled: "{{ applications.nextcloud.features.oidc | default(true) }}" # Activate OIDC for Nextcloud enabled: "{{ applications | get_app_conf(application_id, 'features.oidc')" # Activate OIDC for Nextcloud
# floavor decides which OICD plugin should be used. # floavor decides which OICD plugin should be used.
# Available options: oidc_login, sociallogin # Available options: oidc_login, sociallogin
# @see https://apps.nextcloud.com/apps/oidc_login # @see https://apps.nextcloud.com/apps/oidc_login
@ -34,10 +56,7 @@ features:
default_quota: '1000000000' # Quota to assign if no quota is specified in the OIDC response (bytes) default_quota: '1000000000' # Quota to assign if no quota is specified in the OIDC response (bytes)
legacy_login_mask: legacy_login_mask:
enabled: False # If true, then legacy login mask is shown. Otherwise just SSO enabled: False # If true, then legacy login mask is shown. Otherwise just SSO
container:
application: "nextcloud-application" # Nextcloud application 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
@ -146,16 +165,16 @@ plugins:
enabled: true enabled: true
integration_mastodon: integration_mastodon:
# Nextcloud Integration Mastodon: connects Nextcloud with the Mastodon social network (https://apps.nextcloud.com/apps/integration_mastodon) # Nextcloud Integration Mastodon: connects Nextcloud with the Mastodon social network (https://apps.nextcloud.com/apps/integration_mastodon)
enabled: "{{ 'mastodon' in group_names | lower }}" enabled: "{{ 'web-app-mastodon' in group_names | lower }}"
integration_openai: integration_openai:
# Nextcloud Integration OpenAI: brings OpenAI functionalities into Nextcloud (https://apps.nextcloud.com/apps/integration_openai) # Nextcloud Integration OpenAI: brings OpenAI functionalities into Nextcloud (https://apps.nextcloud.com/apps/integration_openai)
enabled: false enabled: false
integration_openproject: integration_openproject:
# Nextcloud Integration OpenProject: integrates project management features from OpenProject (https://apps.nextcloud.com/apps/integration_openproject) # Nextcloud Integration OpenProject: integrates project management features from OpenProject (https://apps.nextcloud.com/apps/integration_openproject)
enabled: "{{ 'openproject' in group_names | lower }}" enabled: "{{ 'web-app-openproject' in group_names | lower }}"
integration_peertube: integration_peertube:
# Nextcloud Integration PeerTube: connects to PeerTube for video sharing (https://apps.nextcloud.com/apps/integration_peertube) # Nextcloud Integration PeerTube: connects to PeerTube for video sharing (https://apps.nextcloud.com/apps/integration_peertube)
enabled: "{{ 'peertube' in group_names | lower }}" enabled: "{{ 'web-app-peertube' in group_names | lower }}"
#keeweb #keeweb
# # Nextcloud KeeWeb: integrates the KeeWeb password manager within Nextcloud (https://apps.nextcloud.com/apps/keeweb) # # Nextcloud KeeWeb: integrates the KeeWeb password manager within Nextcloud (https://apps.nextcloud.com/apps/keeweb)
# # This isn't maintained anymore. The alternatives don't support keepass files # # This isn't maintained anymore. The alternatives don't support keepass files
@ -216,13 +235,13 @@ plugins:
# enabled: false # enabled: false
twofactor_nextcloud_notification: twofactor_nextcloud_notification:
# Nextcloud two-factor notification: sends notifications for two-factor authentication events (https://apps.nextcloud.com/apps/twofactor_nextcloud_notification) # Nextcloud two-factor notification: sends notifications for two-factor authentication events (https://apps.nextcloud.com/apps/twofactor_nextcloud_notification)
enabled: "{{ not applications.nextcloud.features.oidc | default(true) }}" # Deactivate 2FA if oidc is active enabled: "{{ not applications | get_app_conf('web-app-nextcloud', 'features.oidc', False, True) }}" # Deactivate 2FA if oidc is active
twofactor_totp: twofactor_totp:
# Nextcloud two-factor TOTP: provides time-based one-time password authentication (https://apps.nextcloud.com/apps/twofactor_totp) # Nextcloud two-factor TOTP: provides time-based one-time password authentication (https://apps.nextcloud.com/apps/twofactor_totp)
enabled: "{{ not applications.nextcloud.features.oidc | default(true) }}" # Deactivate 2FA if oidc is active enabled: "{{ not applications | get_app_conf('web-app-nextcloud', 'features.oidc', False, True) }}" # Deactivate 2FA if oidc is active
user_ldap: user_ldap:
# Nextcloud user LDAP: integrates LDAP for user management and authentication (https://apps.nextcloud.com/apps/user_ldap) # Nextcloud user LDAP: integrates LDAP for user management and authentication (https://apps.nextcloud.com/apps/user_ldap)
enabled: "{{ applications.nextcloud.features.ldap | default(true) }}" enabled: "{{ applications | get_app_conf('web-app-nextcloud', 'features.ldap', False, True) }}"
user_directory: user_directory:
enabled: true # Enables the LDAP User Directory Search enabled: true # Enables the LDAP User Directory Search
user_oidc: user_oidc:

View File

@ -8,7 +8,7 @@ export DOCKER_CLIENT_TIMEOUT=600 &&
docker-compose down docker-compose down
``` ```
Afterwards, update the ***applications.nextcloud.version*** variable to the next version and run this repository with this Ansible role. Afterwards, update the ***applications.docker.services.*.version*** variable to the next version and run this repository with this Ansible role.
> **Note:** > **Note:**
> It is only possible to update from one to the next major version at a time. > It is only possible to update from one to the next major version at a time.

View File

@ -1,6 +1,6 @@
--- ---
- name: restart nextcloud nginx service - name: restart nextcloud nginx service
command: command:
cmd: "docker exec {{applications.nextcloud.container.proxy}} nginx -s reload" cmd: "docker exec {{ nextcloud_proxy_name }} nginx -s reload"
listen: restart nextcloud nginx service listen: restart nextcloud nginx service
ignore_errors: true # Ignoring if container is restarting ignore_errors: true # Ignoring if container is restarting

View File

@ -8,11 +8,11 @@
- name: Copy include instructions to the container - name: Copy include instructions to the container
command: > command: >
docker cp {{ nextcloud_host_include_instructions_file }} {{ applications.nextcloud.container.application }}:{{nextcloud_docker_include_instructions_file}} docker cp {{ nextcloud_host_include_instructions_file }} {{ nextcloud_name }}:{{nextcloud_docker_include_instructions_file}}
- name: Append generated config to config.php only if not present - name: Append generated config to config.php only if not present
command: > command: >
docker exec -u {{nextcloud_docker_user}} {{ applications.nextcloud.container.application }} sh -c " docker exec -u {{nextcloud_docker_user}} {{ nextcloud_name }} sh -c "
grep -q '{{ nextcloud_docker_config_additives_directory }}' {{ nextcloud_docker_config_file }} || grep -q '{{ nextcloud_docker_config_additives_directory }}' {{ nextcloud_docker_config_file }} ||
cat {{nextcloud_docker_include_instructions_file}} >> {{ nextcloud_docker_config_file }}" cat {{nextcloud_docker_include_instructions_file}} >> {{ nextcloud_docker_config_file }}"
notify: docker compose restart notify: docker compose restart

View File

@ -65,8 +65,8 @@
- name: Ensure Nextcloud administrator is in the 'admin' group - name: Ensure Nextcloud administrator is in the 'admin' group
command: > command: >
docker exec -u {{ nextcloud_docker_user }} {{ applications.nextcloud.container.application }} docker exec -u {{ nextcloud_docker_user }} {{ nextcloud_name }}
php occ group:adduser admin {{ applications.nextcloud.users.administrator.username }} php occ group:adduser admin {{ nextcloud_administrator_username }}
register: add_admin_to_group register: add_admin_to_group
changed_when: "'Added user' in add_admin_to_group.stdout" changed_when: "'Added user' in add_admin_to_group.stdout"
failed_when: add_admin_to_group.rc != 0 and "'is already a member of' not in add_admin_to_group.stderr" failed_when: add_admin_to_group.rc != 0 and "'is already a member of' not in add_admin_to_group.stderr"

View File

@ -1,8 +1,8 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
application: application:
image: "nextcloud:{{applications.nextcloud.version}}-fpm-alpine" image: "{{ nextcloud_image }}:{{ nextcloud_version }}"
container_name: {{applications.nextcloud.container.application}} container_name: {{ nextcloud_name }}
volumes: volumes:
- data:{{nextcloud_docker_work_directory}} - data:{{nextcloud_docker_work_directory}}
- {{nextcloud_host_config_additives_directory}}:{{nextcloud_docker_config_additives_directory}}:ro - {{nextcloud_host_config_additives_directory}}:{{nextcloud_docker_config_additives_directory}}:ro
@ -16,31 +16,25 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
ipv4_address: 192.168.102.69 ipv4_address: 192.168.102.69
# @Todo activate {% if nextcloud_talk_enabled %}
#nc-talk: talk:
# image: nextcloud/aio-talk:latest {% include 'roles/docker-container/templates/base.yml.j2' %}
# container_name: talk_hpb image: "{{ nextcloud_talk_image }}:{{ nextcloud_talk_version }}"
# hostname: hpb_yt container_name: {{ nextcloud_talk_name }}
# restart: unless-stopped hostname: hpb_yt
# init: true init: true
# ports: ports:
# - 3478:3478/tcp #TURN TCP - {{ networks.internet.ip4 }}:{{ nextcloud_talk_stun_port }}:3478/tcp #TURN TCP
# - 3478:3478/udp #TURN UDP - {{ networks.internet.ip4 }}:{{ nextcloud_talk_stun_port }}:3478/udp #TURN UDP
# - 8181:8081/tcp #Signaling - {{ networks.internet.ip4 }}:8181:8081/tcp #Signaling @todo needs to be optimized
# environment: networks:
# - NC_DOMAIN=cloud.yourdomain.tld default:
# - TALK_HOST=signaling.yourdomain.tld ipv4_address: 192.168.102.68
# - TURN_SECRET=${TURN_SECRET} {% endif %}
# - SIGNALING_SECRET=${SIGNALING_SECRET}
# - TZ=Europe/Berlin
# - TALK_PORT=3478
# - INTERNAL_SECRET=${INTERNAL_SECRET}
# networks:
# - nxnetwork_yt
web: proxy:
image: nginx:alpine image: "{{ nextcloud_proxy_image }}:{{ nextcloud_proxy_version }}"
container_name: {{applications.nextcloud.container.proxy}} container_name: "{{ nextcloud_proxy_name }}"
logging: logging:
driver: journald driver: journald
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
@ -57,8 +51,8 @@
ipv4_address: 192.168.102.67 ipv4_address: 192.168.102.67
cron: cron:
container_name: nextcloud-cron container_name: "{{ nextcloud_cron_name }}"
image: "nextcloud:{{applications.nextcloud.version}}-fpm-alpine" image: "{{ nextcloud_image }}:{{ nextcloud_version }}"
restart: {{docker_restart_policy}} restart: {{docker_restart_policy}}
logging: logging:
driver: journald driver: journald

View File

@ -29,7 +29,7 @@ NEXTCLOUD_ADMIN_PASSWORD= "{{applications | get_app_conf(application_id, '
# Security # Security
NEXTCLOUD_TRUSTED_DOMAINS= "{{domains | get_domain(application_id)}}" NEXTCLOUD_TRUSTED_DOMAINS= "{{ nextcloud_domains }}"
# Whitelist local docker gateway in Nextcloud to prevent brute-force throtteling # Whitelist local docker gateway in Nextcloud to prevent brute-force throtteling
TRUSTED_PROXIES= "{{ networks.internet.values() | select | join(',') }}" TRUSTED_PROXIES= "{{ networks.internet.values() | select | join(',') }}"
OVERWRITECLIURL= "{{ domains | get_url(application_id, web_protocol) }}" OVERWRITECLIURL= "{{ domains | get_url(application_id, web_protocol) }}"
@ -38,3 +38,16 @@ OVERWRITEPROTOCOL= "https"
# Redis Configuration # Redis Configuration
REDIS_HOST= redis REDIS_HOST= redis
REDIS_PORT= 6379 REDIS_PORT= 6379
{% if nextcloud_talk_enabled %}
# Talk Configuration
# This code was just moved here during refactoring and isn't tested yet.
# @todo move it to an own env file for encapsulation reasons
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}
{% endif %}

View File

@ -1,16 +1,18 @@
--- ---
# General # General
application_id: "nextcloud" # Application identifier application_id: "web-app-nextcloud" # Application identifier
container_port: 80 container_port: 80
# Database # Database
database_password: "{{applications.nextcloud.credentials.database_password}}" # Database password database_password: "{{ applications | get_app_conf(application_id, 'credentials.database_password', True)}}"
database_type: "mariadb" # Database flavor database_type: "mariadb" # Database flavor
# Networking # Networking
domain: "{{ domains | get_domain(application_id) }}" # Public domain at which Nextcloud will be accessable domain: "{{ domains | get_domain(application_id) }}" # Public domain at which Nextcloud will be accessable
http_port: "{{ ports.localhost.http[application_id] }}" # Port at which nextcloud is reachable in the local network http_port: "{{ ports.localhost.http[application_id] }}" # Port at which nextcloud is reachable in the local network
nextcloud_administrator_username: "{{ applications | get_app_conf(application_id, 'users.administrator.username', True) }}"
# Control Node # Control Node
nextcloud_control_node_plugin_vars_directory: "{{role_path}}/vars/plugins/" # Folder in which the files for the plugin configuration are stored nextcloud_control_node_plugin_vars_directory: "{{role_path}}/vars/plugins/" # Folder in which the files for the plugin configuration are stored
nextcloud_control_node_plugin_tasks_directory: "{{role_path}}/tasks/plugins/" # Folder which contains the files for extra plugin configuration tasks nextcloud_control_node_plugin_tasks_directory: "{{role_path}}/tasks/plugins/" # Folder which contains the files for extra plugin configuration tasks
@ -21,8 +23,29 @@ nextcloud_control_node_plugin_tasks_directory: "{{role_path}}/tasks/plugins
nextcloud_host_config_additives_directory: "{{docker_compose.directories.volumes}}cymais/" # This folder is the path to which the additive configurations will be copied nextcloud_host_config_additives_directory: "{{docker_compose.directories.volumes}}cymais/" # This folder is the path to which the additive configurations will be copied
nextcloud_host_include_instructions_file: "{{docker_compose.directories.volumes}}includes.php" # Path to the instruction file on the host. Responsible for loading the additional configurations nextcloud_host_include_instructions_file: "{{docker_compose.directories.volumes}}includes.php" # Path to the instruction file on the host. Responsible for loading the additional configurations
nextcloud_domains: "{{ domains[application_id].nextcloud }}"
# Docker # Docker
nextcloud_version: "{{ applications | get_app_conf(application_id, 'docker.services.nextcloud.version', True) }}"
nextcloud_image: "{{ applications | get_app_conf(application_id, 'docker.services.nextcloud.image', True) }}"
nextcloud_name: "{{ applications | get_app_conf(application_id, 'docker.services.nextcloud.name', True) }}"
nextcloud_proxy_name: "{{ applications | get_app_conf(application_id, 'docker.services.proxy.name', True) }}"
nextcloud_proxy_image: "{{ applications | get_app_conf(application_id, 'docker.services.proxy.image', True) }}"
nextcloud_proxy_version: "{{ applications | get_app_conf(application_id, 'docker.services.proxy.version', True) }}"
nextcloud_cron_name: "{{ applications | get_app_conf(application_id, 'docker.services.cron.name', True) }}"
nextcloud_talk_name: "{{ applications | get_app_conf(application_id, 'docker.services.talk.name', True) }}"
nextcloud_talk_image: "{{ applications | get_app_conf(application_id, 'docker.services.talk.image', True) }}"
nextcloud_talk_version: "{{ applications | get_app_conf(application_id, 'docker.services.talk.version', True) }}"
nextcloud_talk_enabled: "{{ applications | get_app_conf(application_id, 'docker.services.talk.enabled', True) }}"
nextcloud_talk_stun_port: "{{ ports.public.stun[application_id] }}"
# nextcloud_talk_domain: "{{ domains[application_id].talk }}"
#nextcloud_collabora_name: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.name', True) }}"
## User Configuration ## User Configuration
nextcloud_docker_user_id: 82 # UID of the www-data user nextcloud_docker_user_id: 82 # UID of the www-data user
nextcloud_docker_user: "www-data" # Name of the www-data user (Set here to easy change it in the future) nextcloud_docker_user: "www-data" # Name of the www-data user (Set here to easy change it in the future)
@ -35,5 +58,5 @@ nextcloud_docker_config_additives_directory: "{{nextcloud_docker_config_d
nextcloud_docker_include_instructions_file: "/tmp/includes.php" # Path to the temporary file which will be included to the config.php to load the additional configurations nextcloud_docker_include_instructions_file: "/tmp/includes.php" # Path to the temporary file which will be included to the config.php to load the additional configurations
## Execution ## Execution
nextcloud_docker_exec: "docker exec -u {{ nextcloud_docker_user }} {{ applications.nextcloud.container.application }}" # General execute composition nextcloud_docker_exec: "docker exec -u {{ nextcloud_docker_user }} {{ nextcloud_name }}" # General execute composition
nextcloud_docker_exec_occ: "{{nextcloud_docker_exec}} {{ nextcloud_docker_work_directory }}occ" # Execute docker occ command nextcloud_docker_exec_occ: "{{nextcloud_docker_exec}} {{ nextcloud_docker_work_directory }}occ" # Execute docker occ command

View File

@ -1,6 +1,6 @@
- name: "Transfering oauth2-proxy-keycloak.cfg.j2 to {{(path_docker_compose_instances | get_docker_compose(application_id)).directories.volumes}}" - name: "Transfering oauth2-proxy-keycloak.cfg.j2 to {{(path_docker_compose_instances | get_docker_compose(application_id)).directories.volumes}}"
template: template:
src: "{{ playbook_dir }}/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2" src: "{{ playbook_dir }}/roles/web-app-oauth2-proxy/templates/oauth2-proxy-keycloak.cfg.j2"
dest: "{{(path_docker_compose_instances | get_docker_compose(application_id)).directories.volumes}}{{applications['oauth2-proxy'].configuration_file}}" dest: "{{(path_docker_compose_instances | get_docker_compose(application_id)).directories.volumes}}{{applications | get_app_conf('oauth2-proxy' 'configuration_file')}}"
notify: notify:
- docker compose up - docker compose up

View File

@ -7,5 +7,5 @@
ports: ports:
- {{ports.localhost.oauth2_proxy[application_id]}}:4180/tcp - {{ports.localhost.oauth2_proxy[application_id]}}:4180/tcp
volumes: volumes:
- "{{docker_compose.directories.volumes}}{{applications['oauth2-proxy'].configuration_file}}:/oauth2-proxy.cfg" - "{{docker_compose.directories.volumes}}{{applications | get_app_conf('oauth2-proxy' 'configuration_file')}}:/oauth2-proxy.cfg"
{% endif %} {% endif %}

View File

@ -1,4 +1,3 @@
version: "13" # Update when available. Sadly no rolling release implemented
oauth2_proxy: oauth2_proxy:
application: "proxy" application: "proxy"
port: "80" port: "80"
@ -32,3 +31,19 @@ docker:
services: services:
database: database:
enabled: true enabled: true
web:
name: openproject-web
image: openproject/community
version: "13" # Update when available. Sadly no rolling release implemented
no_stop_required: true
seeder:
name: openproject-seeder
cron:
name: openproject-cron
worker:
name: openproject-worker
proxy:
name: openproject-proxy
volumes:
data: "openproject_data"

View File

@ -1,4 +1,4 @@
FROM openproject/community:{{applications.openproject.version}} FROM {{ openproject_image }}:{{ openproject_version }}
# If installing a local plugin (using `path:` in the `Gemfile.plugins` above), # If installing a local plugin (using `path:` in the `Gemfile.plugins` above),
# you will have to copy the plugin code into the container here and use the # you will have to copy the plugin code into the container here and use the

View File

@ -17,7 +17,7 @@ x-op-app: &app
proxy: proxy:
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: {{custom_openproject_image}} image: {{custom_openproject_image}}
container_name: openproject-proxy container_name: {{ openproject_proxy_name }}
command: "./docker/prod/proxy" command: "./docker/prod/proxy"
ports: ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80" - "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
@ -33,7 +33,7 @@ x-op-app: &app
<<: *app <<: *app
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: "./docker/prod/web" command: "./docker/prod/web"
container_name: openproject-web container_name: {{ openproject_web_name }}
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %} {% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %}
cache: cache:
@ -51,7 +51,7 @@ x-op-app: &app
<<: *app <<: *app
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: "./docker/prod/worker" command: "./docker/prod/worker"
container_name: openproject-worker container_name: {{ openproject_worker_name }}
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %} {% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %}
cache: cache:
@ -67,7 +67,7 @@ x-op-app: &app
<<: *app <<: *app
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
command: "./docker/prod/cron" command: "./docker/prod/cron"
container_name: openproject-cron container_name: {{ openproject_cron_name }}
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %} {% include 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %}
cache: cache:
@ -81,7 +81,7 @@ x-op-app: &app
seeder: seeder:
<<: *app <<: *app
command: "./docker/prod/seeder" command: "./docker/prod/seeder"
container_name: openproject-seeder container_name: {{ openproject_seeder_name }}
env_file: env_file:
- "{{docker_compose.files.env}}" - "{{docker_compose.files.env}}"
logging: logging:
@ -94,5 +94,6 @@ x-op-app: &app
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: {{ openproject_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,7 +1,15 @@
application_id: "openproject" application_id: "web-app-openproject"
docker_repository_address: "https://github.com/opf/openproject-deploy" docker_repository_address: "https://github.com/opf/openproject-deploy"
database_type: "postgres" database_type: "postgres"
docker_repository: true docker_repository: true
openproject_version: "{{ applications | get_app_conf(application_id, 'docker.services.web.version', True) }}"
openproject_image: "{{ applications | get_app_conf(application_id, 'docker.services.web.image', True) }}"
openproject_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"
openproject_web_name: "{{ applications | get_app_conf(application_id, 'docker.services.web.name', True) }}"
openproject_seeder_name: "{{ applications | get_app_conf(application_id, 'docker.services.seeder.name', True) }}"
openproject_cron_name: "{{ applications | get_app_conf(application_id, 'docker.services.cron.name', True) }}"
openproject_proxy_name: "{{ applications | get_app_conf(application_id, 'docker.services.proxy.name', True) }}"
openproject_worker_name: "{{ applications | get_app_conf(application_id, 'docker.services.worker.name', True) }}"
openproject_plugins_folder: "{{docker_compose.directories.volumes}}plugins/" openproject_plugins_folder: "{{docker_compose.directories.volumes}}plugins/"

View File

@ -1,4 +1,3 @@
version: "bookworm"
features: features:
matomo: true matomo: true
css: false css: false
@ -31,3 +30,10 @@ docker:
enabled: true enabled: true
database: database:
enabled: true enabled: true
peertube:
name: "peertube"
version: "production-bookworm"
image: "chocobozzz/peertube"
no_stop_required: true
volumes:
data: peertube_data

View File

@ -1,5 +1,5 @@
- name: "Uninstall auth-openid-connect plugin for Peertube" - name: "Uninstall auth-openid-connect plugin for Peertube"
command: > command: >
docker exec {{ container_name }} \ docker exec {{ peertube_name }} \
npm run plugin:uninstall -- --npm-name {{oidc_plugin}} npm run plugin:uninstall -- --npm-name {{oidc_plugin}}
ignore_errors: true ignore_errors: true

View File

@ -4,14 +4,14 @@
- name: Check if OIDC plugin is already installed - name: Check if OIDC plugin is already installed
command: > command: >
docker exec {{ container_name }} test -d /data/plugins/data/peertube-plugin-auth-openid-connect docker exec {{ peertube_name }} test -d /data/plugins/data/peertube-plugin-auth-openid-connect
register: peertube_oidc_plugin_check register: peertube_oidc_plugin_check
failed_when: false failed_when: false
changed_when: false changed_when: false
- name: "Install auth-openid-connect plugin for Peertube" - name: "Install auth-openid-connect plugin for Peertube"
command: > command: >
docker exec {{ container_name }} \ docker exec {{ peertube_name }} \
npm run plugin:install -- --npm-name {{oidc_plugin}} npm run plugin:install -- --npm-name {{oidc_plugin}}
when: peertube_oidc_plugin_check.rc != 0 when: peertube_oidc_plugin_check.rc != 0
notify: docker compose up notify: docker compose up

View File

@ -2,8 +2,8 @@
application: application:
{% set container_port = 9000 %} {% set container_port = 9000 %}
image: chocobozzz/peertube:production-{{ applications | get_app_conf(application_id, 'version', True) }} image: {{ peertube_image }}:{{ peertube_version }}
container_name: {{ container_name }} container_name: {{ peertube_name }}
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
ports: ports:
- "1935:1935" # @todo Add to ports - "1935:1935" # @todo Add to ports
@ -18,6 +18,7 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
assets: assets:
data: data:
name: {{ peertube_volume }}
redis: redis:
config: config:

View File

@ -1,4 +1,7 @@
application_id: "peertube" application_id: "web-app-peertube"
database_type: "postgres" database_type: "postgres"
container_name: "{{ application_id }}"
oidc_plugin: "peertube-plugin-auth-openid-connect" oidc_plugin: "peertube-plugin-auth-openid-connect"
peertube_version: "{{ applications | get_app_conf(application_id, 'docker.services.peertube.version', True) }}"
peertube_image: "{{ applications | get_app_conf(application_id, 'docker.services.peertube.image', True) }}"
peertube_name: "{{ applications | get_app_conf(application_id, 'docker.services.peertube.name', True) }}"
peertube_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -1,7 +1,4 @@
titel: "Pictures on {{primary_domain}}" titel: "Pictures on {{primary_domain}}"
#version: "latest"
images:
pixelfed: "zknt/pixelfed:latest"
features: features:
matomo: true matomo: true
css: false # Needs to be reactivated css: false # Needs to be reactivated
@ -29,3 +26,12 @@ docker:
enabled: true enabled: true
database: database:
enabled: true enabled: true
pixelfed:
image: "zknt/pixelfed"
version: "latest"
name: "pixelfed"
no_stop_required: true
worker:
name: "pixelfed_worker"
volumes:
data: "pixelfed_data"

View File

@ -1,7 +1,8 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %} {% include 'roles/docker-compose/templates/base.yml.j2' %}
application: application:
image: "{{ applications | get_app_conf(application_id, 'images.pixelfed', True) }}" image: "{{ pixelfed_image }}:{{ pixelfed_version }}"
container_name: {{ pixelfed_name }}
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
volumes: volumes:
- "data:/var/www/storage" - "data:/var/www/storage"
@ -11,7 +12,8 @@
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %} {% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %} {% include 'roles/docker-container/templates/networks.yml.j2' %}
worker: worker:
image: "{{ applications | get_app_conf(application_id, 'images.pixelfed', True) }}" container_name: {{ pixelfed_worker_name }}
image: "{{ pixelfed_image }}:{{ pixelfed_version }}"
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
volumes: volumes:
- "data:/var/www/storage" - "data:/var/www/storage"
@ -30,5 +32,6 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
redis: redis:
data: data:
name: {{ pixelfed_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %} {% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@ -1,3 +1,8 @@
application_id: "pixelfed" application_id: "web-app-pixelfed"
proxy_extra_configuration: "client_max_body_size 512M;" proxy_extra_configuration: "client_max_body_size 512M;"
database_type: "mariadb" database_type: "mariadb"
pixelfed_version: "{{ applications | get_app_conf(application_id, 'docker.services.pixelfed.version', True) }}"
pixelfed_image: "{{ applications | get_app_conf(application_id, 'docker.services.pixelfed.image', True) }}"
pixelfed_name: "{{ applications | get_app_conf(application_id, 'docker.services.pixelfed.name', True) }}"
pixelfed_worker_name: "{{ applications | get_app_conf(application_id, 'docker.services.worker.name', True) }}"
pixelfed_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -12,7 +12,7 @@ followus:
class: fa-brands fa-mastodon class: fa-brands fa-mastodon
url: "{{ web_protocol }}://{{ service_provider.contact.mastodon.split('@')[2] }}/@{{ service_provider.contact.mastodon.split('@')[1] }}" url: "{{ web_protocol }}://{{ service_provider.contact.mastodon.split('@')[2] }}/@{{ service_provider.contact.mastodon.split('@')[1] }}"
identifier: "{{service_provider.contact.mastodon}}" identifier: "{{service_provider.contact.mastodon}}"
iframe: {{ applications | get_app_conf('mastodon','features.port-ui-desktop',True) }} iframe: {{ applications | get_app_conf('web-app-mastodon','features.port-ui-desktop',True) }}
{% endif %} {% endif %}
{% if service_provider.contact.bluesky is defined and service_provider.contact.bluesky != "" %} {% if service_provider.contact.bluesky is defined and service_provider.contact.bluesky != "" %}
- name: Bluesky - name: Bluesky
@ -31,7 +31,7 @@ followus:
class: fa-solid fa-camera class: fa-solid fa-camera
identifier: "{{service_provider.contact.pixelfed}}" identifier: "{{service_provider.contact.pixelfed}}"
url: "{{ web_protocol }}://{{ service_provider.contact.pixelfed.split('@')[2] }}/@{{ service_provider.contact.pixelfed.split('@')[1] }}" url: "{{ web_protocol }}://{{ service_provider.contact.pixelfed.split('@')[2] }}/@{{ service_provider.contact.pixelfed.split('@')[1] }}"
iframe: {{ applications | get_app_conf('pixelfed','features.port-ui-desktop',True) }} iframe: {{ applications | get_app_conf(web-app-pixelfed,'features.port-ui-desktop',True) }}
{% endif %} {% endif %}
{% if service_provider.contact.peertube is defined and service_provider.contact.peertube != "" %} {% if service_provider.contact.peertube is defined and service_provider.contact.peertube != "" %}
- name: Peertube - name: Peertube
@ -40,7 +40,7 @@ followus:
class: fa-solid fa-video class: fa-solid fa-video
identifier: "{{service_provider.contact.peertube}}" identifier: "{{service_provider.contact.peertube}}"
url: "{{ web_protocol }}://{{ service_provider.contact.peertube.split('@')[2] }}/@{{ service_provider.contact.peertube.split('@')[1] }}" url: "{{ web_protocol }}://{{ service_provider.contact.peertube.split('@')[2] }}/@{{ service_provider.contact.peertube.split('@')[1] }}"
iframe: {{ applications | get_app_conf('peertube','features.port-ui-desktop',True) }} iframe: {{ applications | get_app_conf('web-app-peertube','features.port-ui-desktop',True) }}
{% endif %} {% endif %}
{% if service_provider.contact.wordpress is defined and service_provider.contact.wordpress != "" %} {% if service_provider.contact.wordpress is defined and service_provider.contact.wordpress != "" %}
- name: Wordpress - name: Wordpress
@ -49,7 +49,7 @@ followus:
class: fa-solid fa-blog class: fa-solid fa-blog
identifier: "{{service_provider.contact.wordpress}}" identifier: "{{service_provider.contact.wordpress}}"
url: "{{ web_protocol }}://{{ service_provider.contact.wordpress.split('@')[2] }}/@{{ service_provider.contact.wordpress.split('@')[1] }}" url: "{{ web_protocol }}://{{ service_provider.contact.wordpress.split('@')[2] }}/@{{ service_provider.contact.wordpress.split('@')[1] }}"
iframe: {{ applications | get_app_conf('wordpress','features.port-ui-desktop',True) }} iframe: {{ applications | get_app_conf('web-app-wordpress','features.port-ui-desktop',True) }}
{% endif %} {% endif %}
{% if service_provider.contact.friendica is defined and service_provider.contact.friendica != "" %} {% if service_provider.contact.friendica is defined and service_provider.contact.friendica != "" %}
- name: Friendica - name: Friendica

View File

@ -1,7 +1,7 @@
title: "Blog" # Wordpress titel title: "Blog" # Wordpress titel
plugins: plugins:
wp-discourse: wp-discourse:
enabled: "{{ 'discourse' in group_names | lower }}" enabled: "{{ 'web-app-discourse' in group_names | lower }}"
daggerhart-openid-connect-generic: daggerhart-openid-connect-generic:
enabled: true enabled: true
activitypub: activitypub:
@ -12,7 +12,6 @@ features:
port-ui-desktop: true port-ui-desktop: true
oidc: true oidc: true
central_database: true central_database: true
version: latest
csp: csp:
flags: flags:
style-src: style-src:
@ -43,6 +42,13 @@ docker:
services: services:
database: database:
enabled: true enabled: true
wordpress:
version: latest
image: wordpress
name: wordpress
no_stop_required: true
volumes:
data: wordpress_data
rbac: rbac:
roles: roles:
subscriber: subscriber:

View File

@ -5,14 +5,14 @@
- name: Wait for Discourse API - name: Wait for Discourse API
wait_for: wait_for:
host: "{{ domains | get_domain('discourse') }}" host: "{{ domains | get_domain('web-app-discourse') }}"
port: 80 port: 80
delay: 5 delay: 5
timeout: 600 timeout: 600
- name: Add /var/www/discourse to Git safe.directory - name: Add /var/www/discourse to Git safe.directory
command: > command: >
docker exec {{ applications.discourse.container }} \ docker exec {{ applications['web-app-discourse'].docker.service.discourse.name }} \
git config --global --add safe.directory /var/www/discourse git config --global --add safe.directory /var/www/discourse
args: args:
chdir: "{{ docker_compose.directories.instance }}" chdir: "{{ docker_compose.directories.instance }}"
@ -20,7 +20,7 @@
- name: Revoke old WP Discourse API keys via Rails - name: Revoke old WP Discourse API keys via Rails
command: > command: >
docker exec {{ applications.discourse.container }} bash -lc "\ docker exec {{ applications['web-app-discourse'].docker.service.discourse.name }} bash -lc "\
cd /var/www/discourse && \ cd /var/www/discourse && \
script/rails runner \"\ script/rails runner \"\
ApiKey.where(\ ApiKey.where(\
@ -36,7 +36,7 @@
- name: Generate new WP Discourse API key via Rake task - name: Generate new WP Discourse API key via Rake task
command: > command: >
docker exec {{ applications.discourse.container }} bash -lc "\ docker exec {{ applications['web-app-discourse'].docker.service.discourse.name }} bash -lc "\
cd /var/www/discourse && \ cd /var/www/discourse && \
bin/rake api_key:create_master['WP Discourse Integration']\ bin/rake api_key:create_master['WP Discourse Integration']\
" "

View File

@ -1,4 +1,4 @@
FROM wordpress:{{applications | get_app_conf(application_id, 'version', True)}} FROM {{ wordpress_image }}:{{ wordpress_version }}
# Install msmtp and update system # Install msmtp and update system
RUN apt-get update && \ RUN apt-get update && \

View File

@ -2,7 +2,7 @@
application: application:
{% include 'roles/docker-container/templates/base.yml.j2' %} {% include 'roles/docker-container/templates/base.yml.j2' %}
image: {{ wordpress_custom_image }} image: {{ wordpress_custom_image }}
container_name: wordpress-application container_name: {{ wordpress_name }}
build: build:
context: . context: .
ports: ports:
@ -18,3 +18,4 @@
{% include 'roles/docker-compose/templates/volumes.yml.j2' %} {% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data: data:
name: "{{ wordpress_volume }}"

View File

@ -11,7 +11,7 @@ discourse_settings:
- name: discourse_connect - name: discourse_connect
key: url key: url
value: "{{ domains | get_url('discourse', web_protocol) }}" value: "{{ domains | get_url('web-app-discourse', web_protocol) }}"
- name: discourse_connect - name: discourse_connect
key: api-key key: api-key
value: "{{ vault_discourse_api_key }}" value: "{{ vault_discourse_api_key }}"

View File

@ -1,6 +1,10 @@
application_id: "wordpress" application_id: "web-app-wordpress"
wordpress_max_upload_size: "64M"
database_type: "mariadb" database_type: "mariadb"
host_msmtp_conf: "{{docker_compose.directories.config}}msmtprc.conf"
wordpress_max_upload_size: "64M"
wordpress_custom_image: "wordpress_custom" wordpress_custom_image: "wordpress_custom"
wordpress_docker_html_path: "/var/www/html" wordpress_docker_html_path: "/var/www/html"
host_msmtp_conf: "{{docker_compose.directories.config}}msmtprc.conf" wordpress_version: "{{ applications | get_app_conf(application_id, 'docker.services.wordpress.version', True) }}"
wordpress_image: "{{ applications | get_app_conf(application_id, 'docker.services.wordpress.image', True) }}"
wordpress_name: "{{ applications | get_app_conf(application_id, 'docker.services.wordpress.name', True) }}"
wordpress_volume: "{{ applications | get_app_conf(application_id, 'docker.services.volumes.data', True) }}"

View File

@ -1,50 +0,0 @@
- name: Assert all required application_id-based variables are defined
vars:
missing_keys: []
block:
- name: Check if applications[application_id] exists
set_fact:
missing_keys: "{{ missing_keys + ['applications'] }}"
when: applications.get(application_id, None) is not defined
- name: Check if applications[application_id].docker.services.database.enabled exists
set_fact:
missing_keys: "{{ missing_keys + ['applications.{}.docker.services.database.enabled'.format(application_id)] }}"
when: applications[application_id].docker.services.database is not defined
- name: Check if applications[application_id].docker.services.redis.enabled exists
set_fact:
missing_keys: "{{ missing_keys + ['applications.{}.docker.services.redis.enabled'.format(application_id)] }}"
when: applications[application_id].docker.services.redis is not defined
- name: Check if applications | get_app_conf(application_id, 'images.' ~ application_id, True) exists
set_fact:
missing_keys: "{{ missing_keys + ['applications.{}.images.{}'.format(application_id, application_id)] }}"
when: applications[application_id].images is not defined or applications[application_id].images.get(application_id) is not defined
- name: Check if applications[application_id].features exists
set_fact:
missing_keys: "{{ missing_keys + ['applications.{}.features'.format(application_id)] }}"
when: applications[application_id].features is not defined
- name: Check if ports.localhost.oauth2_proxy[application_id] exists
set_fact:
missing_keys: "{{ missing_keys + ['ports.localhost.oauth2_proxy.{}'.format(application_id)] }}"
when: ports.localhost.oauth2_proxy get(application_id, None) is not defined
- name: Check if ports.localhost.http[application_id] exists
set_fact:
missing_keys: "{{ missing_keys + ['ports.localhost.http.{}'.format(application_id)] }}"
when: ports.localhost.http get(application_id, None) is not defined
- name: Check if networks.local[application_id].subnet exists (optional)
set_fact:
missing_keys: "{{ missing_keys + ['networks.local.{}.subnet'.format(application_id)] }}"
when: networks.local.get(application_id, None) is not defined or networks.local[application_id].get('subnet', None) is not defined
- name: Fail if any required keys are missing
debug:
msg: |
The following variables/keys for application_id {{ application_id }} are not defined or not accessible:
{{ missing_keys | join('\n- ') }}
Please define them in your group_vars, host_vars, or inventory.

View File

@ -2,10 +2,10 @@
# Better load the repositories into /opt/docker/[servicename]/services, build them there and then use a docker-compose file for customizing # Better load the repositories into /opt/docker/[servicename]/services, build them there and then use a docker-compose file for customizing
# @todo Refactor\Remove # @todo Refactor\Remove
# @deprecated # @deprecated
- name: "Merge detached_files with applications['oauth2-proxy'].configuration_file" - name: "Merge detached_files with applications | get_app_conf('oauth2-proxy' 'configuration_file')"
set_fact: set_fact:
merged_detached_files: "{{ detached_files + [applications['oauth2-proxy'].configuration_file] }}" merged_detached_files: "{{ detached_files + [applications | get_app_conf('oauth2-proxy' 'configuration_file')] }}"
when: applications[application_id].get('features', {}).get('oauth2', False) | bool when: "{{ applications | get_app_conf(application_id,'features.oauth2')"
- name: "backup detached files" - name: "backup detached files"
command: > command: >

Some files were not shown because too many files have changed in this diff Show More