13 Commits

Author SHA1 Message Date
Slavi Pantaleev
50813c600d Only run Debian Signed-By migration if Docker installation is managed by the playbook 2024-03-26 17:04:04 +02:00
Slavi Pantaleev
17b109d9f6 Fix year number in CHANGELOG section
Ref: 0e05a332db (commitcomment-140240527)
2024-03-26 13:26:50 +02:00
Slavi Pantaleev
42c036c920 Fix typo in changelog entry 2024-03-26 12:50:05 +02:00
Slavi Pantaleev
23dda314ef Add one more link to changelog entry 2024-03-26 12:45:22 +02:00
Slavi Pantaleev
661f8c7121 Improve wording of changelog entry 2024-03-26 12:43:06 +02:00
Slavi Pantaleev
0e05a332db Announce (Redis -> KeyDB) switch 2024-03-26 12:37:16 +02:00
Slavi Pantaleev
d0fd25dcda Add some () for better readability 2024-03-26 12:37:02 +02:00
Slavi Pantaleev
9a8c9850aa Pass and remap matrix_architecture to KeyDB role
Only `amd64` and `arm64` actually work.

The KeyDB role includes a validation task and will complain about
unsupported architectures (like `arm32`).

`arm32` users can stick to Redis for now (`keydb_enabled: false` + `redis_enabled: true`) until:
- the KeyDB role starts supporting self-building.. although building such large
  projects on weak CPUs is probably impractical
- a prebuilt arm32 image is made available by other means
2024-03-26 12:15:46 +02:00
Slavi Pantaleev
a34ab87782 Upgrade KeyDB (v6.3.4-0 -> v6.3.4-1) 2024-03-26 12:15:12 +02:00
Slavi Pantaleev
b5ec8f83b1 Revert "become -> ansible_become"
This reverts commit 9c01d875f3.

This is very confusing and messy.. but it's documented.
`ansible_become_*` variables actually take priority and override all `become_*`
variables set at the task level.

