Huge role refactoring/cleanup. Other commits will propably follow. Because some bugs will exist. Still important for longrun and also for auto docs/help/slideshow generation

This commit is contained in:
2025-07-08 23:43:13 +02:00
parent 6b87a049d4
commit 563d5fd528
1242 changed files with 2301 additions and 1355 deletions

View File

@@ -0,0 +1,55 @@
# 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,29 @@
# MyBB
## Description
Transform your community engagement with MyBB, a feature-rich forum solution that combines modern design with robust functionality. MyBB fosters dynamic discussions, intuitive moderation, and an energetic user interface that brings people together, creating a vibrant online community.
## Overview
This role deploys MyBB using Docker, leveraging Docker Compose to manage both the MyBB application and its underlying MariaDB database. It also integrates with an Nginx reverse proxy for secure, flexible multi-domain access. Additionally, the role supports the manual installation of MyBB plugins for added extensibility. For detailed installation and configuration instructions, please refer to the [Installation.md](./Installation.md) file.
## Features
- **Multi-Domain Support:** Configure MyBB for multi-domain installations by setting the correct cookie domain and board URL.
- **Plugin Extensibility:** Manually install and activate plugins to extend forum functionality and tailor the user experience.
- **Robust Deployment:** Achieve reliable and scalable deployment of your forum via Docker Compose, ensuring seamless service continuity.
- **Secure and Flexible Access:** Integrate with an Nginx reverse proxy to securely manage traffic and domain access.
## Further Resources
- [MyBB Docker Repository](https://github.com/mybb/docker)
- [MyBB Official Website](https://mybb.com/)
## Credits
Developed and maintained by **Kevin Veen-Birkenbach**.
Learn more at [veen.world](https://www.veen.world).
Part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais)
Licensed under [CyMaIS NonCommercial License (CNCL)](https://s.veen.world/cncl).

View File

@@ -0,0 +1,2 @@
# Todo
- Optimize the role for the new role structure. But propably discourse is sufficient and this role isn't needed anymore.

View File

@@ -0,0 +1,27 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Transform your community engagement with MyBB, a feature-rich forum solution that combines modern design with robust functionality. Enjoy dynamic discussions, intuitive moderation, and a vibrant user interface that brings your community together."
license: "CyMaIS NonCommercial License (CNCL)"
license_url: "https://s.veen.world/cncl"
company: |
Kevin Veen-Birkenbach
Consulting & Coaching Solutions
https://www.veen.world
galaxy_tags:
- mybb
- docker
- forum
- community
- cms
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
logo:
class: "fa-solid fa-comments"
run_after:
- web-app-matomo
- web-app-keycloak
- web-app-mailu
dependencies:
- webserver-proxy-core

View File

@@ -0,0 +1,29 @@
---
- name: "include service-rdbms-central"
include_role:
name: service-rdbms-central
- 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: "create {{docker_compose_instance_confd_directory}} and parent directories"
file:
path: "{{docker_compose_instance_confd_directory}}"
state: directory
mode: 0755
recurse: yes
- name: "create {{docker_compose_instance_confd_defaultconf_file}}"
template:
src: "default.conf"
dest: "{{docker_compose_instance_confd_defaultconf_file}}"
notify: docker compose up
- name: add docker-compose.yml
template:
src: "docker-compose.yml.j2"
dest: "{{docker_compose.directories.instance}}docker-compose.yml"
notify: docker compose up

View File

@@ -0,0 +1,13 @@
- name: "include role receive certbot certificate"
include_role:
name: webserver-tls-core
vars:
domain: "{{domains | get_domain(application_id)}}"
- name: configure {{domains | get_domain(application_id)}}.conf
template:
src: "roles/webserver-proxy-core/templates/vhost/basic.conf.j2"
dest: "{{nginx.directories.http.servers}}{{domains | get_domain(application_id)}}.conf"
notify: restart nginx
vars:
nginx_docker_reverse_proxy_extra_configuration: "sub_filter '{{source_domain}}' '{{domains | get_domain(application_id)}}';"

View File

@@ -0,0 +1,44 @@
upstream mybb {
server application:9000 weight=5;
}
server {
listen 80;
error_log /proc/self/fd/2 {% if enable_debug | bool %}debug{% else %}warn{% endif %};
root /var/www/html;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ inc/ {
internal;
}
location ~ ^/(images|cache|jscripts|uploads)/ {
access_log off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass mybb;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
# proxy timeouts
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
# fastcgi timeouts
fastcgi_read_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_connect_timeout 300s;
}
}

View File

@@ -0,0 +1,31 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
application:
logging:
driver: journald
options:
tag: "mybb_application"
image: mybb/mybb:{{applications.mybb.version}}
restart: {{docker_restart_policy}}
volumes:
- data:/var/www/html
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
server:
logging:
driver: journald
options:
tag: "mybb_server"
image: nginx:mainline
restart: {{docker_restart_policy}}
ports:
- "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
volumes:
- "{{docker_compose_instance_confd_directory}}:{{target_mount_conf_d_directory}}:ro"
- "data:/var/www/html:ro"
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data:
{% include 'roles/docker-compose/templates/networks.yml.j2' %}

View File

@@ -0,0 +1,12 @@
version: "latest"
features:
matomo: true
css: true
portfolio_iframe: true
central_database: true
docker:
services:
database:
enabled: true

View File

@@ -0,0 +1,8 @@
---
application_id: "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_password: "{{mybb_database_password}}"
database_type: "mariadb"