Browse Source

Fix: consider empty/undefined whitelists

master
Pekka Helenius 5 years ago
parent
commit
25c8e56519
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      data/dns-sinkhole_gen.py

+ 11
- 7
data/dns-sinkhole_gen.py View File

@ -219,10 +219,10 @@ domains_blacklists = [
# Exclude these pre-blacklisted domains from the final DNS sinkhole blacklist # Exclude these pre-blacklisted domains from the final DNS sinkhole blacklist
domains_whitelists = [ domains_whitelists = [
{
'name': 'My custom whitelist',
'url': 'file:///home/' + os.environ['USER'] + '/dns-whitelist.txt'
}
# {
# 'name': 'My custom whitelist',
# 'url': 'file:///home/' + os.environ['USER'] + '/dns-whitelist.txt'
# }
] ]
######################################## ########################################
@ -287,10 +287,14 @@ filewrite(filepath, dnscrypt_datafile, dnscrypt_fileheader, 'w', True)
# Download and parse white/blocklists # Download and parse white/blocklists
########## ##########
for whitelist in domains_whitelists:
whitelist_dataset = getlist(whitelist, url_timeout)
if domains_whitelists:
for whitelist in domains_whitelists:
whitelist_dataset = getlist(whitelist, url_timeout)
whitelist_fetched_data = fetchdomaindata(whitelist_dataset)
else:
whitelist_fetched_data = set()
whitelist_fetched_data = fetchdomaindata(whitelist_dataset)
########## ##########
for blacklist in domains_blacklists: for blacklist in domains_blacklists:


Loading…
Cancel
Save