From bca4cb82275c348b89420a7bb23954bea3a47c4e Mon Sep 17 00:00:00 2001 From: bunker-admin Date: Thu, 9 Apr 2026 11:58:14 -0600 Subject: [PATCH] Fix Pangolin site creation: omit address field from payload The clientAddress from pickSiteDefaults lacks CIDR notation and gets rejected by the Pangolin API. Omitting it lets Pangolin auto-assign. Bunker Admin --- config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.sh b/config.sh index 9f239936..b14f6e09 100755 --- a/config.sh +++ b/config.sh @@ -1075,10 +1075,9 @@ pangolin_create_site() { local defaults_resp defaults_resp=$(pangolin_api GET "$api_url/org/$org_id/pick-site-defaults" "$api_key") - local newt_id newt_secret client_address + local newt_id newt_secret newt_id=$(echo "$defaults_resp" | jq -r '.data.newtId // .newtId // empty' 2>/dev/null) newt_secret=$(echo "$defaults_resp" | jq -r '.data.newtSecret // .newtSecret // .data.secret // .secret // empty' 2>/dev/null) - client_address=$(echo "$defaults_resp" | jq -r '.data.clientAddress // .clientAddress // .data.address // .address // empty' 2>/dev/null) if [[ -z "$newt_id" || -z "$newt_secret" ]]; then warn "Could not fetch Newt credentials from pickSiteDefaults." @@ -1090,12 +1089,13 @@ pangolin_create_site() { info "Creating site \"$site_name\"..." local create_payload + # Note: omit 'address' — Pangolin auto-assigns it; clientAddress from + # pickSiteDefaults lacks CIDR notation and gets rejected. create_payload=$(jq -n \ --arg name "$site_name" \ --arg newtId "$newt_id" \ --arg secret "$newt_secret" \ - --arg address "$client_address" \ - '{name: $name, type: "newt", newtId: $newtId, secret: $secret, address: $address}') + '{name: $name, type: "newt", newtId: $newtId, secret: $secret}') local site_resp site_resp=$(pangolin_api PUT "$api_url/org/$org_id/site" "$api_key" "$create_payload")