public IP determination

This commit is contained in:
Matthew Hodgson
2024-11-08 19:59:38 +00:00
parent 6421de30c8
commit 5501022b4b
2 changed files with 8 additions and 3 deletions

View File

@@ -30,6 +30,8 @@ MAS_CLIENT_ID="0000000000000000000SYNAPSE"
MAS_EMAIL_FROM='"Matrix Authentication Service" <support@${DOMAIN}>' MAS_EMAIL_FROM='"Matrix Authentication Service" <support@${DOMAIN}>'
MAS_EMAIL_REPLY_TO='"Matrix Authentication Service" <support@${DOMAIN}>' MAS_EMAIL_REPLY_TO='"Matrix Authentication Service" <support@${DOMAIN}>'
# This should be the public IP of your $LIVEKIT_FQDN.
# If livekit doesn't work, double-check this.
LIVEKIT_NODE_IP=127.0.0.1 LIVEKIT_NODE_IP=127.0.0.1
COUNTRY=GB COUNTRY=GB

View File

@@ -21,9 +21,12 @@ if [[ ! -e .env ]]; then
sed -ir s/^USER_ID=/USER_ID=$(id -u)/ .env sed -ir s/^USER_ID=/USER_ID=$(id -u)/ .env
sed -ir s/^GROUP_ID=/GROUP_ID=$(id -g)/ .env sed -ir s/^GROUP_ID=/GROUP_ID=$(id -g)/ .env
NODE_IP=`getent hosts livekit.$DOMAIN | cut -d' ' -f1` # try to guess your livekit IP
if ! [ -z "$NODE_IP" ]; then if [ -x "$(command -v getent)" ]; then
sed -ir s/LIVEKIT_NODE_IP=127.0.0.1/LIVEKIT_NODE_IP=$NODE_IP/ .env NODE_IP=`getent hosts livekit.$DOMAIN | cut -d' ' -f1`
if ! [ -z "$NODE_IP" ]; then
sed -ir s/LIVEKIT_NODE_IP=127.0.0.1/LIVEKIT_NODE_IP=$NODE_IP/ .env
fi
fi fi
read -p "Enter base domain name (e.g. example.com): " DOMAIN read -p "Enter base domain name (e.g. example.com): " DOMAIN