From 81df7ba3ed5c1497c1172187e06f9b7b429a605c Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 18 May 2023 21:54:30 -0400 Subject: [PATCH 1/8] ~vern instance --- README.md | 1 + instances.json | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 9a88f7f..5297837 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ |-|-|-|-| | [librex.zzls.xyz](https://librex.zzls.xyz/) | [βœ…](http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion/) | [βœ…](http://7huurwog32tny663wkglrhozfoyqyqmsuxjbd7dtudccx44awjda.b32.i2p) | πŸ‡¨πŸ‡± CL | | [librex.me](https://librex.me/) | [βœ…](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [βœ…](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | πŸ‡¨πŸ‡¦ CA | +| [lx.vern.cc](https://lx.vern.cc/) | [βœ…](http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/) | [βœ…](http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/) | πŸ‡ΊπŸ‡Έ US | | [librex.mikata.ru](https://librex.mikata.ru/) | [βœ…](http://f7ssz7l3biu4fugwctfpcx4txg5yq4gqhrt473ledsuc3ivtd3omniid.onion/) | ❌ | πŸ‡ΊπŸ‡Έ US | | [search.milivojevic.in.rs](https://search.milivojevic.in.rs/) | [βœ…](http://librex2xsek6qnh2i4yufuzqjumfdwtw7io7omgmimpzna6llqudqzyd.onion/) | ❌ | πŸ‡³πŸ‡± NL | | [search.ahwx.org](https://search.ahwx.org/) | [βœ…](http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.onion/) | ❌ | πŸ‡³πŸ‡± NL | diff --git a/instances.json b/instances.json index e710af1..893d683 100644 --- a/instances.json +++ b/instances.json @@ -12,6 +12,12 @@ "i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/", "country": "CA" }, + { + "clearnet": "https://lx.vern.cc/", + "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", + "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/", + "country": "US" + }, { "clearnet": "https://librex.mikata.ru/", "tor": "http://f7ssz7l3biu4fugwctfpcx4txg5yq4gqhrt473ledsuc3ivtd3omniid.onion/", From f3b9badfbc04a0aecd87c03ae572b9bd2d017b23 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sun, 21 May 2023 10:50:53 -0400 Subject: [PATCH 2/8] spaceint instance --- README.md | 2 +- instances.json | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5297837..1e92538 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ | [librex.mikata.ru](https://librex.mikata.ru/) | [βœ…](http://f7ssz7l3biu4fugwctfpcx4txg5yq4gqhrt473ledsuc3ivtd3omniid.onion/) | ❌ | πŸ‡ΊπŸ‡Έ US | | [search.milivojevic.in.rs](https://search.milivojevic.in.rs/) | [βœ…](http://librex2xsek6qnh2i4yufuzqjumfdwtw7io7omgmimpzna6llqudqzyd.onion/) | ❌ | πŸ‡³πŸ‡± NL | | [search.ahwx.org](https://search.ahwx.org/) | [βœ…](http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.onion/) | ❌ | πŸ‡³πŸ‡± NL | +| [search.spaceint.fr](https://search.spaceint.fr/) | [βœ…](http://6d4nqt2rndvmhogpwrbqfvj2ur6e6nm2r6dzi7ny4wj6ai3j5hnvbhyd.onion/) | ❌ | πŸ‡«πŸ‡· FR | | [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | πŸ‡¬πŸ‡§ UK | | [search.madreyk.xyz](https://search.madreyk.xyz/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE | | [search.pabloferreiro.es](https://search.pabloferreiro.es/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE | @@ -32,7 +33,6 @@ | [search.zeroish.xyz](https://search.zeroish.xyz/) | ❌| ❌ | πŸ‡ΊπŸ‡Έ US | | [librex.baczek.me](https://librex.baczek.me/) | ❌| ❌ | πŸ‡΅πŸ‡± PL | | [librex.yogeshlamichhane.com.np](https://librex.yogeshlamichhane.com.np/) | ❌| ❌ | πŸ‡ΊπŸ‡Έ US | -| [search.spaceint.fr](https://search.spaceint.fr/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE | | [lx.benike.monster](https://lx.benike.monster/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE |
diff --git a/instances.json b/instances.json index 893d683..10a0ca0 100644 --- a/instances.json +++ b/instances.json @@ -30,6 +30,12 @@ "i2p": null, "country": "NL" }, + { + "clearnet": "https://search.spaceint.fr/", + "tor": "http://6d4nqt2rndvmhogpwrbqfvj2ur6e6nm2r6dzi7ny4wj6ai3j5hnvbhyd.onion/", + "i2p": null, + "country": "FR" + }, { "clearnet": "https://search.davidovski.xyz/", "tor": null, @@ -114,12 +120,6 @@ "i2p": null, "country": "US" }, - { - "clearnet": "https://search.spaceint.fr/", - "tor": null, - "i2p": null, - "country": "DE" - }, { "clearnet": "https://lx.benike.monster/", "tor": null, From b7776f0c7c6ea787cff30dbc337136534af9182b Mon Sep 17 00:00:00 2001 From: Revvy Date: Sun, 28 May 2023 17:47:35 -0400 Subject: [PATCH 3/8] stackexchange support with anonymousoverflow --- misc/tools.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/tools.php b/misc/tools.php index 19f36cb..6735220 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -56,6 +56,12 @@ $gist_path = explode("gist.github.com", $url)[1]; $url = $frontend . "/gist" . $gist_path; } + else if (strpos($url, "stackexchange.com") !== false) + { + $se_domain = explode(".", explode("://", $url)[1])[0]; + $se_path = explode("stackexchange.com", $url)[1]; + $url = $frontend . "/exchange" . "/" . $se_domain . $se_path; + } else { $url = $frontend . explode($original, $url)[1]; @@ -85,6 +91,11 @@ $url = try_replace_with_frontend($url, $frontend, $original); break; } + else if (strpos($url, "stackexchange.com")) + { + $url = try_replace_with_frontend($url, "anonymousoverflow", "stackexchange.com"); + break; + } } return $url; From bb5c370205b98b22d403ebbb1d7bd2880e4d72d2 Mon Sep 17 00:00:00 2001 From: amogusussy Date: Sun, 4 Jun 2023 16:08:05 +0100 Subject: [PATCH 4/8] fix rutor --- engines/bittorrent/rutor.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/bittorrent/rutor.php b/engines/bittorrent/rutor.php index c5db2d5..8369f3e 100644 --- a/engines/bittorrent/rutor.php +++ b/engines/bittorrent/rutor.php @@ -10,20 +10,20 @@ foreach($xpath->query("//table/tr[@class='gai' or @class='tum']") as $result) { - $name = $xpath->evaluate(".//td/a", $result)[2]->textContent; $magnet = $xpath->evaluate(".//td/a/@href", $result)[1]->textContent; $magnet_without_tracker = explode("&tr=", $magnet)[0]; $magnet = $magnet_without_tracker . $config->bittorent_trackers; - $size = $xpath->evaluate(".//td", $result)[3]->textContent; + $td = $xpath->evaluate(".//td", $result); + $size = $td[count($td) == 5 ? 3 : 2]->textContent; $seeders = $xpath->evaluate(".//span", $result)[0]->textContent; $leechers = $xpath->evaluate(".//span", $result)[1]->textContent; array_push($results, array ( "name" => htmlspecialchars($name), - "seeders" => (int) remove_special($seeders), - "leechers" => (int) remove_special($leechers), + "seeders" => (int) filter_var($seeders, FILTER_SANITIZE_NUMBER_INT), + "leechers" => (int) filter_var($leechers, FILTER_SANITIZE_NUMBER_INT), "magnet" => htmlspecialchars($magnet), "size" => htmlspecialchars($size), "source" => "rutor.info" From b135467fcc1bef48495e08a2621282b6fb1e6eb4 Mon Sep 17 00:00:00 2001 From: youshitsune Date: Thu, 8 Jun 2023 11:04:49 +0200 Subject: [PATCH 5/8] add search.decentrala.org --- README.md | 1 + instances.json | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index c4ee080..8c05b79 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ | [search.spaceint.fr](https://search.spaceint.fr/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE | | [lx.benike.monster](https://lx.benike.monster/) | ❌ | ❌ | πŸ‡©πŸ‡ͺ DE | | [librex.nohost.network](https://librex.nohost.network/) | ❌ | ❌ | πŸ‡²πŸ‡½ MX | +| [search.decentrala.org](https://search.decentrala.org/) | ❌| ❌ | πŸ‡ΊπŸ‡Έ US |
### Thanks rms diff --git a/instances.json b/instances.json index db27739..bd48e1f 100644 --- a/instances.json +++ b/instances.json @@ -119,6 +119,12 @@ "tor": null, "i2p": null, "country": "MX" + }, + { + "clearnet": "https://search.decentrala.org/", + "tor": null, + "i2p": null, + "country": "US" } ] } From 7559bc8101fd09a6d946c5b87f0be5ebaccf4031 Mon Sep 17 00:00:00 2001 From: gospodin Date: Sat, 10 Jun 2023 19:49:18 +0300 Subject: [PATCH 6/8] Redirect to random instance if google is ratelimiting --- engines/google/text.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engines/google/text.php b/engines/google/text.php index b18a504..ad8ba3c 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -114,6 +114,12 @@ } $xpath = get_xpath(curl_multi_getcontent($google_ch)); + if (curl_getinfo($google_ch)['http_code'] == '302') { + $instances_json = json_decode(file_get_contents("instances.json"), true); + $instances = array_map(fn($n) => $n['clearnet'], array_filter($instances_json['instances'], fn($n) => !is_null($n['clearnet']))); + header("Location: " . $instances[array_rand($instances)] . "search.php?q=$query"); + die(); + } foreach($xpath->query("//div[@id='search']//div[contains(@class, 'g')]") as $result) { From e03b930386caff3b8cc0de4c059a8666a15a2741 Mon Sep 17 00:00:00 2001 From: gospodin Date: Sun, 11 Jun 2023 03:47:19 +0300 Subject: [PATCH 7/8] moved to redirect earlier, fixed formatting issues --- engines/google/text.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/google/text.php b/engines/google/text.php index ad8ba3c..c598cc1 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -57,7 +57,7 @@ $url = "https://$wikipedia_language.wikipedia.org/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded"; break; } - + if ($url != NULL) { $special_ch = curl_init($url); @@ -70,6 +70,12 @@ do { curl_multi_exec($mh, $running); } while ($running); + if (curl_getinfo($google_ch)['http_code'] == '302') { + $instances_json = json_decode(file_get_contents("instances.json"), true); + $instances = array_map(fn($n) => $n['clearnet'], array_filter($instances_json['instances'], fn($n) => !is_null($n['clearnet']))); + header("Location: " . $instances[array_rand($instances)] . "search.php?q=$query"); + die(); + } if ($special_search != 0) @@ -114,12 +120,6 @@ } $xpath = get_xpath(curl_multi_getcontent($google_ch)); - if (curl_getinfo($google_ch)['http_code'] == '302') { - $instances_json = json_decode(file_get_contents("instances.json"), true); - $instances = array_map(fn($n) => $n['clearnet'], array_filter($instances_json['instances'], fn($n) => !is_null($n['clearnet']))); - header("Location: " . $instances[array_rand($instances)] . "search.php?q=$query"); - die(); - } foreach($xpath->query("//div[@id='search']//div[contains(@class, 'g')]") as $result) { From e2eead1ce02640f68d3d165e6556572fe5474be3 Mon Sep 17 00:00:00 2001 From: rafalohaki Date: Fri, 23 Jun 2023 13:51:40 +0000 Subject: [PATCH 8/8] Update Version: Alpine 3.17->3.18 php7->php8 --- Dockerfile | 2 +- docker/entrypoint.sh | 2 +- docker/php/php.dockerfile | 6 +++--- docker/php/prepare.sh | 12 ++++++------ docker/server/nginx.conf | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6512cdc..58a08ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax = edrevo/dockerfile-plus -ARG VERSION="3.17" +ARG VERSION="3.18" FROM alpine:${VERSION} AS librex WORKDIR "/var/www/html" diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 525dd18..b3eb4b1 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -5,6 +5,6 @@ sh "docker/php/prepare.sh" sh "docker/server/prepare.sh" -/bin/sh -c /usr/sbin/php-fpm7 +/bin/sh -c /usr/sbin/php-fpm8 exec nginx -g "daemon off;" diff --git a/docker/php/php.dockerfile b/docker/php/php.dockerfile index 3252e0e..7c984e4 100644 --- a/docker/php/php.dockerfile +++ b/docker/php/php.dockerfile @@ -1,5 +1,5 @@ # Set this argument during build time to indicate that the path is for php's www.conf -ARG WWW_CONFIG="/etc/php7/php-fpm.d/www.conf" +ARG WWW_CONFIG="/etc/php8/php-fpm.d/www.conf" # Configure 'opensearch.xml' with Librex configuration metadata, such as the encoding and the host that stores the site # These configurations will replace the 'opensearch.xml' inside '.dockers/templates' for the best setup for your instance @@ -52,8 +52,8 @@ ENV CURLOPT_VERBOSE=true # Install PHP-FPM using Alpine's package manager, apk # Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient -RUN apk add php7 php7-fpm php7-dom php7-curl php7-json --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\ - sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php7\/php-fpm7.sock/' ${WWW_CONFIG} &&\ +RUN apk add php8 php8-fpm php8-dom php8-curl php8-json --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing &&\ + sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php8\/php-fpm8.sock/' ${WWW_CONFIG} &&\ sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\ sed -i 's/^\s*;\s*listen.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\ sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG} diff --git a/docker/php/prepare.sh b/docker/php/prepare.sh index 7a15b32..1ea7864 100755 --- a/docker/php/prepare.sh +++ b/docker/php/prepare.sh @@ -5,13 +5,13 @@ echo "[PREPARE] docker/server/prepare.sh'" # Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh' source "docker/attributes.sh" -# This condition creates the Unix socket if 'php-fpm7.sock' does not already exist. +# This condition creates the Unix socket if 'php-fpm8.sock' does not already exist. # This fixes an issue where Nginx starts but does not serve content -if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then - mkdir "/run/php7" - touch "/run/php7/php-fpm7.sock" - chmod 660 "/run/php7/php-fpm7.sock" - chown nginx:nginx "/run/php7/php-fpm7.sock" +if [ ! -d "/run/php8" ] || [ ! -S "/run/php8/php-fpm8.sock" ]; then + mkdir "/run/php8" + touch "/run/php8/php-fpm8.sock" + chmod 660 "/run/php8/php-fpm8.sock" + chown nginx:nginx "/run/php8/php-fpm8.sock" fi # The lines below will replace the environment variables in the templates with the corresponding variables listed above. To accomplish this, the GNU 'envsubst' package will be used diff --git a/docker/server/nginx.conf b/docker/server/nginx.conf index 24cce30..197c575 100644 --- a/docker/server/nginx.conf +++ b/docker/server/nginx.conf @@ -10,7 +10,7 @@ server { } location ~ \.php$ { - fastcgi_pass unix:/run/php7/php-fpm7.sock; + fastcgi_pass unix:/run/php8/php-fpm8.sock; fastcgi_index index.php; include fastcgi.conf; }