Fixed AWG scripts
Check with kubeconform / lint (push) Successful in 12s
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 9s
Auto-update README / Generate README and Create MR (push) Successful in 6s

This commit is contained in:
ab
2026-09-17 17:38:30 +03:00
parent 29c5b00c16
commit 5783547bd3
+12 -6
View File
@@ -96,12 +96,18 @@ data:
[[ "${source}" == \#* ]] && continue [[ "${source}" == \#* ]] && continue
if [ -n "${extra:-}" ] \ if [ -n "${extra:-}" ] \
|| ! valid_ipv4_32 "${source}" \ || ! valid_ipv4_32 "${source}" \
|| ! valid_ipv4_32 "${destination:-}" \ || ! valid_ipv4_32 "${destination:-}"; then
|| ! routed_through_awg0 "${source}" \ echo "Skipping malformed policy line: ${source:-} ${destination:-} ${extra:-}" >&2
|| ! routed_through_awg0 "${destination}"; then continue
echo "Invalid or out-of-tunnel policy line: ${source:-} ${destination:-} ${extra:-}" >&2 fi
"${IPTABLES[@]}" -F "${inactive}" # A pair whose endpoints are not (yet) routed through awg0 is skipped
return 1 # rather than fatal. During interface bring-up the awg0 route may not be
# in place, and a missing ACCEPT simply leaves the pair subject to the
# client-isolation DROP below (fail-closed) instead of aborting the whole
# policy and crash-looping the container.
if ! routed_through_awg0 "${source}" || ! routed_through_awg0 "${destination}"; then
echo "Skipping out-of-tunnel policy pair: ${source} ${destination}" >&2
continue
fi fi
"${IPTABLES[@]}" -A "${inactive}" \ "${IPTABLES[@]}" -A "${inactive}" \
-i awg0 -o awg0 -s "${source}" -d "${destination}" \ -i awg0 -o awg0 -s "${source}" -d "${destination}" \