diff --git a/blocking.py b/blocking.py index f1df05efc..2fc38906c 100644 --- a/blocking.py +++ b/blocking.py @@ -1965,6 +1965,27 @@ def load_blocked_bluesky(base_dir: str) -> {}: return nicknames_dict +def load_blocked_nostr(base_dir: str) -> {}: + """Loads a list of nicknames for accounts which block nostr bridges + """ + block_nostr_filename = data_dir(base_dir) + '/block_nostr.txt' + nicknames_list: list[str] = [] + if os.path.isfile(block_nostr_filename): + try: + with open(block_nostr_filename, 'r', + encoding='utf-8') as fp_nostr: + nicknames_list = fp_nostr.read() + except OSError: + print('EX: error while reading block nostr file') + if not nicknames_list: + return {} + nicknames_list = nicknames_list.split('\n') + nicknames_dict = {} + for nickname in nicknames_list: + nicknames_dict[nickname] = True + return nicknames_dict + + def save_blocked_military(base_dir: str, block_military: {}) -> None: """Saves a list of nicknames for accounts which block military instances """ @@ -2013,6 +2034,22 @@ def save_blocked_bluesky(base_dir: str, block_bluesky: {}) -> None: print('EX: error while saving block bluesky file') +def save_blocked_nostr(base_dir: str, block_nostr: {}) -> None: + """Saves a list of nicknames for accounts which block nostr bridges + """ + nicknames_str = '' + for nickname, _ in block_nostr.items(): + nicknames_str += nickname + '\n' + + block_nostr_filename = data_dir(base_dir) + '/block_nostr.txt' + try: + with open(block_nostr_filename, 'w+', + encoding='utf-8') as fp_nostr: + fp_nostr.write(nicknames_str) + except OSError: + print('EX: error while saving block nostr file') + + def get_mil_domains_list() -> []: """returns a list of military domains """ @@ -2032,6 +2069,12 @@ def get_bsky_domains_list() -> []: return ['brid.gy'] +def get_nostr_domains_list() -> []: + """returns a list of nostr bridges + """ + return ['mostr.pub'] + + def contains_military_domain(message_str: str) -> bool: """Returns true if the given string contains a military domain """ @@ -2073,6 +2116,20 @@ def contains_bluesky_domain(message_str: str) -> bool: return False +def contains_nostr_domain(message_str: str) -> bool: + """Returns true if the given string contains a nostr bridge domain + """ + if '.nostr.' in message_str or \ + '/nostr.' in message_str: + return True + nostr_domains = get_nostr_domains_list() + for domain_str in nostr_domains: + if domain_str + '"' in message_str or \ + domain_str + '/' in message_str: + return True + return False + + def load_federated_blocks_endpoints(base_dir: str) -> []: """Loads endpoint urls for federated blocklists """ diff --git a/crawlers.py b/crawlers.py index 79486ee81..f7bc605f8 100644 --- a/crawlers.py +++ b/crawlers.py @@ -16,6 +16,7 @@ from utils import remove_eol from blocking import get_mil_domains_list from blocking import get_gov_domains_list from blocking import get_bsky_domains_list +from blocking import get_nostr_domains_list from blocking import update_blocked_cache from blocking import is_blocked_domain @@ -114,7 +115,8 @@ def blocked_user_agent(calling_domain: str, agent_str: str, known_bots: [], path: str, block_military: {}, block_government: {}, - block_bluesky: {}): + block_bluesky: {}, + block_nostr: {}): """Should a GET or POST be blocked based upon its user agent? """ if not agent_str: @@ -232,7 +234,8 @@ def blocked_user_agent(calling_domain: str, agent_str: str, block_dicts = { "military": block_military, "government": block_government, - "bluesky": block_bluesky + "bluesky": block_bluesky, + "nostr": block_nostr } for block_type, block_dict in block_dicts.items(): if blocked_ua or not block_dict: @@ -250,6 +253,8 @@ def blocked_user_agent(calling_domain: str, agent_str: str, blk_domains = get_mil_domains_list() elif block_type == "government": blk_domains = get_gov_domains_list() + elif block_type == "nostr": + blk_domains = get_nostr_domains_list() else: blk_domains = get_bsky_domains_list() for domain_str in blk_domains: diff --git a/daemon.py b/daemon.py index e84c1b0cc..5f7e44a0d 100644 --- a/daemon.py +++ b/daemon.py @@ -34,6 +34,7 @@ from blocking import load_federated_blocks_endpoints from blocking import load_blocked_military from blocking import load_blocked_government from blocking import load_blocked_bluesky +from blocking import load_blocked_nostr from blocking import update_blocked_cache from blocking import set_broch_mode from blocking import get_domain_blocklist @@ -311,6 +312,7 @@ class EpicyonServer(ThreadingHTTPServer): block_military = {} block_government = {} block_bluesky = {} + block_nostr = {} followers_synchronization = False followers_sync_cache = {} buy_sites = None @@ -798,6 +800,9 @@ def run_daemon(accounts_data_dir: str, # load a list of nicknames for accounts blocking bluesky bridges httpd.block_bluesky = load_blocked_bluesky(base_dir) + # load a list of nicknames for accounts blocking nostr bridges + httpd.block_nostr = load_blocked_nostr(base_dir) + # scan the theme directory for any svg files containing scripts assert not scan_themes_for_scripts(base_dir) diff --git a/daemon_get.py b/daemon_get.py index a2283aa0a..3434b02b9 100644 --- a/daemon_get.py +++ b/daemon_get.py @@ -361,7 +361,8 @@ def daemon_http_get(self) -> None: self.server.known_bots, self.path, self.server.block_military, self.server.block_government, - self.server.block_bluesky) + self.server.block_bluesky, + self.server.block_nostr) if block: if llm: # check if LLM is too frequent @@ -4366,6 +4367,7 @@ def daemon_http_get(self) -> None: self.server.block_military, self.server.block_government, self.server.block_bluesky, + self.server.block_nostr, self.server.block_federated_endpoints): self.server.getreq_busy = False return diff --git a/daemon_get_profile.py b/daemon_get_profile.py index 3012c76fb..763066144 100644 --- a/daemon_get_profile.py +++ b/daemon_get_profile.py @@ -542,6 +542,7 @@ def edit_profile2(self, calling_domain: str, path: str, block_military: {}, block_government: {}, block_bluesky: {}, + block_nostr: {}, block_federated_endpoints: []) -> bool: """Show the edit profile screen """ @@ -572,6 +573,7 @@ def edit_profile2(self, calling_domain: str, path: str, block_military, block_government, block_bluesky, + block_nostr, block_federated_endpoints) if msg: msg = msg.encode('utf-8') diff --git a/daemon_post.py b/daemon_post.py index e88eb9027..d98af5a8e 100644 --- a/daemon_post.py +++ b/daemon_post.py @@ -25,6 +25,7 @@ from utils import detect_mitm from blocking import contains_military_domain from blocking import contains_government_domain from blocking import contains_bluesky_domain +from blocking import contains_nostr_domain from crawlers import blocked_user_agent from session import get_session_for_domain from session import establish_session @@ -190,7 +191,8 @@ def daemon_http_post(self) -> None: self.server.known_bots, self.path, self.server.block_military, self.server.block_government, - self.server.block_bluesky) + self.server.block_bluesky, + self.server.block_nostr) if block: http_400(self) self.server.postreq_busy = False @@ -1146,6 +1148,12 @@ def daemon_http_post(self) -> None: print('BLOCK: blocked bluesky domain') self.server.postreq_busy = False return + if self.server.block_nostr.get(nickname): + if contains_nostr_domain(decoded_message_bytes): + http_400(self) + print('BLOCK: blocked nostr domain') + self.server.postreq_busy = False + return # convert the raw bytes to json try: diff --git a/daemon_post_profile.py b/daemon_post_profile.py index 567a99df8..120c99347 100644 --- a/daemon_post_profile.py +++ b/daemon_post_profile.py @@ -14,6 +14,7 @@ from socket import error as SocketError from blocking import save_blocked_military from blocking import save_blocked_government from blocking import save_blocked_bluesky +from blocking import save_blocked_nostr from httpheaders import redirect_headers from httpheaders import clear_login_details from flags import is_artist @@ -893,6 +894,25 @@ def _profile_post_block_bluesky(nickname: str, fields: {}, self) -> None: self.server.block_bluesky) +def _profile_post_block_nostr(nickname: str, fields: {}, self) -> None: + """ HTTP POST block nostr bridges + """ + block_nostr_instances = False + if fields.get('blockNostr'): + if fields['blockNostr'] == 'on': + block_nostr_instances = True + if block_nostr_instances: + if not self.server.block_nostr.get(nickname): + self.server.block_nostr[nickname] = True + save_blocked_nostr(self.server.base_dir, + self.server.block_nostr) + else: + if self.server.block_nostr.get(nickname): + del self.server.block_nostr[nickname] + save_blocked_nostr(self.server.base_dir, + self.server.block_nostr) + + def _profile_post_no_reply_boosts(base_dir: str, nickname: str, domain: str, fields: {}) -> bool: """ HTTP POST disallow boosts of replies in inbox @@ -3285,6 +3305,7 @@ def profile_edit(self, calling_domain: str, cookie: str, _profile_post_block_military(nickname, fields, self) _profile_post_block_government(nickname, fields, self) _profile_post_block_bluesky(nickname, fields, self) + _profile_post_block_nostr(nickname, fields, self) _profile_post_no_reply_boosts(base_dir, nickname, domain, fields) _profile_post_no_seen_posts(base_dir, nickname, domain, diff --git a/tests.py b/tests.py index e15018733..863876b80 100644 --- a/tests.py +++ b/tests.py @@ -9172,8 +9172,6 @@ def run_all_tests(): base_dir = os.getcwd() data_dir_testing(base_dir) print('Running tests...') - _test_functions() - return update_default_themes_list(os.getcwd()) _test_source_contains_no_tabs() _translate_ontology(base_dir) diff --git a/translations/ar.json b/translations/ar.json index 7d566861b..071f26d16 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -705,5 +705,6 @@ "Yourself": "نفسك", "Epicyon Instances": "حالات Epicyon", "Block BlueSky bridges": "حجب جسور بلو سكاي", - "Block government instances": "حظر حالات الحكومة" + "Block government instances": "حظر حالات الحكومة", + "Block Nostr bridges": "سد جسور نوستر" } diff --git a/translations/bn.json b/translations/bn.json index f91c2c4ad..c12ce6ef6 100644 --- a/translations/bn.json +++ b/translations/bn.json @@ -705,5 +705,6 @@ "Yourself": "নিজেকে", "Epicyon Instances": "এপিসিয়ন দৃষ্টান্ত", "Block BlueSky bridges": "ব্লুস্কাই ব্রিজ ব্লক করুন", - "Block government instances": "সরকারী দৃষ্টান্ত ব্লক করুন" + "Block government instances": "সরকারী দৃষ্টান্ত ব্লক করুন", + "Block Nostr bridges": "ব্লক নস্ট্র ব্রিজ" } diff --git a/translations/ca.json b/translations/ca.json index 5e4938467..cf9a87704 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -705,5 +705,6 @@ "Yourself": "Tu mateix", "Epicyon Instances": "Instàncies d'Epicyon", "Block BlueSky bridges": "Bloqueja els ponts BlueSky", - "Block government instances": "Bloquejar instàncies governamentals" + "Block government instances": "Bloquejar instàncies governamentals", + "Block Nostr bridges": "Bloc Nostr ponts" } diff --git a/translations/cy.json b/translations/cy.json index d133f6608..4553ad34f 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -705,5 +705,6 @@ "Yourself": "Eich Hun", "Epicyon Instances": "Enghreifftiau Epicyon", "Block BlueSky bridges": "Rhwystro pontydd BlueSky", - "Block government instances": "Rhwystro achosion llywodraeth" + "Block government instances": "Rhwystro achosion llywodraeth", + "Block Nostr bridges": "Rhwystro pontydd Nostr" } diff --git a/translations/de.json b/translations/de.json index 6f2ea3ee3..e1a4257a1 100644 --- a/translations/de.json +++ b/translations/de.json @@ -705,5 +705,6 @@ "Yourself": "Selbst", "Epicyon Instances": "Epicyon-Instanzen", "Block BlueSky bridges": "Blockieren Sie BlueSky-Brücken", - "Block government instances": "Blockieren von Regierungsinstanzen" + "Block government instances": "Blockieren von Regierungsinstanzen", + "Block Nostr bridges": "Block Nostr-Brücken" } diff --git a/translations/el.json b/translations/el.json index eaf3fe810..1ac667444 100644 --- a/translations/el.json +++ b/translations/el.json @@ -705,5 +705,6 @@ "Yourself": "Σύ ο ίδιος", "Epicyon Instances": "Περιπτώσεις Epicyon", "Block BlueSky bridges": "Αποκλείστε τις γέφυρες BlueSky", - "Block government instances": "Αποκλεισμός κρατικών περιπτώσεων" + "Block government instances": "Αποκλεισμός κρατικών περιπτώσεων", + "Block Nostr bridges": "Αποκλείστε τις γέφυρες Nostr" } diff --git a/translations/en.json b/translations/en.json index 726d53ea3..82d0d0317 100644 --- a/translations/en.json +++ b/translations/en.json @@ -705,5 +705,6 @@ "Yourself": "Yourself", "Epicyon Instances": "Epicyon Instances", "Block BlueSky bridges": "Block BlueSky bridges", - "Block government instances": "Block government instances" + "Block government instances": "Block government instances", + "Block Nostr bridges": "Block Nostr bridges" } diff --git a/translations/es.json b/translations/es.json index 324a74550..e33d0429c 100644 --- a/translations/es.json +++ b/translations/es.json @@ -705,5 +705,6 @@ "Yourself": "Tú mismo", "Epicyon Instances": "Instancias de Epicyon", "Block BlueSky bridges": "Bloquear puentes BlueSky", - "Block government instances": "Bloquear instancias gubernamentales" + "Block government instances": "Bloquear instancias gubernamentales", + "Block Nostr bridges": "Puentes Block Nostr" } diff --git a/translations/fa.json b/translations/fa.json index 512ca66ae..fbd6762a5 100644 --- a/translations/fa.json +++ b/translations/fa.json @@ -705,5 +705,6 @@ "Yourself": "خودت", "Epicyon Instances": "موارد Epicyon", "Block BlueSky bridges": "پل های BlueSky را مسدود کنید", - "Block government instances": "موارد دولتی را مسدود کنید" + "Block government instances": "موارد دولتی را مسدود کنید", + "Block Nostr bridges": "پل های نوستر را مسدود کنید" } diff --git a/translations/fi.json b/translations/fi.json index 7165a956e..c4faf91d4 100644 --- a/translations/fi.json +++ b/translations/fi.json @@ -705,5 +705,6 @@ "Yourself": "itseäsi", "Epicyon Instances": "Epicyonin esiintymät", "Block BlueSky bridges": "Estä BlueSky-sillat", - "Block government instances": "Estä hallituksen esiintymät" + "Block government instances": "Estä hallituksen esiintymät", + "Block Nostr bridges": "Estä Nostrin sillat" } diff --git a/translations/fr.json b/translations/fr.json index 4031b9223..50ea93192 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -705,5 +705,6 @@ "Yourself": "Toi-même", "Epicyon Instances": "Instances d'Epicyon", "Block BlueSky bridges": "Bloquer les ponts BlueSky", - "Block government instances": "Bloquer les instances gouvernementales" + "Block government instances": "Bloquer les instances gouvernementales", + "Block Nostr bridges": "Bloc Nostr ponts" } diff --git a/translations/ga.json b/translations/ga.json index a19ff0f77..3f41bdd30 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -705,5 +705,6 @@ "Yourself": "Tú féin", "Epicyon Instances": "Cásanna Epicyon", "Block BlueSky bridges": "Bloc droichid BlueSky", - "Block government instances": "Cuir bac ar chásanna rialtais" + "Block government instances": "Cuir bac ar chásanna rialtais", + "Block Nostr bridges": "Bloc droichid Nostr" } diff --git a/translations/he.json b/translations/he.json index 9c79c908d..a092754ad 100644 --- a/translations/he.json +++ b/translations/he.json @@ -705,5 +705,6 @@ "Yourself": "עַצמְךָ", "Epicyon Instances": "מופעי Epicyon", "Block BlueSky bridges": "חסום גשרי BlueSky", - "Block government instances": "חסום מקרים ממשלתיים" + "Block government instances": "חסום מקרים ממשלתיים", + "Block Nostr bridges": "חסום גשרי Nostr" } diff --git a/translations/hi.json b/translations/hi.json index 1ce2793f9..7b519e2b9 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -705,5 +705,6 @@ "Yourself": "अपने आप को", "Epicyon Instances": "एपिक्योन इंस्टेंसेस", "Block BlueSky bridges": "ब्लूस्काई पुलों को ब्लॉक करें", - "Block government instances": "सरकारी इंस्टेंस ब्लॉक करें" + "Block government instances": "सरकारी इंस्टेंस ब्लॉक करें", + "Block Nostr bridges": "ब्लॉक नोस्ट्र पुल" } diff --git a/translations/it.json b/translations/it.json index 1f20844fc..c3a7a230e 100644 --- a/translations/it.json +++ b/translations/it.json @@ -705,5 +705,6 @@ "Yourself": "Te stesso", "Epicyon Instances": "Istanze di Epicyon", "Block BlueSky bridges": "Blocca i ponti BlueSky", - "Block government instances": "Bloccare le istanze governative" + "Block government instances": "Bloccare le istanze governative", + "Block Nostr bridges": "Ponti Block Nostr" } diff --git a/translations/ja.json b/translations/ja.json index ba0a4061d..406822ce3 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -705,5 +705,6 @@ "Yourself": "あなた自身", "Epicyon Instances": "エピキオンインスタンス", "Block BlueSky bridges": "ブルースカイ橋をブロックする", - "Block government instances": "政府インスタンスをブロックする" + "Block government instances": "政府インスタンスをブロックする", + "Block Nostr bridges": "ノストル橋をブロック" } diff --git a/translations/ko.json b/translations/ko.json index 5570dba3d..90b67605d 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -705,5 +705,6 @@ "Yourself": "당신 자신", "Epicyon Instances": "에피시온 인스턴스", "Block BlueSky bridges": "블루스카이 다리 차단", - "Block government instances": "정부 인스턴스 차단" + "Block government instances": "정부 인스턴스 차단", + "Block Nostr bridges": "블록 노스트르 다리" } diff --git a/translations/ku.json b/translations/ku.json index 168fc22b8..89c51696b 100644 --- a/translations/ku.json +++ b/translations/ku.json @@ -705,5 +705,6 @@ "Yourself": "Xwe", "Epicyon Instances": "Mînakên Epicyon", "Block BlueSky bridges": "Pirên BlueSky asteng bikin", - "Block government instances": "Bûyerên hikûmetê asteng bikin" + "Block government instances": "Bûyerên hikûmetê asteng bikin", + "Block Nostr bridges": "Pirên Nostrê asteng bikin" } diff --git a/translations/nl.json b/translations/nl.json index 5cb54738f..e3261f3bc 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -705,5 +705,6 @@ "Yourself": "Jezelf", "Epicyon Instances": "Epicyon-instanties", "Block BlueSky bridges": "Blokkeer BlueSky-bruggen", - "Block government instances": "Overheidsinstanties blokkeren" + "Block government instances": "Overheidsinstanties blokkeren", + "Block Nostr bridges": "Blok Nostr-bruggen" } diff --git a/translations/oc.json b/translations/oc.json index 31a067628..487968862 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -701,5 +701,6 @@ "Yourself": "Yourself", "Epicyon Instances": "Epicyon Instances", "Block BlueSky bridges": "Block BlueSky bridges", - "Block government instances": "Block government instances" + "Block government instances": "Block government instances", + "Block Nostr bridges": "Block Nostr bridges" } diff --git a/translations/pl.json b/translations/pl.json index 6ca24d693..33c2735d1 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -705,5 +705,6 @@ "Yourself": "Się", "Epicyon Instances": "Instancje Epicyon", "Block BlueSky bridges": "Zablokuj mosty BlueSky", - "Block government instances": "Zablokuj wystąpienia rządowe" + "Block government instances": "Zablokuj wystąpienia rządowe", + "Block Nostr bridges": "Mosty Bloku Nostr" } diff --git a/translations/pt.json b/translations/pt.json index 7b36d5830..4f1ce2706 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -705,5 +705,6 @@ "Yourself": "Tu próprio", "Epicyon Instances": "Instâncias Epicyon", "Block BlueSky bridges": "Bloquear pontes BlueSky", - "Block government instances": "Bloquear instâncias governamentais" + "Block government instances": "Bloquear instâncias governamentais", + "Block Nostr bridges": "Bloquear pontes Nostr" } diff --git a/translations/ru.json b/translations/ru.json index dd1a0e74e..96e271867 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -705,5 +705,6 @@ "Yourself": "Сам", "Epicyon Instances": "Эпиционные экземпляры", "Block BlueSky bridges": "Блокировать мосты BlueSky", - "Block government instances": "Блокировать правительственные инстанции" + "Block government instances": "Блокировать правительственные инстанции", + "Block Nostr bridges": "Блок Ностр мосты" } diff --git a/translations/sw.json b/translations/sw.json index f2b320f86..7e516ce70 100644 --- a/translations/sw.json +++ b/translations/sw.json @@ -705,5 +705,6 @@ "Yourself": "Mwenyewe", "Epicyon Instances": "Matukio ya Epicyon", "Block BlueSky bridges": "Zuia madaraja ya BlueSky", - "Block government instances": "Zuia matukio ya serikali" + "Block government instances": "Zuia matukio ya serikali", + "Block Nostr bridges": "Zuia madaraja ya Nostr" } diff --git a/translations/tr.json b/translations/tr.json index 7b8381200..6e90e1f2e 100644 --- a/translations/tr.json +++ b/translations/tr.json @@ -705,5 +705,6 @@ "Yourself": "Kendin", "Epicyon Instances": "Epikyon Örnekleri", "Block BlueSky bridges": "BlueSky köprülerini engelle", - "Block government instances": "Hükümet örneklerini engelle" + "Block government instances": "Hükümet örneklerini engelle", + "Block Nostr bridges": "Nostr köprülerini engelle" } diff --git a/translations/uk.json b/translations/uk.json index 24c76f6d4..2a61da9ff 100644 --- a/translations/uk.json +++ b/translations/uk.json @@ -705,5 +705,6 @@ "Yourself": "себе", "Epicyon Instances": "Примірники Epicyon", "Block BlueSky bridges": "Блок BlueSky bridges", - "Block government instances": "Блокувати державні інстанції" + "Block government instances": "Блокувати державні інстанції", + "Block Nostr bridges": "Блок Nostr bridges" } diff --git a/translations/yi.json b/translations/yi.json index c79d61d1e..5807f09c4 100644 --- a/translations/yi.json +++ b/translations/yi.json @@ -705,5 +705,6 @@ "Yourself": "זיך", "Epicyon Instances": "Epicyon ינסטאַנסיז", "Block BlueSky bridges": "פאַרשפּאַרן בלוסקי בריקן", - "Block government instances": "פאַרשפּאַרן רעגירונג ינסטאַנסיז" + "Block government instances": "פאַרשפּאַרן רעגירונג ינסטאַנסיז", + "Block Nostr bridges": "פאַרשפּאַרן נאָסטר בריקן" } diff --git a/translations/zh.json b/translations/zh.json index 64a9d05ca..67e06699f 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -705,5 +705,6 @@ "Yourself": "你自己", "Epicyon Instances": "史诗副本", "Block BlueSky bridges": "封锁蓝天桥梁", - "Block government instances": "阻止政府实例" + "Block government instances": "阻止政府实例", + "Block Nostr bridges": "布洛克诺斯特桥" } diff --git a/webapp_profile.py b/webapp_profile.py index fe37938ae..10acbd9d2 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -2434,6 +2434,7 @@ def _html_edit_profile_filtering(base_dir: str, nickname: str, domain: str, buy_sites: {}, block_military: {}, block_government: {}, block_bluesky: {}, + block_nostr: {}, block_federated_endpoints: []) -> str: """Filtering and blocking section of edit profile screen """ @@ -2729,6 +2730,15 @@ def _html_edit_profile_filtering(base_dir: str, nickname: str, domain: str, edit_profile_form += \ edit_check_box(idx, 'blockBlueSky', block_bsky) + idx = 'Block Nostr bridges' + if translate.get(idx): + name = translate[idx] + blocknostr = False + if block_nostr.get(nickname): + blocknostr = block_nostr[nickname] + edit_profile_form += \ + edit_check_box(idx, 'blockNostr', blocknostr) + cw_lists_str = '' for name, _ in cw_lists.items(): variablename = get_cw_list_variable(name) @@ -3311,6 +3321,7 @@ def html_edit_profile(server, translate: {}, block_military: {}, block_government: {}, block_bluesky: {}, + block_nostr: {}, block_federated_endpoints: []) -> str: """Shows the edit profile screen """ @@ -3636,7 +3647,7 @@ def html_edit_profile(server, translate: {}, translate, reply_interval_hours, cw_lists, lists_enabled, buy_sites, block_military, block_government, - block_bluesky, + block_bluesky, block_nostr, block_federated_endpoints) # git projects section