From f9430475bfb6e99f1267a3ff65a5a7fe47590ed8 Mon Sep 17 00:00:00 2001 From: nohoster Date: Tue, 29 Aug 2023 19:49:11 -0600 Subject: [PATCH 01/54] Updated and simplified the docker building setup --- .dockerignore | 10 +++ Dockerfile | 33 +++++----- docker/{php => }/config.php | 0 docker/entrypoint.sh | 7 +- .../{php/prepare.sh => env-substitution.sh} | 29 +++++---- docker/{server => }/fastcgi.conf | 0 docker/{server => }/nginx.conf | 2 +- docker/{php => }/opensearch.xml | 0 docker/php/php.dockerfile | 65 ------------------- docker/server/nginx.dockerfile | 9 --- docker/server/prepare.sh | 21 ------ 11 files changed, 43 insertions(+), 133 deletions(-) create mode 100644 .dockerignore rename docker/{php => }/config.php (100%) rename docker/{php/prepare.sh => env-substitution.sh} (50%) rename docker/{server => }/fastcgi.conf (100%) rename docker/{server => }/nginx.conf (85%) rename docker/{php => }/opensearch.xml (100%) delete mode 100644 docker/php/php.dockerfile delete mode 100644 docker/server/nginx.dockerfile delete mode 100755 docker/server/prepare.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..57a19f4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +.github/ +.git/ +.gitignore +.dockerignore +config.php.example +docker-compose.yml +Dockerfile +opensearch.xml.example +README.md +docker-old/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a378b1c..306dea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -# syntax = edrevo/dockerfile-plus -ARG VERSION="3.18" -FROM alpine:${VERSION} AS librey +FROM alpine:3.18 + WORKDIR "/var/www/html" +ADD "." "." + # Docker metadata contains information about the maintainer, such as the name, repository, and support email -# Please add any necessary information or correct any incorrect information # See more: https://docs.docker.com/config/labels-custom-metadata/ LABEL name="LibreY" \ description="Framework and javascript free privacy respecting meta search engine" \ @@ -18,28 +18,25 @@ LABEL name="LibreY" \ # Change or add new arguments to customize the image generated by 'docker build' command ARG DOCKER_SCRIPTS="docker" ARG NGINX_PORT=8080 +# Set this argument during build time to indicate that the path is for php's www.conf +ARG WWW_CONFIG="/etc/php82/php-fpm.d/www.conf" # Customize the environment during both execution and build time by modifying the environment variables added to the container's shell # When building your image, make sure to set the 'TZ' environment variable to your desired time zone location, for example 'America/Sao_Paulo' # See more: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List ENV TZ="America/New_York" -RUN apk add gettext --no-cache +# Install required packages +RUN apk add gettext php82 php82-fpm php82-dom php82-curl php82-json php82-apcu nginx --no-cache -# The following lines import all Dockerfiles from other folders so that they can be built together in the final build -INCLUDE+ docker/php/php.dockerfile -INCLUDE+ docker/server/nginx.dockerfile - -# Include docker scripts, docker images, and the 'GNU License' in the LibreY container -ADD "." "/var/www/html" - -# Set permissions for script files as executable scripts inside 'docker/scripts' directory -RUN chmod u+x "${DOCKER_SCRIPTS}/php/prepare.sh" &&\ - chmod u+x "${DOCKER_SCRIPTS}/server/prepare.sh" &&\ - chmod u+x "${DOCKER_SCRIPTS}/entrypoint.sh" &&\ - chmod u+x "${DOCKER_SCRIPTS}/attributes.sh" +# Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient +RUN touch /run/php-fpm82.sock && chown nginx:nginx "/run/php-fpm82.sock" +RUN sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php-fpm82.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} EXPOSE ${NGINX_PORT} # Configures the container to be run as an executable. -ENTRYPOINT ["/bin/sh", "-c", "docker/entrypoint.sh"] +ENTRYPOINT ["/bin/sh", "-c", "docker/entrypoint.sh"] \ No newline at end of file diff --git a/docker/php/config.php b/docker/config.php similarity index 100% rename from docker/php/config.php rename to docker/config.php diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b3eb4b1..56078ed 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,10 +1,7 @@ #!/bin/sh -# Due to an issue with Docker's 'CMD' directive, the following scripts are not executing as expected. -# This workaround has been implemented to resolve the issue for now -sh "docker/php/prepare.sh" -sh "docker/server/prepare.sh" +/bin/sh -c docker/env-substitution.sh -/bin/sh -c /usr/sbin/php-fpm8 +/bin/sh -c /usr/sbin/php-fpm82 exec nginx -g "daemon off;" diff --git a/docker/php/prepare.sh b/docker/env-substitution.sh similarity index 50% rename from docker/php/prepare.sh rename to docker/env-substitution.sh index 1ea7864..77f2f8f 100755 --- a/docker/php/prepare.sh +++ b/docker/env-substitution.sh @@ -1,23 +1,24 @@ #!/bin/sh -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-fpm8.sock' does not already exist. -# This fixes an issue where Nginx starts but does not serve content -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 +# The lines below will replace the environment variables in the templates with the corresponding variables listed above if the config file is not yet provided. To accomplish this, the GNU 'envsubst' package will be used # Although not recommended (if you do not know what you are doing), you still have the option to add new substitution file templates using any required environment variables -[[ ! -s ${CONFIG_PHP_TEMPLATE} ]] && cat 'docker/php/config.php' | envsubst > ${CONFIG_PHP_TEMPLATE}; -[[ ! -s ${CONFIG_OPEN_SEARCH_TEMPLATE} ]] && cat 'docker/php/opensearch.xml' | envsubst > ${CONFIG_OPEN_SEARCH_TEMPLATE}; + +[[ ! -s ${CONFIG_PHP_TEMPLATE} ]] && cat 'docker/config.php' | envsubst > ${CONFIG_PHP_TEMPLATE}; +[[ ! -s ${CONFIG_OPEN_SEARCH_TEMPLATE} ]] && cat 'docker/opensearch.xml' | envsubst > ${CONFIG_OPEN_SEARCH_TEMPLATE}; + +export OPEN_SEARCH_HOST_FOR_NGINX="$(echo "${OPEN_SEARCH_HOST}" | cut -d "/" -f 3 | cut -d ":" -f 1)" +if [[ ! -s ${CONFIG_NGINX_TEMPLATE} ]]; then + + cat 'docker/nginx.conf' | envsubst '${OPEN_SEARCH_HOST_FOR_NGINX}' > ${CONFIG_NGINX_TEMPLATE}; + mv "docker/fastcgi.conf" /etc/nginx/fastcgi.conf + + chown nginx:nginx "/etc/nginx/fastcgi.conf" + chown nginx:nginx "/etc/nginx/http.d/librey.conf" + +fi # If it is empty or proxy is not enabled, we are using sed to delete # any line that contains the string 'CURLOPT_PROXY' or 'CURLOPT_PROXYTYPE' diff --git a/docker/server/fastcgi.conf b/docker/fastcgi.conf similarity index 100% rename from docker/server/fastcgi.conf rename to docker/fastcgi.conf diff --git a/docker/server/nginx.conf b/docker/nginx.conf similarity index 85% rename from docker/server/nginx.conf rename to docker/nginx.conf index 197c575..ffbd92a 100644 --- a/docker/server/nginx.conf +++ b/docker/nginx.conf @@ -10,7 +10,7 @@ server { } location ~ \.php$ { - fastcgi_pass unix:/run/php8/php-fpm8.sock; + fastcgi_pass unix:/run/php-fpm82.sock; fastcgi_index index.php; include fastcgi.conf; } diff --git a/docker/php/opensearch.xml b/docker/opensearch.xml similarity index 100% rename from docker/php/opensearch.xml rename to docker/opensearch.xml diff --git a/docker/php/php.dockerfile b/docker/php/php.dockerfile deleted file mode 100644 index 8735137..0000000 --- a/docker/php/php.dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# Set this argument during build time to indicate that the path is for php's www.conf -ARG WWW_CONFIG="/etc/php8/php-fpm.d/www.conf" - -# Configure 'opensearch.xml' with librey 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 -ENV OPEN_SEARCH_TITLE="LibreY" -ENV OPEN_SEARCH_DESCRIPTION="Framework and javascript free privacy respecting meta search engine" -ENV OPEN_SEARCH_ENCODING="UTF-8" -ENV OPEN_SEARCH_LONG_NAME="LibreY search" -ENV OPEN_SEARCH_HOST="http://127.0.0.1:${NGINX_PORT}" - -# Replace the 'config.php' script, which contains the most common search engine configurations, with these environment setups -# These environment setups can be found in 'config.php', and the default configurations can be useful for most use cases -ENV CONFIG_GOOGLE_DOMAIN="com" -ENV CONFIG_GOOGLE_LANGUAGE_SITE="en" -ENV CONFIG_GOOGLE_LANGUAGE_RESULTS="en" -ENV CONFIG_GOOGLE_NUMBER_OF_RESULTS="10" -ENV CONFIG_INSTANCE_FALLBACK=true -ENV CONFIG_INVIDIOUS_INSTANCE="https://invidious.snopyta.org" -ENV CONFIG_HIDDEN_SERVICE_SEARCH=false -ENV CONFIG_DISABLE_BITTORRENT_SEARCH=false -ENV CONFIG_BITTORRENT_TRACKERS="&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce" - -# Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers -# A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librey -ENV APP_INVIDIOUS="" -ENV APP_RIMGO="" -ENV APP_SCRIBE="" -ENV APP_GOTHUB="" -ENV APP_NITTER="" -ENV APP_LIBREREDDIT="" -ENV APP_PROXITOK="" -ENV APP_WIKILESS="" -ENV APP_QUETRE="" -ENV APP_LIBREMDB="" -ENV APP_BREEZEWIKI="" -ENV APP_ANONYMOUS_OVERFLOW="" -ENV APP_SUDS="" -ENV APP_BIBLIOREADS="" - -# Preferred search engines. -ENV CONFIG_TEXT_SEARCH_ENGINE="google" - -# GNU/Curl configurations. Leave 'CURLOPT_PROXY' blank whether you don't need to use a proxy for requests -# Generally, a proxy is needed when your IP address is blocked by search engines in response to multiple requests within a short time frame. In these cases, it is recommended to use rotating proxies -ENV CURLOPT_PROXY_ENABLED=false -ENV CURLOPT_PROXY="" -ENV CURLOPT_PROXYTYPE="CURLPROXY_HTTP" -ENV CURLOPT_RETURNTRANSFER=true -ENV CURLOPT_ENCODING="" -ENV CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" -ENV CURLOPT_CUSTOMREQUEST="GET" -ENV CURLOPT_MAXREDIRS=5 -ENV CURLOPT_TIMEOUT=18 -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 php8 php8-fpm php8-dom php8-curl php8-json php8-apcu --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} - -CMD [ "/bin/sh", "-c", "docker/php/prepare.sh" ] diff --git a/docker/server/nginx.dockerfile b/docker/server/nginx.dockerfile deleted file mode 100644 index 4f50131..0000000 --- a/docker/server/nginx.dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -# Install Nginx with FastCGI enabled, optimizing its performance for serving content -RUN apk add nginx - -# Forward request and error logs to docker log collector -# RUN ln -sf /dev/stdout /var/log/nginx/access.log &&\ -# ln -sf /dev/stderr /var/log/nginx/error.log - -# After executing the 'docker run' command, run the 'prepare.sh' script -CMD [ "/bin/sh", "-c", "docker/server/prepare.sh" ] diff --git a/docker/server/prepare.sh b/docker/server/prepare.sh deleted file mode 100755 index 5040600..0000000 --- a/docker/server/prepare.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -echo "[PREPARE] docker/server/prepare.sh'" - -# Load all environment variables from 'attributes.sh' using the command 'source /path/attributes.sh' -source "docker/attributes.sh" - -export OPEN_SEARCH_HOST_FOR_NGINX="$(echo "${OPEN_SEARCH_HOST}" | cut -d "/" -f 3 | cut -d ":" -f 1)" - -# 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 -# Although not recommended (if you do not know what you are doing), you still have the option to add new substitution file templates using any required environment variables -if [[ ! -s ${CONFIG_NGINX_TEMPLATE} ]]; then - cp "docker/server/fastcgi.conf" /etc/nginx/fastcgi.conf - cp "docker/server/nginx.conf" /etc/nginx/http.d/librey.conf - - # To address issues with 'nginx.conf', the following lines will ensure that these configurations remain executable - chmod u+x "/etc/nginx/fastcgi.conf" - chmod u+x "/etc/nginx/http.d/librey.conf" - - cat 'docker/server/nginx.conf' | envsubst '${OPEN_SEARCH_HOST_FOR_NGINX}' > ${CONFIG_NGINX_TEMPLATE}; -fi From 46fe062bd3baa0bca2aa6dfdd7fd175724398da6 Mon Sep 17 00:00:00 2001 From: Revvy Date: Tue, 29 Aug 2023 21:58:27 -0400 Subject: [PATCH 02/54] fix when ads sometimes show up with ddg --- engines/text/duckduckgo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 378ad4e..9993f5d 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -26,7 +26,7 @@ $results = array(); $xpath = get_xpath(curl_multi_getcontent($this->ch)); - foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div/div") as $result) + foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div[contains(@class, 'web-result')]/div") as $result) { $url = $xpath->evaluate(".//h2[@class='result__title']//a/@href", $result)[0]; From efce4e387e2651d32969050974c4ba5c4f021fcf Mon Sep 17 00:00:00 2001 From: nohoster Date: Tue, 29 Aug 2023 20:01:34 -0600 Subject: [PATCH 03/54] fixed var --- docker/attributes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/attributes.sh b/docker/attributes.sh index 95a1c8c..8c4c8b1 100755 --- a/docker/attributes.sh +++ b/docker/attributes.sh @@ -23,7 +23,7 @@ export CONFIG_GOOGLE_DOMAIN="${CONFIG_GOOGLE_DOMAIN:-"com"}" export CONFIG_GOOGLE_LANGUAGE_SITE="${CONFIG_GOOGLE_LANGUAGE_SITE:-"en"}" export CONFIG_GOOGLE_LANGUAGE_RESULTS="${CONFIG_GOOGLE_LANGUAGE_RESULTS:-"en"}" export CONFIG_GOOGLE_NUMBER_OF_RESULTS="${CONFIG_GOOGLE_NUMBER_OF_RESULTS:-"10"}" -export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK}:-true}" +export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK:-true}" export CONFIG_INVIDIOUS_INSTANCE="${CONFIG_INVIDIOUS_INSTANCE:-"invidious.snopyta.org"}" export CONFIG_HIDDEN_SERVICE_SEARCH=${CONFIG_HIDDEN_SERVICE_SEARCH:-false} export CONFIG_DISABLE_BITTORRENT_SEARCH=${CONFIG_DISABLE_BITTORRENT_SEARCH:-false} From a8c4f4e6090b0bec609d39d4fbb8614ddee2ecab Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 13:50:01 +0100 Subject: [PATCH 04/54] Use caching for all requests --- engines/ahmia/hidden_service.php | 3 +- engines/bittorrent/1337x.php | 4 +-- engines/bittorrent/merge.php | 2 +- engines/bittorrent/nyaa.php | 3 +- engines/bittorrent/rutor.php | 3 +- engines/bittorrent/thepiratebay.php | 3 +- engines/bittorrent/torrentgalaxy.php | 3 +- engines/bittorrent/yts.php | 3 +- engines/invidious/video.php | 3 +- engines/librex/fallback.php | 4 +-- engines/qwant/image.php | 4 +-- engines/special/currency.php | 4 +-- engines/special/definition.php | 4 +-- engines/special/ip.php | 2 +- engines/special/tor.php | 4 +-- engines/special/user_agent.php | 2 +- engines/special/weather.php | 3 +- engines/special/wikipedia.php | 4 +-- engines/text/duckduckgo.php | 4 +-- engines/text/google.php | 4 +-- engines/text/text.php | 2 +- misc/cooldowns.php | 23 ++++++++++++++++ misc/search_engine.php | 41 ++++++++++++++++++++++++---- 23 files changed, 83 insertions(+), 49 deletions(-) diff --git a/engines/ahmia/hidden_service.php b/engines/ahmia/hidden_service.php index f950ba8..5ef9e39 100644 --- a/engines/ahmia/hidden_service.php +++ b/engines/ahmia/hidden_service.php @@ -6,8 +6,7 @@ return "https://ahmia.fi/search/?q=" . urlencode($this->query); } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $results = array(); $xpath = get_xpath($response); diff --git a/engines/bittorrent/1337x.php b/engines/bittorrent/1337x.php index f5390ec..fab7615 100644 --- a/engines/bittorrent/1337x.php +++ b/engines/bittorrent/1337x.php @@ -5,9 +5,7 @@ return "https://1337x.to/search/$query/1/"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); - + public function parse_results($response) { $xpath = get_xpath($response); $results = array(); diff --git a/engines/bittorrent/merge.php b/engines/bittorrent/merge.php index 31dcc24..7d5caae 100644 --- a/engines/bittorrent/merge.php +++ b/engines/bittorrent/merge.php @@ -21,7 +21,7 @@ ); } - public function get_results() { + public function parse_results($response) { $results = array(); foreach ($this->requests as $request) { if ($request->successful()) diff --git a/engines/bittorrent/nyaa.php b/engines/bittorrent/nyaa.php index d3cc22a..9d7b021 100644 --- a/engines/bittorrent/nyaa.php +++ b/engines/bittorrent/nyaa.php @@ -6,8 +6,7 @@ return "https://$this->SOURCE/?q=" . urlencode($this->query); } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $xpath = get_xpath($response); $results = array(); diff --git a/engines/bittorrent/rutor.php b/engines/bittorrent/rutor.php index e575bac..2ee863f 100644 --- a/engines/bittorrent/rutor.php +++ b/engines/bittorrent/rutor.php @@ -4,8 +4,7 @@ return "http://rutor.info/search/" . urlencode($this->query); } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $xpath = get_xpath($response); $results = array(); diff --git a/engines/bittorrent/thepiratebay.php b/engines/bittorrent/thepiratebay.php index 49f3f7a..b674274 100644 --- a/engines/bittorrent/thepiratebay.php +++ b/engines/bittorrent/thepiratebay.php @@ -4,8 +4,7 @@ return "https://apibay.org/q.php?q=" . urlencode($this->query); } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $results = array(); $json_response = json_decode($response, true); diff --git a/engines/bittorrent/torrentgalaxy.php b/engines/bittorrent/torrentgalaxy.php index 2f6c606..48a5222 100644 --- a/engines/bittorrent/torrentgalaxy.php +++ b/engines/bittorrent/torrentgalaxy.php @@ -5,8 +5,7 @@ return "https://torrentgalaxy.to/torrents.php?search=$query#results"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $xpath = get_xpath($response); $results = array(); diff --git a/engines/bittorrent/yts.php b/engines/bittorrent/yts.php index d146ba7..9f7b515 100644 --- a/engines/bittorrent/yts.php +++ b/engines/bittorrent/yts.php @@ -4,9 +4,8 @@ return "https://yts.mx/api/v2/list_movies.json?query_term=" . urlencode($this->query); } - public function get_results() { + public function parse_results($response) { $response = curl_multi_getcontent($this->ch); - global $config; $results = array(); $json_response = json_decode($response, true); diff --git a/engines/invidious/video.php b/engines/invidious/video.php index afd51b2..230bc19 100644 --- a/engines/invidious/video.php +++ b/engines/invidious/video.php @@ -6,9 +6,8 @@ return "$this->instance_url/api/v1/search?q=$query"; } - public function get_results() { + public function parse_results($response) { $results = array(); - $response = curl_multi_getcontent($this->ch); $json_response = json_decode($response, true); foreach ($json_response as $response) { diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index 4ff13b0..ed5a9a8 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -1,6 +1,7 @@ instance = $instance; parent::__construct($opts, $mh); @@ -10,8 +11,7 @@ return $this->instance . "api.php?" . opts_to_params($this->opts); } - public function get_results() { - $response = curl_exec($this->ch); + public function parse_results($response) { $response = json_decode($response, true); if (!$response) return array(); diff --git a/engines/qwant/image.php b/engines/qwant/image.php index 7459b18..9dd9db0 100644 --- a/engines/qwant/image.php +++ b/engines/qwant/image.php @@ -7,9 +7,9 @@ return "https://lite.qwant.com/?q=$query&t=images&p=$page"; } - public function get_results() { + public function parse_results($response) { $results = array(); - $xpath = get_xpath(curl_multi_getcontent($this->ch)); + $xpath = get_xpath($response); if (!$xpath) return $results; diff --git a/engines/special/currency.php b/engines/special/currency.php index ba53598..fcff1fa 100644 --- a/engines/special/currency.php +++ b/engines/special/currency.php @@ -4,9 +4,7 @@ return "https://cdn.moneyconvert.net/api/latest.json"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); - + public function parse_results($response) { $split_query = explode(" ", $this->query); $base_currency = strtoupper($split_query[1]); diff --git a/engines/special/definition.php b/engines/special/definition.php index b862b32..1ca5479 100644 --- a/engines/special/definition.php +++ b/engines/special/definition.php @@ -8,9 +8,7 @@ return "https://api.dictionaryapi.dev/api/v2/entries/en/$word_to_define"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); - + public function parse_results($response) { $json_response = json_decode($response, true); if (!array_key_exists("title", $json_response)) diff --git a/engines/special/ip.php b/engines/special/ip.php index 6fbb684..3f7ab12 100644 --- a/engines/special/ip.php +++ b/engines/special/ip.php @@ -1,6 +1,6 @@ array( "response" => $_SERVER["REMOTE_ADDR"], diff --git a/engines/special/tor.php b/engines/special/tor.php index d3172d0..b461532 100644 --- a/engines/special/tor.php +++ b/engines/special/tor.php @@ -5,9 +5,7 @@ return "https://check.torproject.org/torbulkexitlist"; } - public function get_results() { - $response = curl_multi_getcontent($ch); - + public function parse_results($response) { $formatted_response = strpos($response, $_SERVER["REMOTE_ADDR"]) ? "It seems like you are using Tor" : "It seems like you are not using Tor"; $source = "https://check.torproject.org"; diff --git a/engines/special/user_agent.php b/engines/special/user_agent.php index 64f5e8a..90503bc 100644 --- a/engines/special/user_agent.php +++ b/engines/special/user_agent.php @@ -1,6 +1,6 @@ array( "response" => $_SERVER["HTTP_USER_AGENT"], diff --git a/engines/special/weather.php b/engines/special/weather.php index 2d1d0fb..2980963 100644 --- a/engines/special/weather.php +++ b/engines/special/weather.php @@ -4,8 +4,7 @@ return "https://wttr.in/@" . $_SERVER["REMOTE_ADDR"] . "?format=j1"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); + public function parse_results($response) { $json_response = json_decode($response, true); if (!$json_response) diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index 436deb4..a5b2a1f 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -10,9 +10,7 @@ return "https://$this->wikipedia_language.wikipedia.org/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded"; } - public function get_results() { - $response = curl_multi_getcontent($this->ch); - + public function parse_results($response) { $json_response = json_decode($response, true); $first_page = array_values($json_response["query"]["pages"])[0]; diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 378ad4e..2ae46aa 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -22,9 +22,9 @@ return $url; } - public function get_results() { + public function parse_results($response) { $results = array(); - $xpath = get_xpath(curl_multi_getcontent($this->ch)); + $xpath = get_xpath(response); foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div/div") as $result) { diff --git a/engines/text/google.php b/engines/text/google.php index 45c871d..911f320 100644 --- a/engines/text/google.php +++ b/engines/text/google.php @@ -26,9 +26,9 @@ } - public function get_results() { + public function parse_results($response) { $results = array(); - $xpath = get_xpath(curl_multi_getcontent($this->ch)); + $xpath = get_xpath($response); if (!$xpath) return $results; diff --git a/engines/text/text.php b/engines/text/text.php index 26af3ae..7b134e9 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -30,7 +30,7 @@ $this->special_request = get_special_search_request($opts, $mh); } - public function get_results() { + public function parse_results($response) { if (!$this->engine_request) return array(); diff --git a/misc/cooldowns.php b/misc/cooldowns.php index 0285f47..78ba4fb 100644 --- a/misc/cooldowns.php +++ b/misc/cooldowns.php @@ -1,4 +1,8 @@ time(); } + + function has_cached_results($url) { + if (function_exists("apcu_exists")) + return apcu_exists("cached:$url"); + + return false; + } + + function store_cached_results($url, $results) { + if (function_exists("apcu_store") && !empty($results)) + return apcu_store("cached:$url", $results); + } + + function fetch_cached_results($url) { + if (function_exists("apcu_fetch")) + return apcu_fetch("cached:$url"); + + return array(); + } ?> diff --git a/misc/search_engine.php b/misc/search_engine.php index b76cdcb..cde1419 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -1,15 +1,20 @@ query = $opts->query; $this->page = $opts->page; $this->opts = $opts; - $url = $this->get_request_url(); - if (!$url) + $this->url = $this->get_request_url(); + if (!$this->url) return; - $this->ch = curl_init($url); + if (has_cached_results($this->url)) + return; + + $this->ch = curl_init($this->url); if ($opts->curl_settings) curl_setopt_array($this->ch, $opts->curl_settings); @@ -23,10 +28,35 @@ } public function successful() { - return curl_getinfo($this->ch)['http_code'] == '200'; + return (isset($this->ch) && curl_getinfo($this->ch)['http_code'] == '200') + || has_cached_results($this->url); + } + + abstract function parse_results($response); + + public function get_results() { + if (!isset($this->url)) + return $this->parse_results(null); + + if ($this->DO_CACHING && has_cached_results($this->url)) { + error_log("used cache for $this->url"); + return fetch_cached_results($this->url); + } + + if (!isset($this->ch)) + return $this->parse_results(null); + + $response = curl_multi_getcontent($this->ch); + $results = $this->parse_results($response) ?? array(); + + if ($this->DO_CACHING) { + store_cached_results($this->url, $results); + error_log("caching $this->url in cache"); + } + + return $results; } - abstract function get_results(); static public function print_results($results){} } @@ -113,7 +143,6 @@ } function fetch_search_results($opts, $do_print) { - require "misc/cooldowns.php"; $opts->cooldowns = load_cooldowns(); $start_time = microtime(true); From 4488200d225f0dc1ab05b256168079008c2636d5 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 13:58:47 +0100 Subject: [PATCH 05/54] Add ttl on caches --- config.php.example | 3 +++ misc/cooldowns.php | 4 ++-- misc/search_engine.php | 11 ++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/config.php.example b/config.php.example index 567e839..bd95e80 100644 --- a/config.php.example +++ b/config.php.example @@ -23,6 +23,9 @@ // how long in minutes to put google/other instances on cooldown if they aren't responding "request_cooldown" => 25, + // how long in minutes to store results for in the cache + "cache_time" => 20, + /* Preset privacy friendly frontends for users, these can be overwritten by users in the settings e.g.: Preset the invidious instance URL: "instance_url" => "https://yewtu.be", diff --git a/misc/cooldowns.php b/misc/cooldowns.php index 78ba4fb..ec55fb7 100644 --- a/misc/cooldowns.php +++ b/misc/cooldowns.php @@ -31,9 +31,9 @@ return false; } - function store_cached_results($url, $results) { + function store_cached_results($url, $results, $ttl = 0) { if (function_exists("apcu_store") && !empty($results)) - return apcu_store("cached:$url", $results); + return apcu_store("cached:$url", $results, $ttl); } function fetch_cached_results($url) { diff --git a/misc/search_engine.php b/misc/search_engine.php index cde1419..5851b38 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -38,10 +38,8 @@ if (!isset($this->url)) return $this->parse_results(null); - if ($this->DO_CACHING && has_cached_results($this->url)) { - error_log("used cache for $this->url"); + if ($this->DO_CACHING && has_cached_results($this->url)) return fetch_cached_results($this->url); - } if (!isset($this->ch)) return $this->parse_results(null); @@ -49,10 +47,8 @@ $response = curl_multi_getcontent($this->ch); $results = $this->parse_results($response) ?? array(); - if ($this->DO_CACHING) { - store_cached_results($this->url, $results); - error_log("caching $this->url in cache"); - } + if ($this->DO_CACHING) + store_cached_results($this->url, $results, $this->opts->cache_time * 60); return $results; } @@ -64,6 +60,7 @@ $opts = require "config.php"; $opts->request_cooldown ??= 25; + $opts->cache_time ??= 25; $opts->query = trim($_REQUEST["q"] ?? ""); $opts->type = (int) ($_REQUEST["t"] ?? 0); From 4da025948b3f7791aa27840efcea1667f0dcbf05 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 14:00:44 +0100 Subject: [PATCH 06/54] fix missing $ --- engines/text/duckduckgo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 2ae46aa..b672d7c 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -24,7 +24,7 @@ public function parse_results($response) { $results = array(); - $xpath = get_xpath(response); + $xpath = get_xpath($response); foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div/div") as $result) { From aaf111abf72fb20e9896dc25135b61bb6f99d595 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 16:05:31 +0100 Subject: [PATCH 07/54] Always do no fallback on fallback requests --- engines/librex/fallback.php | 4 ++-- engines/text/text.php | 2 +- misc/search_engine.php | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index ed5a9a8..0af3e2d 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -6,9 +6,9 @@ $this->instance = $instance; parent::__construct($opts, $mh); } - +) public function get_request_url() { - return $this->instance . "api.php?" . opts_to_params($this->opts); + return $this->instance . "api.php?" . opts_to_params($this->opts) . "&nfb=1"; } public function parse_results($response) { diff --git a/engines/text/text.php b/engines/text/text.php index 7b134e9..e818708 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -31,7 +31,7 @@ } public function parse_results($response) { - if (!$this->engine_request) + if (!isset($this->engine_request)) return array(); $results = $this->engine_request->get_results(); diff --git a/misc/search_engine.php b/misc/search_engine.php index 5851b38..87b39bd 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -97,7 +97,6 @@ $params .= "p=$opts->page"; $params .= "&q=$query"; $params .= "&t=$opts->type"; - $params .= "&nfb=" . ($opts->do_fallback ? 0 : 1); $params .= "&safe=" . ($opts->safe_search ? 1 : 0); $params .= "&nf=" . ($opts->disable_frontends ? 1 : 0); $params .= "&ns=" . ($opts->disable_special ? 1 : 0); From a00da6eb65749125e45444eed52e752f648741a3 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 16:07:35 +0100 Subject: [PATCH 08/54] Fix typo --- engines/librex/fallback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index 0af3e2d..d29f046 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -6,7 +6,7 @@ $this->instance = $instance; parent::__construct($opts, $mh); } -) + public function get_request_url() { return $this->instance . "api.php?" . opts_to_params($this->opts) . "&nfb=1"; } From 12f02198f9561a4fb48eea3f37227161da41210b Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 17:26:34 +0100 Subject: [PATCH 09/54] Add no results messages --- engines/text/google.php | 6 ++++++ engines/text/text.php | 26 +++++++++++++++++--------- misc/search_engine.php | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/engines/text/google.php b/engines/text/google.php index 911f320..eaff127 100644 --- a/engines/text/google.php +++ b/engines/text/google.php @@ -70,6 +70,12 @@ ); } + if (empty($results) && !str_contains($response, "Our systems have detected unusual traffic from your computer network.")) { + $results["error"] = array( + "message" => "There are no results. Please try different keywords!" + ); + } + return $results; } } diff --git a/engines/text/text.php b/engines/text/text.php index e818708..c43be94 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -36,23 +36,31 @@ $results = $this->engine_request->get_results(); - if ($this->special_request) { - $special_result = $this->special_request->get_results(); - - if ($special_result) - $results = array_merge(array($special_result), $results); - } - - if (count($results) <= 1) + if (empty(count($results))) { set_cooldown($this->engine, ($opts->request_cooldown ?? "1") * 60, $this->opts->cooldowns); + } else { + if ($this->special_request) { + $special_result = $this->special_request->get_results(); + + if ($special_result) + $results = array_merge(array($special_result), $results); + } + } return $results; } public static function print_results($results) { - if (empty($results)) + if (empty($results)) { + echo "

