From 865746f0e3eabfa841edbffac4417a2ed2fbc427 Mon Sep 17 00:00:00 2001 From: kinduff Date: Wed, 19 Jul 2023 12:08:59 +0200 Subject: [PATCH 01/18] Adds support for n8n --- .gitignore | 6 ++++ docs/services/n8n.md | 41 ++++++++++++++++++++++++ docs/supported-services.md | 1 + group_vars/mash_servers | 65 ++++++++++++++++++++++++++++++++++++++ requirements.yml | 4 ++- setup.yml | 2 ++ 6 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 docs/services/n8n.md diff --git a/.gitignore b/.gitignore index 42df311..4595906 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,9 @@ # ignore roles pulled by ansible-galaxy /roles/galaxy/* !/roles/galaxy/.gitkeep + +# ignores vscode file +.vscode + +# ingores macos files +.DS_Store diff --git a/docs/services/n8n.md b/docs/services/n8n.md new file mode 100644 index 0000000..22fc264 --- /dev/null +++ b/docs/services/n8n.md @@ -0,0 +1,41 @@ +# n8n + +[n8n](https://n8n.io/) is a workflow automation tool for technical people. + +## Dependencies + +This service requires the following other services: + +- a [Postgres](postgres.md) database +- a [Traefik](traefik.md) reverse-proxy server + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# n8n # +# # +######################################################################## + +n8n_enabled: true + +n8n_hostname: mash.example.com +n8n_path_prefix: /n8n + +######################################################################## +# # +# /n8n # +# # +######################################################################## +``` + +In the example configuration above, we configure the service to be hosted at `https://mash.example.com/n8n`. + +You can remove the `n8n_path_prefix` variable definition, to make it default to `/`, so that the service is served at `https://mash.example.com/`. + +## Usage + +You can create additional users (admin-privileged or not) after logging in. diff --git a/docs/supported-services.md b/docs/supported-services.md index e98bddf..b4680df 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -31,6 +31,7 @@ | [Mosquitto](https://mosquitto.org/) | An open-source MQTT broker | [Link](services/mosquitto.md) | | [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](services/miniflux.md) | | [Mobilizon](https://joinmobilizon.org/en/) | An ActivityPub/Fediverse server to create and share events. | [Link](services/mobilizon.md) | +| [n8n](https://n8n.io/) | Workflow automation for technical people. | [Link](services/n8n.md) | | [Navidrome](https://www.navidrome.org/) | [Subsonic-API](http://www.subsonic.org/pages/api.jsp) compatible music server | [Link](services/navidrome.md) | [NetBox](https://docs.netbox.dev/en/stable/) | Web application that provides [IP address management (IPAM)](https://en.wikipedia.org/wiki/IP_address_management) and [data center infrastructure management (DCIM)](https://en.wikipedia.org/wiki/Data_center_management#Data_center_infrastructure_management) functionality | [Link](services/netbox.md) | | [Nextcloud](https://nextcloud.com/) | The most popular self-hosted collaboration solution for tens of millions of users at thousands of organizations across the globe. | [Link](services/nextcloud.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 90d227b..02c371e 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -155,6 +155,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (mrs_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mrs']}] if mrs_enabled else []) + + ([{'name': (n8n_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'n8n']}] if n8n_enabled else []) + + ([{'name': (navidrome_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'navidrome']}] if navidrome_enabled else []) + ([{'name': (netbox_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'netbox', 'netbox-server']}] if netbox_enabled else []) @@ -235,6 +237,8 @@ devture_postgres_systemd_services_to_stop_for_maintenance_list: | {{ ([(miniflux_identifier + '.service')] if miniflux_enabled else []) + + ([(n8n_identifier + '.service')] if n8n_enabled else []) + + ([(redmine_identifier + '.service')] if redmine_enabled else []) }} @@ -305,6 +309,12 @@ devture_postgres_managed_databases_auto: | 'password': redmine_database_password, }] if redmine_enabled else []) + + ([{ + 'name': n8n_database_name, + 'username': n8n_database_username, + 'password': n8n_database_password, + }] if n8n_enabled else []) + + ([{ 'name': netbox_database_name, 'username': netbox_database_username, @@ -1308,6 +1318,14 @@ hubsite_service_miniflux_logo_location: "{{ role_path }}/assets/miniflux.png" hubsite_service_miniflux_description: "An opinionated feed reader" hubsite_service_miniflux_priority: 1000 +# n8n +hubsite_service_n8n_enabled: "{{ n8n_enabled }}" +hubsite_service_n8n_name: n8n +hubsite_service_n8n_url: "https://{{ n8n_hostname }}{{ n8n_path_prefix }}" +hubsite_service_n8n_logo_location: "{{ role_path }}/assets/n8n.png" +hubsite_service_n8n_description: "Workflow automation for technical people." +hubsite_service_n8n_priority: 1000 + # Nextcloud hubsite_service_nextcloud_enabled: "{{ nextcloud_enabled }}" hubsite_service_nextcloud_name: Nextcloud @@ -1401,6 +1419,8 @@ hubsite_service_list_auto: | + ([{'name': hubsite_service_miniflux_name, 'url': hubsite_service_miniflux_url, 'logo_location': hubsite_service_miniflux_logo_location, 'description': hubsite_service_miniflux_description, 'priority': hubsite_service_miniflux_priority}] if hubsite_service_miniflux_enabled else []) + + ([{'name': hubsite_service_n8n_name, 'url': hubsite_service_n8n_url, 'logo_location': hubsite_service_n8n_logo_location, 'description': hubsite_service_n8n_description, 'priority': hubsite_service_n8n_priority}] if hubsite_service_n8n_enabled else []) + + ([{'name': hubsite_service_nextcloud_name, 'url': hubsite_service_nextcloud_url, 'logo_location': hubsite_service_nextcloud_logo_location, 'description': hubsite_service_nextcloud_description, 'priority': hubsite_service_nextcloud_priority}] if hubsite_service_nextcloud_enabled else []) + ([{'name': hubsite_service_owncast_name, 'url': hubsite_service_owncast_url, 'logo_location': hubsite_service_owncast_logo_location, 'description': hubsite_service_owncast_description, 'priority': hubsite_service_owncast_priority}] if hubsite_service_owncast_enabled else []) @@ -1853,6 +1873,51 @@ mrs_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_ +######################################################################## +# # +# n8n # +# # +######################################################################## + +n8n_enabled: false + +n8n_identifier: "{{ mash_playbook_service_identifier_prefix }}n8n" + +n8n_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}n8n" + +n8n_uid: "{{ mash_playbook_uid }}" +n8n_gid: "{{ mash_playbook_gid }}" + +n8n_systemd_required_services_list: | + {{ + (['docker.service']) + + + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled and n8n_database_hostname == devture_postgres_identifier else []) + }} + +n8n_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([devture_postgres_container_network] if devture_postgres_enabled and n8n_database_hostname == devture_postgres_identifier and n8n_container_network != devture_postgres_container_network else []) + }} + +n8n_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +n8n_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +n8n_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +n8n_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +n8n_database_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}" +n8n_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'n8n.db', rounds=655555) | to_uuid }}" + +######################################################################## +# # +# /n8n # +# # +######################################################################## + + + ######################################################################## # # # navidrome # diff --git a/requirements.yml b/requirements.yml index fc5273d..3b713e1 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,5 +1,4 @@ --- - - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-adguard-home.git version: v0.107.26-1 name: adguard_home @@ -103,6 +102,9 @@ name: mariadb - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.45-0 +- src: git+https://github.com/kinduff/ansible-docker-n8n.git + version: v1.4.1 + name: n8n - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git version: v3.1.0-2 name: mobilizon diff --git a/setup.yml b/setup.yml index aaa6f95..b1d8314 100644 --- a/setup.yml +++ b/setup.yml @@ -90,6 +90,8 @@ - role: galaxy/mrs + - role: galaxy/n8n + - role: galaxy/healthchecks - role: galaxy/infisical From b67efdc37b8e0d6fb175e58dcdb19c513f6fbf2b Mon Sep 17 00:00:00 2001 From: kinduff Date: Wed, 19 Jul 2023 16:00:51 +0200 Subject: [PATCH 02/18] Updates role to v1.4.2 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 3b713e1..1462ad5 100644 --- a/requirements.yml +++ b/requirements.yml @@ -103,7 +103,7 @@ - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.45-0 - src: git+https://github.com/kinduff/ansible-docker-n8n.git - version: v1.4.1 + version: v1.4.2 name: n8n - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git version: v3.1.0-2 From e7a01ab58763be90737f31bbcfc520551c3fb9d4 Mon Sep 17 00:00:00 2001 From: kinduff Date: Wed, 19 Jul 2023 16:03:47 +0200 Subject: [PATCH 03/18] Updates n8n uid and gid with note --- group_vars/mash_servers | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 02c371e..722d9d5 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -1885,8 +1885,10 @@ n8n_identifier: "{{ mash_playbook_service_identifier_prefix }}n8n" n8n_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}n8n" -n8n_uid: "{{ mash_playbook_uid }}" -n8n_gid: "{{ mash_playbook_gid }}" +# Please see the note attached to this comment on why we can't use mash's playbook uid and gid +# https://github.com/kinduff/ansible-docker-n8n/blob/v1.4.2/defaults/main.yml +n8n_uid: "1000" +n8n_gid: "1000" n8n_systemd_required_services_list: | {{ From 4173e56a79124952539efaf7f39f1a4ef8bec2f4 Mon Sep 17 00:00:00 2001 From: kinduff Date: Thu, 20 Jul 2023 22:29:50 +0200 Subject: [PATCH 04/18] Adds support for linkding --- docs/services/linkding.md | 53 ++++++++++++++++++++++++++++++++ docs/supported-services.md | 1 + group_vars/mash_servers | 62 ++++++++++++++++++++++++++++++++++++++ requirements.yml | 3 ++ setup.yml | 2 ++ 5 files changed, 121 insertions(+) create mode 100644 docs/services/linkding.md diff --git a/docs/services/linkding.md b/docs/services/linkding.md new file mode 100644 index 0000000..1673e21 --- /dev/null +++ b/docs/services/linkding.md @@ -0,0 +1,53 @@ +# Linkding + +[Linkding](https://github.com/sissbruecker/linkding) bookmark manager that is designed be to be minimal and fast. + +## Dependencies + +This service requires the following other services: + +- a [Postgres](postgres.md) database +- a [Traefik](traefik.md) reverse-proxy server + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# linkding # +# # +######################################################################## + +linkding_enabled: true + +linkding_hostname: mash.example.com +linkding_path_prefix: /linkding +linkding_superuser_username: change me +linkding_superuser_password: change me + +######################################################################## +# # +# /linkding # +# # +######################################################################## +``` + +In the example configuration above, we configure the service to be hosted at `https://mash.example.com/linkding`. + +You can remove the `linkding_path_prefix` variable definition, so that the service is served at `https://mash.example.com/`. + +## Usage + +### Superuser + +Please note the use of [`linkding_superuser_username`](https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_superuser_name) and [`linkding_superuser_password`](https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_superuser_password) variables. These are not mandatory and are meant to be set the first time you run this role. + +### Database + +The role defaults to SQlite, but you can opt to use PostgreSQL by adding the following: + +```yaml +linkding_database_engine: postgres +``` diff --git a/docs/supported-services.md b/docs/supported-services.md index 94d9421..611fe4e 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -26,6 +26,7 @@ | [Jitsi](https://jitsi.org/) | A fully encrypted, 100% Open Source video conferencing solution | [Link](services/jitsi.md) | | [Keycloak](https://www.keycloak.org/) | An open source identity and access management solution. | [Link](services/keycloak.md) | | [Lago](https://www.getlago.com/) | Open-source metering and usage-based billing | [Link](services/lago.md) | +| [linkding](https://github.com/sissbruecker/linkding/) | Bookmark manager designed be to be minimal and fast. | [Link](services/linkding.md) | | [MariaDB](https://mariadb.org/) | A powerful, open source object-relational database system | [Link](services/mariadb.md) | | [Matrix Rooms Search API](https://gitlab.com/etke.cc/mrs/api) | A fully-featured, standalone, matrix rooms search service. | [Link](services/mrs.md) | | [MongoDB](https://www.mongodb.com/) | A source-available cross-platform document-oriented (NoSQL) database program. | [Link](services/mongodb.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index d771102..83475e7 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -149,6 +149,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (lago_identifier + '-pdf.service'), 'priority': 1900, 'groups': ['mash', 'lago', 'lago-pdf']}] if lago_enabled else []) + + ([{'name': (linkding_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'linkding']}] if linkding_enabled else []) + + ([{'name': (miniflux_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'miniflux']}] if miniflux_enabled else []) + ([{'name': (mongodb_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'mongodb']}] if mongodb_enabled else []) @@ -241,6 +243,8 @@ devture_postgres_systemd_services_to_stop_for_maintenance_list: | + ([(n8n_identifier + '.service')] if n8n_enabled else []) + + ([(linkding_identifier + '.service')] if linkding_enabled and linkding_database_engine == 'postgres' else []) + + ([(redmine_identifier + '.service')] if redmine_enabled else []) }} @@ -305,6 +309,12 @@ devture_postgres_managed_databases_auto: | 'password': lago_database_password, }] if lago_enabled and lago_database_hostname == devture_postgres_identifier else []) + + ([{ + 'name': linkding_database_name, + 'username': linkding_database_username, + 'password': linkding_database_password, + }] if linkding_enabled and linkding_database_engine == 'postgres' else []) + + ([{ 'name': miniflux_database_name, 'username': miniflux_database_username, @@ -1334,6 +1344,14 @@ hubsite_service_n8n_logo_location: "{{ role_path }}/assets/n8n.png" hubsite_service_n8n_description: "Workflow automation for technical people." hubsite_service_n8n_priority: 1000 +# Linkding +hubsite_service_linkding_enabled: "{{ linkding_enabled }}" +hubsite_service_linkding_name: Linkding +hubsite_service_linkding_url: "https://{{ linkding_hostname }}{{ linkding_path_prefix }}" +hubsite_service_linkding_logo_location: "{{ role_path }}/assets/linkding.png" +hubsite_service_linkding_description: "Bookmark manager that is designed be to be minimal and fast." +hubsite_service_linkding_priority: 1000 + # Nextcloud hubsite_service_nextcloud_enabled: "{{ nextcloud_enabled }}" hubsite_service_nextcloud_name: Nextcloud @@ -1431,6 +1449,8 @@ hubsite_service_list_auto: | + ([{'name': hubsite_service_nextcloud_name, 'url': hubsite_service_nextcloud_url, 'logo_location': hubsite_service_nextcloud_logo_location, 'description': hubsite_service_nextcloud_description, 'priority': hubsite_service_nextcloud_priority}] if hubsite_service_nextcloud_enabled else []) + + ([{'name': hubsite_service_linkding_name, 'url': hubsite_service_linkding_url, 'logo_location': hubsite_service_linkding_logo_location, 'description': hubsite_service_linkding_description, 'priority': hubsite_service_linkding_priority}] if hubsite_service_linkding_enabled else []) + + ([{'name': hubsite_service_owncast_name, 'url': hubsite_service_owncast_url, 'logo_location': hubsite_service_owncast_logo_location, 'description': hubsite_service_owncast_description, 'priority': hubsite_service_owncast_priority}] if hubsite_service_owncast_enabled else []) + ([{'name': hubsite_service_peertube_name, 'url': hubsite_service_peertube_url, 'logo_location': hubsite_service_peertube_logo_location, 'description': hubsite_service_peertube_description, 'priority': hubsite_service_peertube_priority}] if hubsite_service_peertube_enabled else []) @@ -1749,6 +1769,48 @@ lago_api_environment_variable_encryption_key_derivation_salt: "{{ '%s' | format( # # ######################################################################## +######################################################################## +# # +# linkding # +# # +######################################################################## + +linkding_enabled: false + +linkding_identifier: "{{ mash_playbook_service_identifier_prefix }}linkding" + +linkding_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}linkding" + +linkding_uid: "{{ mash_playbook_uid }}" +linkding_gid: "{{ mash_playbook_gid }}" + +linkding_systemd_required_services_list: | + {{ + (['docker.service']) + + + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled and linkding_database_hostname == devture_postgres_identifier else []) + }} + +linkding_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + + + ([devture_postgres_container_network] if devture_postgres_enabled and linkding_database_hostname == devture_postgres_identifier and linkding_container_network != devture_postgres_container_network else []) + }} + +linkding_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +linkding_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +linkding_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +linkding_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +linkding_database_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}" +linkding_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'linkding.db', rounds=655555) | to_uuid }}" + +######################################################################## +# # +# /linkding # +# # +######################################################################## ######################################################################## diff --git a/requirements.yml b/requirements.yml index fd26b99..5bc8e1b 100644 --- a/requirements.yml +++ b/requirements.yml @@ -100,6 +100,9 @@ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-lago.git version: v0.40.0-0 name: lago +- src: git+https://github.com/kinduff/ansible-docker-linkding.git + version: v1.9.0 + name: linkding - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mariadb.git version: v10.11.4-0 name: mariadb diff --git a/setup.yml b/setup.yml index b31a93a..7011d84 100644 --- a/setup.yml +++ b/setup.yml @@ -108,6 +108,8 @@ - role: galaxy/lago + - role: galaxy/linkding + - role: galaxy/mobilizon - role: galaxy/mosquitto From bf8897983950d76f8bf4cd001bf4dd9338a84c2d Mon Sep 17 00:00:00 2001 From: Alejandro AR Date: Fri, 21 Jul 2023 06:01:20 -0400 Subject: [PATCH 05/18] Update docs/supported-services.md Co-authored-by: Slavi Pantaleev --- docs/supported-services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/supported-services.md b/docs/supported-services.md index 611fe4e..1167eac 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -26,7 +26,7 @@ | [Jitsi](https://jitsi.org/) | A fully encrypted, 100% Open Source video conferencing solution | [Link](services/jitsi.md) | | [Keycloak](https://www.keycloak.org/) | An open source identity and access management solution. | [Link](services/keycloak.md) | | [Lago](https://www.getlago.com/) | Open-source metering and usage-based billing | [Link](services/lago.md) | -| [linkding](https://github.com/sissbruecker/linkding/) | Bookmark manager designed be to be minimal and fast. | [Link](services/linkding.md) | +| [linkding](https://github.com/sissbruecker/linkding/) | Bookmark manager designed to be minimal and fast. | [Link](services/linkding.md) | | [MariaDB](https://mariadb.org/) | A powerful, open source object-relational database system | [Link](services/mariadb.md) | | [Matrix Rooms Search API](https://gitlab.com/etke.cc/mrs/api) | A fully-featured, standalone, matrix rooms search service. | [Link](services/mrs.md) | | [MongoDB](https://www.mongodb.com/) | A source-available cross-platform document-oriented (NoSQL) database program. | [Link](services/mongodb.md) | From 3c9a69dfe45399ab30b56296136965b3f9b7e19c Mon Sep 17 00:00:00 2001 From: Alejandro AR Date: Fri, 21 Jul 2023 13:43:26 +0200 Subject: [PATCH 06/18] Apply suggestions from code review Co-authored-by: Slavi Pantaleev --- docs/services/linkding.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/services/linkding.md b/docs/services/linkding.md index 1673e21..daa4c1f 100644 --- a/docs/services/linkding.md +++ b/docs/services/linkding.md @@ -6,7 +6,7 @@ This service requires the following other services: -- a [Postgres](postgres.md) database +- a [Postgres](postgres.md) database, but [SQLite](https://www.sqlite.org/) is also a possibility (see `linkding_database_engine` below) - a [Traefik](traefik.md) reverse-proxy server ## Configuration @@ -24,6 +24,12 @@ linkding_enabled: true linkding_hostname: mash.example.com linkding_path_prefix: /linkding + +# We configure Linkding to use Postgres by default. See docs/services/postgres.md. +# To use an external Postgres server, you need to tweak additional `linkding_database_*` variables. +# Feel free to remove the line below to make Linkding use SQLite. +linkding_database_engine: postgres + linkding_superuser_username: change me linkding_superuser_password: change me From 6ea3934d0e0c695efa3ccf59d3b0ea6c4b5bf758 Mon Sep 17 00:00:00 2001 From: kinduff Date: Fri, 21 Jul 2023 14:14:49 +0200 Subject: [PATCH 07/18] Updates documentation --- docs/services/linkding.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/services/linkding.md b/docs/services/linkding.md index daa4c1f..9309c45 100644 --- a/docs/services/linkding.md +++ b/docs/services/linkding.md @@ -32,7 +32,6 @@ linkding_database_engine: postgres linkding_superuser_username: change me linkding_superuser_password: change me - ######################################################################## # # # /linkding # @@ -44,16 +43,10 @@ In the example configuration above, we configure the service to be hosted at `ht You can remove the `linkding_path_prefix` variable definition, so that the service is served at `https://mash.example.com/`. -## Usage - ### Superuser Please note the use of [`linkding_superuser_username`](https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_superuser_name) and [`linkding_superuser_password`](https://github.com/sissbruecker/linkding/blob/master/docs/Options.md#ld_superuser_password) variables. These are not mandatory and are meant to be set the first time you run this role. -### Database +## Usage -The role defaults to SQlite, but you can opt to use PostgreSQL by adding the following: - -```yaml -linkding_database_engine: postgres -``` +After installation, you can log in with your superuser login (`linkding_superuser_username`) and password (`linkding_superuser_password`). From 8724dd4a176ea94adc4d83091e74b63d6e3719f9 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 22 Jul 2023 08:54:11 +0300 Subject: [PATCH 08/18] Upgrade Miniflux (v2.0.45-0 -> v2.0.46-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 5bc8e1b..14adeef 100644 --- a/requirements.yml +++ b/requirements.yml @@ -107,7 +107,7 @@ version: v10.11.4-0 name: mariadb - src: git+https://gitlab.com/etke.cc/roles/miniflux.git - version: v2.0.45-0 + version: v2.0.46-0 - src: git+https://github.com/kinduff/ansible-docker-n8n.git version: v1.4.2 name: n8n From f6e7914d36e8aa704ec59ed2af707a392a0177bb Mon Sep 17 00:00:00 2001 From: Aine Date: Sat, 22 Jul 2023 11:23:39 +0300 Subject: [PATCH 09/18] sort requirements.yml --- requirements.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.yml b/requirements.yml index 14adeef..90f4906 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,4 +1,5 @@ --- + - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-adguard-home.git version: v0.107.26-1 name: adguard_home @@ -108,9 +109,6 @@ name: mariadb - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.46-0 -- src: git+https://github.com/kinduff/ansible-docker-n8n.git - version: v1.4.2 - name: n8n - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git version: v3.1.0-2 name: mobilizon @@ -123,6 +121,9 @@ - src: git+https://gitlab.com/etke.cc/mrs/ansible-role-mrs.git version: v0.0.0-9 name: mrs +- src: git+https://github.com/kinduff/ansible-docker-n8n.git + version: v1.4.2 + name: n8n - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-navidrome.git version: v0.49.3-2 name: navidrome From 50a844bb8a61b40f1467776c380b7c234b842f04 Mon Sep 17 00:00:00 2001 From: Aine Date: Sat, 22 Jul 2023 11:27:49 +0300 Subject: [PATCH 10/18] add OPML generator script --- bin/feeds.py | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++ justfile | 7 ++- releases.opml | 43 ++++++++++++++ 3 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 bin/feeds.py create mode 100644 releases.opml diff --git a/bin/feeds.py b/bin/feeds.py new file mode 100644 index 0000000..2774d07 --- /dev/null +++ b/bin/feeds.py @@ -0,0 +1,157 @@ +import os +import sys +import argparse +from urllib.parse import urlparse +import xml.etree.ElementTree as ET + +parser = argparse.ArgumentParser(description='Extracts release feeds from roles') +parser.add_argument('root_dir', help='Root dir which to traverse recursively for defaults/main.yml roles files') +parser.add_argument('action', help='Pass "check" to list roles with missing feeds or "dump" to dump an OPML file') +args = parser.parse_args() +if args.action not in ['check', 'dump', 'hookshot']: + sys.exit('Error: possible arguments are "check" or "dump"') + +excluded_paths = [ + # appservice-kakaotalk defines a Project URL, but that Gitea repository does not have an Atom/RSS feed. + # It doesn't have any tags anyway. + './upstream/roles/custom/matrix-bridge-appservice-kakaotalk/defaults', +] +project_source_url_str = '# Project source code URL:' + +def get_roles_files_from_dir(root_dir): + file_paths = [] + for dir_name, sub_dur_list, file_list in os.walk(root_dir): + for file_name in file_list: + if not dir_name.endswith('defaults') or file_name != 'main.yml': + continue + if dir_name in excluded_paths: + continue + file_paths.append(os.path.join(dir_name, file_name)) + return file_paths + +def get_git_repos_from_files(file_paths, break_on_missing_repos=False): + git_repos = {} + missing_repos = [] + + for file in file_paths: + file_lines = open(file, 'r').readlines() + found_project_repo = False + for line in file_lines: + project_repo_val = '' + if project_source_url_str in line: + # extract the value from a line like this: + # Project source code URL: https://github.com/mautrix/signal + project_repo_val = line.split(project_source_url_str)[1].strip() + if not validate_url(project_repo_val): + print('Invalid url for line ', line) + break + if project_repo_val != '': + if file not in git_repos: + git_repos[file] = [] + + git_repos[file].append(project_repo_val) + found_project_repo = True + + if not found_project_repo: + missing_repos.append(file) + + if break_on_missing_repos and len(missing_repos) > 0: + print('Missing `{0}` comment for:\n{1}'.format(project_source_url_str, '\n'.join(missing_repos))) + + return git_repos + +def validate_url(text): + if text == '': + return False + try: + result = urlparse(text) + return all([result.scheme, result.netloc]) + except: + return False + + +def format_feeds_from_git_repos(git_repos): + feeds = { + 'ansible': { + 'text': 'ansible', + 'title': 'ansible', + 'type': 'rss', + 'htmlUrl': 'https://pypi.org/project/ansible/#history', + 'xmlUrl': 'https://pypi.org/rss/project/ansible/releases.xml' + }, + 'ansible-core': { + 'text': 'ansible-core', + 'title': 'ansible-core', + 'type': 'rss', + 'htmlUrl': 'https://pypi.org/project/ansible-core/#history', + 'xmlUrl': 'https://pypi.org/rss/project/ansible-core/releases.xml' + } + } + for role, git_repos in git_repos.items(): + for idx, git_repo in enumerate(git_repos): + if 'github' in git_repo: + atomFilePath = git_repo.replace('.git', '') + '/releases.atom' + elif ('gitlab' in git_repo or 'mau.dev' in git_repo): + atomFilePath = git_repo.replace('.git', '') + '/-/tags?format=atom' + elif 'git.zx2c4.com' in git_repo: + atomFilePath = git_repo + '/atom/' + else: + print('Unrecognized git repository: %s' % git_repo) + continue + + role_name = role.split('/')[4] + if role_name == 'defaults': + role_name = role.split('/')[3] + role_name = role_name.removeprefix('matrix-bot-').removeprefix('matrix-bridge-').removeprefix('matrix-client-').removeprefix('matrix-') + if idx > 0: + # there is more than 1 project source code for this role + role_name += '-' + str(idx+1) + + feeds[role_name] = { + 'text': role_name, + 'title': role_name, + 'type': 'rss', + 'htmlUrl': git_repo, + 'xmlUrl': atomFilePath + } + + feeds = {key: val for key, val in sorted(feeds.items(), key = lambda item: item[0])} + return feeds + +def dump_opml_file_from_feeds(feeds): + tree = ET.ElementTree('tree') + + opml = ET.Element('opml', {'version': '1.0'}) + head = ET.SubElement(opml, 'head') + + title = ET.SubElement(head, 'title') + title.text = 'Release feeds for roles' + + body = ET.SubElement(opml, 'body') + for role, feed_dict in feeds.items(): + outline = ET.SubElement(body, 'outline', feed_dict) + + ET.indent(opml) + tree._setroot(opml) + file_name = 'releases.opml' + tree.write(file_name, encoding = 'UTF-8', xml_declaration = True) + print('Generated %s' % file_name) + +def dump_hookshot_commands(feeds): + file_name = 'releases.hookshot.txt' + f = open(file_name, 'w') + for role, feed_dict in feeds.items(): + f.write('!hookshot feed %s %s\n' % (feed_dict['xmlUrl'], role)) + f.close() + print('Generated %s' % file_name) + +if __name__ == '__main__': + file_paths = get_roles_files_from_dir(root_dir=args.root_dir) + break_on_missing = args.action == 'check' + git_repos = get_git_repos_from_files(file_paths=file_paths, break_on_missing_repos=break_on_missing) + feeds = format_feeds_from_git_repos(git_repos) + + if args.action == 'dump': + dump_opml_file_from_feeds(feeds) + if args.action == 'hookshot': + dump_hookshot_commands(feeds) diff --git a/justfile b/justfile index 91c8f54..d1139fd 100644 --- a/justfile +++ b/justfile @@ -13,13 +13,18 @@ roles: fi # Updates requirements.yml if there are any new tags available. Requires agru -update: +update: && opml @agru -u # Runs ansible-lint against all roles in the playbook lint: ansible-lint +# dumps an OPML file with extracted git feeds for roles +opml: + @echo "generating opml..." + @python bin/feeds.py . dump + # Runs the playbook with --tags=install-all,start and optional arguments install-all *extra_args: (run-tags "install-all,start" extra_args) diff --git a/releases.opml b/releases.opml new file mode 100644 index 0000000..c178573 --- /dev/null +++ b/releases.opml @@ -0,0 +1,43 @@ + + + + Release feeds for roles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b16b31e8a01294be4934d66d1594a42173ab1d14 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 22 Jul 2023 14:55:59 +0300 Subject: [PATCH 11/18] Upgrade Gitea (v1.20.0-0 -> v1.20.1-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 90f4906..e99fc5c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -70,7 +70,7 @@ version: 6.1.0 name: geerlingguy.docker - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-gitea.git - version: v1.20.0-0 + version: v1.20.1-0 name: gitea - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-gotosocial.git version: v0.9.0-3 From e20c19e81040619054871edf8c066edc2aa8d3d6 Mon Sep 17 00:00:00 2001 From: Borislav Pantaleev Date: Sat, 22 Jul 2023 18:12:59 +0300 Subject: [PATCH 12/18] Update grafana.md --- docs/services/grafana.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/grafana.md b/docs/services/grafana.md index 78bfe34..54647b3 100644 --- a/docs/services/grafana.md +++ b/docs/services/grafana.md @@ -116,7 +116,7 @@ Make sure the user you want to login as has an email address in authentik, other ## Usage -After installation, you should be able to access your new Gitea instance at the configured URL (see above). +After installation, you should be able to access your new Grafana instance at the configured URL (see above). Going there, you'll be taken to the initial setup wizard, which will let you assign some paswords and other configuration. From 64f736f297390d3bb5d2661115c675ab8e0d296d Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 23 Jul 2023 11:23:51 +0300 Subject: [PATCH 13/18] Upgrade appsmith (v1.9.27-0 -> v1.9.29-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index e99fc5c..6d8f3f4 100644 --- a/requirements.yml +++ b/requirements.yml @@ -4,7 +4,7 @@ version: v0.107.26-1 name: adguard_home - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-appsmith.git - version: v1.9.27-0 + version: v1.9.29-0 name: appsmith - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-authentik.git version: v2023.6.1-0 From cdbc8bd41ffb18a99faa0418127d317ef063e763 Mon Sep 17 00:00:00 2001 From: Aine Date: Sun, 23 Jul 2023 21:17:18 +0300 Subject: [PATCH 14/18] focalboard v7.10.4 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 6d8f3f4..acbbe6a 100644 --- a/requirements.yml +++ b/requirements.yml @@ -61,7 +61,7 @@ version: v0.7.30-0 name: firezone - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-focalboard.git - version: v7.9.3-2 + version: v7.10.4-0 name: focalboard - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-funkwhale.git version: v1.3.0-rc6-0 From 3709efcd7489ba042e5b5f2b632a14af2941f01f Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 24 Jul 2023 08:43:36 +0300 Subject: [PATCH 15/18] Upgrade prometheus-postgres-exporter (v0.13.1-0 -> v0.13.2-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index acbbe6a..5b4216c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -150,7 +150,7 @@ - src: git+https://gitlab.com/etke.cc/roles/prometheus_node_exporter.git version: v1.6.1-0 - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git - version: v0.13.1-0 + version: v0.13.2-0 name: prometheus_postgres_exporter - src: git+https://gitlab.com/etke.cc/roles/radicale.git version: v3.1.8.3-0 From e37401d0de4e9f01c7c600dfe3c14b28de96fd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Mon, 24 Jul 2023 18:37:49 +0200 Subject: [PATCH 16/18] Update mobilizon role --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 5b4216c..6088c8e 100644 --- a/requirements.yml +++ b/requirements.yml @@ -110,7 +110,7 @@ - src: git+https://gitlab.com/etke.cc/roles/miniflux.git version: v2.0.46-0 - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mobilizon.git - version: v3.1.0-2 + version: v3.1.3-0 name: mobilizon - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-mongodb.git version: v6.0.6-0 From e9774882eca250ccdaa00dd4882ec367573379c9 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 25 Jul 2023 17:27:53 +0300 Subject: [PATCH 17/18] Upgrade Traefik (v2.10.3-0 -> v2.10.4-0) --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 6088c8e..f78506b 100644 --- a/requirements.yml +++ b/requirements.yml @@ -41,7 +41,7 @@ - src: git+https://github.com/devture/com.devture.ansible.role.timesync.git version: v1.0.0-0 - src: git+https://github.com/devture/com.devture.ansible.role.traefik.git - version: v2.10.3-0 + version: v2.10.4-0 - src: git+https://github.com/devture/com.devture.ansible.role.woodpecker_ci_agent.git version: v0.15.8-0 - src: git+https://github.com/devture/com.devture.ansible.role.woodpecker_ci_server.git From 9be5f7a281f7211fa5e74a25f86e2e51601d2cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Wed, 26 Jul 2023 13:00:47 +0200 Subject: [PATCH 18/18] =?UTF-8?q?Bump=20GTS=20version=20to=20Shrimple=20Sl?= =?UTF-8?q?oth=20=F0=9F=A6=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index f78506b..ae97b63 100644 --- a/requirements.yml +++ b/requirements.yml @@ -73,7 +73,7 @@ version: v1.20.1-0 name: gitea - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-gotosocial.git - version: v0.9.0-3 + version: v0.10.0-0 name: gotosocial - src: git+https://gitlab.com/etke.cc/roles/grafana.git version: v10.0.2-1