diff --git a/conf/sip-communicator.properties b/conf/sip-communicator.properties index 24cf4ef..2f19f54 100644 --- a/conf/sip-communicator.properties +++ b/conf/sip-communicator.properties @@ -1,2 +1,4 @@ org.jitsi.impl.neomedia.transform.srtp.SRTPCryptoContext.checkReplay=false org.jitsi.videobridge.TCP_HARVESTER_PORT=__PORT__ +org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=__PRIVATE_IPV4__ +org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=__PUBLIC_IPV4__ diff --git a/scripts/install b/scripts/install index 6a22c62..32c231c 100644 --- a/scripts/install +++ b/scripts/install @@ -171,9 +171,14 @@ ynh_systemd_action --service_name=metronome --action=restart #================================================= ynh_print_info --message="Building Jitsi-Videobridge..." +public_ipv4="$(curl ip.yunohost.org)" || true +private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true + mkdir -p "$final_path/.sip-communicator" cp ../conf/sip-communicator.properties "$final_path/.sip-communicator/sip-communicator.properties" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/.sip-communicator/sip-communicator.properties" +ynh_replace_string --match_string="__PRIVATE_IPV4__" --replace_string="$private_ipv4" --target_file="$final_path/.sip-communicator/sip-communicator.properties" +ynh_replace_string --match_string="__PUBLIC_IPV4__" --replace_string="$public_ipv4" --target_file="$final_path/.sip-communicator/sip-communicator.properties" chown -R $app: $final_path #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0219936..28f2e3a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,9 +147,14 @@ ynh_print_info --message="Building Jitsi-Videobridge..." if [ "$upgrade_type" == "UPGRADE_APP" ] then + public_ipv4="$(curl ip.yunohost.org)" || true + private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true + mkdir -p "$final_path/.sip-communicator" cp ../conf/sip-communicator.properties "$final_path/.sip-communicator/sip-communicator.properties" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/.sip-communicator/sip-communicator.properties" + ynh_replace_string --match_string="__PRIVATE_IPV4__" --replace_string="$private_ipv4" --target_file="$final_path/.sip-communicator/sip-communicator.properties" + ynh_replace_string --match_string="__PUBLIC_IPV4__" --replace_string="$public_ipv4" --target_file="$final_path/.sip-communicator/sip-communicator.properties" chown -R $app: $final_path fi