Compare commits
1 Commits
main
...
811680a893
| Author | SHA1 | Date | |
|---|---|---|---|
| 811680a893 |
17
piawg.sh
17
piawg.sh
@@ -352,6 +352,7 @@ wg_reply="$(bao_curl "$BAO_KV_MOUNT/data/$BAO_PATH_CONFIG")"
|
|||||||
server_ip="$(printf '%s' "$wg_reply" | jq -r .data.data.server_ip)"
|
server_ip="$(printf '%s' "$wg_reply" | jq -r .data.data.server_ip)"
|
||||||
server_cn="$(printf '%s' "$wg_reply" | jq -r .data.data.server_cn)"
|
server_cn="$(printf '%s' "$wg_reply" | jq -r .data.data.server_cn)"
|
||||||
server_port="$(printf '%s' "$wg_reply" | jq -r .data.data.server_port)"
|
server_port="$(printf '%s' "$wg_reply" | jq -r .data.data.server_port)"
|
||||||
|
server_vip="$(printf '%s' "$wg_reply" | jq -r .data.data.server_vip)"
|
||||||
debug -f "Config from OpenBao ($BAO_PATH_CONFIG)\n%s" \
|
debug -f "Config from OpenBao ($BAO_PATH_CONFIG)\n%s" \
|
||||||
"$(printf '%s' "$wg_reply" | jq .)"
|
"$(printf '%s' "$wg_reply" | jq .)"
|
||||||
unset wg_reply
|
unset wg_reply
|
||||||
@@ -382,3 +383,19 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if conf_reply="$(bao_curl "$BAO_KV_MOUNT/data/$BAO_PATH_CONFIG")"; then
|
||||||
|
port_forward="$(printf '%s' "$conf_reply" | jq -r '.port_forward')"
|
||||||
|
if [ "$port_forward" = "true" ]; then
|
||||||
|
server_cn="$(printf '%s' "$conf_reply" | jq -r '.server_cn')"
|
||||||
|
server_vip="$(printf '%s' "$conf_reply" | jq -r '.server_vip')"
|
||||||
|
if ! pf_sig_reply="$(_curl --resolve "$server_cn:19999:$server_vip" \
|
||||||
|
--data-urlencode "token=$bao_token" \
|
||||||
|
"https://$server_cn:19999/getSignature")"; then
|
||||||
|
err "Failed to connect to https://$server_cn:19999/getSignature"
|
||||||
|
fi
|
||||||
|
debug -f "getSignature\n%s" "$(printf '%s' "$pf_sig_reply" | jq .)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
debug -f "Check for port_forward value in OpenBao ($BAO_PATH_CONFIG)\n%s" \
|
||||||
|
"$conf_reply"
|
||||||
|
|||||||
Reference in New Issue
Block a user