From 1280982e97d7fcaafeb3bebc5b4a6eb9a58d1585 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Tue, 16 Jul 2024 14:12:03 -0700 Subject: [PATCH] load LIMITED_DOMAINS from env var if available for #1089 --- .gitignore | 5 ----- protocol.py | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bd3e967b..539d6e9b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,11 +8,6 @@ flask_secret_key /l /local* limited_domains -make_password private_notes service_account_creds.json -smtp_password -smtp_user -superfeedr_token -superfeedr_username TAGS diff --git a/protocol.py b/protocol.py index 273a6852..ab3e989f 100644 --- a/protocol.py +++ b/protocol.py @@ -2,6 +2,7 @@ import copy from datetime import timedelta import logging +import os import re from threading import Lock from urllib.parse import urljoin, urlparse @@ -52,7 +53,8 @@ OBJECT_REFRESH_AGE = timedelta(days=30) # require a follow for users on these domains before we deliver anything from # them other than their profile -LIMITED_DOMAINS = util.load_file_lines('limited_domains') +LIMITED_DOMAINS = (os.getenv('LIMITED_DOMAINS', '').split() + or util.load_file_lines('limited_domains')) # activity ids that we've already handled and can now ignore. # used in Protocol.receive