1 # -*- mode: python ; coding: utf-8 -*-
7 # This file uses Python syntax, and is sourced as if it were a .py file. Just
8 # pretend you're writing Python, and everything will be peachy keen.
9 #______________________________________________________________________________
11 # Part of BridgeDB, a Tor bridge distribution system.
13 # :authors: The Tor Project, Inc.
14 # :license: This file is freely distributed as part of BridgeDB, see LICENSE
16 # :copyright: (c) 2007-2017 The Tor Project, Inc.
17 # (c) 2007-2017, all sentient entities within the AUTHORS file
19 #===============================================================================
23 # Changed in version 0.3.3 - 2015-07-22
24 # * ADD new options, CSP_ENABLED, CSP_REPORT_ONLY, and CSP_INCLUDE_SELF for
25 # setting options related to HTTP(S) Distributor Content Security Policy
28 # Changed in version 0.3.2 - 2015-04-30
29 # * CHANGE to using BridgeDB release versions for bridgedb.conf file versions.
30 # * ADD support for specifying bridge rotation periods via the
31 # EMAIL_ROTATION_PERIOD and HTTPS_ROTATION_PERIOD settings.
32 # * ADD a new option, IGNORE_NETWORKSTATUS, which controls if BridgeDB cares
33 # whether or not a bridge was present in the BridgeAuthority's
34 # networkstatus-bridges file, as well as what information is gleaned from
35 # the bridge-networkstatus documents within that file.
37 # Changed in version 0.0.15 - 2015-03-26
38 # * ADD new SUPPORTED_TRANSPORTS and DEFAULT_TRANSPORT settings.
40 # Changes in version 0.0.14 - 2015-02-22
41 # * ADD new OpenPGP-related options:
43 # - EMAIL_GPG_PRIMARY_KEY_FINGERPRINT
44 # - EMAIL_GPG_PASSPHRASE
45 # - EMAIL_GPG_PASSPHRASE_FILE
46 # * REMOVE old OpenPGP signing key file option, EMAIL_GPG_SIGNING_KEY.
48 # Changes in version 0.0.13 - 2015-02-20
49 # * ADD NO_DISTRIBUTION_COUNRIES option for refusing to distribute bridges
50 # whose primary ORAddress is geolocated to any of some certain countries.
52 # Changes in version 0.0.12 - 2015-02-06
53 # * ADD a dictionary of TASKS to be run and the intervals at which they
56 # Changes in version 0.0.11 - 2014-07-06
57 # * ADD EMAIL_BLACKLIST and EMAIL_FUZZY_MATCH settings.
59 # Changes in version 0.0.10 - 2014-06-06
60 # * Support requiring distribution of bridges with the "Running" flag.
62 # Changes in version 0.0.9 - 2014-06-06
63 # * ADD EMAIL_WHITELIST setting.
65 # Changes in version 0.0.8 - 2014-05-14
66 # * CHANGE RECAPTCHA_PRIV_KEY to RECAPTCHA_SEC_KEY.
68 # Changes in version 0.0.7 - 2014-03-31
69 # * ADD new settings for tracing function calls and thread info within logged
70 # messages: LOG_THREADS, LOG_TRACE, and LOG_TIME_FORMAT.
72 # Changes in version 0.0.6 - 2014-03-28
73 # * CHANGE gimp-captchas to be the norm.
74 # * ADD bucket for support team.
76 # Changes in version 0.0.5 - 2014-02-27
77 # * ADD GIMP_CAPTCHA_ENABLED, GIMP_CAPTCHA_DIR, GIMP_CAPTCHA_HMAC_KEYFILE,
78 # and GIMP_CAPTCHA_RSA_KEYFILE settings (see #10809).
79 # * Decrease email share.
80 # * Whitelist the public IP address of bridges.torproject.org in
81 # RECAPTCHA_REMOTE_IP setting.
83 # Changes in version 0.0.4 - 2014-01-24
84 # * ADD COLLECT_TIMESTAMPS option (see #10724). Set it to False for the
85 # staging instance (etc/test-bridgedb.conf), and True for the production
86 # server (etc/bridgedb.conf).
88 # Changes in version 0.0.3 - 2014-01-17
89 # * UPDATE config from bridgedb.git/bridgedb.conf, without changing any of the
92 # Changes in version 0.0.2 - 2014-01-17
93 # * ADD missing settings, EMAIL_GPG_SIGNING_ENABLED and EMAIL_GPG_SIGNING_KEY.
95 # Changes in version 0.0.1 - 2013-08-30
96 # * ADD version of config file in use on ponticum.
97 # - Two config variables, RECAPTCHA_PUB_KEY and RECAPTCHA_PRIV_KEY, have
98 # been removed, they can be found in:
99 # patches/001-bridgedb-conf-recaptcha-vars.patch.
100 # * CLEANUP the config file slightly (such as adding these headers) and
101 # fixing the linewraps. No other variables were touched.
103 #===============================================================================
105 #===========================#
106 # General-purpose options #
107 #___________________________#
110 # Required Files \ You'll want to make sure that these ones exist!
111 #------------------------------------------------------------------------------
113 # All filenames are taken as relative to the RUNTIME directory, which is the
114 # current working directory when you call the ``bridgedb`` script, or you may
115 # specify a particular RUNTIME directory by doing:
117 # $ bridgedb -r /path/to/some/nice/place
119 # Obviously, this config file should live in that directory, so that BridgeDB
121 #------------------------------------------------------------------------------
123 # List of directories which contain versions of the files specified in
124 # BRIDGE_FILES, EXTRA_INFO_FILES, and STATUS_FILE.
125 BRIDGE_AUTHORITY_DIRECTORIES = ["from-authority", "from-bifroest"]
127 # List of filenames from which we read ``@type bridge-server-descriptor``s, on
128 # startup and on SIGHUP.
129 BRIDGE_FILES = ["bridge-descriptors"]
131 # List of filenames from which we read ``@type bridge-extra-info``
132 # descriptors, for learning about a bridge's pluggable transports:
133 EXTRA_INFO_FILES = ["cached-extrainfo", "cached-extrainfo.new"]
135 # Filename from which we read ``@type bridge-network-status`` entries, for
136 # learning which current bridges are Running, as well as their IPv6 addresses.
137 STATUS_FILE = "networkstatus-bridges"
139 # If ``True``, then the only information which we obtain from the
140 # networkstatus file (the ``STATUS_FILE`` option) created by the
141 # BridgeAuthority are the bridge flags (i.e. "Running", "Stable", etc.), and
142 # we ignore all errors which have anything to do with networkstatus being
143 # wrong, out-of-date, or missing.
145 # Otherwise, if ``False``, use the networkstatus to determine which bridges
146 # should be distributed.
148 # See https://bugs.torproject.org/9380#comment:39,
149 # https://bugs.torproject.org/11216, and https://bugs.torproject.org/15866.
151 IGNORE_NETWORKSTATUS = True
154 # Output Files \ Where to store created data
155 #------------------------------------------------------------------------------
157 # These will get automatically created for you, just specify where they should
159 #------------------------------------------------------------------------------
161 # Either a file to log to, or None if we should log to the console.
162 LOGFILE = "bridgedb.log"
164 # File in which to write our pid
165 PIDFILE = "bridgedb.pid"
167 # Filename of the database to store persistent info in.
168 DB_FILE = "bridgedist.db"
170 # Filename to log changes to persistent info in. For debugging and bugfixing.
171 DB_LOG_FILE = "bridgedist.log"
173 # Filename where we store our secret HMAC root key. This file and the key
174 # inside are automatically created for you if they do not exist.
175 MASTER_KEY_FILE = "secret_key"
177 # File to which we dump bridge pool assignments for statistics.
178 ASSIGNMENTS_FILE = "assignments.log"
180 # Name of the file that contains BridgeDB's metrics.
181 METRICS_FILE = "bridgedb-metrics.log"
185 #------------------------------------------------------------------------------
187 # Be sure to also see the LOGFILE option above!
188 #------------------------------------------------------------------------------
190 # One of "DEBUG", "INFO", "WARNING", "ERROR", or "FATAL:
193 # If true, we scrub all potentially identifying information before we log it
196 # Logfile rotation settings
198 LOGFILE_ROTATE_SIZE = 10000000
200 # If True, include thread IDs and numbers in log messages, if available:
203 # If True, include the module name, function name, and line number of the
204 # calling function where the log message was generated:
207 # A strftime(3) format string that specifies how to log timestamps:
208 LOG_TIME_FORMAT = "%H:%M:%S"
210 #---------------------------
211 # Database/Parsing Options \
212 #------------------------------------------------------------------------------
214 # These options change various database transaction and descriptor parsing
216 #------------------------------------------------------------------------------
218 # (boolean) If True, then collect, sort, and store all timestamps seen for all
219 # bridges. This operation is extremely expensive, and should be disabled when
220 # it is not necessary.
221 COLLECT_TIMESTAMPS = False
223 #-------------------------------
224 # General Distribution Options \
225 #------------------------------------------------------------------------------
227 # These options are not specific to a certain distributor and they may alter
228 # the bridge selection process in certain circumstances.
229 #------------------------------------------------------------------------------
231 # Filename that contains blocked bridges list. Comment out to disable.
232 #COUNTRY_BLOCK_FILE = "blocked-bridges"
234 # (list of two-character, uppercased strings for country codes) Don't
235 # distribute bridges whose main ORPort IP address is geolocated to any of the
236 # following countries:
237 NO_DISTRIBUTION_COUNTRIES = ['IR', 'SY']
239 # The path to a file containing the fingerprints of blacklisted bridges and
240 # their reason for being blacklisted. An entry should be in the form:
242 # FINGERPRINT [SP REASON]
244 # where REASON is optional and may contain whitespace.
246 # (See NO_DISTRIBUTION_FINGERPRINTS in the code for how this is used.)
247 NO_DISTRIBUTION_FILE = None
249 # A list of filenames that contain IP addresses (one per line) of proxies.
250 # All IP-based distributors that see an incoming connection from a proxy
251 # will treat them specially.
252 PROXY_LIST_FILES = []
254 # If possible, always give a certain number of answers with a given ORPort.
255 # This is a list of ``(port, minimum)`` tuples.
256 FORCE_PORTS = [(443, 1)]
258 # If possible, always give a certain number of answers with a given flag.
259 # Both "Running" and "Stable" are supported.
260 # This is a list of (flag,minimum) tuples.
261 FORCE_FLAGS = [("Stable", 1)]
263 # Only consider routers whose purpose matches this string.
264 BRIDGE_PURPOSE = "bridge"
266 # TASKS is a dictionary mapping the names of tasks to a tuple consisting of the
267 # frequency with which they should be run (in seconds) and a boolean value
268 # expressing if the task should be run immediately after start up. If a task's
269 # frequency is set to 0, it will not be scheduled to run.
271 # Download a list of Tor exit relays once every three hours (by running
272 # scripts/get-exit-list) and add those exit relays to the list of proxies
273 # loaded from the PROXY_LIST_FILES:
274 'GET_TOR_EXIT_LIST': (3 * 60 * 60, True),
275 # Delete *.unparseable descriptor files which are more than 24 hours old:
276 'DELETE_UNPARSEABLE_DESCRIPTORS': (24 * 60 * 60, False),
277 # Export usage metrics every 24 hours:
278 'EXPORT_METRICS': (24 * 60 * 60, False),
281 # SUPPORTED_TRANSPORTS is a dictionary mapping Pluggable Transport methodnames
282 # to booleans. If ``True``, the PT is distributed; if ``False``, it isn't.
283 SUPPORTED_TRANSPORTS = {
287 'scramblesuit': False,
291 # PROBING_RESISTANT_TRANSPORTS is a list of transports that are resistant to
292 # active probing attacks as pioneered by China's GFW. If a bridge supports any
293 # of the following transports, only these transports are distributed, and no
294 # others. Here's why: If we have a bridge that supports both obfs3 and obfs4,
295 # we don't want to hand out its obfs3 line to users because this may get the
296 # bridge probed and its IP address blocked, which also blocks the obfs4 PT.
297 PROBING_RESISTANT_TRANSPORTS = ['scramblesuit', 'obfs4']
299 # DEFAULT_TRANSPORT is a string. It should be the PT methodname of the
300 # transport which is selected by default (e.g. in the webserver dropdown
302 DEFAULT_TRANSPORT = 'obfs4'
304 # HTTP headers that suggest that a request was issued by a bot. The CSV
305 # file must have the following format:
309 # Accept-Language,[Kk]lingon
310 BLACKLISTED_REQUEST_HEADERS_FILE="blacklisted-request-headers.csv"
312 # List of tuples that specify blacklisted tor version ranges. The first
313 # element marks the start of the range and the second element marks the end.
314 # Both the start *and* the end version are blocked too. If you want to block a
315 # single version, have the start and end range be identical. BridgeDB won't
316 # distribute bridges whose version falls within any version ranges.
317 BLACKLISTED_TOR_VERSIONS = [
318 ('0.3.4', '0.3.4.9'), # See <https://bugs.torproject.org/29184>.
322 # Decoy bridges that we are handing out to bots that we detected using the
323 # regular expressions in BLACKLISTED_REQUEST_HEADERS_FILE. The CSV file must
324 # have the following format:
325 # <TRANSPORT>v<IP_VERSION>,<BRIDGE_LINE>
328 # vanillav4,1.2.3.4:1234 0123456789ABCDEF0123456789ABCDEF01234567
329 # vanillav6,[::1]:1234 0123456789ABCDEF0123456789ABCDEF01234567
330 # obfs4v4,obfs4 1.2.3.4:1234 public-key=... node-id=... iat-mode=...
331 DECOY_BRIDGES_FILE="decoy-bridges.csv"
333 #-------------------------------
334 # Moat Distribution Options \
335 #------------------------------------------------------------------------------
337 # These options configure the behaviour of a web interface which speaks JSON API
338 # to a remote application in order to present said application with the
339 # necessary information for creating a user interface for bridge distribution
340 # mechanism, similar to the web interface of BridgeDB's HTTPS Distributor. If
341 # MOAT_DIST is enabled, make sure that the MOAT_CERT_FILE and MOAT_KEY_FILE
342 # options point to the correct location of your SSL certificate and key!
343 # ------------------------------------------------------------------------------
345 # (boolean) True to enable distribution via Moat; False otherwise.
348 # (boolean) True to only allow Moat distribution via a Meek tunnel. False to
349 # only allow Moat distribution via untunneled HTTP(S).
350 MOAT_DIST_VIA_MEEK_ONLY = True
352 # Certificate file and private key for the Moar Distributor. To create a
353 # self-signed cert, run ``scripts/make-ssl-cert`` it will create these files
354 # in your current directory.
355 MOAT_TLS_CERT_FILE="moat-tls.crt"
356 MOAT_TLS_KEY_FILE="moat-tls.pem"
358 # (string) The Fully-Qualified Domain Name (FQDN) of the server that the Moat
359 # and/or HTTPS distributor(s) is/are publicly reachable at.
360 if MOAT_DIST_VIA_MEEK_ONLY:
361 MOAT_SERVER_PUBLIC_ROOT = '/meek/moat'
363 MOAT_SERVER_PUBLIC_ROOT = '/moat'
365 # How many bridges do we give back in an answer (either HTTP or HTTPS)?
366 MOAT_BRIDGES_PER_ANSWER = 3
368 # (list) An ordered list of the preferred transports which moat should
369 # distribute, in order from most preferable to least preferable.
370 MOAT_TRANSPORT_PREFERENCE_LIST = ["obfs4", "vanilla"]
372 # (string or None) The IP address where we listen for HTTPS connections. If
373 # ``None``, listen on the default interface.
374 MOAT_HTTPS_IP = '127.0.0.1'
376 # (integer or None) The port to listen on for incoming HTTPS connections.
377 MOAT_HTTPS_PORT = 6791
379 # (string or None) The IP address to listen on for unencrypted HTTP
380 # connections. Set to ``None`` to disable unencrypted connections to the web
384 # (integer or None) The port to listen on for incoming HTTP connections.
385 MOAT_HTTP_PORT = None
387 # If true, there is a trusted proxy relaying incoming messages to us: take
388 # the *last* entry from its X-Forwarded-For header as the client's IP.
389 MOAT_USE_IP_FROM_FORWARDED_HEADER = True
391 # If True, there is a misconfigured proxy relaying incoming messages
392 # to us: take the *last* entry in the X-Forwarded-For header which is
393 # not a loopback address (127.0.0.1/8) as the client's IP.
394 MOAT_SKIP_LOOPBACK_ADDRESSES = True
396 # How many clusters do we group IPs in when distributing bridges based on IP?
397 # Note that if PROXY_LIST_FILES is set (below), what we actually do here
398 # is use one higher than the number here, and the extra cluster is used
399 # for answering requests made by IP addresses in the PROXY_LIST_FILES file.
400 MOAT_N_IP_CLUSTERS = 4
402 # (string or None) The period at which the available bridges rotates to a
403 # separate set of bridges. This setting can be used in the form
405 # "COUNT PERIOD" where
406 # COUNT is an integer
407 # PERIOD is one of "second", "minute", "hour", "day",
408 # "week", or "month" (or any plural form).
410 # For example, setting HTTPS_ROTATION_PERIOD = "3 days" will result in the set
411 # of bridges which are available through the web interface (either HTTP or
412 # HTTPS) getting rotated once every three days. Setting this to None disables
414 MOAT_ROTATION_PERIOD = "3 hours"
416 # The location of the files which store the HMAC secret key and RSA keypair
417 # (for checking captcha responses):
418 MOAT_GIMP_CAPTCHA_HMAC_KEYFILE = 'moat_captcha_hmac_key'
419 MOAT_GIMP_CAPTCHA_RSA_KEYFILE = 'moat_captcha_rsa_key'
421 #-------------------------------
422 # HTTP(S) Distribution Options \
423 #------------------------------------------------------------------------------
425 # These options configure the behaviour of the web interface bridge
426 # distribution mechanism. If HTTPS_DIST is enabled, make sure that the
427 # HTTPS_CERT_FILE and HTTPS_KEY_FILE options point to the correct location of
428 # your SSL certificate and key!
429 #------------------------------------------------------------------------------
431 # Certificate file and private key for the HTTPS Distributor. To create a
432 # self-signed cert, run ``scripts/make-ssl-cert`` it will create these files
433 # in your current directory.
434 HTTPS_CERT_FILE="cert"
435 HTTPS_KEY_FILE="privkey.pem"
437 # (string) The Fully-Qualified Domain Name (FQDN) of the server that the HTTP
438 # and/or HTTPS distributor(s) is/are publicly reachable at.
439 SERVER_PUBLIC_FQDN = 'bridges.torproject.org'
441 # (string) The IP address that the HTTP and/or HTTPS distributor(s) is/are
442 # publicly reachable at. This is used for fetching the list of Tor exit
443 # relays which allow exits to this IP.
444 SERVER_PUBLIC_EXTERNAL_IP = '38.229.72.19'
446 # (boolean) True to enable distribution via HTTP or HTTPS; False otherwise.
449 # (string or None) The IP address where we listen for HTTPS connections. If
450 # ``None``, listen on the default interface.
451 HTTPS_BIND_IP = '127.0.0.1'
453 # (integer or None) The port to listen on for incoming HTTPS connections.
456 # How many bridges do we give back in an answer (either HTTP or HTTPS)?
457 HTTPS_N_BRIDGES_PER_ANSWER = 3
459 # Should we tell http users about the bridge fingerprints? Turn this on
460 # once we have the vidalia/tor interaction fixed for everbody.
461 HTTPS_INCLUDE_FINGERPRINTS = True
463 # If true, there is a trusted proxy relaying incoming messages to us: take
464 # the *last* entry from its X-Forwarded-For header as the client's IP.
465 HTTPS_USE_IP_FROM_FORWARDED_HEADER = False
467 # How many clusters do we group IPs in when distributing bridges based on IP?
468 # Note that if PROXY_LIST_FILES is set (below), what we actually do here
469 # is use one higher than the number here, and the extra cluster is used
470 # for answering requests made by IP addresses in the PROXY_LIST_FILES file.
473 # (string or None) The period at which the available bridges rotates to a
474 # separate set of bridges. This setting can be used in the form
476 # "COUNT PERIOD" where
477 # COUNT is an integer
478 # PERIOD is one of "second", "minute", "hour", "day",
479 # "week", or "month" (or any plural form).
481 # For example, setting HTTPS_ROTATION_PERIOD = "3 days" will result in the set
482 # of bridges which are available through the web interface (either HTTP or
483 # HTTPS) getting rotated once every three days. Setting this to None disables
485 HTTPS_ROTATION_PERIOD = "3 hours"
487 # (string or None) The IP address to listen on for unencrypted HTTP
488 # connections. Set to ``None`` to disable unencrypted connections to the web
490 HTTP_UNENCRYPTED_BIND_IP = None
492 # (integer or None) The port to listen on for incoming HTTP connections.
493 HTTP_UNENCRYPTED_PORT = None
495 # (boolean) Same as the HTTPS_USE_IP_FROM_FORWARDED_HEADER option, but for
496 # unencrypted connections.
497 HTTP_USE_IP_FROM_FORWARDED_HEADER = False
499 # Options related to recaptcha support.
500 # Enable/Disable recaptcha
501 RECAPTCHA_ENABLED = False
504 RECAPTCHA_PUB_KEY = ''
505 RECAPTCHA_SEC_KEY = ''
507 # The remoteip we send to reCAPTCHA during verification
508 RECAPTCHA_REMOTEIP = ''
510 # If true, use a local cache of generated CAPTCHAs:
511 GIMP_CAPTCHA_ENABLED = True
513 # The directory for the local CAPTCHA cache:
514 GIMP_CAPTCHA_DIR = 'captchas'
516 # The location of the files which store the HMAC secret key and RSA keypair
517 # (for checking captcha responses):
518 GIMP_CAPTCHA_HMAC_KEYFILE = 'captcha_hmac_key'
519 GIMP_CAPTCHA_RSA_KEYFILE = 'captcha_rsa_key'
521 # Content Security Policy Settings
522 # --------------------------------
524 # (boolean) If True, enable use of CSP headers. This must be True for any
525 # other CSP-related options to have any effect.
527 # If enabled, the default Content Security Policy (CSP) is:
529 # default-src 'none' ;
533 # img-src FQDN data: ;
536 # where "FQDN" is the value of the SERVER_PUBLIC_FQDN config setting.
538 # If CSP_INCLUDE_SELF is enabled, then "'self'" (literally, the word self
539 # surrounded by single-quotes) will be appended to the value of the
540 # SERVER_PUBLIC_FQDN config setting to create the "FQDN".
544 # (boolean) If True (and CSP_ENABLED is also True), then set a "report-only"
545 # Content Security Policy. This means that client agents which run into
546 # problems with or cause violations of our CSP settings will report data
547 # regarding the problems/violations. This report data is then logged (at the
548 # DEBUG level), along with the client's IP address (only if SAFELOGGING is
549 # disabled, otherwise the client's IP address is not reported).
551 CSP_REPORT_ONLY = False
553 # (boolean) If True, then append "'self'" to the "FQDN" in the default CSP
554 # header described above.
556 CSP_INCLUDE_SELF = True
558 #-------------------------------
559 # Email Distribution Options \
560 #------------------------------------------------------------------------------
562 # These options configure the behaviour of the email bridge distribution
563 # mechanism. If EMAIL_DIST is enabled, make sure that the above
564 # HTTPS_CERT_FILE and HTTPS_KEY_FILE options point to the correct location of
565 # your SSL certificate and key!
566 # ------------------------------------------------------------------------------
568 # True if we are enabling distribution via Email; false otherwise.
571 # (string or None) The period at which the available bridges rotates to a
572 # separate set of bridges. This setting can be used in the form
574 # "COUNT PERIOD" where
575 # COUNT is an integer
576 # PERIOD is one of "second", "minute", "hour", "day",
577 # "week", or "month" (or any plural form).
579 # For example, setting EMAIL_ROTATION_PERIOD = "3 days" will result in the set
580 # of bridges which are available through the email interface getting rotated
581 # once every three days. Setting this to None disables rotation entirely.
582 EMAIL_ROTATION_PERIOD = "1 day"
584 # What email addresses do we use for outgoing email?
586 # EMAIL_FROM_ADDR goes in the 'From:' header on outgoing emails:
587 EMAIL_FROM_ADDR = "bridges@torproject.org"
589 # EMAIL_SMTP_FROM_ADDR goes in the 'MAIL FROM:' command in outgoing SMTP:
590 EMAIL_SMTP_FROM_ADDR = "bridges@torproject.org"
592 EMAIL_SMTP_HOST = "127.0.0.1"
595 # Reject any RCPT TO lines that aren't to this user.
596 EMAIL_USERNAME = "bridges"
598 # Canonical versions of domains that we will reply to.
599 EMAIL_DOMAINS = ["gmail.com", "riseup.net"]
601 # Map from unofficial domain to canonical domain.
603 "mail.google.com": "gmail.com",
604 "googlemail.com": "gmail.com",
605 "mail.riseup.net": "riseup.net",
606 "fulvetta.riseup.net": "riseup.net",
607 "fruiteater.riseup.net": "riseup.net",
608 "mx1.riseup.net": "riseup.net",
611 # Map from canonical domain to list of options for that domain. Recognized
613 # "ignore_dots" -- the service ignores "." characters in email addresses.
614 # "dkim" -- if there is not a X-DKIM-Authentication-Result header
615 # with the value "pass", then drop the message.
617 # Note that unrecognized options are ignored; be sure to spell them right!
618 EMAIL_DOMAIN_RULES = {
619 'gmail.com': ["ignore_dots", "dkim"],
620 'riseup.net': ["ignore_dots", "dkim"],
623 # A mapping of whitelisted email addresses to GnuPG key fingerprints:
626 # A list of blacklisted email addresses:
629 # An integer. This number will be used to calculate the Levenshtein String
630 # Distance between the 'From:' email address on an incoming client request and
631 # each of the blacklisted email addresses above. If the calculated distance is
632 # equal or less than the number below, the address is assumed to be related to
633 # one of the above blacklisted spammers. Basically, this allows for fuzzy
634 # matching the blacklisted email addresses. Decreasing this number will allow
635 # more email requests through; increasing will mean that a stricter match to
636 # one of the blacklisted addresses is required before the address is blocked.
637 # Set to `0` to disable.
638 EMAIL_FUZZY_MATCH = 4
640 # If there are any IPs in this list, only allow incoming connections from
642 EMAIL_RESTRICT_IPS = []
644 # IP and port to listen on for email connections. Debugging only.
645 EMAIL_BIND_IP = "127.0.0.1"
648 # How many bridges do we give back in an answer?
649 EMAIL_N_BRIDGES_PER_ANSWER = 3
651 # Should we tell http users about the bridge fingerprints? Turn this on
652 # once we have the vidalia/tor interaction fixed for everbody.
653 EMAIL_INCLUDE_FINGERPRINTS = True
655 #-------------------------------
656 # Hashring Allocation Options \
657 #------------------------------------------------------------------------------
659 # These options determine the proportions of bridges per hashring. When
660 # BridgeDB receives a descriptor for a new bridge, that bridge is assigned to
661 # a hashring. For example, if ``HTTPS_DIST`` and ``EMAIL_DIST`` are both
662 # enabled, there is a hashring for bridges allocated to the HTTP(S)
663 # Distributor, and another for the Email Distributor. In addition, an
664 # "Unallocated" hashring is always created, in order to reserve some portion
665 # of bridges for manual distribution, or as backup in the case of a major
666 # blocking event. Once a bridge is assigned to one of these allocation groups,
667 # it stays there; there is currently no mechanism for changing a bridge's
668 # hashring allocation.
670 # Once a bridge is assigned to either of the first two groups, it stays there
671 # persistently. The bridges are allocated to these groups in a proportion of
673 # ``MOAT_SHARE`` : ``HTTPS_SHARE`` : ``EMAIL_SHARE`` : ``RESERVED_SHARE``
674 # ------------------------------------------------------------------------------
676 # The proportion of bridges to allocate to Moat distribution.
679 # The proportion of bridges to allocate to HTTP distribution.
682 # The proportion of bridges to allocate to Email distribution.
685 # An integer specifying the proportion of bridges which should remain
686 # unallocated, for backup usage and manual distribution.