From 88a60cca1bfa50bfc07183804df7ffe452292ddc Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 14 Jul 2023 11:04:33 +0200 Subject: [PATCH 1/4] Basic webrtc spport --- bin/up | 2 +- docker-compose.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/up b/bin/up index 4875d7b..86fa417 100755 --- a/bin/up +++ b/bin/up @@ -8,4 +8,4 @@ mutagen daemon start echo -e ${prefix}The mutagen daemon will stay running until you stop it manually with \`mutagen daemon stop\`.$suffix echo -e ${prefix}Running mutagen-compose...$suffix -mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach +PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c9aab61..0101ff6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,8 @@ services: user: postgres volumes: - pgdata:/var/lib/postgresql/data + ports: + - "5432:5432" dialog: build: context: . @@ -18,8 +20,16 @@ services: HTTPS_CERT_FULLCHAIN: /etc/ssl/fullchain.pem HTTPS_CERT_PRIVKEY: /etc/ssl/privkey.pem INTERACTIVE: "false" + MEDIASOUP_MIN_PORT: 40000 + MEDIASOUP_MAX_PORT: 40050 + MEDIASOUP_ANNOUNCED_IP: PRIVATE_NETWORK_IP ports: - "4443:4443" + # This should be the same as MEDIASOUP_MIN_PORT and MEDIASOUP_MAX_PORT + # You might neeed to increase this number depending on how many clients you are connecting. + # (Keep the ports range small to improve container startup time) + - "40000-40050:40000-40050" + - "40000-40050:40000-40050/udp" volumes: - dialog:/code working_dir: /code From e09b2bdf9554d46f989592e9281d3d4b1fc9c04d Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Wed, 19 Jul 2023 16:04:35 +0200 Subject: [PATCH 2/4] Update docker-compose.yml Co-authored-by: Bryan Enders <2033828+bryanenders@users.noreply.github.com> --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0101ff6..90514ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,7 +22,7 @@ services: INTERACTIVE: "false" MEDIASOUP_MIN_PORT: 40000 MEDIASOUP_MAX_PORT: 40050 - MEDIASOUP_ANNOUNCED_IP: PRIVATE_NETWORK_IP + MEDIASOUP_ANNOUNCED_IP: ${PRIVATE_NETWORK_IP} ports: - "4443:4443" # This should be the same as MEDIASOUP_MIN_PORT and MEDIASOUP_MAX_PORT From 478ed5dbb341f2f617946924e73822395d32b240 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Wed, 19 Jul 2023 16:04:41 +0200 Subject: [PATCH 3/4] Update bin/up Co-authored-by: Bryan Enders <2033828+bryanenders@users.noreply.github.com> --- bin/up | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/up b/bin/up index 86fa417..779166a 100755 --- a/bin/up +++ b/bin/up @@ -8,4 +8,4 @@ mutagen daemon start echo -e ${prefix}The mutagen daemon will stay running until you stop it manually with \`mutagen daemon stop\`.$suffix echo -e ${prefix}Running mutagen-compose...$suffix -PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach \ No newline at end of file +PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach From db81406794e3b9762f4c4c9f857a9a05c915065c Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Fri, 3 May 2024 17:22:35 +0200 Subject: [PATCH 4/4] Make scripts work on WSL and Mac --- bin/down | 7 ++++++- bin/up | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/down b/bin/down index 19a04b2..73702bf 100755 --- a/bin/down +++ b/bin/down @@ -1,3 +1,8 @@ #!/bin/bash basedir=$(dirname "$0")/.. -mutagen-compose -f "$basedir"/docker-compose.yml down +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr) +elif [[ "$OSTYPE" == "darwin"* ]]; then + IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}') +fi +PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml down diff --git a/bin/up b/bin/up index 779166a..32a330c 100755 --- a/bin/up +++ b/bin/up @@ -8,4 +8,10 @@ mutagen daemon start echo -e ${prefix}The mutagen daemon will stay running until you stop it manually with \`mutagen daemon stop\`.$suffix echo -e ${prefix}Running mutagen-compose...$suffix -PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr) +elif [[ "$OSTYPE" == "darwin"* ]]; then + IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}') +fi +PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach