ajoute le relais TURN sur 443 pour la visio (ADR 0006), avec coturn et le routage Nginx par nom
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
ee079ddffb
commit
45f8a69e26
19 changed files with 457 additions and 14 deletions
|
|
@ -32,14 +32,22 @@
|
|||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: noter si la page de statut et la visio peuvent être activées
|
||||
- name: vérifier le DNS du sous-domaine du relais TURN
|
||||
ansible.builtin.command: getent ahostsv4 {{ portail_domaine_turn }}
|
||||
register: portail_dns_turn
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
|
||||
- name: noter si la page de statut, la visio et le relais TURN peuvent être activés
|
||||
ansible.builtin.set_fact:
|
||||
portail_statut_actif: "{{ portail_ip_publique in portail_dns_statut.stdout }}"
|
||||
portail_visio_actif: "{{ portail_ip_publique in portail_dns_visio.stdout }}"
|
||||
portail_turn_actif: "{{ portail_ip_publique in portail_dns_turn.stdout }}"
|
||||
portail_noms_certificat: >-
|
||||
{{ [portail_domaine] + portail_domaines_alias
|
||||
+ ([portail_domaine_statut] if portail_ip_publique in portail_dns_statut.stdout else [])
|
||||
+ ([portail_domaine_visio] if portail_ip_publique in portail_dns_visio.stdout else []) }}
|
||||
+ ([portail_domaine_visio] if portail_ip_publique in portail_dns_visio.stdout else [])
|
||||
+ ([portail_domaine_turn] if portail_ip_publique in portail_dns_turn.stdout else []) }}
|
||||
|
||||
- name: vérifier si le certificat existe déjà
|
||||
ansible.builtin.stat:
|
||||
|
|
|
|||
37
ansible/roles/portail/tasks/07-turn-stream.yml
Normal file
37
ansible/roles/portail/tasks/07-turn-stream.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
# Bloc A (ADR 0006) : partage du port 443 entre le portail et le relais TURN
|
||||
# (coturn, rôle turn), par nom de domaine (SNI), sans jamais déchiffrer le
|
||||
# TLS existant. N'ouvre aucun nouveau port dans nftables : toujours 443.
|
||||
- name: installer le module stream de Nginx
|
||||
ansible.builtin.apt:
|
||||
name: libnginx-mod-stream
|
||||
state: present
|
||||
when: portail_turn_actif | default(false)
|
||||
notify: recharger nginx
|
||||
|
||||
- name: router le port 443 public par nom (stream Nginx)
|
||||
ansible.builtin.blockinfile:
|
||||
path: /etc/nginx/nginx.conf
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK — bloc A, ADR 0006, relais TURN"
|
||||
insertafter: EOF
|
||||
block: |
|
||||
# Le vrai TLS (nos vhosts HTTPS, désormais sur 127.0.0.1:8443) et
|
||||
# coturn (127.0.0.1:{{ portail_port_turn_tls }}) se partagent le port public
|
||||
# 443 : ce bloc regarde seulement le nom demandé dans la poignée de
|
||||
# main TLS (SNI), jamais son contenu déchiffré, puis transmet les
|
||||
# octets tels quels (aucun des deux ne voit l'autre).
|
||||
stream {
|
||||
map $ssl_preread_server_name $syllabus_stream_backend {
|
||||
{{ portail_domaine_turn }} 127.0.0.1:{{ portail_port_turn_tls }};
|
||||
default 127.0.0.1:8443;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443;
|
||||
listen [::]:443;
|
||||
ssl_preread on;
|
||||
proxy_pass $syllabus_stream_backend;
|
||||
}
|
||||
}
|
||||
when: portail_turn_actif | default(false)
|
||||
notify: recharger nginx
|
||||
|
|
@ -14,5 +14,8 @@
|
|||
- name: Nginx
|
||||
ansible.builtin.import_tasks: 05-nginx.yml
|
||||
|
||||
- name: relais TURN sur 443 (bloc A, ADR 0006)
|
||||
ansible.builtin.import_tasks: 07-turn-stream.yml
|
||||
|
||||
- name: file et planificateur (jobs Heat, expiration des sessions)
|
||||
ansible.builtin.import_tasks: 06-queue-scheduler.yml
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue