diff --git a/README.md b/README.md index 338a4cc..5b9c2b6 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ git clone https://git.beparanoid.de/librex ``` ### LibreX compared to other metasearch engines -| Metasearch engine | Works without JS | Privacy frontend redirect | Torrent results | -|-|-|-|-| -| LibreX | ✅ | ✅ | ✅ | -| SearXNG | ✅ | ❓ Only host can set it | ✅ | -| Whoogle | ✅ | ❓ Only host can set it | ❌ | +| Metasearch engine | Works without JS | Privacy frontend redirect | Torrent results | API | +|-|-|-|-|-| +| LibreX | ✅ | ✅ | ✅ | ✅ | +| SearXNG | ❓ Not user friendly | ❓ Only host can set it | ✅ | ✅ | +| Whoogle | ✅ | ❓ Only host can set it | ❌ | ❌ | diff --git a/auto_updater.sh b/auto_updater.sh deleted file mode 100755 index b0458f8..0000000 --- a/auto_updater.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -while true; do - git stash - git pull - sleep 60 -done - diff --git a/config.php.example b/config.php.example index 5d90e18..c43bb25 100644 --- a/config.php.example +++ b/config.php.example @@ -39,7 +39,7 @@ // CURLOPT_PROXYTYPE => CURLPROXY_HTTP, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", - CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36", + CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP, diff --git a/image_proxy.php b/image_proxy.php index 9521952..4f0a8d4 100644 --- a/image_proxy.php +++ b/image_proxy.php @@ -11,7 +11,9 @@ $base_url_main_split = explode(".", strrev($base_url)); $base_url_main = strrev($base_url_main_split[1]) . "." . strrev($base_url_main_split[0]); - if ($base_url_main == "qwant.com" || $base_url_main == "wikimedia.org" || $base_url_main == "brave.com") + $allowed_domains = array("qwant.com", "wikimedia.org", "brave.com"); + + if (in_array($base_url_main, $allowed_domains)) { $image = $url; $image_src = request($image); diff --git a/librex_updater.service b/librex_updater.service deleted file mode 100644 index 50196f1..0000000 --- a/librex_updater.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=LibreX - A privacy respecting free as in freedom meta search engine -After=syslog.target -After=network.target - -[Service] -RestartSec=10s -Type=simple - -User=librex -Group=librex - -WorkingDirectory=/path/to/librex -ExecStart=/path/to/librex/auto_updater.sh - -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/misc/tools.php b/misc/tools.php index b2ca595..6811697 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -25,6 +25,9 @@ $frontend .= "/u"; } + if (empty(trim($frontend))) + return $url; + $url = $frontend . explode($original, $url)[1]; return $url; @@ -35,6 +38,9 @@ function check_for_privacy_frontend($url) { + if (isset($_COOKIE["disable_frontends"])) + return $url; + $frontends = array( "youtube.com" => "invidious", "instagram.com" => "bibliogram", diff --git a/search.php b/search.php index 830f626..0596614 100644 --- a/search.php +++ b/search.php @@ -8,7 +8,7 @@