From ba47bb5eaceb864ab23e5860a16c820f1d0d3ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 5 Apr 2023 17:01:58 +0200 Subject: [PATCH 1/6] Add mobilizon + postgis (WIP) --- docs/services/mobilizon.md | 58 ++++++++++++++++++++++++ docs/services/postgis.md | 31 +++++++++++++ group_vars/mash_servers | 91 ++++++++++++++++++++++++++++++++++++++ setup.yml | 4 ++ 4 files changed, 184 insertions(+) create mode 100644 docs/services/mobilizon.md create mode 100644 docs/services/postgis.md diff --git a/docs/services/mobilizon.md b/docs/services/mobilizon.md new file mode 100644 index 0000000..b236fc3 --- /dev/null +++ b/docs/services/mobilizon.md @@ -0,0 +1,58 @@ +# GoToSocial + +[Mobilizon](https://joinmobilizon.org/en/) is a ActivityPub/Fediverse server to create and share events here powered by the [mother-of-all-self-hosting/ansible-role-mobilizon](https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon) Ansible role. + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file. Also you need to enable postgis which will serve as database for mobilizon. +After that you can re-run the [installation](../installing.md) process. + +```yaml +######################################################################## +# # +# mobilizon # +# # +######################################################################## + +mobilizon_enabled: true + + +# Hostname that this server will be reachable at. +# DO NOT change this after your server has already run once, or you will break things! +mobilizon_hostname: 'events.example.org' + +# to open registrations uncomment the following line +# mobilizon_registrations_open: true + +######################################################################## +# # +# /mobilizon # +# # +######################################################################## + +######################################################################## +# # +# postgis # +# # +######################################################################## + +postgis_enabled: true + +# Put a strong password below, generated with `pwgen -s 64 1` or in another way +postgis_connection_password: '' + +######################################################################## +# # +# /postgis # +# # +######################################################################## +``` + +After installation, you can use `just run-tags mobilizon-add-user --extra-vars=username= --extra-vars=password= --extra-vars=email="` +to create your a user. Change `--tags=mobilizon-add-user` to `--tags=mobilizon-add-admin` to create an admin account. + +### Usage + +After [installing](../installing.md), you can visit at the URL specified in `mobilizon_hostname` and should see your instance. + +Refer to the [great official documentation](https://docs.gotosocial.org/en/latest/) for more information on GoToSocial. diff --git a/docs/services/postgis.md b/docs/services/postgis.md new file mode 100644 index 0000000..10f3379 --- /dev/null +++ b/docs/services/postgis.md @@ -0,0 +1,31 @@ +# Postgis + +[Postgis](https://postgis.net/) is a spatial database extender for PostgreSQL object-relational database. It adds support for geographic objects allowing location queries to be run in SQL. + +Services like [Mobilizon](./mobilizon.md) depend on the ability to store gespatial data. +Enabling the PPostgisostgres database service will automatically wire these services to use it. + + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# postgis # +# # +######################################################################## + +postgis_enabled: true + +# Put a strong password below, generated with `pwgen -s 64 1` or in another way +postgis_connection_password: '' + +######################################################################## +# # +# /postgis # +# # +######################################################################## +``` + diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 7fa2863..32f6425 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -103,6 +103,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (gotosocial_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'gotosocial']}] if gotosocial_enabled else []) + + ([{'name': (mobilizon_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mobilizon']}] if mobilizon_enabled else []) + + ([{'name': (grafana_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'grafana']}] if grafana_enabled else []) + ([{'name': (keycloak_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'keycloak']}] if keycloak_enabled else []) @@ -125,6 +127,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (peertube_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'peertube']}] if peertube_enabled else []) + + ([{'name': (postgis_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'metrics', 'postgis']}] if postgis_enabled else []) + + ([{'name': (prometheus_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'metrics', 'prometheus']}] if prometheus_enabled else []) + ([{'name': (prometheus_blackbox_exporter_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-blackbox-exporter']}] if prometheus_blackbox_exporter_enabled else []) @@ -1165,6 +1169,55 @@ miniflux_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) ######################################################################## +######################################################################## +# # +# mobilizon # +# # +######################################################################## + +mobilizon_enabled: false + +mobilizon_identifier: "{{ mash_playbook_service_identifier_prefix }}mobilizon" + +mobilizon_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}mobilizon" + +mobilizon_uid: "{{ mash_playbook_uid }}" +mobilizon_gid: "{{ mash_playbook_gid }}" + +mobilizon_secret_key: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'sk.mobilizon', rounds=655555) | to_uuid }}" +mobilizon_secret_key_base: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'skb.mobilizon', rounds=655555) | to_uuid }}" + +mobilizon_database_hostname: "{{ postgis_identifier if postgis_enabled else '' }}" +mobilizon_database_port: "{{ '5432' if postgis_enabled else '' }}" +mobilizon_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.mobilizon', rounds=655555) | to_uuid }}" +mobilizon_database_username: "{{ mobilizon_identifier }}" + +mobilizon_systemd_required_services_list: | + {{ + (['docker.service']) + + + ([devture_postgres_identifier ~ '.service'] if postgis_enabled and mobilizon_database_host == postgis_identifier else []) + }} + +mobilizon_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([postgis_container_network] if postgis_enabled and mobilizon_database_host == postgis_identifier and mobilizon_container_network != postgis_container_network else []) + }} + +mobilizon_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +mobilizon_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +mobilizon_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +mobilizon_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +######################################################################## +# # +# /mobilizon # +# # +######################################################################## + + ######################################################################## # # @@ -1370,6 +1423,44 @@ peertube_systemd_required_services_list_auto: | # # ######################################################################## +######################################################################## +# # +# postgis # +# # +######################################################################## + +postgis_enabled: false + +postgis_identifier: "{{ mash_playbook_service_identifier_prefix }}postgis" + +postgis_architecture: "{{ mash_playbook_architecture }}" + +postgis_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}postgis" + +postgis_uid: "{{ mash_playbook_uid }}" +postgis_gid: "{{ mash_playbook_gid }}" + +postgis_systemd_services_to_stop_for_maintenance_list: | + {{ + ([(mobilizon_identifier + '.service')] if miniflux_enabled else []) + }} + +postgis_managed_databases_auto: | + {{ + ([{ + 'name': mobilizon_database_name, + 'username': mobilizon_database_username, + 'password': mobilizon_database_password, + }] if mobilizon_enabled and mobilizon_database_type == 'postgis' and mobilizon_database_hostname == postgis_identifier else []) + }} + +######################################################################## +# # +# /postgis # +# # +######################################################################## + + ######################################################################## # # diff --git a/setup.yml b/setup.yml index 0cfdb1d..a496934 100644 --- a/setup.yml +++ b/setup.yml @@ -82,6 +82,8 @@ - role: galaxy/keycloak + - role: galaxy/mobilizon + - role: galaxy/navidrome - role: galaxy/netbox @@ -92,6 +94,8 @@ - role: galaxy/peertube + - role: galaxy/postgis + - role: galaxy/prometheus - role: galaxy/prometheus_node_exporter - role: galaxy/prometheus_blackbox_exporter From f9267e6600f4f3885c82db16abcf834b1d8e2260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 5 Apr 2023 18:24:53 +0200 Subject: [PATCH 2/6] Naming --- group_vars/mash_servers | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 32f6425..80b0959 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -1196,14 +1196,14 @@ mobilizon_systemd_required_services_list: | {{ (['docker.service']) + - ([devture_postgres_identifier ~ '.service'] if postgis_enabled and mobilizon_database_host == postgis_identifier else []) + ([postgis_identifier ~ '.service'] if postgis_enabled and mobilizon_database_hostname == postgis_identifier else []) }} mobilizon_container_additional_networks: | {{ ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + - ([postgis_container_network] if postgis_enabled and mobilizon_database_host == postgis_identifier and mobilizon_container_network != postgis_container_network else []) + ([postgis_container_network] if postgis_enabled and mobilizon_database_hostname == postgis_identifier and mobilizon_container_network != postgis_container_network else []) }} mobilizon_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" From 4ffb83e571c20d5196f35c06813164a829720dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 1 Jun 2023 10:00:42 +0200 Subject: [PATCH 3/6] Add mobilizon to dependencies --- requirements.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.yml b/requirements.yml index 001a8ca..eb4fdae 100644 --- a/requirements.yml +++ b/requirements.yml @@ -94,6 +94,9 @@ name: mariadb - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.44-0 +- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git + version: v3.1.0 + name: mobilizon - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git version: v0.0.0-9 name: mrs From a11becbd6865a341a00a279363dc122360e55cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 1 Jun 2023 10:10:32 +0200 Subject: [PATCH 4/6] Fix docs --- docs/services/mobilizon.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/services/mobilizon.md b/docs/services/mobilizon.md index b236fc3..1be93d6 100644 --- a/docs/services/mobilizon.md +++ b/docs/services/mobilizon.md @@ -1,4 +1,4 @@ -# GoToSocial +# Mobilizon [Mobilizon](https://joinmobilizon.org/en/) is a ActivityPub/Fediverse server to create and share events here powered by the [mother-of-all-self-hosting/ansible-role-mobilizon](https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon) Ansible role. @@ -48,11 +48,11 @@ postgis_connection_password: '' ######################################################################## ``` -After installation, you can use `just run-tags mobilizon-add-user --extra-vars=username= --extra-vars=password= --extra-vars=email="` -to create your a user. Change `--tags=mobilizon-add-user` to `--tags=mobilizon-add-admin` to create an admin account. +After installation, you can use `just run-tags mobilizon-add-admin --extra-vars=password= --extra-vars=email=` +to create your an admin account. ### Usage After [installing](../installing.md), you can visit at the URL specified in `mobilizon_hostname` and should see your instance. -Refer to the [great official documentation](https://docs.gotosocial.org/en/latest/) for more information on GoToSocial. +Refer to the [great official documentation](https://docs.joinmobilizon.org/use/) for more information on Mobilizon. From 1ef5b9f0da4ea7319447e4763544122684d36181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 1 Jun 2023 10:12:23 +0200 Subject: [PATCH 5/6] Allow mobilizon admin creation --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index eb4fdae..cb4d3ca 100644 --- a/requirements.yml +++ b/requirements.yml @@ -95,7 +95,7 @@ - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.44-0 - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git - version: v3.1.0 + version: v3.1.0-1 name: mobilizon - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git version: v0.0.0-9 From dd91d1030bc88bd3d8bdc2c6602489261343cfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Thu, 1 Jun 2023 16:57:30 +0200 Subject: [PATCH 6/6] Change postgis to be only shown as dependency --- docs/services/mobilizon.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/services/mobilizon.md b/docs/services/mobilizon.md index 1be93d6..d7b36f2 100644 --- a/docs/services/mobilizon.md +++ b/docs/services/mobilizon.md @@ -2,6 +2,14 @@ [Mobilizon](https://joinmobilizon.org/en/) is a ActivityPub/Fediverse server to create and share events here powered by the [mother-of-all-self-hosting/ansible-role-mobilizon](https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon) Ansible role. +## Depedencies + + +This service requires the following other services: + +- a [Postgis](postgis.md) database (postgres based database that supports geospatial data) +- a [Traefik](traefik.md) reverse-proxy server + ## Configuration To enable this service, add the following configuration to your `vars.yml` file. Also you need to enable postgis which will serve as database for mobilizon. @@ -29,23 +37,6 @@ mobilizon_hostname: 'events.example.org' # /mobilizon # # # ######################################################################## - -######################################################################## -# # -# postgis # -# # -######################################################################## - -postgis_enabled: true - -# Put a strong password below, generated with `pwgen -s 64 1` or in another way -postgis_connection_password: '' - -######################################################################## -# # -# /postgis # -# # -######################################################################## ``` After installation, you can use `just run-tags mobilizon-add-admin --extra-vars=password= --extra-vars=email=`