mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-03-29 20:43:32 +01:00
Added coturn draft
This commit is contained in:
parent
08334be18d
commit
9a49e7aa3b
group_vars/all
roles
docker-coturn
docker-nextcloud/templates/config
@ -63,6 +63,12 @@ defaults_applications:
|
||||
database:
|
||||
central_storage: True
|
||||
|
||||
coturn: # @todo implement
|
||||
credentials:
|
||||
user: turnuser
|
||||
# password: # Need to be defined in invetory file
|
||||
# secret: # Need to be defined in invetory file
|
||||
|
||||
## Discourse:
|
||||
discourse:
|
||||
network: "discourse_default" # Name of the docker network
|
||||
|
9
roles/docker-coturn/README.md
Normal file
9
roles/docker-coturn/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# DRAFT role docker-coturn
|
||||
setup an coturn server based on https://hub.docker.com/r/coturn/coturn
|
||||
|
||||
## todo
|
||||
|
||||
Needs to be implemented so that Nextcloud Talk works
|
||||
|
||||
## author
|
||||
[Kevin Veen-Birkenbach](https://www.veen.world)
|
14
roles/docker-coturn/tasks/main.yml
Normal file
14
roles/docker-coturn/tasks/main.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: "include docker-central-database"
|
||||
include_role:
|
||||
name: docker-central-database
|
||||
|
||||
- name: "include role nginx-domain-setup for {{application_id}}"
|
||||
include_role:
|
||||
name: nginx-domain-setup
|
||||
vars:
|
||||
domain: "{{ domains[application_id] }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
69
roles/docker-coturn/templates/docker-compose.yml.j2
Normal file
69
roles/docker-coturn/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,69 @@
|
||||
services:
|
||||
|
||||
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
|
||||
|
||||
application:
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
image: "gitea/gitea:{{applications.gitea.version}}"
|
||||
ports:
|
||||
- "127.0.0.1:{{ports.localhost.http[application_id]}}:3000"
|
||||
- "{{ports.public.ssh[application_id]}}:22"
|
||||
volumes:
|
||||
- data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
{% include 'templates/docker/container/networks.yml.j2' %}
|
||||
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
|
||||
|
||||
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
||||
data:
|
||||
|
||||
{% include 'templates/docker/compose/networks.yml.j2' %}
|
||||
coturn:
|
||||
image: coturn/coturn
|
||||
restart: always
|
||||
network_mode: "host" # Nutzt die Host-IP für externe Erreichbarkeit (optional)
|
||||
ports:
|
||||
- "3478:3478/udp"
|
||||
- "3478:3478/tcp"
|
||||
- "5349:5349/tcp"
|
||||
- "5349:5349/udp"
|
||||
- "49152-65535:49152-65535/udp" # TURN-Relay-Ports (wichtig!)
|
||||
#volumes: # In case customized config is required
|
||||
# - coturn-config:/etc/coturn
|
||||
environment:
|
||||
- TURN_PORT=3478
|
||||
- TURN_PORT_TLS=5349
|
||||
- TURN_SECRET=my-secret-key
|
||||
- TURN_USER=turnuser
|
||||
- TURN_PASSWORD=turnpassword
|
||||
command: >
|
||||
--log-file=stdout
|
||||
--external-ip=$(detect-external-ip)
|
||||
--lt-cred-mech
|
||||
--user=turnuser:turnpassword
|
||||
--realm=nextcloud
|
||||
--total-quota=100
|
||||
--stale-nonce
|
||||
--no-multicast-peers
|
||||
--denied-peer-ip=0.0.0.0-0.255.255.255
|
||||
--denied-peer-ip=10.0.0.0-10.255.255.255
|
||||
--denied-peer-ip=100.64.0.0-100.127.255.255
|
||||
--denied-peer-ip=169.254.0.0-169.254.255.255
|
||||
--denied-peer-ip=172.16.0.0-172.31.255.255
|
||||
--denied-peer-ip=192.0.0.0-192.0.0.255
|
||||
--denied-peer-ip=192.88.99.0-192.88.99.255
|
||||
--denied-peer-ip=192.168.0.0-192.168.255.255
|
||||
--denied-peer-ip=198.18.0.0-198.19.255.255
|
||||
--denied-peer-ip=198.51.100.0-198.51.100.255
|
||||
--denied-peer-ip=203.0.113.0-203.0.113.255
|
||||
--denied-peer-ip=240.0.0.0-255.255.255.255
|
||||
|
||||
volumes:
|
||||
nextcloud:
|
||||
coturn-config:
|
0
roles/docker-coturn/templates/env.j2
Normal file
0
roles/docker-coturn/templates/env.j2
Normal file
3
roles/docker-coturn/vars/main.yml
Normal file
3
roles/docker-coturn/vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
application_id: "coturn"
|
||||
#database_password: "{{gitea_database_password}}"
|
||||
#database_type: "mariadb"
|
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
# Activates the turn server
|
||||
# @see https://nextcloud-talk.readthedocs.io/en/latest/TURN/
|
||||
return 'turn_servers' => [
|
||||
[
|
||||
'host' => 'coturn',
|
||||
'port' => 3478,
|
||||
'secret' => 'my-secret-key',
|
||||
'protocols' => 'udp,tcp'
|
||||
]
|
||||
];
|
Loading…
x
Reference in New Issue
Block a user