From 91850ce83561cdd24f21a0dfa67d0754b0ff5e80 Mon Sep 17 00:00:00 2001 From: Brad Kollmyer Date: Fri, 10 Jul 2026 14:54:38 -0700 Subject: firewall: T9076: add per-remote-group update interval Add 'set firewall group remote-group interval ' to control how often each remote group list is re-downloaded, independent of the global resolver-interval that also drives domain-group/FQDN resolution. The value accepts plain seconds or time-unit suffixes s/m/h/d/w (e.g. 4h), range 60 seconds to 4 weeks, enforced at commit time after conversion. When unset, the group keeps following 'firewall global-options resolver-interval', so existing configurations are unaffected. vyos-domain-resolver now tracks a last-update timestamp per remote group and sleeps until the next due update instead of a fixed resolver-interval tick, honoring per-group intervals both shorter and longer than the global one. A group is only stamped as updated after a successful download; failed downloads fall back to the cached list and are retried at the resolver cadence rather than after the full group interval. human_to_seconds() now treats a plain number as seconds instead of returning 0. Co-Authored-By: Claude Fable 5 --- python/vyos/utils/convert.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/utils/convert.py b/python/vyos/utils/convert.py index bdc9fd549..f867b4167 100644 --- a/python/vyos/utils/convert.py +++ b/python/vyos/utils/convert.py @@ -26,10 +26,14 @@ time_units = { def human_to_seconds(time_str): - """ Converts a human-readable interval such as 1w4d18h35m59s - to number of seconds + """Converts a human-readable interval such as 1w4d18h35m59s + to number of seconds. A plain number is taken as seconds. """ + time_str = str(time_str) + if time_str.isdigit(): + return int(time_str) + time_patterns = { 'y': r'(\d+)\s*y', 'w': r'(\d+)\s*w', -- cgit v1.2.3