ソースを参照

Enable TURN support and UDP for STUN

pull/6/head
Slavi Pantaleev 8年前
コミット
13eaee2463
3個のファイルの変更24行の追加4行の削除
  1. +15
    -3
      roles/matrix-server/tasks/setup_synapse.yml
  2. +2
    -0
      roles/matrix-server/templates/systemd/matrix-synapse.service.j2
  3. +7
    -1
      vars/vars.yml

+ 15
- 3
roles/matrix-server/tasks/setup_synapse.yml ファイルの表示

@@ -58,15 +58,27 @@
line: '\1user: "{{ matrix_postgres_connection_username }}"\n\1password: "{{ matrix_postgres_connection_password }}"\n\1database: "homeserver"\n\1host: "postgres"\n\1cp_min: 5\n\1cp_max: 10'
backrefs: yes

- name: Augment Matrix config (configure Coturn)
lineinfile: "dest={{ matrix_synapse_data_path }}/turnserver.conf"
args:
regexp: "^{{ item.variable }}="
line: '{{ item.variable }}={{ item.value }}'
with_items:
- {'variable': 'min-port', 'value': "{{ matrix_coturn_turn_udp_min_port }}"}
- {'variable': 'max-port', 'value': "{{ matrix_coturn_turn_udp_max_port }}"}
- {'variable': 'external-ip', 'value': "{{ matrix_coturn_turn_external_ip_address }}"}

- name: Allow access to Matrix ports in firewalld
firewalld:
port: "{{ item }}/tcp"
port: "{{ item }}"
state: enabled
immediate: yes
permanent: yes
with_items:
- 3478 # Coturn
- 8448 # Matrix federation
- '8448/tcp' # Matrix federation
- '3478/tcp' # STUN
- '3478/udp' # STUN
- "{{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}/udp" # TURN

- name: Ensure matrix-synapse.service installed
template:


+ 2
- 0
roles/matrix-server/templates/systemd/matrix-synapse.service.j2 ファイルの表示

@@ -14,6 +14,8 @@ ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
--link matrix-postgres:postgres \
-p 8448:8448 \
-p 3478:3478 \
-p 3478:3478/udp \
-p {{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}:{{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}/udp \
-v {{ matrix_synapse_data_path }}:/data \
-v {{ ssl_certs_path }}:/acmetool-certs \
{{ docker_matrix_image }}


+ 7
- 1
vars/vars.yml ファイルの表示

@@ -38,4 +38,10 @@ docker_riot_image: "silviof/matrix-riot-docker"

# Specifies when to restart the Matrix services so that
# a new SSL certificate could go into effect (UTC time).
matrix_services_restart_cron_time_definition: "15 4 3 * *"
matrix_services_restart_cron_time_definition: "15 4 3 * *"

# UDP port-range to use for TURN
matrix_coturn_turn_udp_min_port: 49152
matrix_coturn_turn_udp_max_port: 49172

matrix_coturn_turn_external_ip_address: "{{ ansible_host }}"

読み込み中…
キャンセル
保存