LibreY

- privacy respecting meta search engine
git clone git://git.acid.vegas/LibreY.git
Log | Files | Refs | Archive | README | LICENSE

README.md (10879B)

      1 
      2 ### Introduction
      3 
      4 - [Introduction](#introduction)
      5   - [Running a docker container](#running-a-docker-container)
      6   - [Running a Docker container through ghcr](#running-a-docker-container-through-ghcr)
      7   - [Running a Docker container with composer](#running-a-docker-container-with-composer)
      8   - [Environment variables that can be set in the Docker container](#environment-variables-that-can-be-set-in-the-docker-container)
      9     - [Search Configuration](#search)
     10     - [Frontend Configuration](#frontends)
     11     - [Search Engine Configuration](#engines)
     12     - [cURL Configuration](#curl)
     13     - [OpenSearch Configuration](#opensearch)
     14 - [Docker version issues](#docker-version-issues)
     15 - [Building a docker image](#building-a-docker-image)
     16 - [Support for different architectures](#support-for-different-architectures)
     17 
     18 ### Running a docker container
     19 
     20 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.
     21 
     22 ### Running a Docker container through ghcr
     23 
     24 To run librey in a docker container, you can simply use the command:
     25 
     26 ```sh
     27 docker run -d \
     28   --name librey \
     29   -e TZ="America/New_York" \
     30   -e CONFIG_GOOGLE_DOMAIN="com" \
     31   -e CONFIG_GOOGLE_LANGUAGE="en" \
     32   -e CONFIG_WIKIPEDIA_LANGUAGE="en" \
     33   -p 8080:8080 \
     34   ghcr.io/ahwxorg/librey:latest
     35 ```
     36 
     37 Also run with watchtower for auto-updating: (optional)
     38 ```sh
     39 docker run -d \
     40   --name librey-watchtower-1 \
     41   -v /var/run/docker.sock:/var/run/docker.sock \
     42   containrrr/watchtower
     43 ```
     44 
     45 <br>
     46 
     47 ### Running a Docker container with composer
     48 
     49 ```yml
     50 version: "3"
     51 services:
     52   librey:
     53     image: ghcr.io/ahwxorg/librey:latest
     54     container_name: librey
     55     network_mode: bridge
     56     ports:
     57       - 8080:8080
     58     environment:
     59       - CONFIG_GOOGLE_DOMAIN=com
     60       - CONFIG_LANGUAGE=en
     61       - CONFIG_NUMBER_OF_RESULTS=10
     62       - CONFIG_INVIDIOUS_INSTANCE=https://invidious.snopyta.org
     63       - CONFIG_DISABLE_BITTORRENT_SEARCH=false
     64       - CONFIG_HIDDEN_SERVICE_SEARCH=false
     65       - CONFIG_INSTANCE_FALLBACK=true
     66       - CONFIG_RATE_LIMIT_COOLDOWN=25
     67       - CONFIG_CACHE_TIME=20
     68       - CONFIG_TEXT_SEARCH_ENGINE=google
     69       - CURLOPT_PROXY_ENABLED=false
     70       - CURLOPT_PROXY=192.0.2.53:8388
     71       - CURLOPT_PROXYTYPE=CURLPROXY_HTTP
     72       - CURLOPT_USERAGENT=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0
     73       - CURLOPT_FOLLOWLOCATION=true
     74     volumes:
     75       - ./nginx_logs:/var/log/nginx
     76       - ./php_logs:/var/log/php7
     77     restart: unless-stopped
     78   watchtower: # Watchtower is not required but highly recommended, since Watchtower will re-pull and restart the LibreY container automatically whenever there's an update.
     79     image: containrrr/watchtower
     80     volumes:
     81       - /var/run/docker.sock:/var/run/docker.sock
     82 ```
     83 
     84 <br>
     85 
     86 ### Environment variables that can be set in the Docker container
     87 
     88 This docker image was developed with high configurability in mind, so here is the list of environment variables that can be changed according to your use case, no matter how specific.
     89 
     90 <br>
     91 
     92 ### Search
     93 
     94 | Variables | Default | Examples | Description |
     95 |:----------|:-------------|:---------|:------|
     96 | CONFIG_GOOGLE_DOMAIN | "com" | "com", "com.br", "cat", "se" | Defines which Google domain the search will be done on, change according to your country. |
     97 | 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). |
     98 | CONFIG_NUMBER_OF_RESULTS  | 10 | integer | Number of results for Google to return each page. |
     99 | CONFIG_INVIDIOUS_INSTANCE | "https://invidious.snopyta.org" | string | Defines the host that will be used to do video searches using Invidious. |
    100 | CONFIG_DISABLE_BITTORRENT_SEARCH | false | boolean | Defines whether bittorrent search will be disabled |
    101 | 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. |
    102 | CONFIG_HIDDEN_SERVICE_SEARCH | false | boolean | Defines whether hidden service search will be disabled |
    103 | 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. |
    104 | CONFIG_RATE_LIMIT_COOLDOWN | 25 | integer | Time in minutes to wait before sending requests to Google again after a rate limit. |
    105 | CONFIG_CACHE_TIME | 20 | integer | Time in minutes to store results for in the cache. |
    106 
    107 ### Frontends
    108 | Variables | Default | Examples | Description |
    109 |:----------|:-------------|:---------|:------|
    110 | APP_INVIDIOUS | "" | "https://example.com", string | Integration with external self-hosted apps, configure the desired host. |
    111 | APP_RIMGO | "" | string | Integration with external self-hosted apps, configure the desired host. |
    112 | APP_SCRIBE | "" | string | Integration with external self-hosted apps, configure the desired host. |
    113 | APP_GOTHUB | "" | string | Integration with external self-hosted apps, configure the desired host. |
    114 | APP_NITTER | "" | string | Integration with external self-hosted apps, configure the desired host. |
    115 | APP_LIBREREDDIT | "" | string | Integration with external self-hosted apps, configure the desired host. |
    116 | APP_PROXITOK | "" | string | Integration with external self-hosted apps, configure the desired host. |
    117 | APP_WIKILESS | "" | string | Integration with external self-hosted apps, configure the desired host. |
    118 | APP_QUETRE | "" | string | Integration with external self-hosted apps, configure the desired host. |
    119 | APP_LIBREMDB | "" | string | Integration with external self-hosted apps, configure the desired host. |
    120 | APP_BREEZEWIKI | "" | string | Integration with external self-hosted apps, configure the desired host. |
    121 | APP_ANONYMOUS_OVERFLOW | "" | string | Integration with external self-hosted apps, configure the desired host. |
    122 | APP_SUDS | "" | string | Integration with external self-hosted apps, configure the desired host. |
    123 | APP_BIBLIOREADS | "" | string | Integration with external self-hosted apps, configure the desired host. |
    124 
    125 ### Engines
    126 | Variables | Default | Examples | Description |
    127 |:----------|:-------------|:---------|:------|
    128 | CONFIG_TEXT_SEARCH_ENGINE | "google" | "google", "duckduckgo" | Integration with external self-hosted apps, configure the desired host. |
    129 
    130 ### cURL
    131 | Variables | Default | Examples | Description |
    132 |:----------|:-------------|:---------|:------|
    133 | CURLOPT_PROXY_ENABLED | false | boolean | If you want to use a proxy, you need to set this variable to true. |
    134 | CURLOPT_PROXY | "" | "192.0.2.53:8388" | Set the proxy using the ip and port to be used. |
    135 | CURLOPT_PROXYTYPE | "CURLPROXY_HTTP" | "CURLPROXY_SOCKS4A", "CURLPROXY_SOCKS5", "CURLPROXY_SOCKS5_HOSTNAME" | Set the type of proxy connection (if you enabled it). |
    136 | CURLOPT_RETURNTRANSFER | true | boolean | Return the transfer as a string of the return value of curl_exec() instead of outputting it directly. |
    137 | CURLOPT_ENCODING | "" | string | Return the transfer as a string of the return value of curl_exec() instead of outputting it directly. |
    138 | 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. |
    139 | CURLOPT_IPRESOLVE | "CURL_IPRESOLVE_WHATEVER" | "CURL_IPRESOLVE_V4", "CURL_IPRESOLVE_V6" | Use a fixed IP version for making requests, or what DNS prefers. |
    140 | CURLOPT_CUSTOMREQUEST | "GET" | "POST", "CONNECT" | Defines the HTTP method that curl will use to make the request. |
    141 | CURLOPT_MAXREDIRS | 5 | integer | The maximum amount of HTTP redirections to follow, only enabled with CURLOPT_FOLLOWLOCATION. |
    142 | CURLOPT_TIMEOUT | 3 | integer | The maximum amount of time for cURL requests to complete. |
    143 | CURLOPT_VERBOSE | false | boolean | Whether to output verbose information. |
    144 | CURLOPT_FOLLOWLOCATION | true | boolean | Whether to follow any Location header. Required for instance fallback. |
    145 
    146 
    147 ### OpenSearch
    148 
    149 | Variables | Default | Examples | Description |
    150 |:----------|:-------------|:---------|:------|
    151 | OPEN_SEARCH_TITLE |  "LibreY" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) |
    152 | OPEN_SEARCH_DESCRIPTION | "Framework and javascript free privacy respecting meta search engine" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) |
    153 | OPEN_SEARCH_ENCODING | "UTF-8" | "UTF-8" | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) |
    154 | OPEN_SEARCH_LONG_NAME | "LibreY Search" | string | [OpenSearch XML](https://developer.mozilla.org/en-US/docs/Web/OpenSearch) |
    155 | OPEN_SEARCH_HOST | "http://localhost:80" | string | Host used to identify librey on the network |
    156 
    157 <br>
    158 
    159 ### Docker version issues
    160 
    161 If you are going to build your own docker image based on this repository, pay attention to your Docker version, because depending on how recent the installed version is, maybe you should use the `buildx` command instead of `build`.
    162 
    163 Docker <= 20.10: `docker build`
    164 
    165 Docker > 20.10: `docker buildx build`
    166 
    167 <br>
    168 
    169 ### Building a docker image
    170 
    171 If you don't want to use the image that is already available on `docker hub`, then you can simply build the Dockerfile directly from the github repository using the command:
    172 
    173 ```sh
    174 docker build https://github.com/Ahwxorg/librey.git -t librey:latest
    175 ```
    176 
    177 ```sh
    178 docker run -d --name librey \
    179     -e CONFIG_GOOGLE_DOMAIN="com" \
    180     -e CONFIG_GOOGLE_LANGUAGE="en" \
    181     -p 8080:8080 \
    182     librey:latest
    183 ```
    184 
    185 Or, instead of doing the build remotely, you still have the opportunity to `git clone` the repository, and build it locally with the command:
    186 
    187 ```sh
    188 git clone https://github.com/Ahwxorg/librey.git
    189 cd librey/
    190 docker build -t librey:latest .
    191 ```
    192 
    193 <br>
    194 
    195 ### Support for different architectures
    196 
    197 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.
    198 
    199 In this case, you must run the `buildx` process specifying the desired architecture as shown in the example below:
    200 
    201 ```sh
    202 docker buildx build \
    203     --no-cache \
    204     --platform linux/arm/v7 \
    205     --tag ahwxorg/librey:latest .
    206 ```
    207 
    208 **OBS:** Keep in mind that this can cause some issues at build time, so you need to know a little about Dockerfiles to solve this problem for your specific case.