From 2144d51c2185e4a5f1b52a57cef10ba0df4fe80a Mon Sep 17 00:00:00 2001 From: cruizba Date: Fri, 4 Jul 2025 22:38:38 +0200 Subject: [PATCH] Allow LAN_MODE=false and USE_HTTPS=false without defining LAN_PRIVATE_IP --- community/scripts/entrypoint_openvidu.sh | 2 +- community/scripts/setup.sh | 16 +++++++++------- pro/scripts/entrypoint_openvidu.sh | 2 +- pro/scripts/setup.sh | 16 +++++++++------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/community/scripts/entrypoint_openvidu.sh b/community/scripts/entrypoint_openvidu.sh index 54d3c2f..c57888b 100644 --- a/community/scripts/entrypoint_openvidu.sh +++ b/community/scripts/entrypoint_openvidu.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -if [ "$LAN_PRIVATE_IP" != "none" ]; then +if [ "$LAN_PRIVATE_IP" != "" ]; then export NODE_IP="$LAN_PRIVATE_IP" fi diff --git a/community/scripts/setup.sh b/community/scripts/setup.sh index 2704a16..8a6094b 100644 --- a/community/scripts/setup.sh +++ b/community/scripts/setup.sh @@ -1,6 +1,11 @@ #!/bin/sh -if [ -z "$LAN_PRIVATE_IP" ]; then +if [ "$LAN_MODE" = 'true' ] && [ "$USE_HTTPS" = 'false' ]; then + echo 'LAN_MODE cannot be "true" if USE_HTTPS is "false"' + exit 1 +fi + +if [ "$LAN_MODE" = 'true' ] && [ -z "$LAN_PRIVATE_IP" ]; then echo '------------------------' echo '' echo 'LAN_PRIVATE_IP is required in the .env file.' @@ -14,7 +19,9 @@ if [ -z "$LAN_PRIVATE_IP" ]; then echo 'If it can'\''t be found, you can manually set it in the .env file' echo '------------------------' exit 1 -else +fi + +if [ "$LAN_MODE" = 'true' ] && [ -n "$LAN_PRIVATE_IP" ]; then # Check if the LAN_PRIVATE_IP is reachable if ! ping -c 1 -W 1 "$LAN_PRIVATE_IP" > /dev/null; then echo "ERROR: LAN_PRIVATE_IP $LAN_PRIVATE_IP is not reachable" @@ -30,11 +37,6 @@ else fi fi -if [ "$LAN_MODE" = 'true' ] && [ "$USE_HTTPS" = 'false' ]; then - echo 'LAN_MODE cannot be "true" if USE_HTTPS is "false"' - exit 1 -fi - # Prepare volumes mkdir -p /minio/data mkdir -p /mongo/data diff --git a/pro/scripts/entrypoint_openvidu.sh b/pro/scripts/entrypoint_openvidu.sh index 66a2d71..fdf3456 100644 --- a/pro/scripts/entrypoint_openvidu.sh +++ b/pro/scripts/entrypoint_openvidu.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -if [ "$LAN_PRIVATE_IP" != "none" ]; then +if [ "$LAN_PRIVATE_IP" != "" ]; then export NODE_IP="$LAN_PRIVATE_IP" fi diff --git a/pro/scripts/setup.sh b/pro/scripts/setup.sh index 2704a16..8a6094b 100644 --- a/pro/scripts/setup.sh +++ b/pro/scripts/setup.sh @@ -1,6 +1,11 @@ #!/bin/sh -if [ -z "$LAN_PRIVATE_IP" ]; then +if [ "$LAN_MODE" = 'true' ] && [ "$USE_HTTPS" = 'false' ]; then + echo 'LAN_MODE cannot be "true" if USE_HTTPS is "false"' + exit 1 +fi + +if [ "$LAN_MODE" = 'true' ] && [ -z "$LAN_PRIVATE_IP" ]; then echo '------------------------' echo '' echo 'LAN_PRIVATE_IP is required in the .env file.' @@ -14,7 +19,9 @@ if [ -z "$LAN_PRIVATE_IP" ]; then echo 'If it can'\''t be found, you can manually set it in the .env file' echo '------------------------' exit 1 -else +fi + +if [ "$LAN_MODE" = 'true' ] && [ -n "$LAN_PRIVATE_IP" ]; then # Check if the LAN_PRIVATE_IP is reachable if ! ping -c 1 -W 1 "$LAN_PRIVATE_IP" > /dev/null; then echo "ERROR: LAN_PRIVATE_IP $LAN_PRIVATE_IP is not reachable" @@ -30,11 +37,6 @@ else fi fi -if [ "$LAN_MODE" = 'true' ] && [ "$USE_HTTPS" = 'false' ]; then - echo 'LAN_MODE cannot be "true" if USE_HTTPS is "false"' - exit 1 -fi - # Prepare volumes mkdir -p /minio/data mkdir -p /mongo/data