} CONNEG_DOMAINS = {'rhiaro.co.uk'} CONNEG_PATHS = {'/twitter/rhiaro'} # alias allows unit tests to mock the function now_fn = lambda: datetime.now(tz=timezone.utc) # Domains that don't support webmentions. Mainly just the silos. # Subdomains are automatically blocklisted too. # # We also check this when a user sign up and we extract the web site links from # their profile. We automatically omit links to these domains. _dir = os.path.dirname(__file__) with open(os.path.join(_dir, 'domain_blocklist.txt'), 'rt', encoding='utf-8') as f: BLOCKLIST = util.load_file_lines(f) # Individual URLs that we shouldn't fetch. Started because of # https://github.com/snarfed/bridgy/issues/525 . Hopefully temporary and can be # removed once https://github.com/idno/Known/issues/1088 is fixed! URL_BLOCKLIST = frozenset( ('http://www.evdemon.org/2015/learning-more-about-quill', )) # URL paths of users who opt into testing new "beta" features and changes # before we roll them out to everyone. with open(os.path.join(_dir, 'beta_users.txt'), 'rt', encoding='utf-8') as f: BETA_USER_PATHS = util.load_file_lines(f) # Returned as the HTTP status code when an upstream API fails. Not 5xx so that # it doesn't show up as a server error in graphs or trigger StackDriver's error # reporting.
REQUEST_HEADERS_CONNEG = copy.copy(REQUEST_HEADERS) REQUEST_HEADERS_CONNEG['Accept'] = 'text/html, application/json; q=0.9, */*; q=0.8' CONNEG_DOMAINS = {'rhiaro.co.uk'} CONNEG_PATHS = {'/twitter/rhiaro'} # alias allows unit tests to mock the function now_fn = datetime.datetime.now # Domains that don't support webmentions. Mainly just the silos. # Subdomains are automatically blacklisted too. # # We also check this when a user sign up and we extract the web site links from # their profile. We automatically omit links to these domains. _dir = os.path.dirname(__file__) with open(os.path.join(_dir, 'domain_blacklist.txt'), 'rt', encoding='utf-8') as f: BLACKLIST = util.load_file_lines(f) # Individual URLs that we shouldn't fetch. Started because of # https://github.com/snarfed/bridgy/issues/525 . Hopefully temporary and can be # removed once https://github.com/idno/Known/issues/1088 is fixed! URL_BLACKLIST = frozenset(( 'http://www.evdemon.org/2015/learning-more-about-quill', )) # URL paths of users who opt into testing new "beta" features and changes # before we roll them out to everyone. with open(os.path.join(_dir, 'beta_users.txt'), 'rt', encoding='utf-8') as f: BETA_USER_PATHS = util.load_file_lines(f) # Average HTML page size as of 2015-10-15 is 56K, so this is very generous and # conservative.