From a246db29a6011dcafe57018545e6ea447926ccf8 Mon Sep 17 00:00:00 2001 From: ZenKyma <116916092+ZenKyma@users.noreply.github.com> Date: Tue, 9 Jul 2024 05:55:29 +0200 Subject: [PATCH] Add Writefreely service (#230) * Add writefreely service * Make writefreely.md better readable * Change source of writefreely role from self-hosted to github * Reintroduce admin environment variables * Update writefreely.md --------- Co-authored-by: timofej Co-authored-by: Slavi Pantaleev --- VERSIONS.md | 1 + docs/services/writefreely.md | 83 +++++++++++++++++++++++++++++++ docs/supported-services.md | 1 + templates/group_vars_mash_servers | 68 +++++++++++++++++++++++++ templates/requirements.yml | 4 ++ templates/setup.yml | 4 ++ 6 files changed, 161 insertions(+) create mode 100644 docs/services/writefreely.md diff --git a/VERSIONS.md b/VERSIONS.md index 0fbe546..15261c2 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -89,3 +89,4 @@ * Woodpecker Ci Agent: v2.6.0 * Woodpecker Ci Server: v2.6.0 * Wordpress: 6.5.5 +* Writefreely: v0.15.0 diff --git a/docs/services/writefreely.md b/docs/services/writefreely.md new file mode 100644 index 0000000..e3dd129 --- /dev/null +++ b/docs/services/writefreely.md @@ -0,0 +1,83 @@ +# WriteFreely + +[WriteFreely](https://github.com/writefreely/writefreely) is a clean, minimalist publishing platform made for writers, federated via ActivityPub. + + +## Dependencies + +This service requires the following other services: + +- a [Traefik](traefik.md) reverse-proxy server + +WriteFreely supports using a [MariaDB](./mariadb.md) database, but this Ansible role and playbook are not configured to make use of it. + + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# writefreely # +# # +######################################################################## + +writefreely_enabled: true + +writefreely_hostname: writefreely.example.com + +writefreely_instance_name: 'A Writefreely blog' # optional +writefreely_instance_description: 'My Writefreely blog' # optional + +######################################################################## +# # +# /writefreely # +# # +######################################################################## +``` + +In the example above, we configure the service to be hosted at `writefreely.example.com`. + +You can add the following variables to add an administrator user during the first setup process: + +```yml +# You can use any username except "admin" (see below) +writefreely_env_admin_user: '' +writefreely_env_admin_password: '' +``` + +Alternatively you can add admins after [installation](./installing.md) with: + +```sh +just run-tags writefreely-add-admin --extra-vars=username= --extra-vars=password= +``` + +**Note that the username `admin` is unavailable**, as `writefreely.example.com/admin` is already taken by the admin dashboard. + +Additional user accounts can be added at any time once WriteFreely is running with: + +```sh +just run-tags writefreely-add-user --extra-vars=username= --extra-vars=password= +``` + +Their respective blogs can then be accessed on `writefreely.example.com/`. + +## Settings + +To customize your settings on first setup, you can adjust the `writefreely_env_*` default variables. +After installation, changes in environment variables will be ignored. But you can still change the settings at `writefreely.example.com/admin/settings` or by directly changing `/mash/writefreely/data/config.ini`. + +## Maintenance + +In case you need to run maintenance tasks as documented in [Admin commands](https://writefreely.org/docs/main/admin/commands), you can run the following commands on the server: + +```sh +/usr/bin/docker exec mash-writefreely /writefreely/writefreely -c /data/config.ini [command] +``` + +For example, to delete an existing user, run: + +```sh +/usr/bin/docker exec mash-writefreely /writefreely/writefreely -c /data/config.ini user delete [username] +``` diff --git a/docs/supported-services.md b/docs/supported-services.md index e3577ae..9de5def 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -87,6 +87,7 @@ | [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) | +| [Writefreely](https://writefreely.org) | A clean, minimalist publishing platform made for writers with optional federation via ActivityPub. | [Link](services/writefreely.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 b119e10..cbde2fd 100644 --- a/templates/group_vars_mash_servers +++ b/templates/group_vars_mash_servers @@ -629,6 +629,12 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized: {{ ({'name': (forgejo_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'forgejo', 'forgejo-server']} if forgejo_enabled else omit) }} # /role-specific:forgejo + # role-specific:writefreely + - |- + {{ ({'name': (writefreely_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'writefreely']} if writefreely_enabled else omit) }} + # /role-specific:writefreely + + devture_systemd_service_manager_services_list_auto: "{{ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized | reject('equalto', omit) }}" ######################################################################## @@ -2724,6 +2730,16 @@ hubsite_service_woodpecker_ci_description: "Check you CI" hubsite_service_woodpecker_ci_priority: 1000 # /role-specific:woodpecker_ci_server +# role-specific:writefreely +# writefreely +hubsite_service_writefreely_enabled: "{{ writefreely_enabled }}" +hubsite_service_writefreely_name: writefreely +hubsite_service_writefreely_url: "https://{{ writefreely_hostname }}" +hubsite_service_writefreely_logo_location: "{{ role_path }}/assets/writefreely.png" +hubsite_service_writefreely_description: "A minimalist web blog" +hubsite_service_writefreely_priority: 1000 +# /role-specific:writefreely + # role-specific:forgejo # Forgejo hubsite_service_forgejo_enabled: "{{ forgejo_enabled }}" @@ -3077,6 +3093,19 @@ mash_playbook_hubsite_service_list_auto_itemized: }} # /role-specific:woodpecker_ci_server + # role-specific:writefreely + - |- + {{ + ({ + 'name': hubsite_service_writefreely_name, + 'url': hubsite_service_writefreely_url, + 'logo_location': hubsite_service_writefreely_logo_location, + 'description': hubsite_service_writefreely_description, + 'priority': hubsite_service_writefreely_priority, + } if hubsite_service_writefreely_enabled else omit) + }} + # /role-specific:writefreely + hubsite_service_list_auto: "{{ mash_playbook_hubsite_service_list_auto_itemized | reject('equalto', omit) }}" ######################################################################## @@ -5441,6 +5470,7 @@ devture_woodpecker_ci_agent_config_agent_secret: "{{ devture_woodpecker_ci_serve # /role-specific:woodpecker_ci_agent + # role-specific:wordpress ######################################################################## # # @@ -5486,3 +5516,41 @@ wordpress_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) # # ######################################################################## # /role-specific:wordpress + + + +# role-specific:writefreely +######################################################################## +# # +# writefreely # +# # +######################################################################## + +writefreely_enabled: false + +writefreely_identifier: "{{ mash_playbook_service_identifier_prefix }}writefreely" + +writefreely_uid: "{{ mash_playbook_uid }}" +writefreely_gid: "{{ mash_playbook_gid }}" + +writefreely_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}writefreely" + +writefreely_container_additional_networks_auto: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + }} + +writefreely_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +writefreely_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" + +# role-specific:traefik +writefreely_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +writefreely_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" +# /role-specific:traefik + +######################################################################## +# # +# /writefreely # +# # +######################################################################## +# /role-specific:writefreely diff --git a/templates/requirements.yml b/templates/requirements.yml index a80f304..00e94a7 100644 --- a/templates/requirements.yml +++ b/templates/requirements.yml @@ -395,3 +395,7 @@ version: v6.5.5-2 name: wordpress activation_prefix: wordpress_ +- src: git+https://github.com/ZenKyma/ansible-role-writefreely.git + version: v0.15.0-1 + name: writefreely + activation_prefix: writefreely_ diff --git a/templates/setup.yml b/templates/setup.yml index c6421d9..e1da3f1 100644 --- a/templates/setup.yml +++ b/templates/setup.yml @@ -411,6 +411,10 @@ - role: galaxy/wordpress # /role-specific:wordpress + # role-specific:writefreely + - role: galaxy/writefreely + # /role-specific:writefreely + # role-specific:roundcube - role: galaxy/roundcube # /role-specific:roundcube