Forbidden domains: fix documentation and loading code

master
Stephane Bortzmeyer 10 years ago
parent a1b7c75204
commit 7b75b4491c
  1. 5
      sample-config-file.ini
  2. 6
      test-server-with-config-file.py

@ -60,4 +60,9 @@ handle_wellknown_files = on
# as robots.txt or .well-known/*? Note this argument is ignored if
# url_base_service is not empty.
# forbidden_suffixes=
# A colon-separated list of domain suffixes that must not be
# queried. Useful if the DNS looking glass has access to a private DNS
# view.
# TODO whitelist (an array)

@ -4,6 +4,7 @@ import wsgiref.simple_server as server
import os
import getopt
import sys
import string
import ConfigParser
config_file = os.path.expanduser("~/.dnslg.ini")
@ -56,6 +57,8 @@ description = config.get(SECTION, 'description')
description_html = config.get(SECTION, 'description_html')
google_code = config.get(SECTION, 'code_google_webmasters')
edns_size = config.get(SECTION, 'size_edns')
forbidden_str = config.get(SECTION, 'forbidden_suffixes')
forbidden = string.split(forbidden_str, ':')
if edns_size is None or edns_size == "":
edns_size = None
else:
@ -68,7 +71,8 @@ querier = DNSLG.Querier(email_admin=email_admin, url_doc=url_doc, url_css=url_cs
edns_size=edns_size, bucket_size=rl_bucket_size,
google_code=google_code,
handle_wk_files=handle_wellknown_files,
description=description, description_html=description_html)
description=description, description_html=description_html,
forbidden_suffixes=forbidden)
# TODO listen on IPv6 as well
httpd = server.make_server("", port, querier.application)
print "Serving HTTP on port %i..." % port

Loading…
Cancel
Save