Allow LAN_MODE=false and USE_HTTPS=false without defining LAN_PRIVATE_IP

This commit is contained in:
cruizba 2025-07-04 22:38:38 +02:00
parent fb03ffbae6
commit 2144d51c21
4 changed files with 20 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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