mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-04 12:18:17 +00:00 
			
		
		
		
	feat(web-svc-coturn): add configurable network_mode (default host) and adjust credential generation
- Introduced `COTURN_NETWORK_MODE` to support both host and bridge modes - Updated docker-compose template to skip port publishing in host mode - Changed user_password credential algorithm to random_hex for stronger randomness - Set default network_mode: host in config Ref: https://chatgpt.com/share/68d72a50-c36c-800f-9367-32c4ae520000
This commit is contained in:
		@@ -12,6 +12,7 @@ docker:
 | 
			
		||||
      mem_reservation:  512m
 | 
			
		||||
      mem_limit:        1g
 | 
			
		||||
      pids_limit:       256
 | 
			
		||||
      network_mode:     host
 | 
			
		||||
    redis:
 | 
			
		||||
      enabled:  false
 | 
			
		||||
    database: 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
credentials:
 | 
			
		||||
  user_password:
 | 
			
		||||
    description:  "Long-Term Credential password for clients"
 | 
			
		||||
    algorithm:    "alphanumeric_32"
 | 
			
		||||
    algorithm:    "random_hex"
 | 
			
		||||
    validation:   "^[A-Za-z0-9]{32}$"
 | 
			
		||||
  auth_secret:
 | 
			
		||||
    description:  "TURN-REST static auth secret"
 | 
			
		||||
 
 | 
			
		||||
@@ -4,12 +4,15 @@
 | 
			
		||||
{% include 'roles/docker-container/templates/base.yml.j2' %}
 | 
			
		||||
    image: {{ COTURN_IMAGE }}:{{ COTURN_VERSION }}
 | 
			
		||||
    container_name: {{ COTURN_VOLUME }}
 | 
			
		||||
    network_mode: {{ COTURN_NETWORK_MODE }}
 | 
			
		||||
{% if COTURN_NETWORK_MODE == 'bridge' %}
 | 
			
		||||
    ports:
 | 
			
		||||
      - "{{ COTURN_TURN_PORT }}:{{ COTURN_TURN_PORT }}/udp"
 | 
			
		||||
      - "{{ COTURN_TURN_PORT }}:{{ COTURN_TURN_PORT }}/tcp"
 | 
			
		||||
      - "{{ COTURN_STUN_PORT }}:{{ COTURN_STUN_PORT }}/tcp"
 | 
			
		||||
      - "{{ COTURN_STUN_PORT }}:{{ COTURN_STUN_PORT }}/udp"
 | 
			
		||||
      - "{{ COTURN_RELAY_PORT_RANGE }}/udp"
 | 
			
		||||
{% endif %}
 | 
			
		||||
    volumes:
 | 
			
		||||
      - "{{ COTURN_TLS_CERT_PATH }}:{{ COTURN_TLS_CERT_PATH }}:ro"
 | 
			
		||||
      - "{{ COTURN_TLS_KEY_PATH }}:{{ COTURN_TLS_KEY_PATH }}:ro"
 | 
			
		||||
 
 | 
			
		||||
@@ -10,6 +10,7 @@ COTURN_VERSION:             "{{ applications | get_app_conf(application_id, 'doc
 | 
			
		||||
COTURN_IMAGE:               "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.image') }}"
 | 
			
		||||
COTURN_VOLUME:              "{{ entity_name }}"
 | 
			
		||||
COTURN_REALM:               "{{ domain }}"
 | 
			
		||||
COTURN_NETWORK_MODE:        "{{ applications | get_app_conf(application_id, 'docker.services.' ~ entity_name ~ '.network_mode') }}"
 | 
			
		||||
 | 
			
		||||
## Ports
 | 
			
		||||
COTURN_TURN_PORT:           "{{ ports.public.turn[application_id] }}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user