diff --git a/blueprints/livekit/docker-compose.yml b/blueprints/livekit/docker-compose.yml new file mode 100644 index 00000000..eade857d --- /dev/null +++ b/blueprints/livekit/docker-compose.yml @@ -0,0 +1,58 @@ +services: + livekit: + image: livekit/livekit-server:v1.9.0 + restart: unless-stopped + command: --config /etc/livekit.yaml + volumes: + - ../files/livekit.yaml:/etc/livekit.yaml + ports: + - "${LIVEKIT_PORT}:${LIVEKIT_PORT}" + - "${TURN_UDP_PORT}:${TURN_UDP_PORT}/udp" + - "${LIVEKIT_UDP_PORT}:${LIVEKIT_UDP_PORT}/udp" + healthcheck: + test: [ "CMD-SHELL", "wget -qO- http://localhost:${LIVEKIT_PORT} || exit 1" ] + interval: 10s + timeout: 5s + retries: 6 + depends_on: + redis: + condition: service_healthy + + redis: + image: redis:7-alpine + restart: unless-stopped + command: redis-server /etc/redis.conf + volumes: + - ../files/redis.conf:/etc/redis.conf + healthcheck: + test: [ "CMD-SHELL", "redis-cli ping || exit 1" ] + interval: 10s + timeout: 5s + retries: 6 + + egress: + image: livekit/egress:latest + restart: unless-stopped + environment: + - EGRESS_CONFIG_FILE=/etc/egress.yaml + volumes: + - ../files/egress.yaml:/etc/egress.yaml + cap_add: + - CAP_SYS_ADMIN + depends_on: + livekit: + condition: service_healthy + + ingress: + image: livekit/ingress:latest + restart: unless-stopped + environment: + - INGRESS_CONFIG_FILE=/etc/ingress.yaml + volumes: + - ../files/ingress.yaml:/etc/ingress.yaml + ports: + - "${RTMP_PORT}:${RTMP_PORT}" + - "${INGRESS_UDP_PORT}:${INGRESS_UDP_PORT}/udp" + depends_on: + livekit: + condition: service_healthy diff --git a/blueprints/livekit/livekit.svg b/blueprints/livekit/livekit.svg new file mode 100644 index 00000000..74a5fa12 --- /dev/null +++ b/blueprints/livekit/livekit.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/blueprints/livekit/template.toml b/blueprints/livekit/template.toml new file mode 100644 index 00000000..60ebb5ab --- /dev/null +++ b/blueprints/livekit/template.toml @@ -0,0 +1,150 @@ +[variables] +main_domain = "livekit.${domain}" +turn_domain = "livekit-turn.${domain}" +whip_domain = "livekit-whip.${domain}" +api_key = "API${password:12}" +api_secret = "${password:44}" +redis_address = "redis:6379" +redis_password = "${password:32}" + +livekit_port = "7880" +livekit_tcp_port = "7881" +livekit_udp_port = "7882" +turn_tls_port = "5349" +turn_udp_port = "3478" +rtmp_port = "1935" +whip_port = "8080" +ingress_udp_port = "7885" +http_relay_port = "9090" + +[config] +[[config.domains]] +serviceName = "livekit" +port = 7880 +host = "${main_domain}" + +[[config.domains]] +serviceName = "livekit" +port = 5349 +host = "${turn_domain}" + +[[config.domains]] +serviceName = "ingress" +port = 8080 +host = "${whip_domain}" + +[config.env] +LIVEKIT_URL = "${main_domain}" +RTMP_URL = "${turn_domain}" +WHIP_URL = "${whip_domain}" +REDIS_ADDRESS = "${redis_address}" +REDIS_PASSWORD = "${redis_password}" +API_KEY = "${api_key}" +API_SECRET = "${api_secret}" +LIVEKIT_PORT = "${livekit_port}" +LIVEKIT_TCP_PORT = "${livekit_tcp_port}" +LIVEKIT_UDP_PORT = "${livekit_udp_port}" +TURN_TLS_PORT = "${turn_tls_port}" +TURN_UDP_PORT = "${turn_udp_port}" +RTMP_PORT = "${rtmp_port}" +WHIP_PORT = "${whip_port}" +INGRESS_UDP_PORT = "${ingress_udp_port}" +HTTP_RELAY_PORT = "${http_relay_port}" + +[[config.mounts]] +filePath = "redis.conf" +content = """ +bind 0.0.0.0 +protected-mode yes +port 6379 +timeout 0 +tcp-keepalive 300 +requirepass ${redis_password} +""" + +[[config.mounts]] +filePath = "livekit.yaml" +content = """ +port: ${livekit_port} +bind_addresses: + - "" +rtc: + tcp_port: ${livekit_tcp_port} + udp_port: ${livekit_udp_port} + use_external_ip: true + enable_loopback_candidate: false +redis: + address: ${redis_address} + username: "" + password: ${redis_password} + db: 0 + use_tls: false + sentinel_master_name: "" + sentinel_username: "" + sentinel_password: "" + sentinel_addresses: [] + cluster_addresses: [] + max_redirects: null +turn: + enabled: true + domain: ${turn_domain} + tls_port: ${turn_tls_port} + udp_port: ${turn_udp_port} + external_tls: true +ingress: + rtmp_base_url: rtmp://${main_domain}:${rtmp_port}/x + whip_base_url: https://${whip_domain}/w +keys: + ${api_key}: ${api_secret} +""" + +[[config.mounts]] +filePath = "egress.yaml" +content = """ +redis: + address: ${redis_address} + username: "" + password: ${redis_password} + db: 0 + use_tls: false + sentinel_master_name: "" + sentinel_username: "" + sentinel_password: "" + sentinel_addresses: [] + cluster_addresses: [] + max_redirects: null +api_key: ${api_key} +api_secret: ${api_secret} +ws_url: wss://${main_domain} +""" + +[[config.mounts]] +filePath = "ingress.yaml" +content = """ +redis: + address: ${redis_address} + username: "" + password: ${redis_password} + db: 0 + use_tls: false + sentinel_master_name: "" + sentinel_username: "" + sentinel_password: "" + sentinel_addresses: [] + cluster_addresses: [] + max_redirects: null +api_key: ${api_key} +api_secret: ${api_secret} +ws_url: wss://${main_domain} +rtmp_port: ${rtmp_port} +whip_port: ${whip_port} +http_relay_port: ${http_relay_port} +logging: + json: false + level: "" +development: false +rtc_config: + udp_port: ${ingress_udp_port} + use_external_ip: true + enable_loopback_candidate: false +""" diff --git a/meta.json b/meta.json index 36fd91b8..328db9a2 100644 --- a/meta.json +++ b/meta.json @@ -3422,6 +3422,25 @@ "rabbitmq" ] }, + { + "id": "livekit", + "name": "Livekit", + "version": "v1.9.0", + "description": "LiveKit is an open source platform for developers building realtime media applications.", + "logo": "livekit.svg", + "links": { + "github": "https://github.com/livekit/livekit", + "website": "https://livekit.io/", + "docs": "https://docs.livekit.io/" + }, + "tags": [ + "Video", + "Audio", + "Real-time", + "Streaming", + "Webrtc" + ] + }, { "id": "ezbookkeeping", "name": "EZBookkeeping",