Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Fijxu 2023-06-29 22:15:16 -04:00
commit e18baedc45
10 changed files with 55 additions and 24 deletions

View File

@ -1,5 +1,5 @@
# syntax = edrevo/dockerfile-plus # syntax = edrevo/dockerfile-plus
ARG VERSION="3.17" ARG VERSION="3.18"
FROM alpine:${VERSION} AS librex FROM alpine:${VERSION} AS librex
WORKDIR "/var/www/html" WORKDIR "/var/www/html"

View File

@ -16,7 +16,9 @@
| [librex.zzls.xyz](https://librex.zzls.xyz/) | [](http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion/) | [](http://zzlsaymhcfla7vibo3a223bybeecu3bd5z6rmw2u4y76maqeu76q.b32.i2p) | 🇨🇱 CL | | [librex.zzls.xyz](https://librex.zzls.xyz/) | [](http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion/) | [](http://zzlsaymhcfla7vibo3a223bybeecu3bd5z6rmw2u4y76maqeu76q.b32.i2p) | 🇨🇱 CL |
| [librex.me](https://librex.me/) | [](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA | | [librex.me](https://librex.me/) | [](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA |
| [s.dyox.in](https://s.dyox.in/) | [](http://ddhigxwjz7elcl2erm7qzzukda4qmovoy4cepcueahggpwrpu24mi6qd.onion/) | [](http://s.dyoxin.i2p/) | 🇮🇸 IS | | [s.dyox.in](https://s.dyox.in/) | [](http://ddhigxwjz7elcl2erm7qzzukda4qmovoy4cepcueahggpwrpu24mi6qd.onion/) | [](http://s.dyoxin.i2p/) | 🇮🇸 IS |
| [lx.vern.cc](https://lx.vern.cc/) | [](http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/) | [](http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/) | 🇺🇸 US |
| [search.ahwx.org](https://search.ahwx.org/) | [](http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.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.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 UK |
| [search.madreyk.xyz](https://search.madreyk.xyz/) | ❌ | ❌ | 🇩🇪 DE | | [search.madreyk.xyz](https://search.madreyk.xyz/) | ❌ | ❌ | 🇩🇪 DE |
| [search.pabloferreiro.es](https://search.pabloferreiro.es/) | ❌ | ❌ | 🇩🇪 DE | | [search.pabloferreiro.es](https://search.pabloferreiro.es/) | ❌ | ❌ | 🇩🇪 DE |
@ -30,9 +32,9 @@
| [search.zeroish.xyz](https://search.zeroish.xyz/) | ❌| ❌ | 🇺🇸 US | | [search.zeroish.xyz](https://search.zeroish.xyz/) | ❌| ❌ | 🇺🇸 US |
| [librex.baczek.me](https://librex.baczek.me/) | ❌| ❌ | 🇵🇱 PL | | [librex.baczek.me](https://librex.baczek.me/) | ❌| ❌ | 🇵🇱 PL |
| [librex.yogeshlamichhane.com.np](https://librex.yogeshlamichhane.com.np/) | ❌| ❌ | 🇺🇸 US | | [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 | | [lx.benike.monster](https://lx.benike.monster/) | ❌ | ❌ | 🇩🇪 DE |
| [librex.nohost.network](https://librex.nohost.network/) | ❌ | ❌ | 🇲🇽 MX | | [librex.nohost.network](https://librex.nohost.network/) | ❌ | ❌ | 🇲🇽 MX |
| [search.decentrala.org](https://search.decentrala.org/) | ❌| ❌ | 🇺🇸 US |
<br> <br>
### Thanks rms ### Thanks rms

View File

@ -5,6 +5,6 @@
sh "docker/php/prepare.sh" sh "docker/php/prepare.sh"
sh "docker/server/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;" exec nginx -g "daemon off;"

View File

@ -1,5 +1,5 @@
# Set this argument during build time to indicate that the path is for php's www.conf # 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 # 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 # 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 # 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 # 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 &&\ 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\/php7\/php-fpm7.sock/' ${WWW_CONFIG} &&\ 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.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.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\
sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG} sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG}

View File

@ -5,13 +5,13 @@ echo "[PREPARE] docker/server/prepare.sh'"
# Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh' # Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh'
source "docker/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 # This fixes an issue where Nginx starts but does not serve content
if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then if [ ! -d "/run/php8" ] || [ ! -S "/run/php8/php-fpm8.sock" ]; then
mkdir "/run/php7" mkdir "/run/php8"
touch "/run/php7/php-fpm7.sock" touch "/run/php8/php-fpm8.sock"
chmod 660 "/run/php7/php-fpm7.sock" chmod 660 "/run/php8/php-fpm8.sock"
chown nginx:nginx "/run/php7/php-fpm7.sock" chown nginx:nginx "/run/php8/php-fpm8.sock"
fi 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 # 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

View File

@ -10,7 +10,7 @@ server {
} }
location ~ \.php$ { location ~ \.php$ {
fastcgi_pass unix:/run/php7/php-fpm7.sock; fastcgi_pass unix:/run/php8/php-fpm8.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi.conf; include fastcgi.conf;
} }

View File

@ -10,20 +10,20 @@
foreach($xpath->query("//table/tr[@class='gai' or @class='tum']") as $result) foreach($xpath->query("//table/tr[@class='gai' or @class='tum']") as $result)
{ {
$name = $xpath->evaluate(".//td/a", $result)[2]->textContent; $name = $xpath->evaluate(".//td/a", $result)[2]->textContent;
$magnet = $xpath->evaluate(".//td/a/@href", $result)[1]->textContent; $magnet = $xpath->evaluate(".//td/a/@href", $result)[1]->textContent;
$magnet_without_tracker = explode("&tr=", $magnet)[0]; $magnet_without_tracker = explode("&tr=", $magnet)[0];
$magnet = $magnet_without_tracker . $config->bittorent_trackers; $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; $seeders = $xpath->evaluate(".//span", $result)[0]->textContent;
$leechers = $xpath->evaluate(".//span", $result)[1]->textContent; $leechers = $xpath->evaluate(".//span", $result)[1]->textContent;
array_push($results, array_push($results,
array ( array (
"name" => htmlspecialchars($name), "name" => htmlspecialchars($name),
"seeders" => (int) remove_special($seeders), "seeders" => (int) filter_var($seeders, FILTER_SANITIZE_NUMBER_INT),
"leechers" => (int) remove_special($leechers), "leechers" => (int) filter_var($leechers, FILTER_SANITIZE_NUMBER_INT),
"magnet" => htmlspecialchars($magnet), "magnet" => htmlspecialchars($magnet),
"size" => htmlspecialchars($size), "size" => htmlspecialchars($size),
"source" => "rutor.info" "source" => "rutor.info"

View File

@ -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"; $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; break;
} }
if ($url != NULL) if ($url != NULL)
{ {
$special_ch = curl_init($url); $special_ch = curl_init($url);
@ -70,6 +70,12 @@
do { do {
curl_multi_exec($mh, $running); curl_multi_exec($mh, $running);
} while ($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) if ($special_search != 0)

View File

@ -18,12 +18,24 @@
"i2p": "http://s.dyoxin.i2p/", "i2p": "http://s.dyoxin.i2p/",
"country": "IS" "country": "IS"
}, },
{
"clearnet": "https://lx.vern.cc/",
"tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/",
"i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/",
"country": "US"
},
{ {
"clearnet": "https://search.ahwx.org/", "clearnet": "https://search.ahwx.org/",
"tor": "http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.onion/", "tor": "http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.onion/",
"i2p": null, "i2p": null,
"country": "NL" "country": "NL"
}, },
{
"clearnet": "https://search.spaceint.fr/",
"tor": "http://6d4nqt2rndvmhogpwrbqfvj2ur6e6nm2r6dzi7ny4wj6ai3j5hnvbhyd.onion/",
"i2p": null,
"country": "FR"
},
{ {
"clearnet": "https://search.davidovski.xyz/", "clearnet": "https://search.davidovski.xyz/",
"tor": null, "tor": null,
@ -102,12 +114,6 @@
"i2p": null, "i2p": null,
"country": "US" "country": "US"
}, },
{
"clearnet": "https://search.spaceint.fr/",
"tor": null,
"i2p": null,
"country": "DE"
},
{ {
"clearnet": "https://lx.benike.monster/", "clearnet": "https://lx.benike.monster/",
"tor": null, "tor": null,
@ -119,6 +125,12 @@
"tor": null, "tor": null,
"i2p": null, "i2p": null,
"country": "MX" "country": "MX"
},
{
"clearnet": "https://search.decentrala.org/",
"tor": null,
"i2p": null,
"country": "US"
} }
] ]
} }

View File

@ -56,6 +56,12 @@
$gist_path = explode("gist.github.com", $url)[1]; $gist_path = explode("gist.github.com", $url)[1];
$url = $frontend . "/gist" . $gist_path; $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 else
{ {
$url = $frontend . explode($original, $url)[1]; $url = $frontend . explode($original, $url)[1];
@ -85,6 +91,11 @@
$url = try_replace_with_frontend($url, $frontend, $original); $url = try_replace_with_frontend($url, $frontend, $original);
break; break;
} }
else if (strpos($url, "stackexchange.com"))
{
$url = try_replace_with_frontend($url, "anonymousoverflow", "stackexchange.com");
break;
}
} }
return $url; return $url;