fix(remnawave): логи bootstrap видны, ключи только в файле
ansible-core-net / deploy (push) Failing after 11s
ansible-core-net / deploy (push) Failing after 11s
no_log остаётся на чтении секретов, Infisical и .env. stdout задачи — статус без токена и SECRET_KEY. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e4fc3fce69
commit
0699aa9476
3 files changed
+26
-12
No files matched your search
@@ -100,7 +100,8 @@ for old_uuid in ${old_uuids}; do
|
||||
api DELETE "/tokens/${old_uuid}" >/dev/null || true
|
||||
done
|
||||
active_token=""
|
||||
wildcard=$(api GET /tokens/scopes 2>/dev/null | jq -r '.response.wildcard // "*"')
|
||||
scopes_json=$(api GET /tokens/scopes || echo '{"response":{"wildcard":"*"}}')
|
||||
wildcard=$(printf '%s' "${scopes_json}" | jq -r '.response.wildcard // "*"')
|
||||
token_payload=$(jq -n --arg n "$RW_TOKEN_NAME" --arg s "${wildcard:-*}" \
|
||||
'{name: $n, expiresInDays: 3650, scopes: [$s]}')
|
||||
if token_resp=$(api POST /tokens/ -d "${token_payload}"); then
|
||||
@@ -109,6 +110,7 @@ if token_resp=$(api POST /tokens/ -d "${token_payload}"); then
|
||||
if [ -n "${created}" ]; then
|
||||
active_token="${created}"
|
||||
token_updated=1
|
||||
echo "API-токен ${RW_TOKEN_NAME} перевыпущен" >&2
|
||||
else
|
||||
echo "WARN: POST /tokens/ без поля token" >&2
|
||||
fi
|
||||
@@ -373,9 +375,14 @@ if [ -n "${RW_USERS_FILE:-}" ] && [ -f "${RW_USERS_FILE}" ]; then
|
||||
done < <(printf '%s' "${existing}" | jq -r '.response.users[]? | "\(.username)\t\(.uuid)"')
|
||||
fi
|
||||
|
||||
# Секреты только в файл 0600. В stdout — статус без значений ключей.
|
||||
secrets_file="${RW_SECRETS_FILE:-/opt/remnawave/.bootstrap-secrets.json}"
|
||||
umask 077
|
||||
jq -n --arg api_token "${active_token}" --arg node_secret "${node_secret}" \
|
||||
'{api_token: $api_token, node_secret: $node_secret}' > "${secrets_file}"
|
||||
chmod 600 "${secrets_file}"
|
||||
|
||||
jq -n \
|
||||
--arg api_token "${active_token}" \
|
||||
--arg node_secret "${node_secret}" \
|
||||
--arg profile_uuid "${profile_uuid}" \
|
||||
--arg node_uuid "${node_uuid}" \
|
||||
--arg host_uuid "${host_uuid}" \
|
||||
@@ -387,8 +394,6 @@ jq -n \
|
||||
--argjson host_created "${host_created}" \
|
||||
--argjson users_changed "${users_changed}" \
|
||||
'{
|
||||
api_token: $api_token,
|
||||
node_secret: $node_secret,
|
||||
profile_uuid: $profile_uuid,
|
||||
node_uuid: $node_uuid,
|
||||
host_uuid: $host_uuid,
|
||||
|
||||
Reference in new issue
Block a user