An error occured fetching results

"; return; + } + + if (array_key_exists("error", $results)) { + echo "

" . $results["error"]["message"] . "

"; + return; + } $special = $results[0]; diff --git a/misc/search_engine.php b/misc/search_engine.php index 87b39bd..b203d03 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -152,8 +152,9 @@ } while ($running); $results = $search_category->get_results(); + error_log(print_r($results, true)); - if (count($results) <= 1) { + if (empty($results)) { require "engines/librex/fallback.php"; $results = get_librex_results($opts); } From a33f26a63805feb08bf785dafcd448a029fb3120 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 17:50:56 +0100 Subject: [PATCH 10/54] Add no instances message --- engines/librex/fallback.php | 6 +++++- misc/search_engine.php | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index d29f046..0be02cc 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -62,7 +62,11 @@ } while (!empty($instances)); - return array(); + return array( + "error" => array( + "message" => "No results found. Unable to fallback to other instances." + ) + ); } ?> diff --git a/misc/search_engine.php b/misc/search_engine.php index b203d03..6eb791a 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -152,7 +152,6 @@ } while ($running); $results = $search_category->get_results(); - error_log(print_r($results, true)); if (empty($results)) { require "engines/librex/fallback.php"; From ad747d51a123f1926de2b2f0cec7064023a31e04 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 18:11:17 +0100 Subject: [PATCH 11/54] Make fallback work when no results found --- engines/librex/fallback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index 0be02cc..27798ef 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -53,7 +53,7 @@ $librex_request = new LibreXFallback($instance, $opts, null); $results = $librex_request->get_results(); - if (count($results) > 1) + if (count($results) > 0) return $results; // on fail then do this From dd41f423ac2250483c5f531d7cd073064008a74a Mon Sep 17 00:00:00 2001 From: Revvy Date: Wed, 30 Aug 2023 14:18:49 -0400 Subject: [PATCH 12/54] add/remove instances --- instances.json | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/instances.json b/instances.json index 5889c4a..84caae6 100644 --- a/instances.json +++ b/instances.json @@ -77,6 +77,20 @@ "country": "MX", "librey": true }, + { + "clearnet": "https://search.pabloferreiro.es/", + "tor": null, + "i2p": null, + "country": "DE", + "librey": true + }, + { + "clearnet": "https://search.ratakor.com/", + "tor": null, + "i2p": null, + "country": "FR", + "librey": true + }, { "clearnet": "https://lx.vern.cc/", "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", @@ -91,27 +105,6 @@ "country": "DE", "librey": false }, - { - "clearnet": "https://search.spaceint.fr/", - "tor": null, - "i2p": null, - "country": "FR", - "librey": false - }, - { - "clearnet": "https://search.pabloferreiro.es/", - "tor": null, - "i2p": null, - "country": "DE", - "librey": false - }, - { - "clearnet": "https://librex.ratakor.com/", - "tor": null, - "i2p": null, - "country": "FR", - "librey": false - }, { "clearnet": "https://search.tildevarsh.in/", "tor": null, @@ -146,13 +139,6 @@ "i2p": null, "country": "DE", "librey": false - }, - { - "clearnet": "https://librex.pardesicat.xyz/", - "tor": null, - "i2p": null, - "country": "KR", - "librey": false } ] } From 9d431ae8c090d0e8e789f6d2758b46402f7f375c Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 20:50:23 +0100 Subject: [PATCH 13/54] Actually exec fallback requests --- engines/librex/fallback.php | 7 ++++++- misc/search_engine.php | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index 27798ef..f9612ca 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -47,13 +47,18 @@ $instance = array_pop($instances); + if (!$instance) + break; + if (parse_url($instance)["host"] == parse_url($_SERVER['HTTP_HOST'])["host"]) continue; $librex_request = new LibreXFallback($instance, $opts, null); + error_log($librex_request->url); + $results = $librex_request->get_results(); - if (count($results) > 0) + if (!empty($results)) return $results; // on fail then do this diff --git a/misc/search_engine.php b/misc/search_engine.php index 6eb791a..d653c6c 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -5,6 +5,7 @@ function __construct($opts, $mh) { $this->query = $opts->query; $this->page = $opts->page; + $this->mh = $mh; $this->opts = $opts; $this->url = $this->get_request_url(); @@ -44,10 +45,10 @@ if (!isset($this->ch)) return $this->parse_results(null); - $response = curl_multi_getcontent($this->ch); + $response = $this->mh ? curl_multi_getcontent($this->ch) : curl_exec($this->ch); $results = $this->parse_results($response) ?? array(); - if ($this->DO_CACHING) + if ($this->DO_CACHING && !empty($results)) store_cached_results($this->url, $results, $this->opts->cache_time * 60); return $results; From 73c5b4b98e33f45eba61bb1f13a61efb716b65a8 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 21:00:00 +0100 Subject: [PATCH 14/54] fix not respecting cooldown --- engines/text/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/text/text.php b/engines/text/text.php index c43be94..75ab847 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -36,7 +36,7 @@ $results = $this->engine_request->get_results(); - if (empty(count($results))) { + if (empty($results)) { set_cooldown($this->engine, ($opts->request_cooldown ?? "1") * 60, $this->opts->cooldowns); } else { if ($this->special_request) { From 01fe9830098a7eb72e67e02eecdebe9b06992b44 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 21:06:09 +0100 Subject: [PATCH 15/54] curl follow location by default --- misc/search_engine.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/search_engine.php b/misc/search_engine.php index d653c6c..9ee7d3b 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -88,6 +88,8 @@ $opts->frontends[$frontend]["instance_url"] = $_COOKIE[$frontend] ?? $opts->frontends[$frontend]["instance_url"]; } + $opts->curl_settings[CURLOPT_FOLLOWLOCATION] ??= true; + return $opts; } From f8f30323eea53d12f25cd5f13c51cba481f9780c Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 21:17:30 +0100 Subject: [PATCH 16/54] do not avoid request if cached --- engines/librex/fallback.php | 4 +--- engines/text/text.php | 10 +++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php index f9612ca..d3b6c34 100644 --- a/engines/librex/fallback.php +++ b/engines/librex/fallback.php @@ -1,7 +1,6 @@ instance = $instance; parent::__construct($opts, $mh); @@ -54,8 +53,7 @@ continue; $librex_request = new LibreXFallback($instance, $opts, null); - error_log($librex_request->url); - + $results = $librex_request->get_results(); if (!empty($results)) diff --git a/engines/text/text.php b/engines/text/text.php index 75ab847..2ea76cc 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -12,9 +12,6 @@ if (substr($this->query, 0, 1) == "!" || substr($last_word_query, 0, 1) == "!") check_ddg_bang($this->query, $opts); - if (has_cooldown($this->engine, $this->opts->cooldowns)) - return; - if ($this->engine == "google") { require "engines/text/google.php"; @@ -26,6 +23,13 @@ $this->engine_request = new DuckDuckGoRequest($opts, $mh); } + if (has_cooldown($this->engine, $this->opts->cooldowns) && !has_cached_results($this->engine_request->url)) { + // TODO dont add it in the first place + curl_multi_remove_handle($mh, $this->engine_request->ch); + return; + } + + require "engines/special/special.php"; $this->special_request = get_special_search_request($opts, $mh); } From bfe699d5ad1341db10eb378ed454c8cdd19ee7b8 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 21:40:30 +0100 Subject: [PATCH 17/54] Do not throw error if duckduck go query fails --- engines/text/duckduckgo.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index b672d7c..ddee34c 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -25,6 +25,9 @@ public function parse_results($response) { $results = array(); $xpath = get_xpath($response); + + if (!$xpath) + return $results; foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div/div") as $result) { From 37f77e5e8d7a02534809e607e8e33dd5d6dca389 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 21:47:22 +0100 Subject: [PATCH 18/54] set default language --- engines/text/duckduckgo.php | 3 ++- misc/search_engine.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index ddee34c..2c03833 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -19,6 +19,7 @@ if (isset($_COOKIE["safe_search"])) $url .= "&safe=medium"; + return $url; } @@ -60,7 +61,7 @@ ) ); } - return $results; + return $results; } } diff --git a/misc/search_engine.php b/misc/search_engine.php index 9ee7d3b..79398cf 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -75,7 +75,7 @@ $opts->disable_frontends = (int) ($_REQUEST["nf"] ?? 0) == 1 || isset($_COOKIE["disable_frontends"]); - $opts->language = $_REQUEST["lang"] ?? trim(htmlspecialchars($_COOKIE["language"] ?? $opts->language)); + $opts->language = $_REQUEST["lang"] ?? trim(htmlspecialchars($_COOKIE["language"] ?? $opts->language ?? "en")); $opts->do_fallback = (int) ($_REQUEST["nfb"] ?? 0) == 0; if (!$opts->instance_fallback) { From 4a98228a90d3159a80a4dc7d300af1415ce3b96c Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 30 Aug 2023 22:06:36 +0100 Subject: [PATCH 19/54] Properly remove google request if on cooldown --- engines/text/text.php | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/text/text.php b/engines/text/text.php index 2ea76cc..7d97df7 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -26,6 +26,7 @@ if (has_cooldown($this->engine, $this->opts->cooldowns) && !has_cached_results($this->engine_request->url)) { // TODO dont add it in the first place curl_multi_remove_handle($mh, $this->engine_request->ch); + $this->engine_request = null; return; } From 063b6ea6086657ef4974bfd6677ee96d265d58e7 Mon Sep 17 00:00:00 2001 From: Castor Date: Thu, 31 Aug 2023 10:12:23 +0545 Subject: [PATCH 20/54] `Updated:` spacing between instance list and footer. --- instances.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instances.php b/instances.php index 8e26a8f..0ecffc5 100644 --- a/instances.php +++ b/instances.php @@ -44,7 +44,7 @@ LibreY - instances - +

