Просмотр исходного кода

allow synapse to use redis unix socket instead of tcp

pull/5016/head
Aine 1 день назад
Родитель
Сommit
0c40a03efc
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 34969C908CCA2804
5 измененных файлов: 22 добавлений и 2 удалений
  1. +4
    -0
      group_vars/matrix_servers
  2. +7
    -2
      roles/custom/matrix-synapse/defaults/main.yml
  3. +5
    -0
      roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2
  4. +3
    -0
      roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2
  5. +3
    -0
      roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2

+ 4
- 0
group_vars/matrix_servers Просмотреть файл

@@ -4844,6 +4844,10 @@ matrix_synapse_redis_enabled: "{{ valkey_enabled }}"
matrix_synapse_redis_host: "{{ valkey_identifier if valkey_enabled else '' }}"
matrix_synapse_redis_password: "{{ valkey_connection_password if valkey_enabled else '' }}"

matrix_synapse_redis_path_enabled: false # temporarily, then switch to true by default once properly tested
matrix_synapse_redis_path: "{{ '/tmp/redis.sock' if valkey_enabled else '' }}" # default value for Synapse
matrix_synapse_redis_path_host: "{{ valkey_run_path+'/valkey.sock' if valkey_enabled else '' }}" # path on the host

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 }}"



+ 7
- 2
roles/custom/matrix-synapse/defaults/main.yml Просмотреть файл

@@ -1241,11 +1241,16 @@ matrix_synapse_instance_map: |

# Redis information
matrix_synapse_redis_enabled: false
matrix_synapse_redis_host: ""
matrix_synapse_redis_port: 6379
matrix_synapse_redis_password: ""
matrix_synapse_redis_dbid: 0
matrix_synapse_redis_use_tls: false
# Connection option 1: TCP
matrix_synapse_redis_host: ""
matrix_synapse_redis_port: 6379
# Connection option 2: Unix socket (takes precedence over TCP if `matrix_synapse_redis_path` is set)
matrix_synapse_redis_path_enabled: false
matrix_synapse_redis_path: "" # the path to the redis socket inside the container, e.g. "/var/run/redis.sock"
matrix_synapse_redis_path_host: "" # the path to the redis socket on the host, e.g. "/matrix/valkey/run/valkey.sock"

# Controls whether Synapse starts a replication listener necessary for workers.
#


+ 5
- 0
roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 Просмотреть файл

@@ -2932,6 +2932,11 @@ redis:
host: {{ matrix_synapse_redis_host | to_json }}
port: {{ matrix_synapse_redis_port | to_json }}

# The full path to a local Unix socket file. If this is used, host and port are ignored.
{% if matrix_synapse_redis_path_enabled %}
path: {{ matrix_synapse_redis_path | to_json }}
{% endif %}

# Optional database ID to connect to. Defaults to 0.
dbid: {{ matrix_synapse_redis_dbid | to_json }}



+ 3
- 0
roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse-worker.service.j2 Просмотреть файл

@@ -67,6 +67,9 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{% for volume in matrix_synapse_container_additional_volumes %}
--mount type={{ volume.type | default('bind' if '/' in volume.src else 'volume') }},src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \
{% endfor %}
{% if matrix_synapse_redis_path_enabled %}
--mount type=bind,src={{ matrix_synapse_redis_path_host }},dst={{ matrix_synapse_redis_path }} \
{% endif %}
--label-file={{ matrix_synapse_base_path }}/{{ matrix_synapse_worker_labels_file_name }} \
{% for arg in matrix_synapse_container_arguments %}
{{ arg }} \


+ 3
- 0
roles/custom/matrix-synapse/templates/synapse/systemd/matrix-synapse.service.j2 Просмотреть файл

@@ -51,6 +51,9 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
{% endif %}
--mount type=bind,src={{ matrix_synapse_config_dir_path }},dst=/data,ro \
--mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
{% if matrix_synapse_redis_path_enabled %}
--mount type=bind,src={{ matrix_synapse_redis_path_host }},dst={{ matrix_synapse_redis_path }} \
{% endif %}
--label-file={{ matrix_synapse_base_path }}/labels \
{% for volume in matrix_synapse_container_additional_volumes %}
--mount type={{ volume.type | default('bind' if '/' in volume.src else 'volume') }},src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \


Загрузка…
Отмена
Сохранить