From bcd2b1c5232a2e3dc95acaed46a704634ab42a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Mon, 17 Jul 2023 14:56:56 +0200 Subject: [PATCH 1/2] Fixed: - allow administrator to choose whether the blocklist is published under `/about` or later any other API (e.g. common is `/api/v1/instance/domain_blocks`). --- src/Module/Friendica.php | 3 +-- static/defaults.config.php | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index c6e2768bd..2dbe5d7a9 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -94,8 +94,7 @@ class Friendica extends BaseModule $blockList = $this->config->get('system', 'blocklist') ?? []; - $register_policy_int = $this->config->get('config', 'register_policy'); - if (!empty($blockList) && ($register_policy_int !== Register::CLOSED || $this->session->isAuthenticated())) { + if (!empty($blockList) && ($this->config->get('blocklist', 'published') || $this->session->isAuthenticated())) { $blocked = [ 'title' => $this->t('On this server the following remote servers are blocked.'), 'header' => [ diff --git a/static/defaults.config.php b/static/defaults.config.php index e8f44613c..e2ce631d0 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -786,4 +786,9 @@ return [ // Banner for Mastodon API 'mastodon_banner' => '/images/friendica-banner.jpg', ], + 'blocklist' => [ + // published (Boolean) + // Wether the blocklist is published under /about (or any later API) + 'published' => true, + ], ]; From 3111c2fd5cf67b04fcc92951aa422d7cca8b64fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Wed, 26 Jul 2023 09:44:39 +0200 Subject: [PATCH 2/2] Renamed to 'public' after feedback --- src/Module/Friendica.php | 2 +- static/defaults.config.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index 2dbe5d7a9..e09fd0e0f 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -94,7 +94,7 @@ class Friendica extends BaseModule $blockList = $this->config->get('system', 'blocklist') ?? []; - if (!empty($blockList) && ($this->config->get('blocklist', 'published') || $this->session->isAuthenticated())) { + if (!empty($blockList) && ($this->config->get('blocklist', 'public') || $this->session->isAuthenticated())) { $blocked = [ 'title' => $this->t('On this server the following remote servers are blocked.'), 'header' => [ diff --git a/static/defaults.config.php b/static/defaults.config.php index e2ce631d0..125d8ce7b 100644 --- a/static/defaults.config.php +++ b/static/defaults.config.php @@ -787,8 +787,8 @@ return [ 'mastodon_banner' => '/images/friendica-banner.jpg', ], 'blocklist' => [ - // published (Boolean) - // Wether the blocklist is published under /about (or any later API) - 'published' => true, + // public (Boolean) + // Wether the blocklist is publicly listed under /about (or in any later API) + 'public' => true, ], ];