From 096c3bca7303e54bc190d7c0d6e86ac190027d98 Mon Sep 17 00:00:00 2001 From: mrnoname1000 Date: Thu, 18 May 2023 06:50:50 -0500 Subject: [PATCH 01/22] [XPathAbstract] Fix relative links in fetched HTML (#3401) * [core] Make defaultLinkTo compatible with DOMDocument * [XPathAbstract] Fix relative links in fetched HTML --- lib/XPathAbstract.php | 3 +++ lib/html.php | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/XPathAbstract.php b/lib/XPathAbstract.php index d957bb638b2..27d6e1a1a05 100644 --- a/lib/XPathAbstract.php +++ b/lib/XPathAbstract.php @@ -387,6 +387,9 @@ public function collectData() libxml_clear_errors(); libxml_use_internal_errors(false); + // fix relative links + defaultLinkTo($webPageHtml, $this->feedUri); + $xpath = new \DOMXPath($webPageHtml); $this->feedName = $this->provideFeedTitle($xpath); diff --git a/lib/html.php b/lib/html.php index 9687011542e..2553f3a83df 100644 --- a/lib/html.php +++ b/lib/html.php @@ -185,14 +185,17 @@ function defaultLinkTo($dom, $url) $dom = str_get_html($dom); } - foreach ($dom->find('img') as $image) { - $image->src = urljoin($url, $image->src); + // Use long method names for compatibility with simple_html_dom and DOMDocument + + foreach ($dom->getElementsByTagName('img') as $image) { + $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); } - foreach ($dom->find('a') as $anchor) { - $anchor->href = urljoin($url, $anchor->href); + foreach ($dom->getElementsByTagName('a') as $anchor) { + $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); } + // Will never be true for DOMDocument if ($string_convert) { $dom = $dom->outertext; } From cfe81ab2ac506a2f47f5aab517fc4e7926e28b6a Mon Sep 17 00:00:00 2001 From: Dag Date: Fri, 19 May 2023 16:05:52 +0200 Subject: [PATCH 02/22] fix: Call to a member function setAttribute() on int, #3402 (#3403) --- lib/html.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/html.php b/lib/html.php index 2553f3a83df..ad3e6509eac 100644 --- a/lib/html.php +++ b/lib/html.php @@ -187,12 +187,18 @@ function defaultLinkTo($dom, $url) // Use long method names for compatibility with simple_html_dom and DOMDocument - foreach ($dom->getElementsByTagName('img') as $image) { - $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); + $images = $dom->getElementsByTagName('img'); + if (is_array($images)) { + foreach ($images as $image) { + $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); + } } - foreach ($dom->getElementsByTagName('a') as $anchor) { - $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); + $anchors = $dom->getElementsByTagName('a'); + if (is_array($anchors)) { + foreach ($anchors as $anchor) { + $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); + } } // Will never be true for DOMDocument From 3e0d024888edc79df28ea3b0aca47a8634213475 Mon Sep 17 00:00:00 2001 From: mrnoname1000 Date: Fri, 19 May 2023 17:02:17 -0500 Subject: [PATCH 03/22] [core] Fix defaultLinkTo for simple_html_dom objects (#3404) --- lib/html.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/html.php b/lib/html.php index ad3e6509eac..9cdb55e67a5 100644 --- a/lib/html.php +++ b/lib/html.php @@ -187,18 +187,12 @@ function defaultLinkTo($dom, $url) // Use long method names for compatibility with simple_html_dom and DOMDocument - $images = $dom->getElementsByTagName('img'); - if (is_array($images)) { - foreach ($images as $image) { - $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); - } + foreach ($dom->getElementsByTagName('img', null) as $image) { + $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); } - $anchors = $dom->getElementsByTagName('a'); - if (is_array($anchors)) { - foreach ($anchors as $anchor) { - $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); - } + foreach ($dom->getElementsByTagName('a', null) as $anchor) { + $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); } // Will never be true for DOMDocument From b5dbec4cc1345f88eb34158af01ac1b7b53cefbf Mon Sep 17 00:00:00 2001 From: mrnoname1000 Date: Fri, 19 May 2023 21:15:56 -0500 Subject: [PATCH 04/22] [AllSidesBridge] New bridge (#3405) --- bridges/AllSidesBridge.php | 85 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 bridges/AllSidesBridge.php diff --git a/bridges/AllSidesBridge.php b/bridges/AllSidesBridge.php new file mode 100644 index 00000000000..d71195efe54 --- /dev/null +++ b/bridges/AllSidesBridge.php @@ -0,0 +1,85 @@ + [ + 'limit' => [ + 'name' => 'Number of posts to return', + 'type' => 'number', + 'defaultValue' => 10, + 'required' => false, + 'title' => 'Zero or negative values return all posts (ignored if not fetching full article)', + ], + 'fetch' => [ + 'name' => 'Fetch full article content', + 'type' => 'checkbox', + 'defaultValue' => 'checked', + ], + ], + 'Headline Roundups' => [], + ]; + + private const ROUNDUPS_URI = self::URI . '/headline-roundups'; + + public function collectData() + { + switch ($this->queriedContext) { + case 'Headline Roundups': + $index = getSimpleHTMLDOM(self::ROUNDUPS_URI); + defaultLinkTo($index, self::ROUNDUPS_URI); + $entries = $index->find('table.views-table > tbody > tr'); + + $limit = (int) $this->getInput('limit'); + $fetch = (bool) $this->getInput('fetch'); + + if ($limit > 0 && $fetch) { + $entries = array_slice($entries, 0, $limit); + } + + foreach ($entries as $entry) { + $item = [ + 'title' => $entry->find('.views-field-name', 0)->text(), + 'uri' => $entry->find('a', 0)->href, + 'timestamp' => $entry->find('.date-display-single', 0)->content, + 'author' => 'AllSides Staff', + ]; + + if ($fetch) { + $article = getSimpleHTMLDOMCached($item['uri']); + defaultLinkTo($article, $item['uri']); + + $item['content'] = $article->find('.story-id-page-description', 0); + + foreach ($article->find('.page-tags a') as $tag) { + $item['categories'][] = $tag->text(); + } + } + + $this->items[] = $item; + } + break; + } + } + + public function getName() + { + if ($this->queriedContext) { + return self::NAME . " - {$this->queriedContext}"; + } + return self::NAME; + } + + public function getURI() + { + switch ($this->queriedContext) { + case 'Headline Roundups': + return self::ROUNDUPS_URI; + } + return self::URI; + } +} From f803ffa79af646a4d26d78e5f4b0b7a87f9b1133 Mon Sep 17 00:00:00 2001 From: Dag Date: Sun, 21 May 2023 19:59:39 +0200 Subject: [PATCH 05/22] fix: ArgumentCountError: DOMDocument::getElementsByTagName() expects exactly 1 argument, 2 given, #3406 (#3407) --- lib/html.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/html.php b/lib/html.php index 9cdb55e67a5..0ffd9257070 100644 --- a/lib/html.php +++ b/lib/html.php @@ -187,13 +187,13 @@ function defaultLinkTo($dom, $url) // Use long method names for compatibility with simple_html_dom and DOMDocument - foreach ($dom->getElementsByTagName('img', null) as $image) { - $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); - } + // foreach ($dom->getElementsByTagName('img', null) as $image) { + // $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); + // } - foreach ($dom->getElementsByTagName('a', null) as $anchor) { - $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); - } + // foreach ($dom->getElementsByTagName('a', null) as $anchor) { + // $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); + // } // Will never be true for DOMDocument if ($string_convert) { From 87b9f2dd945034b2ea9dff6e3fb031b49aa7f583 Mon Sep 17 00:00:00 2001 From: mrnoname1000 Date: Sun, 21 May 2023 14:06:35 -0500 Subject: [PATCH 06/22] [core] Fix XPathAbstract while working around Simple HTML DOM bug (#3408) --- lib/html.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/html.php b/lib/html.php index 0ffd9257070..7f4f12017c5 100644 --- a/lib/html.php +++ b/lib/html.php @@ -187,13 +187,24 @@ function defaultLinkTo($dom, $url) // Use long method names for compatibility with simple_html_dom and DOMDocument - // foreach ($dom->getElementsByTagName('img', null) as $image) { - // $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); - // } + // Work around bug in simple_html_dom->getElementsByTagName + if ($dom instanceof simple_html_dom) { + $findByTag = function ($name) use ($dom) { + return $dom->getElementsByTagName($name, null); + }; + } else { + $findByTag = function ($name) use ($dom) { + return $dom->getElementsByTagName($name); + }; + } + + foreach ($findByTag('img') as $image) { + $image->setAttribute('src', urljoin($url, $image->getAttribute('src'))); + } - // foreach ($dom->getElementsByTagName('a', null) as $anchor) { - // $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); - // } + foreach ($findByTag('a') as $anchor) { + $anchor->setAttribute('href', urljoin($url, $anchor->getAttribute('href'))); + } // Will never be true for DOMDocument if ($string_convert) { From 01f731cfa44cf9a3c6c4f6ef8bf29af9a13763ed Mon Sep 17 00:00:00 2001 From: July Date: Fri, 26 May 2023 12:19:34 -0400 Subject: [PATCH 07/22] [GameBananaBridge] Create new bridge (#3410) --- bridges/GameBananaBridge.php | 86 ++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 bridges/GameBananaBridge.php diff --git a/bridges/GameBananaBridge.php b/bridges/GameBananaBridge.php new file mode 100644 index 00000000000..c436407bfa1 --- /dev/null +++ b/bridges/GameBananaBridge.php @@ -0,0 +1,86 @@ + [ + 'gid' => [ + 'name' => 'Game ID', + 'required' => true, + // Example: latest mods from Zelda: Tears of the Kingdom + 'exampleValue' => '7617', + ], + 'updates' => [ + 'name' => 'Get updates', + 'type' => 'checkbox', + 'required' => false, + 'title' => 'Enable game updates in feed' + ], + ] + ]; + + public function getIcon() + { + return 'https://images.gamebanana.com/static/img/favicon/favicon.ico'; + } + + public function collectData() + { + $url = 'https://api.gamebanana.com/Core/List/New?itemtype=Mod&page=1&gameid=' . $this->getInput('gid'); + if ($this->getInput('updates')) { + $url .= '&include_updated=1'; + } + $api_response = getContents($url); + $json_list = json_decode($api_response, true); // Get first page mod list + + $url = 'https://api.gamebanana.com/Core/Item/Data?itemtype[]=Game&fields[]=name&itemid[]=' . $this->getInput('gid'); + $fields = 'name,Owner().name,text,Preview().sSubFeedImageUrl(),Files().aFiles(),date,Url().sProfileUrl(),udate'; + foreach ($json_list as $element) { // Build api request to minimize API calls + $mid = $element[1]; + $url .= '&itemtype[]=Mod&fields[]=' . $fields . '&itemid[]=' . $mid; + } + $api_response = getContents($url); + $json_list = json_decode($api_response, true); + + $this->title = $json_list[0][0]; + array_shift($json_list); // Take title from API request and remove from json + + foreach ($json_list as $element) { + $item = []; + $item['uri'] = $element[6]; + $item['comments'] = $item['uri'] . '#PostsListModule'; + $item['title'] = $element[0]; + $item['author'] = $element[1]; + $item['content'] = '
' . $element[2]; + $item['timestamp'] = $element[5]; + if ($this->getInput('updates')) { + $item['timestamp'] = $element[7]; + } + $item['enclosures'] = []; + foreach ($element[4] as $file) { // Place mod downloads in enclosures + array_push($item['enclosures'], 'https://files.gamebanana.com/mods/' . $file['_sFile']); + } + $item['uid'] = $item['uri'] . $item['title'] . $item['timestamp']; + $this->items[] = $item; + } + } + + public function getName() + { + $name = parent::getName(); + if (isset($this->title)) { + $name .= " - $this->title"; + } + return $name; + } + + public function getURI() + { + $uri = parent::getURI() . 'games/' . $this->getInput('gid'); + return $uri; + } +} From 227c7b8968d00be7b438e9c340158bcc9d2ae63f Mon Sep 17 00:00:00 2001 From: piyushpaliwal Date: Sun, 28 May 2023 05:01:45 +0530 Subject: [PATCH 08/22] Sleeper.com Alerts. Fixes #2234 (#3411) * Sleeper.com Alerts. Fixes #2234 * fix: linter issue --- bridges/SleeperFantasyFootballBridge.php | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 bridges/SleeperFantasyFootballBridge.php diff --git a/bridges/SleeperFantasyFootballBridge.php b/bridges/SleeperFantasyFootballBridge.php new file mode 100644 index 00000000000..c506482c097 --- /dev/null +++ b/bridges/SleeperFantasyFootballBridge.php @@ -0,0 +1,44 @@ +find('div.content > div.latest-topics > a') as $index => $a) { + $content = $a->find('div.title > p', 0)->innertext; + $meta = $this->processString($a->find('div.desc > div.username', 0)->innertext); + $item['title'] = $content; + $item['content'] = $content; + $item['categories'] = $a->find('div.title div.tag', 0)->innertext; + $item['timestamp'] = $meta['timestamp']; + $item['author'] = $meta['author']; + $item['enclosures'] = $a->find('div.player-photo amp-img', 0)->src; + $this->items[] = $item; + if (count($this->items) >= 10) { + break; + } + } + } + + protected function processString($inputString) + { + $decodedString = str_replace([' ', '•'], [' ', '|'], $inputString); + $splitArray = explode(' | ', $decodedString); + $author = trim($splitArray[0]); + $timeString = trim($splitArray[1]); + $timestamp = strtotime($timeString); + return [ + 'author' => $author, + 'timestamp' => $timestamp + ]; + } +} From 2f0784c2871c428c9ed53f022f086f07af377a19 Mon Sep 17 00:00:00 2001 From: aysilu-kitsune <134463137+aysilu-kitsune@users.noreply.github.com> Date: Sun, 28 May 2023 16:21:44 +0000 Subject: [PATCH 09/22] added my instance (#3413) --- docs/01_General/06_Public_Hosts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/01_General/06_Public_Hosts.md b/docs/01_General/06_Public_Hosts.md index b702bc041bb..531e53836ee 100644 --- a/docs/01_General/06_Public_Hosts.md +++ b/docs/01_General/06_Public_Hosts.md @@ -19,6 +19,7 @@ | ![](https://iplookup.flagfox.net/images/h16/DE.png) | https://rss-bridge.mediani.de | ![](https://img.shields.io/website/https/rss-bridge.mediani.de.svg) | [@sokai](https://github.com/sokai) | Hosted with Netcup, Germany | | ![](https://iplookup.flagfox.net/images/h16/US.png) | http://rb.vern.cc/ | ![](https://img.shields.io/website/https/rb.vern.cc.svg) | [@vern.cc](https://vern.cc/en/admin) | Hosted with Hetzner, US | | ![](https://iplookup.flagfox.net/images/h16/FR.png) | https://rssbridge.flossboxin.org.in/ | ![](https://img.shields.io/badge/website-up-brightgreen) | [@vdbhb59](https://github.com/vdbhb59) | Hosted with OVH SAS (Maintained in India) +| ![](https://iplookup.flagfox.net/images/h16/PL.png) | https://rss.foxhaven.cyou| ![](https://img.shields.io/badge/website-up-brightgreen) | [@Aysilu](https://foxhaven.cyou) | Hosted with Timeweb (Maintained in Poland) ## Inactive instances From 845a8f793698e64a65e0bbc6c47a77904866d240 Mon Sep 17 00:00:00 2001 From: July Date: Sun, 28 May 2023 12:23:01 -0400 Subject: [PATCH 10/22] [MangaDexBridge] Add option to add chapter images to entries (#3412) --- bridges/MangaDexBridge.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bridges/MangaDexBridge.php b/bridges/MangaDexBridge.php index 143cd7328af..009d2532e09 100644 --- a/bridges/MangaDexBridge.php +++ b/bridges/MangaDexBridge.php @@ -21,6 +21,18 @@ class MangaDexBridge extends BridgeAbstract 'exampleValue' => 'en,jp', 'required' => false ], + 'images' => [ + 'name' => 'Fetch chapter page images', + 'type' => 'list', + 'title' => 'Places chapter images in feed contents. Entries will consume more bandwidth.', + 'defaultValue' => 'no', + 'values' => [ + 'None' => 'no', + 'Data Saver' => 'saver', + 'Full Quality' => 'yes' + ] + ] + ], 'Title Chapters' => [ 'url' => [ @@ -239,6 +251,27 @@ protected function getChapters($content) $item['content'] .= '
Other Users: ' . implode(', ', $users); } + // Fetch chapter page images if desired and add to content + if ($this->getInput('images') !== 'no') { + $api_uri = self::API_ROOT . 'at-home/server/' . $item['uid']; + $header = [ 'Content-Type: application/json' ]; + $pages = json_decode(getContents($api_uri, $header), true); + if ($pages['result'] != 'ok') { + returnServerError('Could not retrieve API results'); + } + + if ($this->getInput('images') == 'saver') { + $page_base = $pages['baseUrl'] . '/data-saver/' . $pages['chapter']['hash'] . '/'; + foreach ($pages['chapter']['dataSaver'] as $image) { + $item['content'] .= '
'; + } + } else { + $page_base = $pages['baseUrl'] . '/data/' . $pages['chapter']['hash'] . '/'; + foreach ($pages['chapter']['data'] as $image) { + $item['content'] .= '
'; + } + } + } $this->items[] = $item; } } From c5cd2294456c6a118885003f7beb6f32bb98bc68 Mon Sep 17 00:00:00 2001 From: Ryan Stafford Date: Thu, 1 Jun 2023 15:26:47 -0400 Subject: [PATCH 11/22] [YoutubeBridge] Set icon (#3416) --- bridges/YoutubeBridge.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bridges/YoutubeBridge.php b/bridges/YoutubeBridge.php index fc00283ba87..95f4f01791e 100644 --- a/bridges/YoutubeBridge.php +++ b/bridges/YoutubeBridge.php @@ -336,6 +336,7 @@ public function collectData() $html = $this->ytGetSimpleHTMLDOM($url_listing); $jsonData = $this->getJSONData($html); $url_feed = $jsonData->metadata->channelMetadataRenderer->rssUrl; + $this->iconURL = $jsonData->metadata->channelMetadataRenderer->avatar->thumbnails[0]->url; } if (!$this->skipFeeds()) { $html = $this->ytGetSimpleHTMLDOM($url_feed); @@ -444,4 +445,13 @@ public function getName() return parent::getName(); } } + + public function getIcon() + { + if (empty($this->iconURL)) { + return parent::getIcon(); + } else { + return $this->iconURL; + } + } } From ee498eadf93a1e5ffdc7932ed1519c875eadcd7d Mon Sep 17 00:00:00 2001 From: Dag Date: Fri, 2 Jun 2023 20:22:09 +0200 Subject: [PATCH 12/22] fix: move debug mode to config (#3324) * fix: move debug mode to config * fix: also move debug_whitelist to .ini config * fix: move logic back to Debug class * docs * docs * fix: disable debug mode by default * fix: restore previous behavior for alerts * fix: center-align alert text --- README.md | 4 +- actions/DisplayAction.php | 8 +- actions/FrontpageAction.php | 1 + .../SchweinfurtBuergerinformationenBridge.php | 4 - config.default.ini.php | 7 ++ docs/04_For_Developers/05_Debug_mode.md | 20 ++-- docs/images/debug_mode.png | Bin 21735 -> 0 bytes lib/Configuration.php | 16 +++ lib/Debug.php | 99 ++---------------- lib/FeedExpander.php | 4 +- lib/Logger.php | 15 ++- lib/RssBridge.php | 2 + lib/bootstrap.php | 1 + lib/contents.php | 7 +- lib/html.php | 33 ++++-- static/style.css | 32 ++++-- templates/base.html.php | 8 +- templates/frontpage.html.php | 14 --- 18 files changed, 119 insertions(+), 156 deletions(-) delete mode 100644 docs/images/debug_mode.png diff --git a/README.md b/README.md index a09d65535e7..b54194a7221 100644 --- a/README.md +++ b/README.md @@ -183,9 +183,9 @@ Add the bridge name to `whitelist.txt`: ### How to enable debug mode -Create a file named `DEBUG`: +Set in `config.ini.php`: - touch DEBUG + enable_debug_mode = true Learn more in [debug mode](https://rss-bridge.github.io/rss-bridge/For_Developers/Debug_mode.html). diff --git a/actions/DisplayAction.php b/actions/DisplayAction.php index 3a262674380..c71be5dd11f 100644 --- a/actions/DisplayAction.php +++ b/actions/DisplayAction.php @@ -107,7 +107,7 @@ public function execute(array $request) && (time() - $cache_timeout < $mtime) && !Debug::isEnabled() ) { - // At this point we found the feed in the cache + // At this point we found the feed in the cache and debug mode is disabled if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { // The client wants to know if the feed has changed since its last check @@ -118,7 +118,7 @@ public function execute(array $request) } } - // Fetch the cached feed from the cache and prepare it + // Load the feed from cache and prepare it $cached = $cache->loadData(); if (isset($cached['items']) && isset($cached['extraInfos'])) { foreach ($cached['items'] as $item) { @@ -127,7 +127,7 @@ public function execute(array $request) $infos = $cached['extraInfos']; } } else { - // At this point we did NOT find the feed in the cache. So invoke the bridge! + // At this point we did NOT find the feed in the cache or debug mode is enabled. try { $bridge->setDatas($bridge_params); $bridge->collectData(); @@ -200,7 +200,7 @@ private function createFeedItemFromException($e, BridgeInterface $bridge): FeedI $item->setURI(get_current_url()); $item->setTimestamp(time()); - // Create a item identifier for feed readers e.g. "staysafetv twitch videos_19389" + // Create an item identifier for feed readers e.g. "staysafetv twitch videos_19389" $item->setUid($bridge->getName() . '_' . $uniqueIdentifier); $content = render_template(__DIR__ . '/../templates/bridge-error.html.php', [ diff --git a/actions/FrontpageAction.php b/actions/FrontpageAction.php index f015062f55b..f7ba56e65b0 100644 --- a/actions/FrontpageAction.php +++ b/actions/FrontpageAction.php @@ -24,6 +24,7 @@ public function execute(array $request) } return render(__DIR__ . '/../templates/frontpage.html.php', [ + 'messages' => [], 'admin_email' => Configuration::getConfig('admin', 'email'), 'admin_telegram' => Configuration::getConfig('admin', 'telegram'), 'bridges' => $body, diff --git a/bridges/SchweinfurtBuergerinformationenBridge.php b/bridges/SchweinfurtBuergerinformationenBridge.php index c7c935fd336..349a9d8a84e 100644 --- a/bridges/SchweinfurtBuergerinformationenBridge.php +++ b/bridges/SchweinfurtBuergerinformationenBridge.php @@ -43,10 +43,6 @@ public function collectData() foreach ($articleIDs as $articleID) { $this->items[] = $this->generateItemFromArticle($articleID); - - if (Debug::isEnabled()) { - break; - } } } diff --git a/config.default.ini.php b/config.default.ini.php index f67f315ff61..3a347036d60 100644 --- a/config.default.ini.php +++ b/config.default.ini.php @@ -15,6 +15,13 @@ ; Display a system message to users. message = "" +; Whether to enable debug mode. +enable_debug_mode = false + +; Enable debug mode only for these permitted ip addresses +; debug_mode_whitelist[] = 127.0.0.1 +; debug_mode_whitelist[] = 192.168.1.10 + [http] timeout = 60 useragent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0" diff --git a/docs/04_For_Developers/05_Debug_mode.md b/docs/04_For_Developers/05_Debug_mode.md index 482ff0f5c46..6bdb1d484a0 100644 --- a/docs/04_For_Developers/05_Debug_mode.md +++ b/docs/04_For_Developers/05_Debug_mode.md @@ -5,23 +5,29 @@ Enabling debug mode on a public server may result in malicious clients retrievin *** Debug mode enables error reporting and prevents loading data from the cache (data is still written to the cache). -To enable debug mode, create a file named 'DEBUG' in the root directory of RSS-Bridge (next to `index.php`). For further security, insert your IP address in the file. You can add multiple addresses, one per line. +To enable debug mode, set in `config.ini.php`: + + enable_debug_mode = true + +Allow only explicit ip addresses: + + debug_mode_whitelist[] = 127.0.0.1 + debug_mode_whitelist[] = 192.168.1.10 _Notice_: * An empty file enables debug mode for anyone! * The bridge whitelist still applies! (debug mode does **not** enable all bridges) -RSS-Bridge will give you a visual feedback when debug mode is enabled: - -![twitter bridge](../images/debug_mode.png) +RSS-Bridge will give you a visual feedback when debug mode is enabled. While debug mode is active, RSS-Bridge will write additional data to your servers `error.log`. Debug mode is controlled by the static class `Debug`. It provides three core functions: -`Debug::isEnabled()`: Returns `true` if debug mode is enabled. -`Debug::isSecure()`: Returns `true` if your client is on the debug whitelist. -`Debug::log($message)`: Adds a message to `error.log`. It takes one parameter, which can be anything. For example: `Debug::log('Hello World!');` +* `Debug::isEnabled()`: Returns `true` if debug mode is enabled. +* `Debug::log($message)`: Adds a message to `error.log`. It takes one parameter, which can be anything. + +Example: `Debug::log('Hello World!');` **Notice**: `Debug::log($message)` calls `Debug::isEnabled()` internally. You don't have to do that manually. \ No newline at end of file diff --git a/docs/images/debug_mode.png b/docs/images/debug_mode.png deleted file mode 100644 index 6ab8917bb62e10365885cb2a4d422d5905ecfe8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21735 zcmZ5oWmFqow8h;Win|tfr??YbTHM`>OVQx&?(R~Y;_hCcxJz*7<$FKgkGIxcnMo#V zlB4(BefHc)Rb?4eBqAgT2nbX;SxEo{1SB>1{3ik&_*MT;+#&=7IfR^~xW>=y3qQ|n zlA(lN;!DpX!PjZqFVL-#E@;`%JWo!8t8jLCs07z*mV2B=E*!K(Y}M3aSoHbXuBoaL zSn>!pe{2>ejBmQKwP3Q0ZXO>;6lWIi&b*90Td=G?%V*@Trm|`;YhOIv-8Jv)E%W^F zzHv!{hYS>|;9nG!ISkY}40a-@VhW-{3IP)j&XU1P7#Hc<>AvIhY`tGX47nr)N>DKv6!&iZ%U^$$gaPkl8(cy!Y0!l2zF zr?!CdltZWK3$e$x4EAG3!NT8H7Z>gkY0xjR1Ki3ol&E{~p=3G&>285%n4;{ILwDG@ z(sX&CwT+FaEf?5L5LD{<)ZQEk|KB!-U!6SW&Y#P~!)>_rT&ja2MZsNhfs1?K-`FNQ z5YlixE3*r)WSzQO;gspdJwKV;E4c7tPViPEgb$qymLCmU!A~2kEj);Cqc2B5Y)GDp=%%_Gcxk!P-Y;lG^5?_ zJDPf@0s^inv(Z$>U#7uZ0s9Vpxd`6WAY^3O%=DO1f}Z%045lq2p?=DN zELxf}0fIl5ufH^sCnp4G&EXC?aFG&sIc& z3QIyf(6Z;OEjYK*r0BIOd#No9e;av1zoeZ#!NAL|$S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bah zKPE$bKZmw#M*tIt3Xp_8BwK))l@yQ1eSv{0rQ;`HPHo3GkZ}G|aN-r27us5@E_>ek zcNg>vTY!(8kIdTr2!(pjDOVeiHpA3qJxUpWR^R}7LQIe^4l61iLssZ`48GgI6~`dp89 zO0q0F)M)=iW6UfUP1CISEE{BLj1~1E(fMS3<1HC}{wNr+HfRU{1tvPbqJQ&pz<*AO z{$A8i7PcWe_8$VIw=wy}Ar*^7M~IoF#DtD26eB8J>{%wrl-P>O{_;Xezo#oO^$(%H$b2dcj9BzJwUSuh zYPH4uG$J5Mr_)tIk_^NtIMtE?YH9hA=y}>t)<=H3cDVIv2#^K{l=w((Cpa>jb&@4n zP+TqH;)Pd4G~bE-PV`%TMfMX~e)~XyiEcmGDx1k6lcyMa8zw|RFA=myZ`kwZ)#N{In z<+8nlh)$-c{t-KcV#3E0T{T65D-vSSyV&p8U)nDH4HaA-O80_DyP2Mu%D~%p*eHsF!0RSWlOw>}MWWbWZa=8mPaUGZ zrAWB;MAU5m8yS~o##jVGe$^Li^{rk%YK>KY=C$5?>2nldk7h7>#{-fGlz2h**47c1 zn)MSd(ew2_tF_wmia^1M-)=D=qQ~JBjQsl9Xnz{zU(}vx9GV$p%4?%#efv6>{O9%l zUu#@yje+QUzkVLAV02Uf5VM$DsFC*iOSOQauWgFn rA)3ej&gDSy-pG3zCBJ?iP4xc(YC%p#`+d<>00000NkvXXu0mjfj;%x4 diff --git a/lib/Configuration.php b/lib/Configuration.php index bdbd830bcc9..6eec33f6f0e 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -114,6 +114,15 @@ public static function loadConfiguration(array $customConfig = [], array $env = } } + if (file_exists(__DIR__ . '/../DEBUG')) { + // The debug mode has been moved to config. Preserve existing installs which has this DEBUG file. + self::setConfig('system', 'enable_debug_mode', true); + $debug = trim(file_get_contents(__DIR__ . '/../DEBUG')); + if ($debug) { + self::setConfig('system', 'debug_mode_whitelist', explode("\n", str_replace("\r", '', $debug))); + } + } + if ( !is_string(self::getConfig('system', 'timezone')) || !in_array(self::getConfig('system', 'timezone'), timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)) @@ -121,6 +130,13 @@ public static function loadConfiguration(array $customConfig = [], array $env = self::throwConfigError('system', 'timezone'); } + if (!is_bool(self::getConfig('system', 'enable_debug_mode'))) { + self::throwConfigError('system', 'enable_debug_mode', 'Is not a valid Boolean'); + } + if (!is_array(self::getConfig('system', 'debug_mode_whitelist') ?: [])) { + self::throwConfigError('system', 'debug_mode_whitelist', 'Is not a valid array'); + } + if (!is_string(self::getConfig('proxy', 'url'))) { self::throwConfigError('proxy', 'url', 'Is not a valid string'); } diff --git a/lib/Debug.php b/lib/Debug.php index 9210ebc801c..f6a8d1052b4 100644 --- a/lib/Debug.php +++ b/lib/Debug.php @@ -1,106 +1,23 @@ message)); - } + Logger::debug(trim($xmlError->message)); } if ($xmlErrors) { // Render only the first error into exception message diff --git a/lib/Logger.php b/lib/Logger.php index 9bbdd512e94..e15035fe503 100644 --- a/lib/Logger.php +++ b/lib/Logger.php @@ -6,9 +6,7 @@ final class Logger { public static function debug(string $message, array $context = []) { - if (Debug::isEnabled()) { - self::log('DEBUG', $message, $context); - } + self::log('DEBUG', $message, $context); } public static function info(string $message, array $context = []): void @@ -28,6 +26,11 @@ public static function error(string $message, array $context = []): void private static function log(string $level, string $message, array $context = []): void { + if (!Debug::isEnabled() && $level === 'DEBUG') { + // Don't log this debug log record because debug mode is disabled + return; + } + if (isset($context['e'])) { /** @var \Throwable $e */ $e = $context['e']; @@ -66,7 +69,13 @@ private static function log(string $level, string $message, array $context = []) $message, $context ? Json::encode($context) : '' ); + // Log to stderr/stdout whatever that is + // todo: extract to log handler error_log($text); + + // Log to file + // todo: extract to log handler + //file_put_contents('/tmp/rss-bridge.log', $text, FILE_APPEND); } } diff --git a/lib/RssBridge.php b/lib/RssBridge.php index 62e8acc58cb..e6f1c9e4409 100644 --- a/lib/RssBridge.php +++ b/lib/RssBridge.php @@ -42,6 +42,7 @@ private function run($request): void ); Logger::warning($text); if (Debug::isEnabled()) { + // todo: extract to log handler print sprintf("
%s
\n", e($text)); } }); @@ -59,6 +60,7 @@ private function run($request): void ); Logger::error($message); if (Debug::isEnabled()) { + // todo: extract to log handler print sprintf("
%s
\n", e($message)); } } diff --git a/lib/bootstrap.php b/lib/bootstrap.php index 8e5cf69cc9a..98c7b54d955 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -40,6 +40,7 @@ const REPOSITORY = 'https://github.com/RSS-Bridge/rss-bridge/'; // Allow larger files for simple_html_dom +// todo: extract to config (if possible) const MAX_FILE_SIZE = 10000000; // Files diff --git a/lib/contents.php b/lib/contents.php index ebd4ee2cc63..a1630e3ca19 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -438,14 +438,17 @@ function getSimpleHTMLDOMCached( $time !== false && (time() - $duration < $time) && !Debug::isEnabled() - ) { // Contents within duration + ) { + // Contents within duration and debug mode is disabled $content = $cache->loadData(); - } else { // Content not within duration + } else { + // Contents not within duration, or debug mode is enabled $content = getContents( $url, $header ?? [], $opts ?? [] ); + // todo: fix bad if statement if ($content !== false) { $cache->saveData($content); } diff --git a/lib/html.php b/lib/html.php index 7f4f12017c5..ca0a411c872 100644 --- a/lib/html.php +++ b/lib/html.php @@ -1,23 +1,34 @@ Configuration::getConfig('system', 'message'), + 'level' => 'info', + ]; + } + if (Debug::isEnabled()) { + $debugModeWhitelist = Configuration::getConfig('system', 'debug_mode_whitelist') ?: []; + if ($debugModeWhitelist === []) { + $context['messages'][] = [ + 'body' => 'Warning : Debug mode is active from any location, make sure only you can access RSS-Bridge.', + 'level' => 'error' + ]; + } else { + $context['messages'][] = [ + 'body' => 'Warning : Debug mode is active from your IP address, your requests will bypass the cache.', + 'level' => 'warning' + ]; + } + } $context['page'] = render_template($template, $context); return render_template('base.html.php', $context); } diff --git a/static/style.css b/static/style.css index 570ee014812..a83e25e4214 100644 --- a/static/style.css +++ b/static/style.css @@ -71,15 +71,34 @@ header { text-align: center; } -section.warning { +.alert-info { + margin-bottom: 15px; + color: white; + font-weight: bold; + background-color: rgb(33, 150, 243); + padding: 15px; + border-radius: 4px; + text-align: center; +} + +.alert-warning { background-color: #ffc600; color: #5f5f5f; + margin-bottom: 15px; + font-weight: bold; + padding: 15px; + border-radius: 4px; + text-align: center; } -section.critical-warning { +.alert-error { background-color: #cf3e3e; font-weight: bold; color: white; + margin-bottom: 15px; + padding: 15px; + border-radius: 4px; + text-align: center; } select, @@ -342,15 +361,6 @@ button { width: 200px; } -.alert { - margin-bottom: 15px; - color: white; - font-weight: bold; - background-color: rgb(33, 150, 243); - padding: 15px; - border-radius: 4px; -} - @media screen and (max-width: 767px) { .container { width: 100%; diff --git a/templates/base.html.php b/templates/base.html.php index 00728785c83..ca31823dc35 100644 --- a/templates/base.html.php +++ b/templates/base.html.php @@ -17,11 +17,11 @@ - -
- + +
+
- +
diff --git a/templates/frontpage.html.php b/templates/frontpage.html.php index 5daa63bdd66..63f4a2ab2fa 100644 --- a/templates/frontpage.html.php +++ b/templates/frontpage.html.php @@ -4,20 +4,6 @@ document.addEventListener('DOMContentLoaded', rssbridge_list_search); - - -
- Warning : Debug mode is active from any location, - make sure only you can access RSS-Bridge. -
- -
- Warning : Debug mode is active from your IP address, - your requests will bypass the cache. -
- - -