LibreY instances

+
From 407a4dcb74f15bfc62d373c086010c61f06c6743 Mon Sep 17 00:00:00 2001 From: Castor Date: Thu, 31 Aug 2023 10:23:36 +0545 Subject: [PATCH 21/54] `Fix:` indentation for search settings. --- settings.php | 8 ++++---- static/css/styles.css | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/settings.php b/settings.php index 6a4f849..f52b64e 100644 --- a/settings.php +++ b/settings.php @@ -106,10 +106,10 @@ " > -
- - safe_search ? "checked" : ""; ?> > -
+ +
+ + safe_search ? "checked" : ""; ?> >
diff --git a/static/css/styles.css b/static/css/styles.css index f39b0e0..e0e20ac 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -151,7 +151,7 @@ a:hover, .misc-container { text-align: center; word-wrap: break-word; - width: 450px; + width: 460px; margin-left: auto; margin-right: auto; margin-bottom: 100px; From 9f755026277ecf135b8e74a4e163abe6d76e23b0 Mon Sep 17 00:00:00 2001 From: Castor Date: Thu, 31 Aug 2023 10:25:20 +0545 Subject: [PATCH 22/54] `Add:` a new libreY instance --- instances.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instances.json b/instances.json index 84caae6..8b7ebca 100644 --- a/instances.json +++ b/instances.json @@ -91,6 +91,13 @@ "country": "FR", "librey": true }, + { + "clearnet": "https://librex.yogeshlamichhane.com.np/", + "tor": null, + "i2p": null, + "country": "FI", + "librey": true + }, { "clearnet": "https://lx.vern.cc/", "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", From 7c31b0781176da9d98c2ee6dc2566f27b1369b5b Mon Sep 17 00:00:00 2001 From: Castor Date: Thu, 31 Aug 2023 10:49:09 +0545 Subject: [PATCH 23/54] `Add:` instance to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 312a5db..bf69b96 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ You can access the full list of LibreX and LibreY instances on one of the follow | [librex.revvy.de](https://librex.revvy.de/) | [✅](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [✅](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA | | [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 GB | | [librey.nohost.network](https://librey.nohost.network/) | ❌ | ❌ | 🇲🇽 MX | +| [librex.yogeshlamichhane.com.np](https://librex.yogeshlamichhane.com.np/) | ❌ | ❌ | 🇫🇮 FI |
From b8869a217e25ebfa92504670661f99a2520cb015 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 31 Aug 2023 14:09:39 +0200 Subject: [PATCH 24/54] feat(SECURITY.md): add something like a security policy --- SECURITY.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..a0bf505 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,9 @@ +# Security Policy + +## Supported Versions + +Basically the latest commit. We don't really do versioning with LibreY. + +## Reporting a Vulnerability + +Please join #librey:ahwx.org on Matrix and please DM me (@ahwx:ahwx.org) or if Matrix is absolutely impossible, email me; ahwx *at* ahwx *dot* org From 123b3bfcd4cb718d11213abc2011647696bd3316 Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 31 Aug 2023 10:18:38 -0400 Subject: [PATCH 25/54] update instances --- instances.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instances.json b/instances.json index 8b7ebca..3bc68bf 100644 --- a/instances.json +++ b/instances.json @@ -35,6 +35,13 @@ "country": "US", "librey": true }, + { + "clearnet": "https://lx.vern.cc/", + "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", + "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/", + "country": "US", + "librey": true + }, { "clearnet": "https://search.davidovski.xyz/", "tor": null, @@ -97,13 +104,6 @@ "i2p": null, "country": "FI", "librey": true - }, - { - "clearnet": "https://lx.vern.cc/", - "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", - "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/", - "country": "US", - "librey": false }, { "clearnet": "https://lx.owo.si/", From f718c36e45de640e8702ae36fe3072377e94c2d8 Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 31 Aug 2023 10:22:55 -0400 Subject: [PATCH 26/54] update cocker configs and docs --- docker-compose.yml | 2 +- docker/README.md | 120 +++++++++++++++++++------------------------ docker/attributes.sh | 26 +++++----- docker/config.php | 31 ++++++----- 4 files changed, 82 insertions(+), 97 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 14749f2..b024fec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "2.1" services: librey: - image: ahwxorg/librey:latest + image: ghcr.io/ahwxorg/librey:latest container_name: librey network_mode: bridge ports: diff --git a/docker/README.md b/docker/README.md index 82f8040..b6a7cb6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,15 +3,14 @@ - [Introduction](#introduction) - [Running a docker container](#running-a-docker-container) - - [Running a Docker container through the Docker hub](#running-a-docker-container-through-the-docker-hub) + - [Running a Docker container through ghcr](#running-a-docker-container-through-ghcr) - [Running a Docker container with composer](#running-a-docker-container-with-composer) - [Environment variables that can be set in the Docker container](#environment-variables-that-can-be-set-in-the-docker-container) - - [OpenSearch](#opensearch) - - [Search Config](#search-config) - - [Wikipedia](#wikipedia) - - [Applications](#applications) - - [Engines](#engines) - - [Curl](#curl) + - [Search Configuration](#search) + - [Frontend Configuration](#frontends) + - [Search Engine Configuration](#engines) + - [cURL Configuration](#curl) + - [OpenSearch Configuration](#opensearch) - [Docker version issues](#docker-version-issues) - [Building a docker image](#building-a-docker-image) - [Support for different architectures](#support-for-different-architectures) @@ -20,7 +19,7 @@ Dockerized librey is a way to provide users with yet another way to self-host their own projects with a view to privacy. If you wish to help, please start by looking for bugs in used docker configurations. -### Running a Docker container through the Docker hub +### Running a Docker container through ghcr To run librey in a docker container, you can simply use the command: @@ -32,7 +31,7 @@ docker run -d \ -e CONFIG_GOOGLE_LANGUAGE="en" \ -e CONFIG_WIKIPEDIA_LANGUAGE="en" \ -p 8080:8080 \ - librey/librey:latest + ghcr.io/ahwxorg/librey:latest ```
@@ -43,7 +42,7 @@ docker run -d \ version: "2.1" services: librey: - image: librey/librey:latest + image: ghcr.io/ahwxorg/librey:latest container_name: librey network_mode: bridge ports: @@ -52,10 +51,13 @@ services: - PUID=1000 - PGID=1000 - VERSION=docker - - TZ="America/New_York" - - CONFIG_GOOGLE_DOMAIN="com" - - CONFIG_GOOGLE_LANGUAGE="en" - - CONFIG_WIKIPEDIA_LANGUAGE="en" + - TZ=America/New_York + - CONFIG_GOOGLE_DOMAIN=com + - CONFIG_GOOGLE_LANGUAGE_SITE=en + - CONFIG_GOOGLE_LANGUAGE_RESULTS=en + - CONFIG_TEXT_SEARCH_ENGINE=google + - CONFIG_INSTANCE_FALLBACK=true + - CONFIG_WIKIPEDIA_LANGUAGE=en volumes: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 @@ -70,53 +72,24 @@ This docker image was developed with high configurability in mind, so here is th
-### OpenSearch +### Search | Variables | Default | Examples | Description | |:----------|:-------------|:---------|:------| -| OPEN_SEARCH_TITLE | "LibreY" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | -| OPEN_SEARCH_DESCRIPTION | "Framework and javascript free privacy respecting meta search engine" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | -| OPEN_SEARCH_ENCODING | "UTF-8" | "UTF-8" | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | -| OPEN_SEARCH_LONG_NAME | "librey Search" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | -| OPEN_SEARCH_HOST | "http://localhost:8080" | string | Host used to identify librey on the network | - -
- -### Search Config - -| Variables | Default | Examples | Description | -|:----------|:-------------|:---------|:------| -| CONFIG_GOOGLE_DOMAIN | "com" | "com", "com.br", "com.es" | Defines which Google domain the search will be done, change according to your country | -| CONFIG_GOOGLE_LANGUAGE | "en" | "pt", "es", "ru" | Defines the language in which searches will be done, see the list of supported languages [here](https://developers.google.com/custom-search/docs/ref_languages). | -| CONFIG_GOOGLE_NUMBER_OF_RESULTS | "10" | "10", "20", "30" | Number of results for Google to return each page. | +| CONFIG_GOOGLE_DOMAIN | "com" | "com", "com.br", "cat", "se" | Defines which Google domain the search will be done on, change according to your country. | +| CONFIG_LANGUAGE | "en" | "zh-Hans", "fil", "no" | Defines the language in which searches will be done, see the list of supported languages [here](https://developers.google.com/custom-search/docs/ref_languages). | +| CONFIG_NUMBER_OF_RESULTS | 10 | integer | Number of results for Google to return each page. | +| CONFIG_INVIDIOUS_INSTANCE | "https://invidious.snopyta.org" | string | Defines the host that will be used to do video searches using Invidious. | +| CONFIG_DISABLE_BITTORRENT_SEARCH | false | boolean | Defines whether bittorrent search will be disabled | +| CONFIG_BITTORRENT_TRACKERS | "&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce" | string | Set list of bittorrent trackers for torrent search. | +| CONFIG_HIDDEN_SERVICE_SEARCH | false | boolean | Defines whether hidden service search will be disabled | | CONFIG_INSTANCE_FALLBACK | true | boolean | Choose whether or not to use the API on the backend to request to another LibreX/Y instance in case of rate limiting. | -| CONFIG_INVIDIOUS_INSTANCE | "https://invidious.namazso.eu" | string | Defines the host that will be used to do video searches using invidious | -| CONFIG_HIDDEN_SERVICE_SEARCH | false | boolean | Defines whether safesearch will be enabled or disabled | -| CONFIG_DISABLE_BITTORRENT_SEARCH | false | boolean | Defines whether bittorrent support will be enabled or disabled | -| CONFIG_BITTORRENT_TRACKERS | "http://nyaa.tracker.wf:7777/announce" | string | Bittorrent trackers, see the complete example in the `config.php` file. | - -
- -### Wikipedia +| CONFIG_RATE_LIMIT_COOLDOWN | 25 | integer | Time in minutes to wait before sending requests to Google again after a rate limit. | +### Frontends | Variables | Default | Examples | Description | |:----------|:-------------|:---------|:------| -| CONFIG_WIKIPEDIA_LANGUAGE | "en" | "pt", "es", "hu" | Adds language support for Wikipedia results | - -
- -### Engines -| Variables | Default | Examples | Description | -|:----------|:-------------|:---------|:------| -| CONFIG_TEXT_SEARCH_ENGINE | "google" | "google", "duckduckgo" | Change your text search engine. | - -
- -### Applications - -| Variables | Default | Examples | Description | -|:----------|:-------------|:---------|:------| -| APP_INVIDIOUS | "" | string | Integration with external self-hosted apps, configure the desired host. | +| APP_INVIDIOUS | "" | "https://example.com", string | Integration with external self-hosted apps, configure the desired host. | | APP_RIMGO | "" | string | Integration with external self-hosted apps, configure the desired host. | | APP_SCRIBE | "" | string | Integration with external self-hosted apps, configure the desired host. | | APP_GOTHUB | "" | string | Integration with external self-hosted apps, configure the desired host. | @@ -131,22 +104,37 @@ This docker image was developed with high configurability in mind, so here is th | APP_SUDS | "" | string | Integration with external self-hosted apps, configure the desired host. | | APP_BIBLIOREADS | "" | string | Integration with external self-hosted apps, configure the desired host. | -
- -### Curl +### Engines +| Variables | Default | Examples | Description | +|:----------|:-------------|:---------|:------| +| CONFIG_TEXT_SEARCH_ENGINE | "google" | "google", "duckduckgo" | Integration with external self-hosted apps, configure the desired host. | +### cURL | Variables | Default | Examples | Description | |:----------|:-------------|:---------|:------| | CURLOPT_PROXY_ENABLED | false | boolean | If you want to use a proxy, you need to set this variable to true. | -| CURLOPT_PROXY | "" | "127.0.0.1:8080" | Set the proxy using the ip and port to be used | -| CURLOPT_PROXYTYPE | "CURLPROXY_HTTP" | "CURLPROXY_SOCKS4A" "CURLPROXY_SOCKS5" "CURLPROXY_SOCKS5_HOSTNAME" | Set the type of proxy connection (if you enabled it). | -| CURLOPT_RETURNTRANSFER | true | boolean | **TODO** | -| CURLOPT_ENCODING | "" | string | Defines the encode that curl should use to display the texts correctly | -| CURLOPT_USERAGENT | "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" | string | This variable defines the 'User-Agent' that curl will use to attempt to avoid being blocked | -| CURLOPT_CUSTOMREQUEST | "GET" | "HEAD", "OPTIONS" | Defines the HTTP method that curl will use to make the request | -| CURLOPT_MAXREDIRS | 5 | number | **TODO** | -| CURLOPT_TIMEOUT | 18 | number | Sets the maximum time curl will wait for a response before timing out | -| CURLOPT_VERBOSE | false | boolean | Specifies whether curl should display detailed information on stdout about the request and response when making requests. Setting to 'true' enables verbose mode | +| CURLOPT_PROXY | "" | "192.0.2.53:8388" | Set the proxy using the ip and port to be used. | +| CURLOPT_PROXYTYPE | "CURLPROXY_HTTP" | "CURLPROXY_SOCKS4A", "CURLPROXY_SOCKS5", "CURLPROXY_SOCKS5_HOSTNAME" | Set the type of proxy connection (if you enabled it). | +| CURLOPT_RETURNTRANSFER | true | boolean | Return the transfer as a string of the return value of curl_exec() instead of outputting it directly. | +| CURLOPT_ENCODING | "" | string | Return the transfer as a string of the return value of curl_exec() instead of outputting it directly. | +| CURLOPT_USERAGENT | "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0" | string | This variable defines the 'User-Agent' that curl will use to attempt to avoid being blocked. | +| CURLOPT_IPRESOLVE | "CURL_IPRESOLVE_WHATEVER" | "CURL_IPRESOLVE_V4", "CURL_IPRESOLVE_V6" | Use a fixed IP version for making requests, or what DNS prefers. | +| CURLOPT_CUSTOMREQUEST | "GET" | "POST", "CONNECT" | Defines the HTTP method that curl will use to make the request. | +| CURLOPT_MAXREDIRS | 5 | integer | The maximum amount of HTTP redirections to follow, only enabled with CURLOPT_FOLLOWLOCATION. | +| CURLOPT_TIMEOUT | 3 | integer | The maximum amount of time for cURL requests to complete. | +| CURLOPT_VERBOSE | false | boolean | Whether to output verbose information. | +| CURLOPT_FOLLOWLOCATION | true | boolean | Whether to follow any Location header. Required for instance fallback. | + + +### OpenSearch + +| Variables | Default | Examples | Description | +|:----------|:-------------|:---------|:------| +| OPEN_SEARCH_TITLE | "LibreY" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | +| OPEN_SEARCH_DESCRIPTION | "Framework and javascript free privacy respecting meta search engine" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | +| OPEN_SEARCH_ENCODING | "UTF-8" | "UTF-8" | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | +| OPEN_SEARCH_LONG_NAME | "LibreY Search" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) | +| OPEN_SEARCH_HOST | "http://localhost:80" | string | Host used to identify librey on the network |
diff --git a/docker/attributes.sh b/docker/attributes.sh index 8c4c8b1..8f797cb 100755 --- a/docker/attributes.sh +++ b/docker/attributes.sh @@ -19,19 +19,15 @@ export OPEN_SEARCH_HOST=${OPEN_SEARCH_HOST:-"127.0.0.1"} # Replace the 'config.php' script, which contains the most common search engine configurations, with these environment setups # These environment setups can be found in 'config.php', and the default configurations can be useful for most use cases -export CONFIG_GOOGLE_DOMAIN="${CONFIG_GOOGLE_DOMAIN:-"com"}" -export CONFIG_GOOGLE_LANGUAGE_SITE="${CONFIG_GOOGLE_LANGUAGE_SITE:-"en"}" -export CONFIG_GOOGLE_LANGUAGE_RESULTS="${CONFIG_GOOGLE_LANGUAGE_RESULTS:-"en"}" -export CONFIG_GOOGLE_NUMBER_OF_RESULTS="${CONFIG_GOOGLE_NUMBER_OF_RESULTS:-"10"}" -export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK:-true}" -export CONFIG_INVIDIOUS_INSTANCE="${CONFIG_INVIDIOUS_INSTANCE:-"invidious.snopyta.org"}" -export CONFIG_HIDDEN_SERVICE_SEARCH=${CONFIG_HIDDEN_SERVICE_SEARCH:-false} +export CONFIG_GOOGLE_DOMAIN=${CONFIG_GOOGLE_DOMAIN:-"com"} +export CONFIG_LANGUAGE=${CONFIG_LANGUAGE:-"en"} +export CONFIG_NUMBER_OF_RESULTS=${CONFIG_NUMBER_OF_RESULTS:-10} +export CONFIG_INVIDIOUS_INSTANCE=${CONFIG_INVIDIOUS_INSTANCE:-"https://invidious.snopyta.org"} export CONFIG_DISABLE_BITTORRENT_SEARCH=${CONFIG_DISABLE_BITTORRENT_SEARCH:-false} -export CONFIG_BITTORRENT_TRACKERS="${CONFIG_BITTORRENT_TRACKERS:-"&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce"}" - -# The settings that will be used to handle Wikipedia results displayed on the librey search page -# the settings below can be edited via environment variables. -export CONFIG_WIKIPEDIA_LANGUAGE=${CONFIG_WIKIPEDIA_LANGUAGE:-${CONFIG_GOOGLE_LANGUAGE}} +export CONFIG_BITTORRENT_TRACKERS=${CONFIG_BITTORRENT_TRACKERS:-"&tr=http://nyaa.tracker.wf:7777/announce&tr=udp://open.stealth.si:80/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://exodus.desync.com:6969/announce&tr=udp://tracker.torrent.eu.org:451/announce"} +export CONFIG_HIDDEN_SERVICE_SEARCH=${CONFIG_HIDDEN_SERVICE_SEARCH:-false} +export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK:-true}" +export CONFIG_RATE_LIMIT_COOLDOWN="${CONFIG_RATE_LIMIT_COOLDOWN:-25}" # Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers # A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librey @@ -59,11 +55,13 @@ export CURLOPT_PROXY=${CURLOPT_PROXY:-""} export CURLOPT_PROXYTYPE=${CURLOPT_PROXYTYPE:-"CURLPROXY_HTTP"} export CURLOPT_RETURNTRANSFER=${CURLOPT_RETURNTRANSFER:-true} export CURLOPT_ENCODING=${CURLOPT_ENCODING:-""} -export CURLOPT_USERAGENT="${CURLOPT_USERAGENT:-"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"}" +export CURLOPT_USERAGENT=${CURLOPT_USERAGENT:-"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0"} +export CURLOPT_IPRESOLVE=${CURLOPT_IPRESOLVE:-"CURL_IPRESOLVE_WHATEVER"} export CURLOPT_CUSTOMREQUEST="${CURLOPT_CUSTOMREQUEST:-"GET"}" export CURLOPT_MAXREDIRS=${CURLOPT_MAXREDIRS:-5} -export CURLOPT_TIMEOUT=${CURLOPT_TIMEOUT:-18} +export CURLOPT_TIMEOUT=${CURLOPT_TIMEOUT:-3} export CURLOPT_VERBOSE=${CURLOPT_VERBOSE:-true} +export CURLOPT_FOLLOWLOCATION=${CURLOPT_FOLLOWLOCATION:-true} # These shell functions will be available for use by any function calls function AwkTrim() { awk '{$1=$1};1'; } diff --git a/docker/config.php b/docker/config.php index ab09990..301936c 100644 --- a/docker/config.php +++ b/docker/config.php @@ -1,17 +1,15 @@ "${CONFIG_GOOGLE_DOMAIN}", - "google_language_site" => "${CONFIG_GOOGLE_LANGUAGE_SITE}", - "google_language_results" => "${CONFIG_GOOGLE_LANGUAGE_RESULTS}", - "google_number_of_results" => "${CONFIG_GOOGLE_NUMBER_OF_RESULTS}", - - "wikipedia_language" => "${CONFIG_WIKIPEDIA_LANGUAGE}", + "language" => "${CONFIG_LANGUAGE}", + "number_of_results" => ${CONFIG_NUMBER_OF_RESULTS}, "invidious_instance_for_video_results" => "${CONFIG_INVIDIOUS_INSTANCE}", - "disable_bittorent_search" => ${CONFIG_DISABLE_BITTORRENT_SEARCH}, "bittorent_trackers" => "${CONFIG_BITTORRENT_TRACKERS}", "disable_hidden_service_search" => ${CONFIG_HIDDEN_SERVICE_SEARCH}, "instance_fallback" => ${CONFIG_INSTANCE_FALLBACK}, + "request_cooldown" => ${CONFIG_RATE_LIMIT_COOLDOWN}, "frontends" => array( "invidious" => array( @@ -34,7 +32,7 @@ ), "gothub" => array( "instance_url" => "${APP_GOTHUB}", - "project_url" => "https://codeberg.org/gothub/gothub/wiki/Instances", + "project_url" => "https://codeberg.org/gothub/gothub#instances", "original_name" => "GitHub", "original_url" => "github.com" ), @@ -44,10 +42,9 @@ "original_name" => "Twitter", "original_url" => "twitter.com" ), - "libreddit" => array( "instance_url" => "${APP_LIBREREDDIT}", - "project_url" => "https://github.com/spikecodes/libreddit", + "project_url" => "https://github.com/libreddit/libreddit-instances/blob/master/instances.md", "original_name" => "Reddit", "original_url" => "reddit.com" ), @@ -61,23 +58,23 @@ "instance_url" => "${APP_WIKILESS}", "project_url" => "https://github.com/Metastem/wikiless#instances", "original_name" => "Wikipedia", - "original_url" => "wikipedia.com" + "original_url" => "wikipedia.org" ), "quetre" => array( "instance_url" => "${APP_QUETRE}", - "project_url" => "https://github.com/zyachel/quetre", + "project_url" => "https://github.com/zyachel/quetre#instances", "original_name" => "Quora", "original_url" => "quora.com" ), "libremdb" => array( "instance_url" => "${APP_LIBREMDB}", - "project_url" => "https://github.com/zyachel/libremdb", + "project_url" => "https://github.com/zyachel/libremdb#instances", "original_name" => "IMDb", "original_url" => "imdb.com" ), "breezewiki" => array( "instance_url" => "${APP_BREEZEWIKI}", - "project_url" => "https://gitdab.com/cadence/breezewiki", + "project_url" => "https://docs.breezewiki.com/Links.html", "original_name" => "Fandom", "original_url" => "fandom.com" ), @@ -101,23 +98,25 @@ ) ), + "preferred_engines" => array( "text" => "${CONFIG_TEXT_SEARCH_ENGINE}" ), "curl_settings" => array( CURLOPT_PROXY => "${CURLOPT_PROXY}", - CURLOPT_PROXYTYPE => "${CURLOPT_PROXYTYPE}", + CURLOPT_PROXYTYPE => ${CURLOPT_PROXYTYPE}, CURLOPT_RETURNTRANSFER => ${CURLOPT_RETURNTRANSFER}, CURLOPT_ENCODING => "${CURLOPT_ENCODING}", CURLOPT_USERAGENT => "${CURLOPT_USERAGENT}", - CURLOPT_IPRESOLVE => CURL_IPRESOLVE_WHATEVER, + CURLOPT_IPRESOLVE => ${CURLOPT_IPRESOLVE}, CURLOPT_CUSTOMREQUEST => "${CURLOPT_CUSTOMREQUEST}", CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP, CURLOPT_REDIR_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP, CURLOPT_MAXREDIRS => ${CURLOPT_MAXREDIRS}, CURLOPT_TIMEOUT => ${CURLOPT_TIMEOUT}, - CURLOPT_VERBOSE => ${CURLOPT_VERBOSE} + CURLOPT_VERBOSE => ${CURLOPT_VERBOSE}, + CURLOPT_FOLLOWLOCATION => ${CURLOPT_FOLLOWLOCATION} ) ); ?> From 5e37afdd12bae5052dcf0e510f86d059e80493a5 Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 31 Aug 2023 10:39:04 -0400 Subject: [PATCH 27/54] add cache ttl to docker --- docker/README.md | 1 + docker/attributes.sh | 1 + docker/config.php | 1 + 3 files changed, 3 insertions(+) diff --git a/docker/README.md b/docker/README.md index b6a7cb6..15b502a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -85,6 +85,7 @@ This docker image was developed with high configurability in mind, so here is th | CONFIG_HIDDEN_SERVICE_SEARCH | false | boolean | Defines whether hidden service search will be disabled | | CONFIG_INSTANCE_FALLBACK | true | boolean | Choose whether or not to use the API on the backend to request to another LibreX/Y instance in case of rate limiting. | | CONFIG_RATE_LIMIT_COOLDOWN | 25 | integer | Time in minutes to wait before sending requests to Google again after a rate limit. | +| CONFIG_CACHE_TIME | 20 | integer | Time in minutes to store results for in the cache. | ### Frontends | Variables | Default | Examples | Description | diff --git a/docker/attributes.sh b/docker/attributes.sh index 8f797cb..b6cc10a 100755 --- a/docker/attributes.sh +++ b/docker/attributes.sh @@ -28,6 +28,7 @@ export CONFIG_BITTORRENT_TRACKERS=${CONFIG_BITTORRENT_TRACKERS:-"&tr=http://nyaa export CONFIG_HIDDEN_SERVICE_SEARCH=${CONFIG_HIDDEN_SERVICE_SEARCH:-false} export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK:-true}" export CONFIG_RATE_LIMIT_COOLDOWN="${CONFIG_RATE_LIMIT_COOLDOWN:-25}" +export CONFIG_CACHE_TIME="${CONFIG_CACHE_TIME:-25}" # Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers # A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librey diff --git a/docker/config.php b/docker/config.php index 301936c..dfd6eb5 100644 --- a/docker/config.php +++ b/docker/config.php @@ -10,6 +10,7 @@ "disable_hidden_service_search" => ${CONFIG_HIDDEN_SERVICE_SEARCH}, "instance_fallback" => ${CONFIG_INSTANCE_FALLBACK}, "request_cooldown" => ${CONFIG_RATE_LIMIT_COOLDOWN}, + "cache_time" => ${CONFIG_CACHE_TIME}, "frontends" => array( "invidious" => array( From 90f07bceeba904e12fc68e0e7b6a5105eb184908 Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 31 Aug 2023 10:40:14 -0400 Subject: [PATCH 28/54] fix default for cache ttl docker --- docker/attributes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/attributes.sh b/docker/attributes.sh index b6cc10a..0539c9a 100755 --- a/docker/attributes.sh +++ b/docker/attributes.sh @@ -28,7 +28,7 @@ export CONFIG_BITTORRENT_TRACKERS=${CONFIG_BITTORRENT_TRACKERS:-"&tr=http://nyaa export CONFIG_HIDDEN_SERVICE_SEARCH=${CONFIG_HIDDEN_SERVICE_SEARCH:-false} export CONFIG_INSTANCE_FALLBACK="${CONFIG_INSTANCE_FALLBACK:-true}" export CONFIG_RATE_LIMIT_COOLDOWN="${CONFIG_RATE_LIMIT_COOLDOWN:-25}" -export CONFIG_CACHE_TIME="${CONFIG_CACHE_TIME:-25}" +export CONFIG_CACHE_TIME="${CONFIG_CACHE_TIME:-20}" # Supported apps integration configuration. These empty spaces can be set up using free hosts as pointers # A particular example is using the "https://yewtu.be" or a self-hosted host to integrate the invidious app to librey From 0c7224a67aec4505bc4b8ff3dd4f61ed457fb704 Mon Sep 17 00:00:00 2001 From: Revvy Date: Fri, 1 Sep 2023 08:19:15 -0400 Subject: [PATCH 29/54] some security headers --- docker/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/nginx.conf b/docker/nginx.conf index ffbd92a..2901477 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -2,6 +2,10 @@ server { listen 8080; server_name ${OPEN_SEARCH_HOST_FOR_NGINX} localhost; + add_header Content-Security-Policy "default-src 'none'; style-src 'self'; img-src 'self'"; + add_header X-Frame-Options "DENY" always; + add_header X-Content-Type-Options "nosniff"; + root /var/www/html; index index.php; From 5a8672c1509ddd5c744dde0cfad89c9db29dfde6 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 00:12:13 -0400 Subject: [PATCH 30/54] add watchtower --- docker-compose.yml | 6 +++++- docker/README.md | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b024fec..0984943 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "2.1" +version: "3" services: librey: image: ghcr.io/ahwxorg/librey:latest @@ -21,3 +21,7 @@ services: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 restart: unless-stopped + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock diff --git a/docker/README.md b/docker/README.md index 15b502a..2732ab6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -34,12 +34,20 @@ docker run -d \ ghcr.io/ahwxorg/librey:latest ``` +Also run with watchtower for auto-updating: (optional) +```sh +docker run -d \ + --name librey-watchtower-1 \ + -v /var/run/docker.sock:/var/run/docker.sock \ + containrrr/watchtower +``` +
### Running a Docker container with composer ```yml -version: "2.1" +version: "3" services: librey: image: ghcr.io/ahwxorg/librey:latest @@ -62,6 +70,10 @@ services: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 restart: unless-stopped + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock ```
From f73a3f0ff9117ba6bc22e750096de92b94770778 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 00:13:52 -0400 Subject: [PATCH 31/54] fix instances.json order --- instances.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/instances.json b/instances.json index 3bc68bf..43a2972 100644 --- a/instances.json +++ b/instances.json @@ -29,16 +29,16 @@ "librey": true }, { - "clearnet": "https://librey.org/", - "tor": "http://jxhkfulu6wpdl4apuy4dyivuowmpprvsd7e3el2z73crq7fmyv7rjkyd.onion/", - "i2p": null, + "clearnet": "https://lx.vern.cc/", + "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", + "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/", "country": "US", "librey": true }, { - "clearnet": "https://lx.vern.cc/", - "tor": "http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/", - "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/", + "clearnet": "https://librey.org/", + "tor": "http://jxhkfulu6wpdl4apuy4dyivuowmpprvsd7e3el2z73crq7fmyv7rjkyd.onion/", + "i2p": null, "country": "US", "librey": true }, From 94de6a116b65660d06d6184728a0bb06514ecd93 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 00:15:52 -0400 Subject: [PATCH 32/54] typo in docker readme --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 2732ab6..c0e33a1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -191,7 +191,7 @@ docker build -t librey:latest . Supported architectures for the official librey images include the same ones supported by Alpine itself, which are typically denoted as `linux/386`, `linux/amd64`, `linux/arm/v6`. If you need support for a different architecture, such as `linux/arm/v7`, you can modify the 'Dockerfile' to use a more comprehensive base image like `ubuntu:latest` instead. -In this case, you must run the `build` process specifying the desired architecture as shown in the example below: +In this case, you must run the `buildx` process specifying the desired architecture as shown in the example below: ```sh docker buildx build \ From 9361117f09063ffa42fddb901e8f03cec7f07807 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Sat, 2 Sep 2023 22:33:48 +0200 Subject: [PATCH 33/54] fix(docker-compose.yml): Add "docs" for Watchtower --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0984943..724c95a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 restart: unless-stopped - watchtower: + watchtower: # Watchtower is not required but highly recommended, since Watchtower will re-pull and restart the LibreY container automatically whenever there's an update. image: containrrr/watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock From ee9f7d84472681b7e684f93a2481a4a7c5dfd79d Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 22:23:23 -0400 Subject: [PATCH 34/54] update default compose --- docker-compose.yml | 21 +++++++++++++-------- docker/README.md | 23 ++++++++++++++--------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 724c95a..dfc96f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,16 +7,21 @@ services: ports: - 8080:8080 environment: - - PUID=1000 - - PGID=1000 - - VERSION=docker - - TZ=America/New_York - CONFIG_GOOGLE_DOMAIN=com - - CONFIG_GOOGLE_LANGUAGE_SITE=en - - CONFIG_GOOGLE_LANGUAGE_RESULTS=en - - CONFIG_TEXT_SEARCH_ENGINE=google + - CONFIG_LANGUAGE=en + - CONFIG_NUMBER_OF_RESULTS=10 + - CONFIG_INVIDIOUS_INSTANCE=https://invidious.snopyta.org + - CONFIG_DISABLE_BITTORRENT_SEARCH=false + - CONFIG_HIDDEN_SERVICE_SEARCH=false - CONFIG_INSTANCE_FALLBACK=true - - CONFIG_WIKIPEDIA_LANGUAGE=en + - CONFIG_RATE_LIMIT_COOLDOWN=25 + - CONFIG_CACHE_TIME=20 + - CONFIG_TEXT_SEARCH_ENGINE=google + - CURLOPT_PROXY_ENABLED=false + - CURLOPT_PROXY=192.0.2.53:8388 + - CURLOPT_PROXYTYPE=CURLPROXY_HTTP + - CURLOPT_USERAGENT=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0 + - CURLOPT_FOLLOWLOCATION=true volumes: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 diff --git a/docker/README.md b/docker/README.md index c0e33a1..0bc8a57 100644 --- a/docker/README.md +++ b/docker/README.md @@ -56,21 +56,26 @@ services: ports: - 8080:8080 environment: - - PUID=1000 - - PGID=1000 - - VERSION=docker - - TZ=America/New_York - CONFIG_GOOGLE_DOMAIN=com - - CONFIG_GOOGLE_LANGUAGE_SITE=en - - CONFIG_GOOGLE_LANGUAGE_RESULTS=en - - CONFIG_TEXT_SEARCH_ENGINE=google + - CONFIG_LANGUAGE=en + - CONFIG_NUMBER_OF_RESULTS=10 + - CONFIG_INVIDIOUS_INSTANCE=https://invidious.snopyta.org + - CONFIG_DISABLE_BITTORRENT_SEARCH=false + - CONFIG_HIDDEN_SERVICE_SEARCH=false - CONFIG_INSTANCE_FALLBACK=true - - CONFIG_WIKIPEDIA_LANGUAGE=en + - CONFIG_RATE_LIMIT_COOLDOWN=25 + - CONFIG_CACHE_TIME=20 + - CONFIG_TEXT_SEARCH_ENGINE=google + - CURLOPT_PROXY_ENABLED=false + - CURLOPT_PROXY=192.0.2.53:8388 + - CURLOPT_PROXYTYPE=CURLPROXY_HTTP + - CURLOPT_USERAGENT=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0 + - CURLOPT_FOLLOWLOCATION=true volumes: - ./nginx_logs:/var/log/nginx - ./php_logs:/var/log/php7 restart: unless-stopped - watchtower: + watchtower: # Watchtower is not required but highly recommended, since Watchtower will re-pull and restart the LibreY container automatically whenever there's an update. image: containrrr/watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock From ea51467714f14c7ae55b7f149b679be9e8d3e296 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 22:45:27 -0400 Subject: [PATCH 35/54] update instance list on readme --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bf69b96..12e923e 100644 --- a/README.md +++ b/README.md @@ -15,18 +15,19 @@ ### Instances -> If you host using CloudFlare, this will be mentioned in the instances list. - -You can access the full list of LibreX and LibreY instances on one of the following updated LibreY instances: - -| Clearnet | TOR | I2P | Country | -|-|-|-|-| -| [search.ahwx.org](https://search.ahwx.org/) | [✅](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion) | ❌ | 🇳🇱 NL | -| [librex.me](https://librex.me/) | [✅](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [✅](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA | -| [librex.revvy.de](https://librex.revvy.de/) | [✅](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [✅](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA | -| [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 GB | -| [librey.nohost.network](https://librey.nohost.network/) | ❌ | ❌ | 🇲🇽 MX | -| [librex.yogeshlamichhane.com.np](https://librex.yogeshlamichhane.com.np/) | ❌ | ❌ | 🇫🇮 FI | +You can find a list of instances on any LibreY instance by accessing /instances.php +Instance list on @codedipper's instance: +[librex.me](https://librex.me/instances.php) +[librex.revvy.de](https://librex.revvy.de/instances.php) +[Tor](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/instances.php) +[I2P](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/instances.php) +
+@davidovski's instance: +[search.davidovski.xyz](https://search.davidovski.xyz/instances.php) +
+@Ahwxorg's instance: +[search.ahwx.org](https://search.ahwx.org/instances.php) +[Tor](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/instances.php)
From aa9f46dbbd3c317c9ac542375007a1a52f6954c2 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 22:51:54 -0400 Subject: [PATCH 36/54] more changes --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 12e923e..e0fce7b 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,20 @@ ### Instances You can find a list of instances on any LibreY instance by accessing /instances.php -Instance list on @codedipper's instance: -[librex.me](https://librex.me/instances.php) -[librex.revvy.de](https://librex.revvy.de/instances.php) -[Tor](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/instances.php) -[I2P](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/instances.php) +While the official instances may be more updated and have better uptime, please consider using another person's instances as these are heavily overloaded.
+Support the community. ❤️

+Instance list on [@codedipper](https://github.com/codedipper)'s instance:
+[librex.me](https://librex.me/instances.php)
+[librex.revvy.de](https://librex.revvy.de/instances.php)
+[Tor](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/instances.php)
+[I2P](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/instances.php)

-@davidovski's instance: -[search.davidovski.xyz](https://search.davidovski.xyz/instances.php) +[@davidovski](https://github.com/davidovski)'s instance:
+[search.davidovski.xyz](https://search.davidovski.xyz/instances.php)

-@Ahwxorg's instance: -[search.ahwx.org](https://search.ahwx.org/instances.php) -[Tor](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/instances.php) +[@Ahwxorg](https://github.com/Ahwxorg)'s instance:
+[search.ahwx.org](https://search.ahwx.org/instances.php)
+[Tor](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/instances.php)

From 30a8802eae88763ac975c009b9d1a03526f174c5 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 22:54:49 -0400 Subject: [PATCH 37/54] more changes --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e0fce7b..f3a62ce 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ ### Instances -You can find a list of instances on any LibreY instance by accessing /instances.php +You can find a list of instances on any LibreY instance by accessing /instances.php.
+Alternatively look at `instances.json` where the list is generated from.
While the official instances may be more updated and have better uptime, please consider using another person's instances as these are heavily overloaded.
Support the community. ❤️

Instance list on [@codedipper](https://github.com/codedipper)'s instance:
@@ -24,13 +25,13 @@ Instance list on [@codedipper](https://github.com/codedipper)'s instance:
[Tor](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/instances.php)
[I2P](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/instances.php)

-[@davidovski](https://github.com/davidovski)'s instance:
-[search.davidovski.xyz](https://search.davidovski.xyz/instances.php)
-
[@Ahwxorg](https://github.com/Ahwxorg)'s instance:
[search.ahwx.org](https://search.ahwx.org/instances.php)
[Tor](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/instances.php)

+[@davidovski](https://github.com/davidovski)'s instance:
+[search.davidovski.xyz](https://search.davidovski.xyz/instances.php)
+
### About LibreY From 158a7e02961c59ef956ec1338d62e3bd6da19616 Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 2 Sep 2023 22:56:39 -0400 Subject: [PATCH 38/54] more changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f3a62ce..7cb52d2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### Instances You can find a list of instances on any LibreY instance by accessing /instances.php.
-Alternatively look at `instances.json` where the list is generated from.
+Alternatively look at `instances.json` where the list is generated from.

While the official instances may be more updated and have better uptime, please consider using another person's instances as these are heavily overloaded.
Support the community. ❤️

Instance list on [@codedipper](https://github.com/codedipper)'s instance:
From 7d260df145bee99f2a367ec4bfe2c5105ac850b5 Mon Sep 17 00:00:00 2001 From: osarthak Date: Sun, 3 Sep 2023 17:56:18 +0530 Subject: [PATCH 39/54] update donate ui && fix footer links margin --- donate.php | 75 ++++++++++++++++++--- static/css/styles.css | 106 +++++++++++++++++++++++++++++- static/images/buy-me-a-coffee.png | Bin 0 -> 9936 bytes static/images/kofi.png | Bin 0 -> 8153 bytes 4 files changed, 169 insertions(+), 12 deletions(-) create mode 100644 static/images/buy-me-a-coffee.png create mode 100644 static/images/kofi.png diff --git a/donate.php b/donate.php index d5fcf3a..4140ab2 100644 --- a/donate.php +++ b/donate.php @@ -7,16 +7,71 @@ LibreY - Donate -
-

Donate to the original developer of LibreX, a project LibreY tries to improve.

-

Bitcoin (BTC):

-

bc1qs43kh6tvhch02dtsp7x7hcrwj8fwe4rzy7lp0h

- btc qr code -

Monero (XMR):

-

41dGQr9EwZBfYBY3fibTtJZYfssfRuzJZDSVDeneoVcgckehK3BiLxAV4FvEVJiVqdiW996zvMxhFB8G8ot9nBFqQ84VkuC

- xmr qr code -

Donate to the person that forked LibreX into LibreY

- Click here + + + + diff --git a/static/css/styles.css b/static/css/styles.css index e0e20ac..559a810 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -319,8 +319,7 @@ a[title] { } .footer-container a { - margin-left: 15px; - margin-right: 15px; + margin-right: 30px; } .hide { @@ -339,6 +338,60 @@ a[title] { color: #ff79c6; } + +/* donate css start */ + +.donate-container { + width: 700px; + margin-left: auto; + margin-right: auto; + margin-bottom: 100px; +} + +.flexbox-column { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + gap: 10px; +} + +.inner-wrap { + width: 500px; + padding: 20px; +} + +.qr-box { + background-color: var(--search-container-background-color); + border: 1px solid var(--search-container-background-border); + border-radius: 10px 0px 0px 10px; + width: 100%; + + display: flex; + word-wrap: break-word; + align-items: center; + justify-content: space-between; +} + +.flex-row { + width: 700px; + height: auto; + display: flex; + flex-direction: row; + justify-content: space-evenly; +} + +hr.small-line { + /* background-color: #f1f3f4; */ + border: 2px solid var(--main-fg); + height: 0px; + width: 100px; + margin: 30px; + border-radius: 2px; +} +/* donate css end */ + + @media only screen and (max-width: 1320px) { .special-result-container { position: relative; @@ -485,4 +538,53 @@ a[title] { margin-left: 20px; } + /* dontate css start*/ + + .donate-container { + margin-bottom: 100px; + width: 95%; + text-align: center; + } + + .qr-box { + display: flex; + flex-direction: column; + word-wrap: break-word; + align-items: center; + justify-content: space-between; + word-wrap: break-word; + height: auto; + } + + .qr-box { + border-radius: 10px; + flex-direction: column; + align-items: center; + } + + .inner-wrap { + width: 80%; + text-align: center; + } + + .qr-box img { + width: 40%; + height: auto; + padding: 20px; + } + + .flex-row { + flex-direction: column; + align-items: center; + gap: 5px; + width: 0; + } + + .flex-row a img { + width: 220px; + height: auto; + } + /* donate css end */ + + } \ No newline at end of file diff --git a/static/images/buy-me-a-coffee.png b/static/images/buy-me-a-coffee.png new file mode 100644 index 0000000000000000000000000000000000000000..5366115bbfb710b24c3e66837ef6392e06c8acaa GIT binary patch literal 9936 zcmX9^bwE_j*G2^C7LcVoq#NlFSfoUdT)J607X+jQgjKp1q+@B8PL=NNknZmK_WgZ- z+?qQx_sl)#%=4U?6RD}Lgoh2lMnOTr11c+Mp`g4_LEfulzCxZAM@$Nl7c3WLeRmWT z9FqTz7bs~NZ;*vA+_jYCP|Am?c99QgHnM86C@57>oCh;>6ciRKpn|Nn&x^xMj11DL z+sc)&d^QGUrFX&Dzf46GbA#F9^gf2z5(~x^RdxUQlEia0i)k8R3yy51B#o)c2@e1E zRd1*DIyQUo*?*Y7#%6eUvDy2Yd!P#v&>qx!J)9}NIq0`6g&rqEh<16|{?tU3|3L&a zAJwyd3Wj~3vI^&}Abb5f@z4zjs#D-?e`z!WiQ=fFbe?*^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{|IW%NGr8zwLBu!k*!XCu=+i)*JAhJ0x*Yv^j|Pr#j6`nNRvqj8Ewp6_U>n z=aI1Z&{$JkcaFYRq=Aiy5SST_QTcAGe6hEO6!FUTS!3WfXoW47#%Y8v`qyN58%v)i z&@ez#l#gma;2m4_>!ZBw24uQWZ-tf7=-lFw2NX-a{tE{T%x04pA`R6>{O#xKp|Z#V zX-{web;i+7$;Q3C|E5Wo5hZR=u;c}4ZV$QZl#~EBPQiGHsO$@5rc((nelf*=i56Lc)^uz= z|K(QsjK7J2eXTCxwEsA_mQ|xq)CtY%6bS=WLnT% z6>oVj*Jm#U`{DtzARwbM_Pd4uPwpE0@klgq4 literal 0 HcmV?d00001 diff --git a/static/images/kofi.png b/static/images/kofi.png new file mode 100644 index 0000000000000000000000000000000000000000..067bf5217c389a3ce947b73e97f2b1edf0d7ebba GIT binary patch literal 8153 zcmW+*WmKF^&tBZ!iO;cZ$2aySqD!yUYFU_vW0DOs*u8 zOwRmCxU!-Y2I>b?5D0`JBQ2>40>Ruu_ln4H(0Q8$pAx#DI7n+bgFt9_|36?rf76LU zAUKe+JouZGgZ%dP_R9YVx(N>tht5#i+}wP7dz+u1hidQc?v9L%EH5ulO-(H>E<)Lo zk`gFeSXh{qmDSnV2?Y-f4Aj)rK-tpLQmEGCFevGqobdl zosEu;Qd3jk-Q8hgVm>@Pu&}V4oSX;<2&}KKqoSgcl9JZf*EcpcT3K0ndwYwEivzlb zY;0_}xVXByx(*Hwm6er%wiWc|fWEG_wl*}J@87>mN=ia=GCe&F27^UKMO#~26%-V{ ze*N0q-0b4w0u3C{HV3qSe*XL!(A76IG)zcH$jHdx;o&JLDERd06QFAh=$hu_U3e(=#9-AT>2rRaG@OIN03WJS{EF&dx40G!*(+F)=YtPEOFw`}+FI z%F6!v^XJ#EUx1E1pa~uv9E^*L1AeGhS67>wnnp)Q1DY;?rW2rI6&V>REiDab+X1@f zz{@LeeGM4u0=l|@wkh$N_26f*a=sgmF2zVrTWpZfsw6SAP||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FTjwH#7OLA7=7^MBm0EHwMJFb6K@H8JmUir)I~;;j4=BFd@ZF}GBoP}3uTXXHj=@_ z-};OLC)jq;<$0Z3=~oSAicHhu4Ky`VRFg6@Gt<&fo$V9)#ss2TgwM%a2mk&}4_-sb zLlY0r_=DHDMprnU{#{EL6QW$%R>^Pq9^^BMsx|`c8|swuLOX^H)F0e?6}Di47Oge(#J8w$j2D@CbXcXs0;YhUNE=I{V`-+lOVUI!WHQ-<1hXG zTpPL6nUmu<-lJPnL4ny>B6Iu0!;j^EwMHCDE`GLL*hnq`>l0rv#5g{zVYkq>w6Snu z!?bTwp5wSNAF;lq*m3Ck_+7j4y$X%fv-#4k@r$GEIu@6yzv_;k^9eRjH+Nxe>h=at#^{X$!)jCSPn z0%%-dHDgc4vuN}#;FjHvQvZ#le^x Date: Sun, 3 Sep 2023 23:38:39 +0200 Subject: [PATCH 40/54] ci: multi-arch docker images based on https://docs.docker.com/build/ci/github-actions/multi-platform/ --- .github/workflows/docker-image.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 62675ca..4114861 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -22,10 +22,14 @@ jobs: uses: ASzc/change-string-case-action@v5 with: string: ${{ github.event.repository.name }} + + - uses: docker/setup-qemu-action@v2 + - uses: docker/setup-buildx-action@v2 - uses: docker/build-push-action@v4 with: context: . file: Dockerfile + platforms: linux/amd64,linux/arm64 push: true tags: | ghcr.io/${{ steps.owner.outputs.lowercase }}/${{ steps.repo.outputs.lowercase }}:latest From 43234d6d87998697ee7e612db763acb93462be5a Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 5 Sep 2023 15:49:05 +0200 Subject: [PATCH 41/54] feat(donate.php): adding xmr and qr for ahwx --- donate.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/donate.php b/donate.php index 4140ab2..4653ba4 100644 --- a/donate.php +++ b/donate.php @@ -39,7 +39,7 @@ src="/static/images/xmr.png" height="160" width="160" - alt="xmr qr code" + alt="xmr qr code (hnhx)" />
@@ -52,6 +52,21 @@ > +
+
+

