load LIMITED_DOMAINS from env var if available

for #1089
pull/1187/head
Ryan Barrett 2024-07-16 14:12:03 -07:00
rodzic bf11eb8649
commit 1280982e97
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 3 dodań i 6 usunięć

5
.gitignore vendored
Wyświetl plik

@ -8,11 +8,6 @@ flask_secret_key
/l /l
/local* /local*
limited_domains limited_domains
make_password
private_notes private_notes
service_account_creds.json service_account_creds.json
smtp_password
smtp_user
superfeedr_token
superfeedr_username
TAGS TAGS

Wyświetl plik

@ -2,6 +2,7 @@
import copy import copy
from datetime import timedelta from datetime import timedelta
import logging import logging
import os
import re import re
from threading import Lock from threading import Lock
from urllib.parse import urljoin, urlparse 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 # require a follow for users on these domains before we deliver anything from
# them other than their profile # 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. # activity ids that we've already handled and can now ignore.
# used in Protocol.receive # used in Protocol.receive