-
Notifications
You must be signed in to change notification settings - Fork 113
feat(pegboard): expose rivet server from within containers for docker compose #2628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0a32a7f
to
f56f348
Compare
046dd3e
to
2a7b66a
Compare
Deploying rivet with
|
Latest commit: |
eea0c38
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a648c09f.rivet.pages.dev |
Branch Preview URL: | https://06-17-feat-pegboard-expose-r.rivet.pages.dev |
f56f348
to
7d71cc9
Compare
2a7b66a
to
2b3a103
Compare
RIVET_SERVER_HOST="$(dig +short rivet-server)" | ||
echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | ||
add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DNS lookup for rivet-server
lacks error handling. If the lookup fails, RIVET_SERVER_HOST
will be empty, resulting in an invalid iptables rule (-j DNAT --to-destination
). Consider adding validation to ensure RIVET_SERVER_HOST
contains a valid IP address before creating the rule:
RIVET_SERVER_HOST="$(dig +short rivet-server)"
if [ -z "$RIVET_SERVER_HOST" ]; then
echo "ERROR: Failed to resolve rivet-server hostname"
exit 1
fi
echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)"
add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST"
This ensures the script fails explicitly rather than creating a broken network configuration.
RIVET_SERVER_HOST="$(dig +short rivet-server)" | |
echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | |
add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" | |
RIVET_SERVER_HOST="$(dig +short rivet-server)" | |
if [ -z "$RIVET_SERVER_HOST" ]; then | |
echo "ERROR: Failed to resolve rivet-server hostname" | |
exit 1 | |
fi | |
echo "Adding rule to forward $RIVET_SERVER_IPV4 to rivet-server ($RIVET_SERVER_HOST)" | |
add_ipt_rule "$ipt" "nat" "$NAT_CHAIN" "-d $RIVET_SERVER_IPV4 -j DNAT --to-destination $RIVET_SERVER_HOST" |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
2b3a103
to
6fe1578
Compare
7d71cc9
to
38061b3
Compare
Deploying rivet-hub with
|
Latest commit: |
eea0c38
|
Status: | ✅ Deploy successful! |
Preview URL: | https://55ee5baf.rivet-hub-7jb.pages.dev |
Branch Preview URL: | https://06-17-feat-pegboard-expose-r.rivet-hub-7jb.pages.dev |
38061b3
to
f07e495
Compare
6fe1578
to
8cc2d55
Compare
8cc2d55
to
eea0c38
Compare
f07e495
to
a130124
Compare
a130124
to
a38bee6
Compare
eea0c38
to
14ceb65
Compare
14ceb65
to
eea0c38
Compare
a38bee6
to
a130124
Compare
Merge activity
|
… compose (#2628) <!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes