Merge pull request #69 from moan0s/mobilizon

Mobilizon & Postgis
This commit is contained in:
Slavi Pantaleev 2023-06-02 10:32:00 +03:00 committed by GitHub
commit e12e6cfd39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 178 additions and 0 deletions

View file

@ -0,0 +1,49 @@
# 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.
## 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.
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 #
# #
########################################################################
```
After installation, you can use `just run-tags mobilizon-add-admin --extra-vars=password=<password> --extra-vars=email=<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.joinmobilizon.org/use/) for more information on Mobilizon.

31
docs/services/postgis.md Normal file
View file

@ -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 #
# #
########################################################################
```

View file

@ -111,6 +111,8 @@ devture_systemd_service_manager_services_list_auto: |
+ +
([{'name': (gotosocial_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'gotosocial']}] if gotosocial_enabled else []) ([{'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': (grafana_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'grafana']}] if grafana_enabled else [])
+ +
([{'name': (hubsite_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'hubsite']}] if hubsite_enabled else []) ([{'name': (hubsite_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'hubsite']}] if hubsite_enabled else [])
@ -159,6 +161,8 @@ devture_systemd_service_manager_services_list_auto: |
+ +
([{'name': (peertube_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'peertube']}] if peertube_enabled else []) ([{'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_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 []) ([{'name': (prometheus_blackbox_exporter_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-blackbox-exporter']}] if prometheus_blackbox_exporter_enabled else [])
@ -1566,6 +1570,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'])
+
([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_hostname == 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 #
# #
########################################################################
######################################################################## ########################################################################
@ -1833,6 +1886,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 #
# #
########################################################################
######################################################################## ########################################################################

View file

@ -94,6 +94,9 @@
name: mariadb name: mariadb
- src: git+https://gitlab.com/etke.cc/roles/miniflux.git - src: git+https://gitlab.com/etke.cc/roles/miniflux.git
version: v2.0.44-0 version: v2.0.44-0
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git
version: v3.1.0-1
name: mobilizon
- src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git
version: v0.0.0-9 version: v0.0.0-9
name: mrs name: mrs

View file

@ -96,6 +96,8 @@
- role: galaxy/lago - role: galaxy/lago
- role: galaxy/mobilizon
- role: galaxy/navidrome - role: galaxy/navidrome
- role: galaxy/netbox - role: galaxy/netbox
@ -106,6 +108,8 @@
- role: galaxy/peertube - role: galaxy/peertube
- role: galaxy/postgis
- role: galaxy/prometheus - role: galaxy/prometheus
- role: galaxy/prometheus_node_exporter - role: galaxy/prometheus_node_exporter
- role: galaxy/prometheus_blackbox_exporter - role: galaxy/prometheus_blackbox_exporter