From e90d04760172b19c4b7076d0bad82a43396fc922 Mon Sep 17 00:00:00 2001 From: Matteo Di Lorenzi Date: Tue, 30 Jun 2026 11:43:20 +0200 Subject: [PATCH] fix(ns.threatshield): update geoblocking config to block only input connections --- packages/ns-api/files/ns.threatshield | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/ns-api/files/ns.threatshield b/packages/ns-api/files/ns.threatshield index e5d8bbd7c..fa061d7d0 100644 --- a/packages/ns-api/files/ns.threatshield +++ b/packages/ns-api/files/ns.threatshield @@ -1032,15 +1032,22 @@ def set_geoblocking_configuration(e_uci, payload): # handle the country feed enable/disable feeds = list(e_uci.get('banip', 'global', 'ban_feed', list=True, default=[])) - + ban_blockinput = list(e_uci.get('banip', 'global', 'ban_blockinput', list=True, default=[])) + if payload['enabled']: # add 'country' feed if not present if 'country' not in feeds: feeds.append('country') + if 'country' not in ban_blockinput: + ban_blockinput.append('country') + e_uci.set('banip', 'global', 'ban_blockinput', ban_blockinput) else: # remove 'country' feed if present if 'country' in feeds: feeds.remove('country') + if 'country' in ban_blockinput: + ban_blockinput.remove('country') + e_uci.set('banip', 'global', 'ban_blockinput', ban_blockinput) # convert country codes to lowercase countries = [c.lower() for c in payload['countries']]