Skip to content
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

fix invalid HTTPS check #58

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ if [ "$(uci get wireguard.mesh_vpn.enabled)" == "true" ] || [ "$(uci get wiregua
PUBLICKEY=$(uci get network.wg_mesh.private_key | wg pubkey)

# Push public key to broker, test for https and use if supported
wget -q https://[::1]
if [ $? -eq 1 ]; then
PROTO=http
else
if wget -q "https://[::1]"
then
PROTO=https
else
PROTO=http
fi

NODENAME=$(uci get system.@system[0].hostname)
Expand Down Expand Up @@ -127,4 +127,4 @@ if [ "$(uci get wireguard.mesh_vpn.enabled)" == "true" ] || [ "$(uci get wiregua
# If we have a BATMAN_V env we need to correct the throughput value now
batctl hardif mesh-vpn throughput_override 1000mbit;
fi
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ if [ "$(uci get gluon.mesh_vpn.enabled)" == "true" ] || [ "$(uci get gluon.mesh_
# check if registration has been done since last boot
if [ ! -f /tmp/WG_REGISTRATION_SUCCESSFUL ]; then
# Push public key to broker, test for https and use if supported
wget -q https://[::1]
if [ $? -eq 1 ]; then
PROTO=http
else
if wget -q "https://[::1]"
then
PROTO=https
else
PROTO=http
fi
PUBLICKEY=$(uci get network.wg_mesh.private_key | wg pubkey)
NODENAME=$(uci get system.@system[0].hostname)
Expand All @@ -20,4 +20,4 @@ if [ "$(uci get gluon.mesh_vpn.enabled)" == "true" ] || [ "$(uci get gluon.mesh_
logger -t wg-registration "successfully registered wg publickey"
fi
fi
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ if [ "$(uci get wireguard.mesh_vpn.enabled)" == "true" ] || [ "$(uci get wiregua
SEGMENT=$(uci get gluon.core.domain)

# Push public key to broker, test for https and use if supported
wget -q https://[::1]
if [ $? -eq 1 ]; then
PROTO=http
else

if wget -q "https://[::1]"
then
PROTO=https
else
PROTO=http
fi
gluon-wan wget -q -O- --post-data='{"domain": "'"$SEGMENT"'","public_key": "'"$PUBLICKEY"'"}' $PROTO://$(uci get wireguard.mesh_vpn.broker)

Expand Down