diff --git a/VERSIONS.md b/VERSIONS.md index b615ea3..0fbe546 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -88,3 +88,4 @@ * Wg Easy: 12 * Woodpecker Ci Agent: v2.6.0 * Woodpecker Ci Server: v2.6.0 +* Wordpress: 6.5.5 diff --git a/docs/services/wordpress.md b/docs/services/wordpress.md new file mode 100644 index 0000000..db9b4fe --- /dev/null +++ b/docs/services/wordpress.md @@ -0,0 +1,52 @@ +# Wordpress + +[WordPress](https://wordpress.org/) is a widley used open source web content management system that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-wordpress](https://github.com/mother-of-all-self-hosting/ansible-role-wordpress) Ansible role. + +## Dependencies + +This service requires the following other services: + +- a [MariaDB](mariadb.md) database +- a [Traefik](traefik.md) reverse-proxy server + +## Configuration + +```yaml +######################################################################## +# # +# wordpress # +# # +######################################################################## + +wordpress_enabled: true + +wordpress_hostname: example.org + +######################################################################## +# # +# /wordpress # +# # +######################################################################## +``` + +## Usage + +Navigate to the domain you set as `wordpress_hostname`, select a language and create an admin user. + +> **Make sure to create a user with a strong password** + +You can now log in and fill your website with content! + + +## Advanced + +### Basic authentication + +If you don't want to have your website accessible to everyone (e.g. you first want to present it to a client) you can use + +```yaml +wordpress_container_labels_middleware_basic_auth_enabled: true +# Use `htpasswd -nb USERNAME PASSSWORD` to generate the users below. +# See: https://doc.traefik.io/traefik/middlewares/http/basicauth/#users +wordpress_container_labels_middleware_basic_auth_users: '' +``` diff --git a/docs/supported-services.md b/docs/supported-services.md index 4fe017e..e3577ae 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -86,6 +86,7 @@ | [WireGuard Easy](https://github.com/wg-easy/wg-easy) | The easiest way to run [WireGuard](https://www.wireguard.com/) VPN + Web-based Admin UI. | [Link](services/wg-easy.md) | | [Forgejo](https://forgejo.org/) | An alternative fork of Gitea. Easy and painless self-hosted git server. | [Link](services/forgejo.md) | | [Woodpecker CI](https://woodpecker-ci.org/) | A simple Continuous Integration (CI) engine with great extensibility. | [Link](services/woodpecker-ci.md) | +| [WordPress](https://wordpress.org/) | A widley used open source web content management system | [Link](services/wordpress.md) | | System-related | A collection of various system-related components | [Link](services/system.md) | diff --git a/templates/group_vars_mash_servers b/templates/group_vars_mash_servers index 7175354..b119e10 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -619,6 +619,11 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized: {{ ({'name': (wg_easy_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'wg-easy']} if wg_easy_enabled else omit) }} # /role-specific:wg_easy + # role-specific:wordpress + - |- + {{ ({'name': (wordpress_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'wordpress']} if wordpress_enabled else omit) }} + # /role-specific:wordpress + # role-specific:forgejo - |- {{ ({'name': (forgejo_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'forgejo', 'forgejo-server']} if forgejo_enabled else omit) }} @@ -3969,6 +3974,17 @@ mash_playbook_mariadb_managed_databases_auto_itemized: }} # /role-specific:authelia + # role-specific:wordpress + - |- + {{ + ({ + 'name': wordpress_database_name, + 'username': wordpress_database_username, + 'password': wordpress_database_password, + } if wordpress_enabled and wordpress_database_hostname == mariadb_identifier | default('mash-mariadb') else omit) + }} + # /role-specific:wordpress + mariadb_managed_databases_auto: "{{ mash_playbook_mariadb_managed_databases_auto_itemized | reject('equalto', omit) }}" ######################################################################## @@ -5423,3 +5439,50 @@ devture_woodpecker_ci_agent_config_agent_secret: "{{ devture_woodpecker_ci_serve # # ######################################################################## # /role-specific:woodpecker_ci_agent + + +# role-specific:wordpress +######################################################################## +# # +# wordpress # +# # +######################################################################## + +wordpress_enabled: false + +wordpress_identifier: "{{ mash_playbook_service_identifier_prefix }}wordpress" + +wordpress_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}wordpress" + +wordpress_uid: "{{ mash_playbook_uid }}" +wordpress_gid: "{{ mash_playbook_gid }}" + +wordpress_systemd_required_systemd_services_list_auto: | + {{ + ([(mariadb_identifier | default('mash-mariadb')) ~ '.service'] if mariadb_enabled | default(false) and wordpress_database_hostname == mariadb_identifier | default('mash-mariadb') else []) + }} + + +wordpress_container_additional_networks_auto: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([mariadb_identifier | default('mash-mariadb')] if mariadb_enabled | default(false) and wordpress_database_hostname == mariadb_identifier | default('mash-mariadb') and wordpress_container_network != mariadb_identifier | default('mash-mariadb') else []) + }} + +wordpress_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +wordpress_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +wordpress_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +wordpress_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + + +wordpress_database_hostname: "{{ mariadb_identifier if mariadb_enabled | default(false) else '' }}" +wordpress_mysql_port: "{{ '3306' if mariadb_enabled | default(false) else '' }}" +wordpress_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.mariadb', rounds=655555) | to_uuid }}" + +######################################################################## +# # +# /wordpress # +# # +######################################################################## +# /role-specific:wordpress diff --git a/templates/requirements.yml b/templates/requirements.yml index 5b0a664..fb2cf3b 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -391,3 +391,7 @@ version: v2.6.0-0 name: woodpecker_ci_server activation_prefix: devture_woodpecker_ci_server_ +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-wordpress + version: v6.5.5-0 + name: wordpress + activation_prefix: wordpress_ diff --git a/templates/setup.yml b/templates/setup.yml index 42b6d6f..c6421d9 100644 --- a/templates/setup.yml +++ b/templates/setup.yml @@ -407,6 +407,10 @@ - role: galaxy/woodpecker_ci_agent # /role-specific:woodpecker_ci_agent + # role-specific:wordpress + - role: galaxy/wordpress + # /role-specific:wordpress + # role-specific:roundcube - role: galaxy/roundcube # /role-specific:roundcube