As such, using `ansible_become=true ansible_become_user=root` in
`inventory/hosts` causes issues because tasks that specify
`become: OTHER_USER` will be forced to run as `root` due to
`ansible_become_user`.
2024-03-26 11:59:13 +02:00
Slavi Pantaleev
ffd5829476 Merge pull request #3245 from spantaleev/renovate/redis-7.x
chore(deps): update dependency redis to v7.2.4-0
2024-03-26 11:37:43 +02:00
renovate[bot]
859f4ca26b chore(deps): update dependency redis to v7.2.4-0 2024-03-26 09:25:53 +00:00
Aine
0b4309c8ef Add keydb (#3244)
* add keydb as redis replacement

* sort requirements
2024-03-26 11:25:18 +02:00
6 changed files with 80 additions and 10 deletions

View File

@@ -1,3 +1,29 @@
# 2024-03-26
## (Backward Compatibility Break) The playbook now defaults to KeyDB, instead of Redis
**TLDR**: if the playbook used installed Redis as a dependency for you before, it will now replace it with [KeyDB](https://docs.keydb.dev/) (a drop-in alternative) due to [Redis having changed its license](https://redis.com/blog/redis-adopts-dual-source-available-licensing/).
Thanks to [Aine](https://gitlab.com/etke.cc) of [etke.cc](https://etke.cc/), the playbook now uses [KeyDB](https://docs.keydb.dev/) (a drop-in alternative for Redis), instead of [Redis](https://redis.io/).
The playbook used to install Redis (and now installs KeyDB in its place) if services have a need for it ([enabling worker support for Synapse](docs/configuring-playbook-synapse.md#load-balancing-with-workers), [enabling Hookshot encryption](docs/configuring-playbook-bridge-hookshot.md#end-to-bridge-encryption), etc.) or if you explicitly enabled the service (`redis_enabled: true` or `keydb_enabled: true`).
This change is provoked by the fact that [Redis is now "source available"](https://redis.com/blog/redis-adopts-dual-source-available-licensing/). According to the Limitations of [the new license](https://redis.com/legal/rsalv2-agreement/) (as best as we understand them, given that we're not lawyers), using Redis in the playbook (even in a commercial FOSS service like [etke.cc](https://etke.cc/)) does not violate the new Redis license. That said, we'd rather neither risk it, nor endorse shady licenses and products that pretend to be free-software. Another high-quality alternative to Redis seems to be [Dragonfly](https://www.dragonflydb.io/), but the [Dragonfly license](https://github.com/dragonflydb/dragonfly?tab=License-1-ov-file#readme) is no better than Redis's.
Next time your run the playbook (via the `setup-all` tag), **Redis will be automatically uninstalled and replaced with KeyDB**. Some Synapse downtime may occur while the switch happens.
Users on `arm32` should be aware that there's **neither a prebuilt `arm32` container image for KeyDB**, nor the KeyDB role supports self-building yet. Users on this architecture likely don't run Synapse with workers, etc., so they're likely in no need of KeyDB (or Redis). If Redis is necessary in an `arm32` deployment, disabling KeyDB and making the playbook fall back to Redis is possible (see below).
**The playbook still supports Redis** and you can keep using Redis (for now) if you'd like, by adding this additional configuration to your `vars.yml` file:
```yml
# Explicitly disable KeyDB, which will auto-enable Redis
# if the playbook requires it as a dependency for its operation.
keydb_enabled: false
```
# 2024-03-24
## Initial work on IPv6 support

View File

@@ -2,8 +2,8 @@
# If you'd rather use a local IP here, make sure to set up `matrix_coturn_turn_external_ip_address`.
#
# To connect using a non-root user (and elevate to root with sudo later),
# replace `ansible_ssh_user=root` with something like this: `ansible_ssh_user=username ansible_become=true ansible_become_user=root`.
# If sudo requires a password, either add `ansible_become_password=PASSWORD_HERE` to the host line
# replace `ansible_ssh_user=root` with something like this: `ansible_ssh_user=username become=true become_user=root`.
# If sudo requires a password, either add `become_password=PASSWORD_HERE` to the host line
# or tell Ansible to ask you for the password interactively by adding a `--ask-become-pass` (`-K`) flag to all `ansible-playbook` (or `just`) commands.
#
# For improved Ansible performance, SSH pipelining is enabled by default in `ansible.cfg`.

View File

@@ -402,6 +402,8 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': (redis_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'redis']}] if redis_enabled else [])
+
([{'name': (keydb_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'keydb']}] if keydb_enabled else [])
+
([{'name': 'matrix-pantalaimon.service', 'priority': 4000, 'groups': ['matrix', 'pantalaimon']}] if matrix_pantalaimon_enabled else [])
+
([{'name': 'matrix-registration.service', 'priority': 4000, 'groups': ['matrix', 'registration', 'matrix-registration']}] if matrix_registration_enabled else [])
@@ -1862,12 +1864,14 @@ matrix_hookshot_systemd_wanted_services_list: |
matrix_addons_homeserver_systemd_services_list
+
([(redis_identifier + '.service')] if redis_enabled and matrix_hookshot_queue_host == redis_identifier else [])
+
([(keydb_identifier + '.service')] if keydb_enabled and matrix_hookshot_queue_host == keydb_identifier else [])
}}
# Hookshot's experimental encryption feature (and possibly others) may benefit from Redis, if available.
# We only connect to Redis if encryption is enabled (not for everyone who has Redis enabled),
# because connectivity is still potentially troublesome and is to be investigated.
matrix_hookshot_queue_host: "{{ redis_identifier if redis_enabled and matrix_hookshot_experimental_encryption_enabled else '' }}"
matrix_hookshot_queue_host: "{{ redis_identifier if redis_enabled and matrix_hookshot_experimental_encryption_enabled else (keydb_identifier if keydb_enabled and matrix_hookshot_experimental_encryption_enabled else '') }}"
matrix_hookshot_container_network: "{{ matrix_addons_container_network }}"
@@ -1878,6 +1882,8 @@ matrix_hookshot_container_additional_networks_auto: |
+
([redis_container_network] if redis_enabled and matrix_hookshot_queue_host == redis_identifier else [])
+
([keydb_container_network] if keydb_enabled and matrix_hookshot_queue_host == keydb_identifier else [])
+
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network and matrix_hookshot_container_labels_traefik_enabled else [])
) | unique
}}
@@ -3956,7 +3962,7 @@ ntfy_visitor_request_limit_exempt_hosts_hostnames_auto: |
#
######################################################################
redis_enabled: "{{ matrix_synapse_workers_enabled or (matrix_hookshot_enabled and matrix_hookshot_experimental_encryption_enabled) }}"
redis_enabled: "{{ not keydb_enabled and (matrix_synapse_workers_enabled or (matrix_hookshot_enabled and matrix_hookshot_experimental_encryption_enabled)) }}"
redis_identifier: matrix-redis
@@ -3967,7 +3973,37 @@ redis_base_path: "{{ matrix_base_data_path }}/redis"
######################################################################
#
# /etle/redis
# /etke/redis
#
######################################################################
######################################################################
#
# keydb
#
######################################################################
keydb_enabled: "{{ matrix_synapse_workers_enabled or (matrix_hookshot_enabled and matrix_hookshot_experimental_encryption_enabled) }}"
keydb_identifier: matrix-keydb
keydb_uid: "{{ matrix_user_uid }}"
keydb_gid: "{{ matrix_user_gid }}"
keydb_base_path: "{{ matrix_base_data_path }}/keydb"
keydb_arch: |-
{{
({
'amd64': 'x86_64',
'arm32': 'arm32',
'arm64': 'arm64',
})[matrix_architecture]
}}
######################################################################
#
# keydb
#
######################################################################
@@ -4174,6 +4210,8 @@ matrix_synapse_container_additional_networks_auto: |
+
([redis_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == redis_identifier else [])
+
([keydb_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == keydb_identifier else [])
+
([exim_relay_container_network] if (exim_relay_enabled and matrix_synapse_email_enabled and matrix_synapse_email_smtp_host == exim_relay_identifier and matrix_synapse_container_network != exim_relay_container_network) else [])
+
([matrix_ma1sd_container_network] if (matrix_ma1sd_enabled and matrix_synapse_account_threepid_delegates_msisdn == matrix_synapse_account_threepid_delegates_msisdn_mas1sd_url and matrix_synapse_container_network != matrix_ma1sd_container_network) else [])
@@ -4256,6 +4294,8 @@ matrix_synapse_systemd_required_services_list_auto: |
+
([redis_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == redis_identifier else [])
+
([keydb_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == keydb_identifier else [])
+
(['matrix-goofys.service'] if matrix_s3_media_store_enabled else [])
}}
@@ -4267,9 +4307,9 @@ matrix_synapse_systemd_wanted_services_list_auto: |
}}
# Synapse workers (used for parallel load-scaling) need Redis for IPC.
matrix_synapse_redis_enabled: "{{ redis_enabled }}"
matrix_synapse_redis_host: "{{ redis_identifier if redis_enabled else '' }}"
matrix_synapse_redis_password: "{{ redis_connection_password if redis_enabled else '' }}"
matrix_synapse_redis_enabled: "{{ redis_enabled or keydb_enabled }}"
matrix_synapse_redis_host: "{{ redis_identifier if redis_enabled else (keydb_identifier if keydb_enabled else '') }}"
matrix_synapse_redis_password: "{{ redis_connection_password if redis_enabled else (keydb_connection_password if keydb_enabled else '') }}"
matrix_synapse_container_extra_arguments_auto: "{{ matrix_homeserver_container_extra_arguments_auto }}"
matrix_synapse_app_service_config_files_auto: "{{ matrix_homeserver_app_service_config_files_auto }}"

View File

@@ -27,6 +27,9 @@
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git
version: v9364-1
name: jitsi
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-keydb.git
version: v6.3.4-1
name: keydb
- src: git+https://gitlab.com/etke.cc/roles/ntfy.git
version: v2.10.0-0
name: ntfy
@@ -55,7 +58,7 @@
version: v0.14.0-4
name: prometheus_postgres_exporter
- src: git+https://gitlab.com/etke.cc/roles/redis.git
version: v7.2.3-2
version: v7.2.4-0
name: redis
- src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git
version: v1.1.0-0

View File

@@ -6,7 +6,7 @@
block:
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: ansible_os_family == 'Debian' and matrix_playbook_migration_debian_signedby_migration_enabled | bool
- when: ansible_os_family == 'Debian' and matrix_playbook_docker_installation_enabled | bool and matrix_playbook_migration_debian_signedby_migration_enabled | bool
tags:
- setup-all
- install-all

View File

@@ -48,6 +48,7 @@
- role: galaxy/postgres
- galaxy/redis
- galaxy/keydb
- custom/matrix-corporal
- custom/matrix-appservice-draupnir-for-all
- custom/matrix-bridge-appservice-discord