feat(security): isolate exit nodes via NetBird Zero-Trust ACL and pull-mode metrics
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 3s
ansible-deploy / deploy (core-net, ) (push) Successful in 10s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 1m27s
ansible-deploy / deploy (opnsense, ) (push) Successful in 16s
ansible-deploy / deploy (rus-central, ) (push) Successful in 28s

This commit is contained in:
karpenok committed 2026-11-18 12:24:43 +07:00
1 parent ca25b1d042
commit a5f3400c0c
12 files changed
+273 -56

No files matched your search

@@ -145,40 +145,9 @@
routes_json=$(curl "${CURL_OPTS[@]}" -H "Authorization: Token ${active_token}" "${API_BASE}/routes")
existing_route=$(printf '%s' "${routes_json}" | jq -c --arg nid "$NB_LAN_NET_ID" --arg net "$NB_LAN_SUBNET" '.[] | select(.network_id == $nid or .network == $net)' | head -n 1)
existing_route_id=$(printf '%s' "${existing_route}" | jq -r '.id // empty' 2>/dev/null || true)
needs_lan_route_update="false"
if [ -n "${existing_route_id}" ]; then
needs_lan_route_update=$(printf '%s' "${existing_route}" | jq -r --arg rmg "$remna_group_id" '((.groups // []) | sort) != ([$rmg] | sort)')
fi
if [ -z "${existing_route_id}" ] || [ "${needs_lan_route_update}" = "true" ]; then
route_payload=$(jq -n \
--arg desc "Homelab LAN (${NB_LAN_SUBNET} via OPNsense)" \
--arg nid "$NB_LAN_NET_ID" \
--arg net "$NB_LAN_SUBNET" \
--arg rg "$router_group_id" \
--arg rmg "$remna_group_id" \
'{
description: $desc,
network_id: $nid,
enabled: true,
peer_groups: [$rg],
network: $net,
metric: 100,
masquerade: true,
groups: [$rmg],
keep_route: true
}')
if [ -z "${existing_route_id}" ]; then
curl "${CURL_OPTS[@]}" -X POST "${API_BASE}/routes" \
-H "Authorization: Token ${active_token}" \
-H "Content-Type: application/json" \
-d "${route_payload}" >/dev/null
else
curl "${CURL_OPTS[@]}" -X PUT "${API_BASE}/routes/${existing_route_id}" \
-H "Authorization: Token ${active_token}" \
-H "Content-Type: application/json" \
-d "${route_payload}" >/dev/null
fi
curl "${CURL_OPTS[@]}" -X DELETE "${API_BASE}/routes/${existing_route_id}" \
-H "Authorization: Token ${active_token}" >/dev/null || true
route_created=1
fi