diff --git a/roles/web-app-mybb/Installation.md b/roles/web-app-mybb/Installation.md deleted file mode 100644 index 836f1025..00000000 --- a/roles/web-app-mybb/Installation.md +++ /dev/null @@ -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. -- Set the Board Url to mybb. - -## 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 administrator@:/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/.zip -d /opt/docker/mybb/plugins/ - ``` - - Replace `.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/ application:/var/www/html/inc/plugins/ - ``` - - Replace `` 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. \ No newline at end of file diff --git a/roles/web-app-mybb/schema/main.yml b/roles/web-app-mybb/schema/main.yml new file mode 100644 index 00000000..636b2f03 --- /dev/null +++ b/roles/web-app-mybb/schema/main.yml @@ -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}$" \ No newline at end of file diff --git a/roles/web-app-mybb/tasks/main.yml b/roles/web-app-mybb/tasks/main.yml index c3deefb8..d760c80b 100644 --- a/roles/web-app-mybb/tasks/main.yml +++ b/roles/web-app-mybb/tasks/main.yml @@ -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: cmp-db-docker-proxy + 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' \ No newline at end of file diff --git a/roles/web-app-mybb/tasks/setup-domain.yml b/roles/web-app-mybb/tasks/setup-domain.yml deleted file mode 100644 index b7d92143..00000000 --- a/roles/web-app-mybb/tasks/setup-domain.yml +++ /dev/null @@ -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) }}';" diff --git a/roles/web-app-mybb/templates/config.php.j2 b/roles/web-app-mybb/templates/config.php.j2 new file mode 100644 index 00000000..fbe28037 --- /dev/null +++ b/roles/web-app-mybb/templates/config.php.j2 @@ -0,0 +1,13 @@ +