Skip to content

Commit

Permalink
feat: alphine -> 3.19, php -> 8.3, fixes, etc (merge pull req…
Browse files Browse the repository at this point in the history
…uest #99 from codedipper/alpine-3.19)

chore: bump alpine to 3.19, bump php to 8.3, config features, fix instances.json + readme.md
  • Loading branch information
Ahwxorg authored Jan 8, 2024
2 parents b2e79f0 + 0c8c695 commit 277f0ad
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 61 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18
FROM alpine:3.19

WORKDIR "/var/www/html"

Expand All @@ -19,24 +19,24 @@ LABEL name="LibreY" \
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"
ARG WWW_CONFIG="/etc/php83/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"

# Install required packages
RUN apk add gettext php82 php82-fpm php82-dom php82-curl php82-json php82-apcu nginx --no-cache
RUN apk add gettext php83 php83-fpm php83-dom php83-curl php83-json php83-pecl-apcu nginx --no-cache

# 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} &&\
RUN touch /run/php-fpm83.sock && chown nginx:nginx "/run/php-fpm83.sock"
RUN sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php-fpm83.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"]
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,23 @@ You can find a list of instances on any LibreY instance by accessing /instances.
Alternatively look at `instances.json` where the list is generated from.<br><br>
While the official instances may be more updated and have better uptime, please consider using another person's instances as these are heavily overloaded.<br>
Support the community. ❤️<br><br>
[@Ahwxorg](https://github.com/Ahwxorg)'s instances:<br>
[@Ahwxorg](https://github.com/Ahwxorg)'s instance:<br>
[search.ahwx.org](https://search.ahwx.org/instances.php)<br>
[Tor](http://wn5jl6fxlzzfenlyu3lc4q7jpw2saplrywxvxtvqbguotwd4y5cjeuqd.onion/instances.php)<br>
[search2.ahwx.org](https://search.ahwx.org/instances.php)<br>
[search2.ahwx.org](https://search2.ahwx.org/instances.php)<br>
[Tor](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion/instances.php)<br>
[search3.ahwx.org](https://search3.ahwx.org/instances.php)<br>
[Tor](http://r7nesn6dnp2fssinw7n5uj4ob2na6g4jppakpjgioxb6v4ca4bbsqoyd.onion/instances.php)<br>
<br>
[@davidovski](https://github.com/davidovski)'s instance:<br>
[search.davidovski.xyz](https://search.davidovski.xyz/instances.php)<br>
<br>
[@codedipper](https://github.com/codedipper)'s instance:<br>
[librex.me](https://librex.me/instances.php)<br>
[librex.revvy.de](https://librex.revvy.de/instances.php)<br>
[Tor](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/instances.php)<br>
[I2P](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/instances.php)<br>
<br>


### About LibreY
Expand Down
1 change: 0 additions & 1 deletion config.php.example
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@


"preferred_engines" => array(

/* search engine to use to search, auto will automatically balance between all scrapers, which is recommended. */
"text" => "auto"
// "text" => "google"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ services:
- CURLOPT_FOLLOWLOCATION=true
volumes:
- ./nginx_logs:/var/log/nginx
- ./php_logs:/var/log/php7
- ./php_logs:/var/log/php83
restart: unless-stopped
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
Expand Down
5 changes: 3 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:
- CURLOPT_FOLLOWLOCATION=true
volumes:
- ./nginx_logs:/var/log/nginx
- ./php_logs:/var/log/php7
- ./php_logs:/var/log/php83
restart: unless-stopped
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
Expand Down Expand Up @@ -105,6 +105,7 @@ This docker image was developed with high configurability in mind, so here is th
| 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. |
| CONFIG_DISABLE_API | false | boolean | Disable requests to /api.php |
| CONFIG_SHOW_RESULT_SOURCE | true | boolean | Whether to show where the result is from on the results page |
### Frontends
| Variables | Default | Examples | Description |
Expand All @@ -127,7 +128,7 @@ This docker image was developed with high configurability in mind, so here is th
### Engines
| Variables | Default | Examples | Description |
|:----------|:-------------|:---------|:------|
| CONFIG_TEXT_SEARCH_ENGINE | "google" | "google", "duckduckgo" | Integration with external self-hosted apps, configure the desired host. |
| CONFIG_TEXT_SEARCH_ENGINE | "auto" | "brave", "duckduckgo", "ecosia", "google", "mojeek", "yandex" | Use a specific search engine, or "auto" to use any available search engine. |
### cURL
| Variables | Default | Examples | Description |
Expand Down
3 changes: 2 additions & 1 deletion docker/attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ 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:-20}"
export CONFIG_DISABLE_API="${CONFIG_DISABLE_API:-false}"
export CONFIG_SHOW_RESULT_SOURCE="${CONFIG_SHOW_RESULT_SOURCE:-true}"

# 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
Expand All @@ -48,7 +49,7 @@ export APP_ANONYMOUS_OVERFLOW=${APP_ANONYMOUS_OVERFLOW:-""}
export APP_SUDS=${APP_SUDS:-""}
export APP_BIBLIOREADS=${APP_BIBLIOREADS:-""}

export CONFIG_TEXT_SEARCH_ENGINE=${CONFIG_TEXT_SEARCH_ENGINE:-"google"}
export CONFIG_TEXT_SEARCH_ENGINE=${CONFIG_TEXT_SEARCH_ENGINE:-"auto"}

# 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
Expand Down
1 change: 1 addition & 0 deletions docker/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"request_cooldown" => ${CONFIG_RATE_LIMIT_COOLDOWN},
"cache_time" => ${CONFIG_CACHE_TIME},
"disable_api" => ${CONFIG_DISABLE_API},
"show_result_source" => ${CONFIG_SHOW_RESULT_SOURCE},

"frontends" => array(
"invidious" => array(
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

/bin/sh -c docker/env-substitution.sh

/bin/sh -c /usr/sbin/php-fpm82
/bin/sh -c /usr/sbin/php-fpm83

exec nginx -g "daemon off;"
2 changes: 1 addition & 1 deletion docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ server {
}

location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm82.sock;
fastcgi_pass unix:/run/php-fpm83.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
Expand Down
69 changes: 24 additions & 45 deletions instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,21 @@
"country": "FR",
"librey": true
},
{
{
"clearnet": "https://search3.ahwx.org/",
"tor": "http://r7nesn6dnp2fssinw7n5uj4ob2na6g4jppakpjgioxb6v4ca4bbsqoyd.onion/",
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://glass.prpl.wtf",
"tor": null,
"i2p": null,
"country": "GB",
"librey": true
"clearnet": "https://ly.owo.si/",
"tor": "http://ly.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/",
"i2p": "http://d4vi3tvfui2rfzsxr33tin4a6542heulf4mhkokdpbhbcejlg3la.b32.i2p/",
"country": "DE",
"librey": true
},
{
"clearnet": "https://ly.owo.si/",
"tor": "http://ly.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/",
"i2p": "http://d4vi3tvfui2rfzsxr33tin4a6542heulf4mhkokdpbhbcejlg3la.b32.i2p/",
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.danyaal.xyz/",
"tor": "http://libreytvcxak42f3p7nxh3filsp2pjqesjii5f5e4eivs2gpcn77tdid.onion/",
"i2p": "http://libreyqmoa2iuihoyyscolhaymrxxgdrmkgmiufnyaukwub2c7ya.b32.i2p/",
"country": "GB",
"librey": true
},
{
"clearnet": "https://librey.org/",
"tor": "http://jxhkfulu6wpdl4apuy4dyivuowmpprvsd7e3el2z73crq7fmyv7rjkyd.onion/",
"i2p": null,
Expand All @@ -56,6 +42,13 @@
"country": "GB",
"librey": true
},
{
"clearnet": "https://glass.prpl.wtf",
"tor": null,
"i2p": null,
"country": "GB",
"librey": true
},
{
"clearnet": "https://librex.uk.to/",
"tor": null,
Expand All @@ -64,7 +57,7 @@
"librey": true
},
{
"clearnet": "https://librex.ix.tc/",
"clearnet": "https://librey.ix.tc/",
"tor": null,
"i2p": null,
"country": "GB",
Expand Down Expand Up @@ -99,35 +92,28 @@
"librey": true
},
{
"clearnet": "https://search.ratakor.com/",
"tor": null,
"i2p": null,
"country": "FR",
"librey": true
},
{
"clearnet": "https://librex.yogeshlamichhane.com.np/",
"clearnet": "https://librey.baczek.me/",
"tor": null,
"i2p": null,
"country": "FI",
"country": "PL",
"librey": true
},
{
"clearnet": "https://librey.baczek.me/",
"clearnet": "https://lx.benike.me/",
"tor": null,
"i2p": null,
"country": "PL",
"country": "DE",
"librey": true
},
{
"clearnet": "https://lx.benike.me/",
"clearnet": "https://search.seitan-ayoub.lol/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://search.seitan-ayoub.lol/",
"clearnet": "https://librey.myroware.net/",
"tor": null,
"i2p": null,
"country": "DE",
Expand All @@ -145,21 +131,14 @@
"tor": null,
"i2p": null,
"country": "US",
"librey": false
},
{
"clearnet": "https://librex.baczek.me/",
"tor": null,
"i2p": null,
"country": "PL",
"librey": false
"librey": true
},
{
"clearnet": "https://librey.myroware.net/",
"clearnet": "https://search.zeroish.xyz/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": false
"country": "US",
"librey": true
}
]
}
7 changes: 6 additions & 1 deletion locale/sv.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"category_videos" => "Videor",
"category_torrents" => "Torrents",
"category_tor" => "Tor",
"category_maps" => "Maps", // TRANSLATE

"feature_disabled" => "Funktionen är inaktiverad av serverägaren :C",

Expand All @@ -31,6 +32,8 @@

"settings_search_settings" => "Sökinställningar",
"settings_language" => "Språk",
"settings_preferred_engine" => "Preferred Engine", // TRANSLATE


"settings_number_of_results" => "Antal resultat per sida",

Expand All @@ -47,7 +50,9 @@

"donate_original_developer" => "Donera till orginalutvecklaren av %s, ett
projekt som LibreY försöker förbättra.",
"donate_fork" => "Donera till personen som forkade %s till LibreY"
"donate_fork" => "Donera till personen som forkade %s till LibreY",

"api_unavailable" => "This LibreY API is unavailable at the moment" // TRANSLATE
);

?>

0 comments on commit 277f0ad

Please sign in to comment.