mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-29 23:10:08 +00:00
fix: improve IPv6 compatibility in containers and PHP AIO interface
Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/c71fba87-d463-4682-9cb3-abb659b2ca40 Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
50643afd6a
commit
3abbbfbc2b
@@ -4,4 +4,4 @@ if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z 127.0.0.1 1234 || exit 1
|
||||
nc -z 127.0.0.1 1234 || nc -z ::1 1234 || exit 1
|
||||
|
||||
@@ -58,13 +58,21 @@ extensionaudio = .m4a
|
||||
extensionvideo = .mp4"
|
||||
fi
|
||||
|
||||
# Detect IPv6 availability to choose the right listen address
|
||||
RECORDING_LISTEN="0.0.0.0:1234"
|
||||
if ! grep -q "1" /sys/module/ipv6/parameters/disable 2>/dev/null \
|
||||
&& ! grep -q "1" /proc/sys/net/ipv6/conf/all/disable_ipv6 2>/dev/null \
|
||||
&& ! grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6 2>/dev/null; then
|
||||
RECORDING_LISTEN="[::]:1234"
|
||||
fi
|
||||
|
||||
cat << RECORDING_CONF > "/conf/recording.conf"
|
||||
[logs]
|
||||
# 30 means Warning
|
||||
level = ${TALK_RECORDING_LOG_LEVEL}
|
||||
|
||||
[http]
|
||||
listen = 0.0.0.0:1234
|
||||
listen = ${RECORDING_LISTEN}
|
||||
|
||||
[backend]
|
||||
allowall = ${ALLOW_ALL}
|
||||
|
||||
@@ -4,11 +4,13 @@ if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
nc -z 127.0.0.1 8081 || exit 1
|
||||
nc -z 127.0.0.1 8081 || nc -z ::1 8081 || exit 1
|
||||
nc -z 127.0.0.1 8188 || exit 1
|
||||
nc -z 127.0.0.1 4222 || exit 1
|
||||
nc -z 127.0.0.1 "$TALK_PORT" || exit 1
|
||||
nc -z 127.0.0.1 "$TALK_PORT" || nc -z ::1 "$TALK_PORT" || exit 1
|
||||
eturnalctl status || exit 1
|
||||
# Verify that the signaling server is actually serving requests, not just
|
||||
# listening on the TCP port (which nc -z above only tests for open port).
|
||||
wget -q -O /dev/null http://127.0.0.1:8081/api/v1/stats || exit 1
|
||||
# SC2102: [::1] is an IPv6 address literal in a URL, not a character-range glob.
|
||||
# shellcheck disable=SC2102
|
||||
wget -q -O /dev/null http://127.0.0.1:8081/api/v1/stats || wget -q -O /dev/null http://[::1]:8081/api/v1/stats || exit 1
|
||||
|
||||
@@ -75,6 +75,13 @@ if grep -q "1" /sys/module/ipv6/parameters/disable \
|
||||
|| grep -q "1" /proc/sys/net/ipv6/conf/default/disable_ipv6; then
|
||||
IP_BINDING="0.0.0.0"
|
||||
fi
|
||||
# Build a listen address suitable for the signaling server's "ip:port" format.
|
||||
# IPv6 needs bracket notation: [::]:8081; IPv4 keeps the plain form: 0.0.0.0:8081
|
||||
if [ "$IP_BINDING" = "::" ]; then
|
||||
SIGNALING_LISTEN="[::]:8081"
|
||||
else
|
||||
SIGNALING_LISTEN="$IP_BINDING:8081"
|
||||
fi
|
||||
if [ "$AIO_LOG_LEVEL" != 'debug' ]; then
|
||||
set +x
|
||||
fi
|
||||
@@ -118,7 +125,7 @@ fi
|
||||
# Signaling
|
||||
cat << SIGNALING_CONF > "/conf/signaling.conf"
|
||||
[http]
|
||||
listen = 0.0.0.0:8081
|
||||
listen = ${SIGNALING_LISTEN}
|
||||
readtimeout = 15
|
||||
writetimeout = 30
|
||||
|
||||
|
||||
Reference in New Issue
Block a user