fix(mullvad): Use --data-urlencode for Mullvad API key registration

Base64 WG pubkeys with + or / chars break plain -d POST. Hit this
on VPS setup — "Invalid public key" from Mullvad API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 11:43:55 +00:00
parent e4d44f821a
commit 15acd96076

View File

@@ -95,8 +95,8 @@ cmd_setup() {
# --- Step 2: Register with Mullvad API --- # --- Step 2: Register with Mullvad API ---
echo "Registering key with Mullvad..." echo "Registering key with Mullvad..."
RESULT=$(curl -s --max-time 15 -X POST https://api.mullvad.net/wg/ \ RESULT=$(curl -s --max-time 15 -X POST https://api.mullvad.net/wg/ \
-d "account=$ACCOUNT" \ --data-urlencode "account=$ACCOUNT" \
-d "pubkey=$PUBKEY") --data-urlencode "pubkey=$PUBKEY")
if echo "$RESULT" | grep -q "^[0-9]"; then if echo "$RESULT" | grep -q "^[0-9]"; then
MULLVAD_IPV4=$(echo "$RESULT" | cut -d',' -f1) MULLVAD_IPV4=$(echo "$RESULT" | cut -d',' -f1)