Skip to content

Commit

Permalink
Update relay jar and necessary configs (#5)
Browse files Browse the repository at this point in the history
* Update relays.txt to use PASSWD and NO_PASSWD

* Update Dockerfile to latest relay commit

* Update start.sh generate config with PASSWD and NO_PASSWD
  • Loading branch information
UplandJacob2 authored Nov 17, 2024
1 parent 15e06ed commit b9710e7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
3 changes: 2 additions & 1 deletion eag-relay/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ COPY relays.txt /
RUN chmod +x start.sh
RUN chmod +x run.sh

ARG RELAY_DL_COMMIT="7a9c154254415e6646fc6afdcf66279d521e1f56"
# commit ID at git.eaglercraft.rip/eaglercraft/eaglercraft-1.8 to download the relay jar from
ARG RELAY_DL_COMMIT="59aee1b42f8d06b9a7d1813cb89afe08112c7fcc"

# Uses /bin for compatibility purposes
# hadolint ignore=DL4005
Expand Down
22 changes: 11 additions & 11 deletions eag-relay/relays.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
[STUN]
[NO_PASSWD]
url=stun:stun.duckdns.org:3478

[STUN]
[NO_PASSWD]
url=stun:stun.l.google.com:19302

[STUN]
[NO_PASSWD]
url=stun:stun1.l.google.com:19302

[STUN]
[NO_PASSWD]
url=stun:stun2.l.google.com:19302

[STUN]
[NO_PASSWD]
url=stun:stun3.l.google.com:19302

[STUN]
[NO_PASSWD]
url=stun:stun4.l.google.com:19302

[STUN]
[NO_PASSWD]
url=stun:stun.stunprotocol.org:3478


[TURN]
[NO_PASSWD]
url=turn:turn.duckdns.org:5349

[TURN]
[PASSWD]
url=turn:turn.speed.cloudflare.com:50000
username=aa6bfdace75434eb08879f54aca515b83e8e69579d461d3dcae71ed3e1a2b5f856780dace4d82bed70848733e5c1e958def215f32f156e2b85a63a90340fde82
credential=aba9b169546eb6dcc7bfb1cdf34544cf95b5161d602e3b5fa7c8342b2e9802fb

[TURN]
[NO_PASSWD]
url=turn:turn01.hubl.in?transport=udp

[TURN]
[NO_PASSWD]
url=turn:turn01.hubl.in?transport=tcp

19 changes: 10 additions & 9 deletions eag-relay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,25 @@ relayJSON=$(echo $RELAYS | sed 's/}/},/g' | sed '$ s/,$//' | awk '{print "[" $0
logGreen "relays JSON formatted:"
echo $relayJSON
echo ""

length=$(echo "$relayJSON" | jq '. | length')

relays=""
for (( i=0; i<$length; i++ )); do
type=$(echo "$relayJSON" | jq -r ".[$i].type")
# type=$(echo "$relayJSON" | jq -r ".[$i].type")
url=$(echo "$relayJSON" | jq -r ".[$i].url")
user=$(echo "$relayJSON" | jq -r ".[$i].username // empty")
cred=$(echo "$relayJSON" | jq -r ".[$i].credential // empty")

relays+="[$type]\nurl=$url\n"
[ -n "$user" ] && relays+="username=$user\n"
[ -n "$cred" ] && relays+="credential=$cred\n"

if [ -n "$user" ] && [ -n "$cred" ]; then
relays+="[PASSWD]\nurl=$url\nusername=$user\ncredential=$cred\n\n"
else
relays+="[NO_PASSWD]\nurl=$url\n\n"
fi
# relays+="[$type]\nurl=$url\n"
# [ -n "$user" ] && relays+="username=$user\n"
# [ -n "$cred" ] && relays+="credential=$cred\n"
relays+="\n"
done

echo -e "$relays" > relays.txt

logGreen "relays.txt:"
cat relays.txt

Expand Down

0 comments on commit b9710e7

Please sign in to comment.