Skip to content

Commit

Permalink
Removing invalid values in case they slip through, Issue #109
Browse files Browse the repository at this point in the history
  • Loading branch information
danielperna84 committed Aug 8, 2018
1 parent bd4d23f commit e226667
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3497,6 +3497,7 @@ def load_settings(settingsfile):
ipaddress.ip_network(net)
except Exception:
LOG.warning("Invalid network in ALLOWED_NETWORKS: %s", net)
ALLOWED_NETWORKS.remove(net)
BANNED_IPS = settings.get("BANNED_IPS", BANNED_IPS)
if BANNED_IPS and not all(BANNED_IPS):
LOG.warning("Invalid value for BANNED_IPS. Using empty list.")
Expand All @@ -3506,6 +3507,7 @@ def load_settings(settingsfile):
ipaddress.ip_address(banned_ip)
except Exception:
LOG.warning("Invalid IP address in BANNED_IPS: %s", banned_ip)
BANNED_IPS.remove(banned_ip)
BANLIMIT = settings.get("BANLIMIT", BANLIMIT)
DEV = settings.get("DEV", DEV)
IGNORE_PATTERN = settings.get("IGNORE_PATTERN", IGNORE_PATTERN)
Expand Down

0 comments on commit e226667

Please sign in to comment.