Compare commits

...

9 Commits

Author SHA1 Message Date
6ea8301364 Refactor: migrate cmp/* and srv/* roles into sys-stk/* and sys-svc/* namespaces
- Removed obsolete 'cmp' category, introduced 'stk' category (fa-bars-staggered icon).
- Renamed roles:
  * cmp-db-docker → sys-stk-back-stateful
  * cmp-docker-oauth2 → sys-stk-back-stateless
  * srv-domain-provision → sys-stk-front
  * cmp-db-docker-proxy → sys-stk-full-stateful
  * cmp-docker-proxy → sys-stk-full-stateless
  * cmp-rdbms → sys-svc-rdbms
- Updated all include_role references, vars, templates and README.md files.
- Adjusted run_once comments and variable paths accordingly.
- Updated all web-app roles to use new sys-stk/* and sys-svc/* roles.

Conversation: https://chatgpt.com/share/68b0ba66-09f8-800f-86fc-76c47009d431
2025-08-28 22:23:09 +02:00
92f5bf6481 refactor(web-app-mybb): remove obsolete Installation.md, introduce schema for secret_pin, and rework task/vars handling
- Removed outdated Installation.md (manual plugin instructions no longer needed)
- Added schema/main.yml with validation for secret_pin
- Added config.php.j2 template to manage DB + admin config
- Refactored tasks/main.yml to deploy config.php instead of legacy docker-compose
- Removed setup-domain.yml (TLS/domain handling moved to core roles)
- Updated docker-compose.yml.j2 to mount config.php and use new vars
- Cleaned up vars/main.yml: standardized MYBB_* variable names, added MYBB_SECRET_PIN, config paths, and container port

See ChatGPT conversation: https://chatgpt.com/share/68b0ae26-93ec-800f-8785-0da7c9303090
2025-08-28 21:29:58 +02:00
58c17bf043 web-app-mediawiki: template-driven LocalSettings.php + admin automation; compose & config tweaks
Config & features:
- roles/web-app-mediawiki/config/main.yml:
  - Add sitename ('Wiki on {{ PRIMARY_DOMAIN | upper }}') and meta_namespace ('Meta')
  - Enable central_database feature and database service
  - Move volumes under docker.volumes (correct indentation)

Tasks & automation:
- roles/web-app-mediawiki/tasks/main.yml:
  - Avoid immediate compose handler flush (docker_compose_flush_handlers: false), then explicit meta: flush_handlers
  - Deploy templated LocalSettings.php to host path
  - Create admin via maintenance/createAndPromote.php (docker exec, idempotent changed_when/failed_when)

Templates:
- roles/web-app-mediawiki/templates/LocalSettings.php.j2:
  - Set $wgSitename, $wgMetaNamespace, $wgServer from MEDIAWIKI_*
  - DB settings (mysql, host:port, name, user, password)
  - Mail settings (EmergencyContact/PasswordSender)
  - Default skin: vector
  - Load basic extensions (ParserFunctions, Cite)
- roles/web-app-mediawiki/templates/docker-compose.yml.j2:
  - Switch to MEDIAWIKI_* vars, mount LocalSettings.php (ro)
  - Use container_port, include curl healthcheck
  - Fix volumes name to MEDIAWIKI_VOLUME

Vars:
- roles/web-app-mediawiki/vars/main.yml:
  - Restructure with MEDIAWIKI_* (sitename, meta_namespace, URL, image/version/container/volume)
  - Define SETTINGS host/dock paths, container_port, default user (www-data)
  - Admin bootstrap vars (name/password/email)

Misc:
- Add empty schema/main.yml placeholder for future validation

Refs: ChatGPT conversation (2025-08-28, Europe/Berlin). Link: https://chatgpt.com/share/68b0ace6-f8f4-800f-b7a7-a51a6c5260f1
2025-08-28 21:28:47 +02:00
6c2d5c52c8 Attached 'not (system_service_suppress_flush | bool)' directly to handler 2025-08-28 21:16:04 +02:00
b919f39e35 Made stop unrequired for joomla container 2025-08-28 21:15:07 +02:00
9f2cfe65af Remove non-functional Joomla LDAP integration
- Disabled LDAP feature flag (set to false by default, with comment)
- Removed ldapautocreate plugin (PHP + XML)
- Deleted LDAP helper tasks (01_ldap_files.yml, 05_ldap.yml, 07_diagnose.yml)
- Deleted LDAP CLI helper scripts (cli.php, diagnose.php, plugins.php, auth-trace.php)
- Removed LDAP configuration variables from vars/main.yml
- Removed LDAP environment variables from env.j2
- Removed LDAP-specific mounts from docker-compose.yml.j2
- Dropped php-ldap installation from Dockerfile
- Renamed task files for consistent numbering (02->01_install, 03->02_debug, 04->03_patch, 06->04_assert)

Reason: LDAP integration was removed because it was not functional.

Conversation: https://chatgpt.com/share/68b09373-7aa8-800f-8f2c-11e27123bad1
2025-08-28 19:36:12 +02:00
fe399c3967 Added all LDAP changes before removing, because it doesn't work. Will trty to replace it by OIDC 2025-08-28 19:22:37 +02:00
ef801aa498 Joomla: Add LDAP autocreate plugin support
- Introduced autocreate_users feature flag in config/main.yml
- Added ldapautocreate.php and ldapautocreate.xml plugin files
- Implemented tasks/01_ldap_files.yml for plugin deployment
- Added tasks/05_ldap.yml to configure LDAP plugin and register ldapautocreate
- Renamed tasks for better structure (01→02, 02→03, etc.)
- Updated cli-ldap.php.j2 for clean parameter handling
- Mounted ldapautocreate plugin via docker-compose.yml.j2
- Extended vars/main.yml with LDAP autocreate configuration

Ref: https://chatgpt.com/share/68b0802f-bfd4-800f-b10a-57cf0c091f7e
2025-08-28 18:13:53 +02:00
18f3b1042f feat(web-app-joomla): reliable first-run install, safe debug toggler, DB patching, LDAP scaffolding
Why
- Fix flaky first-run installs and make config edits idempotent.
- Prepare LDAP support and allow optional inline CSP for UI.
- Improve observability and guard against broken configuration.php.

What
- config/main.yml: enable features.ldap; add CSP flags (allow inline style/script elem); minor spacing.
- tasks/: split into 01_install (wait for core, absolute CLI path), 02_debug (toggle $debug/$error_reporting safely), 03_patch (patch DB creds in configuration.php), 04_ldap (configure plugin via helper), 05_assert (optional php -l).
- templates/Dockerfile.j2: conditionally install/compile php-ldap (fallback to docker-php-ext-install with libsasl2-dev).
- templates/cli-ldap.php.j2: idempotently enable & configure Authentication - LDAP from env.
- templates/docker-compose.yml.j2: build custom image when LDAP is enabled; mount cli-ldap.php; pull_policy: never.
- templates/env.j2: add site/admin vars, MariaDB connector/env, full LDAP env.
- vars/main.yml: default to MariaDB (mysqli), add JOOMLA_* vars incl. JOOMLA_CONFIG_FILE.

Notes
- LDAP path implemented but NOT yet tested end-to-end.
- Ref: https://chatgpt.com/share/68b068a8-2aa4-800f-8cd1-56383561a9a8.
2025-08-28 16:33:45 +02:00
116 changed files with 508 additions and 268 deletions

View File

@@ -1,9 +1,4 @@
roles:
cmp:
title: "Compositions"
description: "Composition of other roles."
icon: "fas fa-sitemap"
invokable: false
docker:
title: "Docker Toolkit"
description: "Generic Docker helpers and utilities (compose wrappers, container tooling)."
@@ -56,6 +51,11 @@ roles:
description: "DNS providers, records, and rDNS management (Cloudflare, Hetzner, etc.)."
icon: "fas fa-network-wired"
invokable: false
stk:
title: "Stack"
description: "Stack levels to setup the server"
icon: "fas fa-bars-staggered"
invokable: false
update:
title: "Updates & Package Management"
description: "OS & package updates"

View File

@@ -1,11 +0,0 @@
# Database Docker with Web Proxy
This role builds on `cmp-db-docker` by adding a reverse-proxy frontend for HTTP access to your database service.
## Features
- **Database Composition**
Leverages the `cmp-db-docker` role to stand up your containerized database (PostgreSQL, MariaDB, etc.) with backups and user management.
- **Reverse Proxy**
Includes the `srv-domain-provision` role to configure a proxy (e.g. nginx) for routing HTTP(S) traffic to your database UI or management endpoint.

View File

@@ -1 +0,0 @@
DATABASE_VARS_FILE: "{{ playbook_dir }}/roles/cmp-rdbms/vars/database.yml"

View File

@@ -1 +0,0 @@
{% include 'roles/cmp-rdbms/templates/services/' + database_type + '.yml.j2' %}

View File

@@ -2,7 +2,7 @@
services:
{# Load Database #}
{% if applications | is_docker_service_enabled(application_id, 'database') %}
{% include 'roles/cmp-rdbms/templates/services/main.yml.j2' %}
{% include 'roles/sys-svc-rdbms/templates/services/main.yml.j2' %}
{% endif %}
{# Load Redis #}
{% if applications | is_docker_service_enabled(application_id, 'redis') or applications | get_app_conf(application_id, 'features.oauth2', False) %}

View File

@@ -4,5 +4,6 @@
daemon_reload: yes
enabled: yes
state: "{{ system_service_state }}"
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
when: not (system_service_suppress_flush | bool)

View File

@@ -46,5 +46,5 @@
command: /bin/true
notify: refresh systemctl service
when: not system_service_uses_at
when: (SYS_SERVICE_ALL_ENABLED | bool or system_force_flush | bool) and not system_service_suppress_flush | bool
when: (SYS_SERVICE_ALL_ENABLED | bool or system_force_flush | bool)

View File

@@ -1,18 +1,18 @@
# Database Docker Composition
This role combines the central RDBMS role (`cmp-rdbms`) with Docker Compose to deliver a ready-to-use containerized database environment.
This role combines the central RDBMS role (`sys-svc-rdbms`) with Docker Compose to deliver a ready-to-use containerized database environment.
## Features
- **Central RDBMS Integration**
Includes the `cmp-rdbms` role, which handles backups, restores, user and permission management for your relational database system (PostgreSQL, MariaDB, etc.).
Includes the `sys-svc-rdbms` role, which handles backups, restores, user and permission management for your relational database system (PostgreSQL, MariaDB, etc.).
- **Docker Compose**
Utilizes the standalone `docker-compose` role to define and bring up containers, networks, and volumes automatically.
- **Variable Load Order**
1. Docker Compose variables (`roles/docker-compose/vars/docker-compose.yml`)
2. Database variables (`roles/cmp-rdbms/vars/database.yml`)
2. Database variables (`roles/sys-svc-rdbms/vars/database.yml`)
Ensures compose ports and volumes are defined before the database role consumes them.
The role will load both sub-roles and satisfy all dependencies transparently.
@@ -22,4 +22,4 @@ The role will load both sub-roles and satisfy all dependencies transparently.
1. **Set Fact** `database_application_id` to work around lazyloading ordering.
2. **Include Vars** in the specified order.
3. **Invoke** `docker-compose` role to create containers, networks, and volumes.
4. **Invoke** `cmp-rdbms` role to provision the database, backups, and users.
4. **Invoke** `sys-svc-rdbms` role to provision the database, backups, and users.

View File

@@ -1,4 +1,4 @@
# run_once_cmp_db_docker: disabled
# run_once_sys_stk_back_stateful: disabled
- name: "For '{{ application_id }}': Set database_application_id (Needed due to lazzy loading issue)"
set_fact:
@@ -12,8 +12,8 @@
- name: "For '{{ application_id }}': Load central RDBMS"
include_role:
name: cmp-rdbms
name: sys-svc-rdbms
- name: "For '{{ application_id }}': Load cmp-docker-oauth2"
- name: "For '{{ application_id }}': Load sys-stk-back-stateless"
include_role:
name: cmp-docker-oauth2
name: sys-stk-back-stateless

View File

@@ -0,0 +1 @@
DATABASE_VARS_FILE: "{{ playbook_dir }}/roles/sys-svc-rdbms/vars/database.yml"

View File

@@ -1,4 +1,4 @@
# cmp-docker-oauth2
# sys-stk-back-stateless
This Ansible role enhances a Docker Compose application by conditionally enabling OAuth2-based authentication. It ensures that the `docker-compose` role is always loaded, and if the application has OAuth2 support enabled via `features.oauth2`, it also configures the OAuth2 proxy.

View File

@@ -1,4 +1,4 @@
# run_once_cmp_docker_oauth2: disabled
# run_once_sys_stk_back_stateless: disabled
- name: "For '{{ application_id }}': Load docker-compose"
include_role:

View File

@@ -6,7 +6,7 @@ This role bootstraps **per-domain Nginx configuration**: it requests TLS certifi
## Overview
A higher-level orchestration wrapper, *srv-domain-provision* ties together several lower-level roles:
A higher-level orchestration wrapper, *sys-stk-front* ties together several lower-level roles:
1. **`sys-srv-web-inj-compose`** applies global tweaks and includes.
2. **`srv-tls-core`** obtains Lets Encrypt certificates.

View File

@@ -1,4 +1,3 @@
# roles/srv-domain-provision/tasks/02_enable_cf_dev_mode.yml
---
# Enables Cloudflare Development Mode (bypasses cache for ~3 hours).
# Uses the same auth token as in 01_cleanup.yml: CLOUDFLARE_API_TOKEN

View File

@@ -4,7 +4,7 @@
name: srv-proxy-core
when: run_once_srv_proxy_core is not defined
- include_tasks: utils/run_once.yml
when: run_once_srv_domain_provision is not defined
when: run_once_sys_stk_front is not defined
- include_tasks: "01_cloudflare.yml"
when: DNS_PROVIDER == "cloudflare"

View File

@@ -0,0 +1,11 @@
# Database Docker with Web Proxy
This role builds on `sys-stk-back-stateful` by adding a reverse-proxy frontend for HTTP access to your database service.
## Features
- **Database Composition**
Leverages the `sys-stk-back-stateful` role to stand up your containerized database (PostgreSQL, MariaDB, etc.) with backups and user management.
- **Reverse Proxy**
Includes the `sys-stk-front` role to configure a proxy (e.g. nginx) for routing HTTP(S) traffic to your database UI or management endpoint.

View File

@@ -1,7 +1,7 @@
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: >
Extends cmp-db-docker by adding an HTTP reverse proxy via srv-domain-provision.
Extends sys-stk-back-stateful by adding an HTTP reverse proxy via sys-stk-front.
company: |
Kevin Veen-Birkenbach
Consulting & Coaching Solutions

View File

@@ -1,16 +1,16 @@
# run_once_cmp_db_docker_proxy: deactivated
# run_once_sys_stk_full_stateful: deactivated
- include_tasks: "{{ playbook_dir }}/tasks/utils/load_handlers.yml"
vars:
handler_role_name: "svc-prx-openresty"
- name: "For '{{ application_id }}': load docker and db"
- name: "For '{{ application_id }}': include role sys-stk-front"
include_role:
name: cmp-db-docker
- name: "For '{{ application_id }}': include role srv-domain-provision"
include_role:
name: srv-domain-provision
name: sys-stk-front
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"
- name: "For '{{ application_id }}': load docker and db"
include_role:
name: sys-stk-back-stateful

View File

@@ -8,4 +8,4 @@ This role combines the standard Docker Compose setup with a reverse-proxy for an
Brings up containers, networks, and volumes via the `docker-compose` role.
- **Reverse Proxy**
Uses the `srv-domain-provision` role to expose your application under a custom domain and port.
Uses the `sys-stk-front` role to expose your application under a custom domain and port.

View File

@@ -1,7 +1,7 @@
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: >
Combines the docker-compose role with srv-domain-provision to
Combines the docker-compose role with sys-stk-front to
deploy applications behind a reverse proxy.
company: |
Kevin Veen-Birkenbach

View File

@@ -1,14 +1,13 @@
# run_once_cmp_docker_proxy: deactivated
# run_once_sys_stk_full_stateless: deactivated
# Load the proxy first, so that openresty handlers are flushed before the main docker compose
- name: "For '{{ application_id }}': include role srv-domain-provision"
- name: "For '{{ application_id }}': include role sys-stk-front"
include_role:
name: srv-domain-provision
name: sys-stk-front
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"
- name: "For '{{ application_id }}': Load cmp-docker-oauth2"
- name: "For '{{ application_id }}': Load sys-stk-back-stateless"
include_role:
name: cmp-docker-oauth2
name: sys-stk-back-stateless

View File

@@ -1,4 +1,4 @@
# run_once_cmp_rdbms: deactivated
# run_once_sys_svc_rdbms: deactivated
# The following env file will just be used from the dedicated mariadb container
# and not the central one

View File

@@ -0,0 +1 @@
{% include 'roles/sys-svc-rdbms/templates/services/' + database_type + '.yml.j2' %}

View File

@@ -10,7 +10,7 @@
- name: "For '{{ application_id }}': load docker, db and proxy"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
# Forward flag into compose templating
cmp_extra_facts:

View File

@@ -11,7 +11,7 @@
- name: "For '{{ application_id }}': load docker and db"
include_role:
name: cmp-db-docker
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,4 +1,4 @@
---
- name: "For '{{ application_id }}': load docker, db and proxy"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful

View File

@@ -11,7 +11,7 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless
vars:
docker_compose_flush_handlers: false
- name: "include 04_seed-database-to-backup.yml"

View File

@@ -2,9 +2,9 @@
include_role:
name: docker-compose
- name: "include role srv-domain-provision for {{ application_id }}"
- name: "include role sys-stk-front for {{ application_id }}"
include_role:
name: srv-domain-provision
name: sys-stk-front
vars:
domain: "{{ item.domain }}"
http_port: "{{ item.http_port }}"

View File

@@ -7,7 +7,7 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless
- name: "Check if host-specific config.yaml exists in {{ DESKTOP_INVENTORY_CONFIG_PATH }}"
stat:

View File

@@ -6,7 +6,7 @@
file: "{{ item }}"
loop:
- "{{ playbook_dir }}/roles/docker-compose/vars/docker-compose.yml"
- "{{ playbook_dir }}/roles/cmp-rdbms/vars/database.yml"
- "{{ playbook_dir }}/roles/sys-svc-rdbms/vars/database.yml"
- name: Sanity check for required vars
assert:

View File

@@ -6,7 +6,7 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,8 +1,8 @@
---
- name: "include role srv-domain-provision for {{ application_id }}"
- name: "include role sys-stk-front for {{ application_id }}"
include_role:
name: srv-domain-provision
name: sys-stk-front
vars:
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"

View File

@@ -8,7 +8,7 @@ Enhance your sales and service processes with EspoCRM, an open-source CRM featur
This Ansible role deploys EspoCRM using Docker. It handles:
- MariaDB database provisioning via the `cmp-rdbms` role
- MariaDB database provisioning via the `sys-svc-rdbms` role
- Nginx domain setup with WebSocket and reverse-proxy configuration
- Environment variable management through Jinja2 templates
- Docker Compose orchestration for **web**, **daemon**, and **websocket** services

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: Integrate LDAP
include_tasks: 01_ldap.yml

View File

@@ -1,6 +1,6 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful

View File

@@ -9,7 +9,7 @@ This Ansible role deploys and configures [FusionDirectory](https://www.fusiondir
- Loads and templating of FusionDirectory-specific variables
- Generates a `.env` file for the container environment
- Deploys the FusionDirectory container via Docker Compose
- Configures NGINX (via the `srv-domain-provision` role) to expose the service
- Configures NGINX (via the `sys-stk-front` role) to expose the service
- Integrates with your central LDAP server for authentication
## Features

View File

@@ -1,3 +1,3 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: Wait for Gitea HTTP endpoint
wait_for:

View File

@@ -1,4 +1,4 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful

View File

@@ -1,4 +1,4 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful

View File

@@ -1,4 +1,4 @@
# Joomla CMS
# Joomla
## Description

View File

@@ -1,20 +1,31 @@
autocreate_users: true # Autocreate LDAP users on Login
features:
matomo: true
css: true
desktop: true
central_database: true
logout: true
ldap: false # There is no working free open source LDAP solution 2025-08-28
oidc: false # There is no working free open source OIDC solution 2025-08-28
server:
domains:
canonical:
- "cms.{{ PRIMARY_DOMAIN }}"
csp:
flags:
style-src:
unsafe-inline: true
script-src-elem:
unsafe-inline: true
docker:
services:
database:
enabled: true
enabled: true
joomla:
image: joomla
version: latest
name: joomla
backup:
no_stop_required: true
volumes:
data: "joomla_data"
data: "joomla_data"

View File

@@ -0,0 +1,53 @@
# Wait until the Joomla core is copied into the volume
- name: "Wait for Joomla files to exist"
command:
argv: [ docker, exec, "{{ JOOMLA_CONTAINER }}", test, -f, /var/www/html/index.php ]
register: joomla_files
changed_when: false
retries: 60
delay: 2
until: joomla_files.rc == 0
# (Optional) specifically wait for the CLI installer script
- name: "Check for CLI installer"
command:
argv: [ docker, exec, "{{ JOOMLA_CONTAINER }}", test, -f, /var/www/html/installation/joomla.php ]
register: has_installer
changed_when: false
failed_when: false
# Only if not already installed (no configuration.php)
- name: "Check if Joomla is already installed"
command:
argv: [ docker, exec, "{{ JOOMLA_CONTAINER }}", test, -f, "{{ JOOMLA_CONFIG_FILE }}" ]
register: joomla_installed
changed_when: false
failed_when: false
# Install (uses absolute path + argv)
- name: "Joomla CLI install (first run only)"
command:
argv:
- docker
- exec
- "{{ JOOMLA_CONTAINER }}"
- php
- /var/www/html/installation/joomla.php
- install
- "--db-type={{ JOOMLA_DB_CONNECTOR }}"
- "--db-host={{ database_host }}"
- "--db-user={{ database_username }}"
- "--db-pass={{ database_password }}"
- "--db-name={{ database_name }}"
- "--admin-user={{ JOOMLA_USER }}"
- "--admin-username={{ JOOMLA_USER_NAME }}"
- "--admin-password={{ JOOMLA_USER_PASSWORD }}"
- "--admin-email={{ JOOMLA_USER_EMAIL }}"
- "--no-interaction"
- "--site-name={{ JOOMLA_SITE_NAME }}"
register: j_install
changed_when: j_install.rc == 0
failed_when: j_install.rc != 0
when:
- joomla_installed.rc != 0
- has_installer.rc == 0

View File

@@ -0,0 +1,45 @@
- name: "Toggle Joomla debug flags safely (configuration.php)"
command:
argv:
- docker
- exec
- -e
- "J_MODE_DEBUG={{ MODE_DEBUG | default(false) | bool | ternary('1','0') }}"
- -e
- "J_ERR_LEVEL={{ MODE_DEBUG | default(false) | bool | ternary('maximum','default') }}"
- "{{ JOOMLA_CONTAINER }}"
- php
- -r
- |
$f = '{{ JOOMLA_CONFIG_FILE }}';
if (!file_exists($f)) { fwrite(STDERR, "configuration.php missing\n"); exit(1); }
$c = file_get_contents($f);
$changed = 0;
$debug = getenv('J_MODE_DEBUG') === '1';
$err = getenv('J_ERR_LEVEL') ?: 'default';
// Clean up previously broken lines
$c = preg_replace('/^\s*public\s+1\s*=.*?;$/m', '', $c, -1, $nBad1); $changed += $nBad1;
$c = preg_replace('/^\s*public\s*=\s*maximum;$/m', '', $c, -1, $nBad2); $changed += $nBad2;
// Ensure: public $debug = true|false;
$lineDebug = "public \$debug = " . ($debug ? 'true' : 'false') . ";";
if (preg_match('/public\s*\$debug\s*=\s*[^;]*;/', $c)) {
$c = preg_replace('/public\s*\$debug\s*=\s*[^;]*;/', $lineDebug, $c, 1, $n); $changed += $n;
} else {
$c = preg_replace("/\n\}\s*$/", "\n\t".$lineDebug."\n}\n", $c, 1, $n); $changed += $n;
}
// Ensure: public $error_reporting = 'maximum'|'default';
$lineErr = "public \$error_reporting = '" . str_replace("'", "\\'", $err) . "';";
if (preg_match('/public\s*\$error_reporting\s*=\s*[^;]*;/', $c)) {
$c = preg_replace('/public\s*\$error_reporting\s*=\s*[^;]*;/', $lineErr, $c, 1, $n); $changed += $n;
} else {
$c = preg_replace("/\n\}\s*$/", "\n\t".$lineErr."\n}\n", $c, 1, $n); $changed += $n;
}
if ($changed) { file_put_contents($f, $c); echo "changed"; } else { echo "ok"; }
register: j_cfg_debug
changed_when: (j_cfg_debug.stdout | trim) == "changed"
failed_when: j_cfg_debug.rc != 0

View File

@@ -0,0 +1,52 @@
- name: "Ensure configuration.php DB settings match inventory"
command:
argv:
- docker
- exec
- -e
- J_DBTYPE={{ JOOMLA_DB_CONNECTOR }}
- -e
- J_DBHOST={{ database_host }}:{{ database_port }}
- -e
- J_DBUSER={{ database_username }}
- -e
- J_DBPASS={{ database_password }}
- -e
- J_DBNAME={{ database_name }}
- "{{ JOOMLA_CONTAINER }}"
- php
- -r
- |
$f = '{{ JOOMLA_CONFIG_FILE }}';
if (!file_exists($f)) { exit(0); }
$c = file_get_contents($f);
$changed = 0;
$map = [
'dbtype' => getenv('J_DBTYPE'),
'host' => getenv('J_DBHOST'),
'user' => getenv('J_DBUSER'),
'password' => getenv('J_DBPASS'),
'db' => getenv('J_DBNAME'),
];
foreach ($map as $k => $v) {
// Escape single quotes for safe embedding into the PHP source string
$vEsc = str_replace("'", "\\'", $v);
// Match current value in config: public $key = '...';
if (preg_match("/public \\$".$k."\\s*=\\s*'([^']*)';/", $c, $m) && $m[1] !== $v) {
$c = preg_replace(
"/public \\$".$k."\\s*=\\s*'[^']*';/",
"public $".$k." = '".$vEsc."';",
$c
);
$changed = 1;
}
}
if ($changed) { file_put_contents($f, $c); echo "changed"; } else { echo "ok"; }
register: cfg_patch
changed_when: cfg_patch.stdout == "changed"
failed_when: cfg_patch.rc != 0
when: joomla_installed.rc == 0

View File

@@ -0,0 +1,4 @@
- name: "PHP lint configuration.php"
command:
argv: [ docker, exec, "{{ JOOMLA_CONTAINER }}", php, "-l", "{{ JOOMLA_CONFIG_FILE }}" ]
changed_when: false

View File

@@ -1,7 +1,26 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
loop: "{{ domains }}"
- name: "Include role sys-stk-front for {{ application_id }}"
include_role:
name: sys-stk-front
loop: "{{ JOOMLA_DOMAINS }}"
loop_control:
loop_var: domain
loop_var: domain
vars:
http_port: "{{ ports.localhost.http[application_id] }}"
- name: "load docker and db for {{ application_id }}"
include_role:
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: true
- name: Include install routines
include_tasks: "{{ item }}"
loop:
- 01_install.yml
- 02_debug.yml
- 03_patch.yml
- name: Include assert routines
include_tasks: "04_assert.yml"
when: MODE_ASSERT | bool

View File

@@ -0,0 +1 @@
FROM {{ JOOMLA_IMAGE }}:{{ JOOMLA_VERSION }}

View File

@@ -1,7 +1,11 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
image: "{{ JOOMLA_IMAGE }}:{{ JOOMLA_VERSION }}"
container_name: "{{ JOOMLA_CONTAINER }}"
build:
context: {{ docker_compose.directories.instance }}
dockerfile: Dockerfile
image: "{{ JOOMLA_CUSTOM_IMAGE }}"
container_name: {{ JOOMLA_CONTAINER }}
pull_policy: never
{% include 'roles/docker-container/templates/base.yml.j2' %}
volumes:
- data:/var/www/html

View File

@@ -1,4 +1,14 @@
JOOMLA_DB_HOST="{{ database_host }}:{{ database_port }}"
JOOMLA_DB_USER="{{ database_username }}"
JOOMLA_DB_PASSWORD="{{ database_password }}"
JOOMLA_DB_NAME="{{ database_name }}"
JOOMLA_SITE_NAME={{ JOOMLA_SITE_NAME }}
JOOMLA_ADMIN_USER={{ JOOMLA_USER }}
JOOMLA_ADMIN_USERNAME={{ JOOMLA_USER_NAME }}
JOOMLA_ADMIN_PASSWORD={{ JOOMLA_USER_PASSWORD }}
JOOMLA_ADMIN_EMAIL={{ JOOMLA_USER_EMAIL }}
{% if database_type == 'mariadb' %}
# Database
JOOMLA_DB_HOST={{ database_host }}:{{ database_port }}
JOOMLA_DB_USER={{ database_username }}
JOOMLA_DB_PASSWORD={{ database_password }}
JOOMLA_DB_NAME={{ database_name }}
JOOMLA_DB_TYPE={{ JOOMLA_DB_CONNECTOR }}
{% endif %}

View File

@@ -1,10 +1,21 @@
# General
application_id: "web-app-joomla"
database_type: "postgres"
container_port: 80
application_id: "web-app-joomla"
database_type: "mariadb"
container_port: 80
# Joomla
JOOMLA_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.version') }}"
JOOMLA_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.image') }}"
JOOMLA_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.name') }}"
JOOMLA_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
JOOMLA_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.version') }}"
JOOMLA_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.image') }}"
JOOMLA_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.joomla.name') }}"
JOOMLA_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
JOOMLA_CUSTOM_IMAGE: "{{ JOOMLA_IMAGE }}_custom"
JOOMLA_DOMAINS: "{{ applications | get_app_conf(application_id, 'server.domains.canonical') }}"
JOOMLA_SITE_NAME: "{{ SOFTWARE_NAME }} Joomla - CMS"
JOOMLA_DB_CONNECTOR: "{{ 'pgsql' if database_type == 'postgres' else 'mysqli' }}"
JOOMLA_CONFIG_FILE: "/var/www/html/configuration.php"
# User
JOOMLA_USER_NAME: "{{ users.administrator.username }}"
JOOMLA_USER: "{{ JOOMLA_USER_NAME | capitalize }}"
JOOMLA_USER_PASSWORD: "{{ users.administrator.password }}"
JOOMLA_USER_EMAIL: "{{ users.administrator.email }}"

View File

@@ -5,4 +5,4 @@
file: "{{ item }}"
loop:
- "{{ playbook_dir }}/roles/docker-compose/vars/docker-compose.yml"
- "{{ playbook_dir }}/roles/cmp-rdbms/vars/database.yml"
- "{{ playbook_dir }}/roles/sys-svc-rdbms/vars/database.yml"

View File

@@ -7,6 +7,6 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,3 +1,3 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
proxy_extra_configuration: >-
{% if not applications | get_app_conf(application_id, 'public_api_activated', True) %}

View File

@@ -27,7 +27,7 @@
block:
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,7 +1,7 @@
---
- name: "Include setup for domain '{{ domain }}'"
include_role:
name: srv-domain-provision
name: sys-stk-front
loop: "{{ domains['web-app-mastodon'] }}"
loop_control:
loop_var: domain
@@ -14,7 +14,7 @@
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: true

View File

@@ -1,6 +1,6 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: "Patch Matomo config.ini.php"
include_tasks: 02_configuration.yml

View File

@@ -1,6 +1,6 @@
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: false

View File

@@ -9,9 +9,9 @@
src: "well-known.j2"
dest: "{{ MATRIX_WELL_KNOWN_FILE }}"
- name: "include role srv-domain-provision for {{ MATRIX_ELEMENT_DOMAIN }}"
- name: "include role sys-stk-front for {{ MATRIX_ELEMENT_DOMAIN }}"
include_role:
name: srv-domain-provision
name: sys-stk-front
vars:
domain: "{{ MATRIX_ELEMENT_DOMAIN }}"
http_port: "{{ MATRIX_ELEMENT_PORT }}"

View File

@@ -1,16 +1,21 @@
sitename: "Wiki on {{ PRIMARY_DOMAIN | upper }}"
meta_namespace: "Meta"
server:
domains:
canonical:
- "wiki.{{ PRIMARY_DOMAIN }}"
docker:
services:
database:
enabled: true
mediawiki:
image: mediawiki
version: latest
backup:
no_stop_required: true
name: mediawiki
volumes:
data: mediawiki_data
volumes:
data: mediawiki_data
features:
logout: true
central_database: true

View File

View File

@@ -1,8 +1,33 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: false
- name: add docker-compose.yml
template: src=docker-compose.yml.j2 dest={{ docker_compose.directories.instance }}docker-compose.yml
notify: docker compose up
- name: "Deploy MediaWiki LocalSettings.php"
template:
src: "LocalSettings.php.j2"
dest: "{{ MEDIAWIKI_SETTINGS_HOST_PATH }}"
mode: '0644'
- name: "Flush docker compose handlers"
meta: flush_handlers
- name: "Create MediaWiki admin user"
command: >
docker exec
-u {{ MEDIAWIKI_USER }}
{{ MEDIAWIKI_CONTAINER }}
php /var/www/html/maintenance/createAndPromote.php
--bureaucrat --sysop
{{ MEDIAWIKI_ADMINISTRATOR_NAME }}
{{ MEDIAWIKI_ADMINISTRATOR_PASSWORD }}
{{ MEDIAWIKI_ADMINISTRATOR_EMAIL }}
register: create_admin
changed_when: >
'created' in (create_admin.stdout | default('')) or
'Created' in (create_admin.stdout | default(''))
failed_when: >
create_admin.rc != 0 and
('already exists' not in (create_admin.stdout | default('') ~ create_admin.stderr | default('')))

View File

@@ -0,0 +1,29 @@
<?php
# This file was automatically generated by the MediaWiki installer.
# Managed by Ansible in your setup.
# Basic settings
$wgSitename = "{{ MEDIAWIKI_SITENAME }}";
$wgMetaNamespace = "{{ MEDIAWIKI_META_NAMESPACE }}";
$wgScriptPath = "";
$wgServer = "{{ MEDIAWIKI_URL }}";
# Database settings
$wgDBtype = "mysql";
$wgDBserver = "{{ database_host }}:{{ database_port }}";
$wgDBname = "{{ database_name }}";
$wgDBuser = "{{ database_username }}";
$wgDBpassword = "{{ database_password }}";
# Email settings
$wgEnableEmail = true;
$wgEnableUserEmail = true;
$wgEmergencyContact = "{{ users.administrator.email }}";
$wgPasswordSender = "{{ users['no-reply'].email }}";
# Default skin
$wgDefaultSkin = "vector";
# Extensions (examples)
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'Cite' );

View File

@@ -1,16 +1,19 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
{% include 'roles/docker-container/templates/base.yml.j2' %}
container_name: "{{ mediawiki_name }}"
image: "{{ mediawiki_image }}:{{ mediawiki_version }}"
volumes:
- "data:/var/www/html/"
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:80"
container_name: "{{ MEDIAWIKI_CONTAINER }}"
image: "{{ MEDIAWIKI_IMAGE }}:{{ MEDIAWIKI_VERSION }}"
volumes:
- "data:/var/www/html/"
- "{{ MEDIAWIKI_SETTINGS_HOST_PATH }}:{{ MEDIAWIKI_SETTINGS_DOCK_PATH }}:ro"
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
{% 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:
name: {{ mediawiki_volume }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
name: {{ MEDIAWIKI_VOLUME }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -1,6 +1,23 @@
application_id: "web-app-mediawiki"
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.volumes.data', True) }}"
# General
application_id: "web-app-mediawiki"
database_type: "mariadb"
container_port: 80
# Mediawiki
MEDIAWIKI_SITENAME: "{{ applications | get_app_conf(application_id, 'sitename') }}"
MEDIAWIKI_META_NAMESPACE: "{{ applications | get_app_conf(application_id, 'meta_namespace') }}"
MEDIAWIKI_URL: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}"
## Docker
MEDIAWIKI_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.version') }}"
MEDIAWIKI_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.image') }}"
MEDIAWIKI_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.mediawiki.name') }}"
MEDIAWIKI_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
MEDIAWIKI_SETTINGS_HOST_PATH: "{{ [docker_compose.directories.volumes, 'LocalSettings.php'] | path_join }}"
MEDIAWIKI_SETTINGS_DOCK_PATH: "/var/www/html/LocalSettings.php"
MEDIAWIKI_USER: "www-data"
# User
MEDIAWIKI_ADMINISTRATOR_NAME: "{{ users.administrator.username }}"
MEDIAWIKI_ADMINISTRATOR_PASSWORD: "{{ users.administrator.password }}"
MEDIAWIKI_ADMINISTRATOR_EMAIL: "{{ users.administrator.email }}"

View File

@@ -18,7 +18,7 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless
- name: Build data (single async task)
include_tasks: 02_build_data.yml

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: add config.exs
template:

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: Check if config.php exists
command: docker exec --user root {{ moodle_container }} test -f {{ moodle_config }}

View File

@@ -1,55 +0,0 @@
# Installation
## Multi Domain Installation
If you want to access your mybb over multiple domains, keep the following in mind:
- Set Cookie Domain to nothing
- Access mybb for installation via mybb.<PRIMARY_DOMAIN>
- Set the Board Url to mybb.<PRIMARY_DOMAIN>
## Manual Installation of MyBB Plugins
This guide describes the process of manually installing MyBB plugins in your Docker-MyBB environment. This can be useful if you want to quickly test plugins or do not wish to execute the Ansible role.
### Steps for Manual Installation
1. **Prepare Plugin Files:**
- Download the desired MyBB plugin zip files.
2. **Copy plugin to host:**
- ```bash scp <plugin> administrator@<server>:/opt/docker/mybb/plugins```
3. **Unzip Plugin Files on the Host:**
- Unzip the plugin zip files in the host's plugin directory:
```bash
unzip /opt/docker/mybb/plugins/<plugin-file>.zip -d /opt/docker/mybb/plugins/
```
- Replace `<plugin-file>.zip` with the name of the plugin zip file.
- Repeat this step for each plugin.
4. **Access the Docker Container:**
- Open a terminal or SSH session on the server where the Docker container is running.
5. **Copy Unzipped Plugin Files to the Container:**
- Copy the unzipped plugin files from the host directory to the Docker container:
```bash
docker compose cp /opt/docker/mybb/plugins/<unzipped-plugin-folder> application:/var/www/html/inc/plugins/
```
- Replace `<unzipped-plugin-folder>` with the name of the unzipped plugin folder.
6. **Restart the Container:**
- Execute the following command to restart the MyBB container:
```bash
docker-compose -p mybb up -d --force-recreate
```
- This ensures all changes take effect.
7. **Activate Plugins in the MyBB Admin Panel:**
- Open the MyBB admin panel in your web browser.
- Navigate to the plugin settings and activate the newly installed plugins.
### Important Notes
- Ensure you use the correct paths and filenames.
- Do not forget to regularly back up your MyBB database and files before making changes.
- If encountering issues, refer to the MyBB documentation or specific instructions from the plugin author.

View File

@@ -0,0 +1,8 @@
credentials:
secret_pin:
description: >
Optional secret PIN required for accessing the MyBB Admin Control Panel.
If set, administrators must enter this PIN in addition to their username
and password when logging into the ACP.
algorithm: "sha256"
validation: "^[a-f0-9]{64}$"

View File

@@ -1,36 +1,25 @@
- block:
- name: Include dependency 'srv-proxy-core'
include_role:
name: srv-proxy-core
when: run_once_srv_proxy_core is not defined
- include_tasks: utils/run_once.yml
when: run_once_web_app_mybb is not defined
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: sys-stk-full-stateful
vars:
docker_compose_flush_handlers: false
proxy_extra_configuration: "sub_filter '{{MYBB_DOMAIN}}' '{{ MYBB_DOMAIN }}';"
- name: "include tasks setup-domain.yml with {{ domains | get_domain(application_id) }}"
include_tasks: setup-domain.yml
loop: "{{ mybb_domains + [source_domain] }}"
loop_control:
loop_var: domain
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
- name: "create {{docker_compose_instance_confd_directory}} and parent directories"
- name: "create {{ MYBB_NGINX_CONF_DIR_HOST }} and parent directories"
file:
path: "{{docker_compose_instance_confd_directory}}"
path: "{{ MYBB_NGINX_CONF_DIR_HOST }}"
state: directory
mode: "0755"
recurse: yes
- name: "create {{docker_compose_instance_confd_defaultconf_file}}"
- name: "Deploy {{ MYBB_NGINX_DEFAULT_CONF_HOST }}"
template:
src: "default.conf.j2"
dest: "{{docker_compose_instance_confd_defaultconf_file}}"
dest: "{{ MYBB_NGINX_DEFAULT_CONF_HOST }}"
notify: docker compose up
- name: add docker-compose.yml
- name: "Deploy {{ MYBB_CONFIG_HOST_PATH }}"
template:
src: "docker-compose.yml.j2"
dest: "{{ docker_compose.directories.instance }}docker-compose.yml"
notify: docker compose up
src: "config.php.j2"
dest: "{{ MYBB_CONFIG_HOST_PATH }}"
mode: '0644'

View File

@@ -1,13 +0,0 @@
- name: "include role receive certbot certificate"
include_role:
name: srv-tls-core
vars:
domain: "{{ domains | get_domain(application_id) }}"
- name: configure {{ domains | get_domain(application_id) }}.conf
template:
src: "roles/srv-proxy-core/templates/vhost/basic.conf.j2"
dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ domains | get_domain(application_id) }}.conf"
notify: restart openresty
vars:
proxy_extra_configuration: "sub_filter '{{source_domain}}' '{{ domains | get_domain(application_id) }}';"

View File

@@ -0,0 +1,13 @@
<?php
$config = array();
$config['database']['type'] = 'mysqli';
$config['database']['database'] = '{{ database_name }}';
$config['database']['table_prefix'] = 'mybb_';
$config['database']['hostname'] = '{{ database_host }}';
$config['database']['port'] = '{{ database_port }}';
$config['database']['username'] = '{{ database_username }}';
$config['database']['password'] = '{{ database_password }}';
$config['database']['encoding'] = 'utf8mb4';
$config['super_admins'] = '{{ MYBB_ADMIN_USER_ID }}';
$config['secret_pin'] = '{{ MYBB_SECRET_PIN }}';
$config['admin_dir'] = 'admin';

View File

@@ -1,11 +1,8 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
logging:
driver: journald
options:
tag: "mybb_application"
image: {{ mybb_image }}:{{ mybb_version }}
container_name: {{ mybb_name }}
{% include 'roles/docker-container/templates/base.yml.j2' %}
image: {{ MYBB_IMAGE }}:{{ MYBB_VERSION }}
container_name: {{ MYBB_CONTAINER }}
restart: {{ DOCKER_RESTART_POLICY }}
volumes:
- data:/var/www/html
@@ -13,21 +10,20 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %}
server:
logging:
driver: journald
options:
tag: "mybb_server"
{% include 'roles/docker-container/templates/base.yml.j2' %}
image: nginx:mainline
restart: {{ DOCKER_RESTART_POLICY }}
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:80"
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
volumes:
- "{{docker_compose_instance_confd_directory}}:{{target_mount_conf_d_directory}}:ro"
- "{{ MYBB_NGINX_CONF_DIR_HOST }}:{{ MYBB_NGINX_CONF_DIR_DOCK }}:ro"
- "{{ MYBB_CONFIG_HOST_PATH }}:{{ MYBB_CONFIG_DOCK_PATH }}:ro"
- "data:/var/www/html:ro"
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data:
name: {{ mybb_volume }}
name: {{ MYBB_VOLUME }}
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -1,11 +1,25 @@
---
application_id: "web-app-mybb"
docker_compose_instance_confd_directory: "{{ docker_compose.directories.instance }}conf.d/"
docker_compose_instance_confd_defaultconf_file: "{{docker_compose_instance_confd_directory}}default.conf"
target_mount_conf_d_directory: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}"
source_domain: "mybb.{{ PRIMARY_DOMAIN }}"
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.volumes.data', True) }}"
# General
application_id: "web-app-mybb"
database_type: "mariadb"
container_port: 80
# MyBB
## Credentials
MYBB_SECRET_PIN: "{{ applications | get_app_conf(application_id, 'credentials.secret_pin') }}"
## Server
MYBB_NGINX_CONF_DIR_HOST: "{{ docker_compose.directories.instance }}conf.d/"
MYBB_NGINX_CONF_DIR_DOCK: "{{ NGINX.DIRECTORIES.CONFIGURATION }}"
MYBB_NGINX_DEFAULT_CONF_HOST: "{{ MYBB_NGINX_CONF_DIR_HOST }}default.conf"
## Application
MYBB_ADMIN_USER_ID: 1
MYBB_DOMAIN: "{{ domains | get_domain(application_id) }}"
MYBB_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.version') }}"
MYBB_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.image') }}"
MYBB_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.mybb.name') }}"
MYBB_VOLUME: "{{ applications | get_app_conf(application_id, 'docker.volumes.data') }}"
MYBB_CONFIG_HOST_PATH: "{{ [docker_compose.directories.instance, 'config.php'] | path_join }}"
MYBB_CONFIG_DOCK_PATH: "/var/www/html/inc/config.php"

View File

@@ -16,7 +16,7 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless
# Hack because it wasn't possible to fix an handler bug in pkgmgr install
- name: „Trigger“ docker compose up

View File

@@ -21,7 +21,7 @@
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
name: sys-stk-back-stateful
vars:
docker_compose_flush_handlers: false

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
name: sys-stk-full-stateful
- name: "Create {{ openproject_plugins_folder }}"
file:

View File

@@ -11,7 +11,7 @@
- name: "load docker and db for {{ application_id }}"
include_role:
name: cmp-db-docker
name: sys-stk-back-stateful
- name: "Install and activate auth-openid-connect plugin if OIDC is enabled"
include_tasks: enable-oidc.yml

View File

@@ -1,7 +1,7 @@
---
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless
- name: "configure pgadmin servers"
include_tasks: configuration.yml

View File

@@ -1,3 +1,3 @@
- name: "load docker, proxy for '{{ application_id }}'"
include_role:
name: cmp-docker-proxy
name: sys-stk-full-stateless

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