Monero [XMR]

+

+ 4ArntPzKpu32s4z2XqYhyaY1eUeUBKtCzJqEqxWtF5mCi5vR6sdhh32Hd2fk9FjeUxYDtaaUexUqoRNxrgfrtuXs4XpgMNJ +

+
+ xmr qr code (ahwx) +
+
Date: Tue, 5 Sep 2023 15:50:00 +0200 Subject: [PATCH 42/54] feat(xmr-ahwx.png): adding ahwx' xmr' qr code --- static/images/xmr-ahwx.png | Bin 0 -> 2235 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 static/images/xmr-ahwx.png diff --git a/static/images/xmr-ahwx.png b/static/images/xmr-ahwx.png new file mode 100644 index 0000000000000000000000000000000000000000..fa0c79db086f701b3ce66708fccdd699ab1a511a GIT binary patch literal 2235 zcmcgteN0nV6o29ef^%6=(M{)EGF=o66-1@9Ad2$gS{$W-;ur`xTjjHq0u|~UlT4kT zbj}uDW8B)6Vv7c?Ti3#L0Ws3fw2V=BEvQf_@JfO5Xrb*MF4@N```4S?oZNfQIrp63 z`Q3BBIzWzI>ido_002v4W1p#Cw@$qT045Fq%;^At{}upN=GXl6F#$bTbYy>Y6e`hS-=pB5!Y4oG zAOn@@ujc6S-5LP!R>np}CYI<&pvc^z?aOyP{qAK?mwVF}Cz@;hk9F*GW=%=i>IPia z!3gEL(Op)j{baZi@Tv$apAQ(}K-#E*c_ zASTOEY<5V(o9K0^b~f1TyX4VZo7e4WIQ7OaUO@|%Jc=Rv$m)6eVNf^%;&17-a(bWv zHc{-XrXeb)Q`Yd{mDWEdY4o@h7F`3uN~S_oB>^A8(|w%>GcbS&E4@GJKF2b*|Db4M z>G@uKbC!{%pA_Sf_3<+W;*_d@wKgTc3>Zu(ivgf&_OMZkSosS`74iniQ(V} zBGhw%T^nS#lDGpr&zYkswO)aVN3L4ZQENupxutIfJ?IeJh*MM@F8&1k#oi2~&T zMJoxIRpt`{OcRh($r^DXL|e~U_99sdHoKdmN|B+bq+eH*rw=W&(R$$>43&8~(<|WL ztU?jaoT$!660;FdL1Fg@%U!TVf2&a1-$)x+fGuvz%Z+IA+J|V+!L}V~2Bk(pR$gc5 zbrxxxwmAT+j&cFL-=3?5$90WXDGlWesGU<`9?>$z)QMTVq;r$fF{NUz%ZJfXI?0POgGgYG}w(@g{djme94w@h%p- zS*XQ3PLlbq8s6`uFz*ij&jfDec5w%z_eUI%Mnj`ChEyR$!hna%eKBRZA zjA+9)k`gh)$HFTHdtqX(b}}7SxoM_QkVhti4k&vLCMPG6VryCvUD9>=81jCF(EjT_DIU|%D#ObeUBJZ^hY zJsRiyx>_>HtL1G1%QERs(k+Sf)0#OF{aIJtkgEspQu4+Q+ghGdg+w=1U@Uig@<~{^ zdZgm!fSA?`O@}h2Mu^B&7|)l{AKT+R0=UNWBX`da$uY~PS+!*@k+4bvGq^O)9B$h- z_O-UQ4yOKbL=WDfAPl;hWhS&LG#Ol)*5KJX41%lCUI53V^}NQv(CQtybfuMZx%wOQ zM_*sGH>D^mqbM7nS(uFqAP5%}yagA!1s9UIH5k8bCw}Yp02~gF!ztr|W&bhA$;+Z0 XE&YFkCw}*3r~weWmmDSCoqqaH!H?al literal 0 HcmV?d00001 From c9ff9a0de863ef6ebe6e70ae5c5e0e5bca19c035 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 5 Sep 2023 23:42:06 +0200 Subject: [PATCH 43/54] feat(instances.json): add librey.baczek.me --- instances.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instances.json b/instances.json index 43a2972..50043cc 100644 --- a/instances.json +++ b/instances.json @@ -105,6 +105,13 @@ "country": "FI", "librey": true }, + { + "clearnet": "https://librey.baczek.me/", + "tor": null, + "i2p": null, + "country": "PL", + "librey": true + }, { "clearnet": "https://lx.owo.si/", "tor": "http://lx.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/", From f79e4f5026ffe94c86255af7ac13e7313df52d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ber=C3=A9nyi=20Bence?= <69584313+drinkmonster@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:47:12 +0200 Subject: [PATCH 44/54] edit domain --- instances.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instances.json b/instances.json index 50043cc..e34d2f9 100644 --- a/instances.json +++ b/instances.json @@ -112,6 +112,13 @@ "country": "PL", "librey": true }, + { + "clearnet": "https://lx.benike.me/", + "tor": null, + "i2p": null, + "country": "DE", + "librey": true + }, { "clearnet": "https://lx.owo.si/", "tor": "http://lx.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/", @@ -146,13 +153,6 @@ "i2p": null, "country": "PL", "librey": false - }, - { - "clearnet": "https://lx.benike.monster/", - "tor": null, - "i2p": null, - "country": "DE", - "librey": false } ] } From c70436b25790fd8466b5c8548a750b20980ae1b4 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 6 Sep 2023 12:07:38 +0100 Subject: [PATCH 45/54] Move checking for frontends to printing instead of parsing --- engines/ahmia/hidden_service.php | 4 ++-- engines/bittorrent/merge.php | 2 +- engines/invidious/video.php | 4 ++-- engines/qwant/image.php | 4 ++-- engines/special/wikipedia.php | 2 +- engines/text/duckduckgo.php | 8 ++------ engines/text/google.php | 1 - engines/text/text.php | 33 ++++++++++++++------------------ misc/search_engine.php | 4 ++-- misc/tools.php | 5 ++--- 10 files changed, 28 insertions(+), 39 deletions(-) diff --git a/engines/ahmia/hidden_service.php b/engines/ahmia/hidden_service.php index 5ef9e39..4786980 100644 --- a/engines/ahmia/hidden_service.php +++ b/engines/ahmia/hidden_service.php @@ -32,8 +32,8 @@ return $results; } - public static function print_results($results) { - TextSearch::print_results($results); + public static function print_results($results, $opts) { + TextSearch::print_results($results, $opts); } } ?> diff --git a/engines/bittorrent/merge.php b/engines/bittorrent/merge.php index 7d5caae..08bd0f7 100644 --- a/engines/bittorrent/merge.php +++ b/engines/bittorrent/merge.php @@ -34,7 +34,7 @@ return $results; } - public static function print_results($results) { + public static function print_results($results, $opts) { echo "
"; if (empty($results)) { diff --git a/engines/invidious/video.php b/engines/invidious/video.php index 230bc19..c4c5d0e 100644 --- a/engines/invidious/video.php +++ b/engines/invidious/video.php @@ -14,7 +14,6 @@ if ($response["type"] == "video") { $title = $response["title"]; $url = "https://youtube.com/watch?v=" . $response["videoId"]; - $url = check_for_privacy_frontend($url, $this->opts); $uploader = $response["author"]; $views = $response["viewCount"]; $date = $response["publishedText"]; @@ -37,12 +36,13 @@ return $results; } - public static function print_results($results) { + public static function print_results($results, $opts) { echo "
"; foreach($results as $result) { $title = $result["title"]; $url = $result["url"]; + $url = check_for_privacy_frontend($url, $opts); $base_url = $result["base_url"]; $uploader = $result["uploader"]; $views = $result["views"]; diff --git a/engines/qwant/image.php b/engines/qwant/image.php index 9dd9db0..c26dd04 100644 --- a/engines/qwant/image.php +++ b/engines/qwant/image.php @@ -24,7 +24,6 @@ $encoded_url_split1 = explode("==/", $encoded_url)[1]; $encoded_url_split2 = explode("?position", $encoded_url_split1)[0]; $real_url = urldecode(base64_decode($encoded_url_split2)); - $real_url = check_for_privacy_frontend($real_url, $this->opts); $alt = $image->getAttribute("alt"); $thumbnail = urlencode($image->getAttribute("src")); @@ -43,7 +42,7 @@ return $results; } - public static function print_results($results) { + public static function print_results($results, $opts) { echo "
"; foreach($results as $result) @@ -51,6 +50,7 @@ $thumbnail = urlencode($result["thumbnail"]); $alt = $result["alt"]; $url = $result["url"]; + $url = check_for_privacy_frontend($url, $opts); echo ""; echo ""; diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index a5b2a1f..0ee11d2 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -20,7 +20,7 @@ $description = substr($first_page["extract"], 0, 250) . "..."; - $source = check_for_privacy_frontend("https://$this->wikipedia_language.wikipedia.org/wiki/$this->query", $this->opts); + $source = "https://$this->wikipedia_language.wikipedia.org/wiki/$this->query"; $response = array( "special_response" => array( "response" => htmlspecialchars($description), diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 5fa8264..0d814e8 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -30,23 +30,19 @@ if (!$xpath) return $results; - foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div[contains(@class, 'web-result')]/div") as $result) - { + foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div[contains(@class, 'web-result')]/div") as $result) { $url = $xpath->evaluate(".//h2[@class='result__title']//a/@href", $result)[0]; if ($url == null) continue; - if (!empty($results)) // filter duplicate results - { + if (!empty($results)) // filter duplicate results { if (end($results)["url"] == $url->textContent) continue; } $url = $url->textContent; - $url = check_for_privacy_frontend($url, $this->opts); - $title = $xpath->evaluate(".//h2[@class='result__title']", $result)[0]; $description = $xpath->evaluate(".//a[@class='result__snippet']", $result)[0]; diff --git a/engines/text/google.php b/engines/text/google.php index eaff127..280a4c5 100644 --- a/engines/text/google.php +++ b/engines/text/google.php @@ -53,7 +53,6 @@ } $url = $url->textContent; - $url = check_for_privacy_frontend($url, $this->opts); $title = $xpath->evaluate(".//h3", $result)[0]; $description = $xpath->evaluate(".//div[contains(@class, 'VwiC3b')]", $result)[0]; diff --git a/engines/text/text.php b/engines/text/text.php index 7d97df7..57c2f33 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -55,7 +55,7 @@ return $results; } - public static function print_results($results) { + public static function print_results($results, $opts) { if (empty($results)) { echo "

An error occured fetching results

"; @@ -69,8 +69,7 @@ $special = $results[0]; - if (array_key_exists("did_you_mean", $special)) - { + if (array_key_exists("did_you_mean", $special)) { $didyoumean = $special["did_you_mean"]; $new_url = "/search.php?q=" . urlencode($didyoumean); echo "

Did you mean "; @@ -78,32 +77,33 @@ echo "?

"; } - if (array_key_exists("special_response", $special)) - { + if (array_key_exists("special_response", $special)) { $response = $special["special_response"]["response"]; $source = $special["special_response"]["source"]; echo "

"; - if (array_key_exists("image", $special["special_response"])) - { + if (array_key_exists("image", $special["special_response"])) { $image_url = $special["special_response"]["image"]; echo ""; } echo $response; - if ($source) + if ($source) { + $source = check_for_privacy_frontend($source, $opts); echo "$source"; + } echo "

"; } echo "
"; - foreach($results as $result) - { + foreach($results as $result) { if (!array_key_exists("title", $result)) continue; $title = $result["title"]; $url = $result["url"]; + $url = check_for_privacy_frontend($url, $opts); + $base_url = $result["base_url"]; $description = $result["description"]; @@ -120,8 +120,7 @@ } } - function check_ddg_bang($query, $opts) - { + function check_ddg_bang($query, $opts) { $bangs_json = file_get_contents("static/misc/ddg_bang.json"); $bangs = json_decode($bangs_json, true); @@ -133,22 +132,18 @@ $bang_url = null; - foreach($bangs as $bang) - { - if ($bang["t"] == $search_word) - { + foreach($bangs as $bang) { + if ($bang["t"] == $search_word) { $bang_url = $bang["u"]; break; } } - if ($bang_url) - { + if ($bang_url) { $bang_query_array = explode("!" . $search_word, $query); $bang_query = trim(implode("", $bang_query_array)); $request_url = str_replace("{{{s}}}", str_replace('%26quot%3B','%22', urlencode($bang_query)), $bang_url); - $request_url = check_for_privacy_frontend($request_url, $opts); header("Location: " . $request_url); die(); diff --git a/misc/search_engine.php b/misc/search_engine.php index 79398cf..6021ee6 100644 --- a/misc/search_engine.php +++ b/misc/search_engine.php @@ -54,7 +54,7 @@ return $results; } - static public function print_results($results){} + public static function print_results($results, $opts) {} } function load_opts() { @@ -165,7 +165,7 @@ return $results; print_elapsed_time($start_time); - $search_category->print_results($results); + $search_category->print_results($results, $opts); return $results; } diff --git a/misc/tools.php b/misc/tools.php index f210bf0..389fc24 100644 --- a/misc/tools.php +++ b/misc/tools.php @@ -1,8 +1,7 @@ Date: Wed, 6 Sep 2023 12:23:59 +0100 Subject: [PATCH 46/54] Move base_url parsing to print results --- engines/ahmia/hidden_service.php | 1 + engines/invidious/video.php | 3 ++- engines/text/duckduckgo.php | 1 + engines/text/google.php | 1 + engines/text/text.php | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/ahmia/hidden_service.php b/engines/ahmia/hidden_service.php index 4786980..a547078 100644 --- a/engines/ahmia/hidden_service.php +++ b/engines/ahmia/hidden_service.php @@ -23,6 +23,7 @@ array ( "title" => $title ? htmlspecialchars($title) : "No description provided", "url" => htmlspecialchars($url), + // base_url is to be removed in the future, see #47 "base_url" => htmlspecialchars(get_base_url($url)), "description" => htmlspecialchars($description) ) diff --git a/engines/invidious/video.php b/engines/invidious/video.php index c4c5d0e..a5ac593 100644 --- a/engines/invidious/video.php +++ b/engines/invidious/video.php @@ -23,6 +23,7 @@ array ( "title" => htmlspecialchars($title), "url" => htmlspecialchars($url), + // base_url is to be removed in the future, see #47 "base_url" => htmlspecialchars(get_base_url($url)), "uploader" => htmlspecialchars($uploader), "views" => htmlspecialchars($views), @@ -43,7 +44,7 @@ $title = $result["title"]; $url = $result["url"]; $url = check_for_privacy_frontend($url, $opts); - $base_url = $result["base_url"]; + $base_url = get_base_url($url); $uploader = $result["uploader"]; $views = $result["views"]; $date = $result["date"]; diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 0d814e8..3ee4a9f 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -50,6 +50,7 @@ array ( "title" => htmlspecialchars($title->textContent), "url" => htmlspecialchars($url), + // base_url is to be removed in the future, see #47 "base_url" => htmlspecialchars(get_base_url($url)), "description" => $description == null ? "No description was provided for this site." : diff --git a/engines/text/google.php b/engines/text/google.php index 280a4c5..814eb47 100644 --- a/engines/text/google.php +++ b/engines/text/google.php @@ -61,6 +61,7 @@ array ( "title" => htmlspecialchars($title->textContent), "url" => htmlspecialchars($url), + // base_url is to be removed in the future, see #47 "base_url" => htmlspecialchars(get_base_url($url)), "description" => $description == null ? "No description was provided for this site." : diff --git a/engines/text/text.php b/engines/text/text.php index 57c2f33..e665f7c 100644 --- a/engines/text/text.php +++ b/engines/text/text.php @@ -104,7 +104,7 @@ $url = $result["url"]; $url = check_for_privacy_frontend($url, $opts); - $base_url = $result["base_url"]; + $base_url = get_base_url($url); $description = $result["description"]; echo "
"; From 5512e5da8040834c71b021b6c48c4a226a3e6d9d Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 7 Sep 2023 17:59:39 +0200 Subject: [PATCH 47/54] feat(auto_updater.sh): adding auto updater like LibreX used to have --- auto_updater.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 auto_updater.sh diff --git a/auto_updater.sh b/auto_updater.sh new file mode 100644 index 0000000..798ca23 --- /dev/null +++ b/auto_updater.sh @@ -0,0 +1,6 @@ +#!/bin/sh +while true; do + git stash + git pull + sleep 60 +done From d0499bafc0f03b832905481c700462e6f20147cd Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 7 Sep 2023 18:18:07 +0200 Subject: [PATCH 48/54] feat(instances.json): adding @Ahwxorg's 2nd instance in france --- instances.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/instances.json b/instances.json index e34d2f9..38a97c8 100644 --- a/instances.json +++ b/instances.json @@ -2,11 +2,18 @@ "instances": [ { "clearnet": "https://search.ahwx.org/", - "tor": "http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/", + "tor": "http://wn5jl6fxlzzfenlyu3lc4q7jpw2saplrywxvxtvqbguotwd4y5cjeuqd.onion/", "i2p": null, "country": "NL", "librey": true }, + { + "clearnet": "https://search2.ahwx.org/", + "tor": "http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/", + "i2p": null, + "country": "FR", + "librey": true + }, { "clearnet": "https://librex.me/", "tor": "http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/", From 6a1dea2581a17102971aae7b833138b49efe816c Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 9 Sep 2023 14:07:34 +0100 Subject: [PATCH 49/54] Use language list for wikipedia --- engines/special/wikipedia.php | 12 +++++++----- static/misc/languages.json | 1 + static/misc/wikipedia_langs.json | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 static/misc/languages.json delete mode 100644 static/misc/wikipedia_langs.json diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index 0ee11d2..ad8effb 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -1,13 +1,15 @@ wikipedia_language = $this->opts->language; + $this->wikipedia_domain = "wikipedia.org"; $query_encoded = urlencode($this->query); - if (!in_array($this->wikipedia_language, json_decode(file_get_contents("static/misc/wikipedia_langs.json"), true))) - $this->wikipedia_language = "en"; + $languages = json_decode(file_get_contents("static/misc/languages.json"), true); - return "https://$this->wikipedia_language.wikipedia.org/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded"; + if (array_key_exists($this->opts->language, $languages)) + $this->wikipedia_domain = $languages[$this->opts->language]["wikipedia"] . ".wikipedia.org"; + + return "https://$this->wikipedia_domain/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded"; } public function parse_results($response) { @@ -20,7 +22,7 @@ $description = substr($first_page["extract"], 0, 250) . "..."; - $source = "https://$this->wikipedia_language.wikipedia.org/wiki/$this->query"; + $source = "https://$this->wikipedia_domain/wiki/$this->query"; $response = array( "special_response" => array( "response" => htmlspecialchars($description), diff --git a/static/misc/languages.json b/static/misc/languages.json new file mode 100644 index 0000000..c55a0f8 --- /dev/null +++ b/static/misc/languages.json @@ -0,0 +1 @@ +{"af": {"name": "Afrikaans", "wikipedia": "af"}, "ak": {"name": "Akan", "wikipedia": "ak"}, "sq": {"name": "Albanian", "wikipedia": "sq"}, "ws": {"name": "Samoa", "wikipedia": "ws"}, "am": {"name": "Amharic", "wikipedia": "am"}, "ar": {"name": "Arabic", "wikipedia": "ar"}, "hy": {"name": "Armenian", "wikipedia": "hy"}, "az": {"name": "Azerbaijani", "wikipedia": "az"}, "eu": {"name": "Basque", "wikipedia": "eu"}, "be": {"name": "Belarusian", "wikipedia": "be"}, "bem": {"name": "Bemba", "wikipedia": ""}, "bn": {"name": "Bengali", "wikipedia": "bn"}, "bh": {"name": "Bihari", "wikipedia": "bh"}, "xx-bork": {"name": "Bork, bork, bork!", "wikipedia": ""}, "bs": {"name": "Bosnian", "wikipedia": "bs"}, "br": {"name": "Breton", "wikipedia": "br"}, "bg": {"name": "Bulgarian", "wikipedia": "bg"}, "bt": {"name": "Bhutanese", "wikipedia": ""}, "km": {"name": "Cambodian", "wikipedia": ""}, "ca": {"name": "Catalan", "wikipedia": "ca"}, "chr": {"name": "Cherokee", "wikipedia": "chr"}, "ny": {"name": "Chichewa", "wikipedia": "ny"}, "zh-cn": {"name": "Chinese (Simplified)", "wikipedia": "zh"}, "zh-tw": {"name": "Chinese (Traditional)", "wikipedia": "zh-classical"}, "co": {"name": "Corsican", "wikipedia": "co"}, "hr": {"name": "Croatian", "wikipedia": "hr"}, "cs": {"name": "Czech", "wikipedia": "cs"}, "da": {"name": "Danish", "wikipedia": "da"}, "nl": {"name": "Dutch", "wikipedia": "nl"}, "xx-elmer": {"name": "Elmer Fudd", "wikipedia": ""}, "en": {"name": "English", "wikipedia": "en"}, "eo": {"name": "Esperanto", "wikipedia": "eo"}, "et": {"name": "Estonian", "wikipedia": "et"}, "ee": {"name": "Ewe", "wikipedia": "ee"}, "fo": {"name": "Faroese", "wikipedia": "fo"}, "tl": {"name": "Filipino", "wikipedia": "tl"}, "fi": {"name": "Finnish", "wikipedia": "fi"}, "fr": {"name": "French", "wikipedia": "fr"}, "fy": {"name": "Frisian", "wikipedia": "fy"}, "gaa": {"name": "Ga", "wikipedia": ""}, "gl": {"name": "Galician", "wikipedia": "gl"}, "ka": {"name": "Georgian", "wikipedia": "ka"}, "de": {"name": "German", "wikipedia": "de"}, "el": {"name": "Greek", "wikipedia": "el"}, "kl": {"name": "Greenlandic", "wikipedia": "kl"}, "gn": {"name": "Guarani", "wikipedia": "gn"}, "gu": {"name": "Gujarati", "wikipedia": "gu"}, "xx-hacker": {"name": "Hacker", "wikipedia": ""}, "ht": {"name": "Haitian Creole", "wikipedia": "ht"}, "ha": {"name": "Hausa", "wikipedia": "ha"}, "haw": {"name": "Hawaiian", "wikipedia": "haw"}, "iw": {"name": "Hebrew", "wikipedia": "he"}, "hi": {"name": "Hindi", "wikipedia": "hi"}, "hu": {"name": "Hungarian", "wikipedia": "hu"}, "is": {"name": "Icelandic", "wikipedia": "is"}, "ig": {"name": "Igbo", "wikipedia": "ig"}, "id": {"name": "Indonesian", "wikipedia": "id"}, "ia": {"name": "Interlingua", "wikipedia": "ia"}, "ga": {"name": "Irish", "wikipedia": "ga"}, "it": {"name": "Italian", "wikipedia": "it"}, "ja": {"name": "Japanese", "wikipedia": "ja"}, "jw": {"name": "Javanese", "wikipedia": "jv"}, "kn": {"name": "Kannada", "wikipedia": "kn"}, "kk": {"name": "Kazakh", "wikipedia": "kk"}, "rw": {"name": "Kinyarwanda", "wikipedia": "rw"}, "rn": {"name": "Kirundi", "wikipedia": "rn"}, "xx-klingon": {"name": "Klingon", "wikipedia": "tlh"}, "kg": {"name": "Kongo", "wikipedia": "kg"}, "ko": {"name": "Korean", "wikipedia": "ko"}, "kri": {"name": "Krio (Sierra Leone)", "wikipedia": ""}, "ku": {"name": "Kurdish", "wikipedia": "ku"}, "ckb": {"name": "Kurdish (Soran\u00ee)", "wikipedia": "ckb"}, "ky": {"name": "Kyrgyz", "wikipedia": "ky"}, "lo": {"name": "Laothian", "wikipedia": "lo"}, "la": {"name": "Latin", "wikipedia": "la"}, "lv": {"name": "Latvian", "wikipedia": "lv"}, "ln": {"name": "Lingala", "wikipedia": "ln"}, "lt": {"name": "Lithuanian", "wikipedia": "lt"}, "loz": {"name": "Lozi", "wikipedia": ""}, "lg": {"name": "Luganda", "wikipedia": "lg"}, "ach": {"name": "Luo", "wikipedia": ""}, "mk": {"name": "Macedonian", "wikipedia": "mk"}, "mg": {"name": "Malagasy", "wikipedia": "mg"}, "my": {"name": "Malay", "wikipedia": "ms"}, "ml": {"name": "Malayalam", "wikipedia": "ml"}, "mt": {"name": "Maltese", "wikipedia": "mt"}, "mv": {"name": "Maldives", "wikipedia": "dv"}, "mi": {"name": "Maori", "wikipedia": "mi"}, "mr": {"name": "Marathi", "wikipedia": "mr"}, "mfe": {"name": "Mauritian Creole", "wikipedia": ""}, "mo": {"name": "Moldavian", "wikipedia": "ro"}, "mn": {"name": "Mongolian", "wikipedia": "mn"}, "sr-me": {"name": "Montenegrin", "wikipedia": "sr"}, "ne": {"name": "Nepali", "wikipedia": "ne"}, "pcm": {"name": "Nigerian Pidgin", "wikipedia": "pcm"}, "nso": {"name": "Northern Sotho", "wikipedia": "nso"}, "no": {"name": "Norwegian", "wikipedia": "no"}, "nn": {"name": "Norwegian (Nynorsk)", "wikipedia": "nn"}, "oc": {"name": "Occitan", "wikipedia": "oc"}, "or": {"name": "Oriya", "wikipedia": ""}, "om": {"name": "Oromo", "wikipedia": "om"}, "ps": {"name": "Pashto", "wikipedia": "ps"}, "fa": {"name": "Persian", "wikipedia": "fa"}, "xx-pirate": {"name": "Pirate", "wikipedia": ""}, "pl": {"name": "Polish", "wikipedia": "pl"}, "pt": {"name": "Portuguese", "wikipedia": "pt"}, "pt-br": {"name": "Portuguese (Brazil)", "wikipedia": "pt"}, "pt-pt": {"name": "Portuguese (Portugal)", "wikipedia": "pt"}, "pa": {"name": "Punjabi", "wikipedia": "pa"}, "qu": {"name": "Quechua", "wikipedia": "qu"}, "ro": {"name": "Romanian", "wikipedia": "ro"}, "rm": {"name": "Romansh", "wikipedia": "rm"}, "nyn": {"name": "Runyakitara", "wikipedia": ""}, "ru": {"name": "Russian", "wikipedia": "ru"}, "gd": {"name": "Scots Gaelic", "wikipedia": "gd"}, "sr": {"name": "Serbian", "wikipedia": "sr"}, "sh": {"name": "Serbo-Croatian", "wikipedia": "sh"}, "st": {"name": "Sesotho", "wikipedia": "st"}, "tn": {"name": "Setswana", "wikipedia": "tn"}, "crs": {"name": "Seychellois Creole", "wikipedia": ""}, "sn": {"name": "Shona", "wikipedia": "sn"}, "sd": {"name": "Sindhi", "wikipedia": "sd"}, "si": {"name": "Sinhalese", "wikipedia": "si"}, "sk": {"name": "Slovak", "wikipedia": "sk"}, "sl": {"name": "Slovenian", "wikipedia": "sl"}, "so": {"name": "Somali", "wikipedia": "so"}, "es": {"name": "Spanish", "wikipedia": "es"}, "es-419": {"name": "Spanish (Latin American)", "wikipedia": "es"}, "su": {"name": "Sundanese", "wikipedia": "su"}, "sw": {"name": "Swahili", "wikipedia": "sw"}, "sv": {"name": "Swedish", "wikipedia": "sv"}, "tg": {"name": "Tajik", "wikipedia": "tg"}, "ta": {"name": "Tamil", "wikipedia": "ta"}, "tt": {"name": "Tatar", "wikipedia": "tt"}, "te": {"name": "Telugu", "wikipedia": "te"}, "th": {"name": "Thai", "wikipedia": "th"}, "ti": {"name": "Tigrinya", "wikipedia": "ti"}, "to": {"name": "Tonga", "wikipedia": "to"}, "lua": {"name": "Tshiluba", "wikipedia": ""}, "tum": {"name": "Tumbuka", "wikipedia": "tum"}, "tr": {"name": "Turkish", "wikipedia": "tr"}, "tk": {"name": "Turkmen", "wikipedia": "tk"}, "tw": {"name": "Twi", "wikipedia": "tw"}, "ug": {"name": "Uighur", "wikipedia": "ug"}, "uk": {"name": "Ukrainian", "wikipedia": "uk"}, "ur": {"name": "Urdu", "wikipedia": "ur"}, "uz": {"name": "Uzbek", "wikipedia": "uz"}, "vu": {"name": "Vanuatu", "wikipedia": ""}, "vi": {"name": "Vietnamese", "wikipedia": "vi"}, "cy": {"name": "Welsh", "wikipedia": "cy"}, "wo": {"name": "Wolof", "wikipedia": "wo"}, "xh": {"name": "Xhosa", "wikipedia": "xh"}, "yi": {"name": "Yiddish", "wikipedia": "yi"}, "yo": {"name": "Yoruba", "wikipedia": "yo"}, "zu": {"name": "Zulu", "wikipedia": "zu"}} diff --git a/static/misc/wikipedia_langs.json b/static/misc/wikipedia_langs.json deleted file mode 100644 index 6d7c1a5..0000000 --- a/static/misc/wikipedia_langs.json +++ /dev/null @@ -1 +0,0 @@ -["ab","ace","ady","af","ak","als","am","an","ang","ar","arc","ary","arz","as","ast","atj","av","avk","awa","ay","az","azb","ba","ban","bar","bat-smg","bcl","be","be-tarask","bg","bh","bi","bjn","bm","bn","bo","bpy","br","bs","bug","bxr","ca","cbk-zam","cdo","ce","ceb","ch","chr","chy","ckb","co","cr","crh","cs","csb","cu","cv","cy","da","de","din","diq","dsb","dty","dv","dz","ee","el","eml","en","eo","es","et","eu","ext","fa","ff","fi","fiu-vro","fj","fo","fr","frp","frr","fur","fy","ga","gag","gan","gcr","gd","gl","glk","gn","gom","gor","got","gu","gv","ha","hak","haw","he","hi","hif","hr","hsb","ht","hu","hy","hyw","ia","id","ie","ig","ik","ilo","inh","io","is","it","iu","ja","jam","jbo","jv","ka","kaa","kab","kbd","kbp","kg","ki","kk","kl","km","kn","ko","koi","krc","ks","ksh","ku","kv","kw","ky","la","lad","lb","lbe","lez","lfn","lg","li","lij","lld","lmo","ln","lo","lt","ltg","lv","mad","mai","map-bms","mdf","mg","mhr","mi","min","mk","ml","mn","mnw","mr","mrj","ms","mt","mwl","my","myv","mzn","na","nah","nap","nds","nds-nl","ne","new","nia","nl","nn","no","nostalgia","nov","nqo","nrm","nso","nv","ny","oc","olo","om","or","os","pa","pag","pam","pap","pcd","pdc","pfl","pi","pih","pl","pms","pnb","pnt","ps","pt","qu","rm","rmy","rn","ro","roa-rup","roa-tara","ru","rue","rw","sa","sah","sat","sc","scn","sco","sd","se","sg","sh","shn","si","simple","sk","skr","sl","sm","smn","sn","so","sq","sr","srn","ss","st","stq","su","sv","sw","szl","szy","ta","tcy","te","tet","tg","th","ti","tk","tl","tn","to","tpi","tr","ts","tt","tum","tw","ty","tyv","udm","ug","uk","ur","uz","ve","vec","vep","vi","vls","vo","wa","war","wo","wuu","xal","xh","xmf","yi","yo","za","zea","zh","zh-classical","zh-min-nan","zh-yue","zu","zh-hans","zh-hant","zh-cn","zh-hk","zh-mo","zh-my","zh-sg","zh-tw"] From e99670628d3bc2214a01d7aa0f9f8801f3425ba7 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 9 Sep 2023 14:28:04 +0100 Subject: [PATCH 50/54] Use languages list to generate dropdown in settings --- settings.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/settings.php b/settings.php index f52b64e..9baeacd 100644 --- a/settings.php +++ b/settings.php @@ -1,6 +1,5 @@ @@ -59,7 +60,7 @@ "; - if (isset($_COOKIE["theme"])) { + if (isset($opts->theme)) { $theme = $opts->theme; $themes = str_replace($theme . "\"", $theme . "\" selected", $themes); } @@ -97,10 +98,22 @@
Language +
From 049272c043e853f6c1761b12a846c06ab9a23aef Mon Sep 17 00:00:00 2001 From: davidovski Date: Sat, 9 Sep 2023 14:45:29 +0100 Subject: [PATCH 51/54] Fix typo in duckduckgo --- engines/text/duckduckgo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 3ee4a9f..da35f93 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -36,7 +36,7 @@ if ($url == null) continue; - if (!empty($results)) // filter duplicate results { + if (!empty($results)) { // filter duplicate results if (end($results)["url"] == $url->textContent) continue; } From 6867fcceb62c5d3a6c1c49c87284d17ff5847c0e Mon Sep 17 00:00:00 2001 From: Revvy Date: Sat, 16 Sep 2023 20:40:44 -0400 Subject: [PATCH 52/54] librex.supernets.org --- instances.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/instances.json b/instances.json index 38a97c8..e9a7596 100644 --- a/instances.json +++ b/instances.json @@ -126,6 +126,13 @@ "country": "DE", "librey": true }, + { + "clearnet": "https://librex.supernets.org/", + "tor": null, + "i2p": null, + "country": "US", + "librey": true + }, { "clearnet": "https://lx.owo.si/", "tor": "http://lx.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/", From b01219c8c6397ce07e1001b5d9505dfeb357fd84 Mon Sep 17 00:00:00 2001 From: Revvy Date: Thu, 21 Sep 2023 20:52:38 -0400 Subject: [PATCH 53/54] add/remove instances --- instances.json | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/instances.json b/instances.json index e9a7596..88f0aac 100644 --- a/instances.json +++ b/instances.json @@ -106,11 +106,11 @@ "librey": true }, { - "clearnet": "https://librex.yogeshlamichhane.com.np/", - "tor": null, - "i2p": null, - "country": "FI", - "librey": true + "clearnet": "https://librex.yogeshlamichhane.com.np/", + "tor": null, + "i2p": null, + "country": "FI", + "librey": true }, { "clearnet": "https://librey.baczek.me/", @@ -134,18 +134,11 @@ "librey": true }, { - "clearnet": "https://lx.owo.si/", - "tor": "http://lx.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/", - "i2p": "http://d4vi3tvfui2rfzsxr33tin4a6542heulf4mhkokdpbhbcejlg3la.b32.i2p/", - "country": "DE", - "librey": false - }, - { - "clearnet": "https://search.tildevarsh.in/", + "clearnet": "https://search.seitan-ayoub.lol/", "tor": null, "i2p": null, - "country": "IN", - "librey": false + "country": "DE", + "librey": true }, { "clearnet": "https://librex.myroware.eu/", From 420949d4b7feb27e9868e57b7e70437f6de14a56 Mon Sep 17 00:00:00 2001 From: Revvy Date: Mon, 25 Sep 2023 20:13:45 -0400 Subject: [PATCH 54/54] supernets onion --- instances.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instances.json b/instances.json index 88f0aac..3ccf3ce 100644 --- a/instances.json +++ b/instances.json @@ -49,6 +49,13 @@ "country": "US", "librey": true }, + { + "clearnet": "https://librex.supernets.org/", + "tor": "http://ouosr2fq3lktngcvbz4r4op2lab5hbiz5y6g6toorsgieb7elet76jad.onion/", + "i2p": null, + "country": "US", + "librey": true + }, { "clearnet": "https://search.davidovski.xyz/", "tor": null, @@ -126,13 +133,6 @@ "country": "DE", "librey": true }, - { - "clearnet": "https://librex.supernets.org/", - "tor": null, - "i2p": null, - "country": "US", - "librey": true - }, { "clearnet": "https://search.seitan-ayoub.lol/", "tor": null,