fix(remnawave): парсить keypairs[] из x25519 generate v3
ansible-core-net / deploy (push) Failing after 1m27s

API отдаёт массив пар, а не одиночные privateKey/publicKey.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
karpenokandCursor committed 2026-11-11 22:48:29 +07:00
1 parent 8872b8765e
commit a4a0655888
1 file changed
+6 -3
@@ -117,11 +117,14 @@ pub=""
if [ -z "${profile_uuid}" ]; then
key_resp=$(api GET /system/tools/x25519/generate 2>/dev/null || echo '{}')
# v3: {response:{keypairs:[{publicKey,privateKey},...]}}
priv=$(printf '%s' "${key_resp}" | jq -r '
.response.privateKey // .response.privKey // .privateKey // .privKey // empty')
.response.keypairs[0].privateKey
// .response.privateKey // .response.privKey // .privateKey // .privKey // empty')
pub=$(printf '%s' "${key_resp}" | jq -r '
.response.publicKey // .response.pubKey // .publicKey // .pubKey // empty')
if [ -z "${priv}" ]; then
.response.keypairs[0].publicKey
// .response.publicKey // .response.pubKey // .publicKey // .pubKey // empty')
if [ -z "${priv}" ] || [ -z "${pub}" ]; then
echo "Не удалось сгенерировать X25519 ключи Reality" >&2
printf '%s\n' "${key_resp}" >&2
exit 1