Skip to content

Commit

Permalink
chore: merge pull request #207 from codedipper/iamalive
Browse files Browse the repository at this point in the history
update alpine, php, instances list; add permissions-policy header
  • Loading branch information
Ahwxorg authored Feb 10, 2025
2 parents 387e69b + 832bdde commit 85c020c
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 116 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.20
FROM alpine:3.21

WORKDIR "/var/www/html"

Expand All @@ -19,19 +19,19 @@ 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/php83/php-fpm.d/www.conf"
ARG WWW_CONFIG="/etc/php84/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 php83 php83-fpm php83-dom php83-curl php83-json php83-pecl-apcu nginx --no-cache
RUN apk add gettext php84 php84-fpm php84-dom php84-curl php84-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-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} &&\
RUN touch /run/php-fpm84.sock && chown nginx:nginx "/run/php-fpm84.sock"
RUN sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php-fpm84.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}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
- CONFIG_GOOGLE_DOMAIN=com
- CONFIG_LANGUAGE=en
- CONFIG_NUMBER_OF_RESULTS=10
- CONFIG_INVIDIOUS_INSTANCE=https://yt.ahwx.org
- CONFIG_INVIDIOUS_INSTANCE=https://inv.nadeko.net
- CONFIG_DISABLE_BITTORRENT_SEARCH=false
- CONFIG_HIDDEN_SERVICE_SEARCH=false
- CONFIG_INSTANCE_FALLBACK=true
Expand All @@ -24,7 +24,7 @@ services:
- CURLOPT_FOLLOWLOCATION=true
volumes:
# - ./nginx_logs:/var/log/nginx # Disabled by default. These are the NGINX request logs.
- ./php_logs:/var/log/php83 # Enabled by default. These are the PHP error logs.
- ./php_logs:/var/log/php84 # Enabled by default. These are the PHP error logs.
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
4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
- CONFIG_GOOGLE_DOMAIN=com
- CONFIG_LANGUAGE=en
- CONFIG_NUMBER_OF_RESULTS=10
- CONFIG_INVIDIOUS_INSTANCE=https://yt.ahwx.org
- CONFIG_INVIDIOUS_INSTANCE=https://inv.nadeko.net
- CONFIG_DISABLE_BITTORRENT_SEARCH=false
- CONFIG_HIDDEN_SERVICE_SEARCH=false
- CONFIG_INSTANCE_FALLBACK=true
Expand All @@ -47,7 +47,7 @@ services:
- CURLOPT_FOLLOWLOCATION=true
volumes:
# - ./nginx_logs:/var/log/nginx # Disabled by default. These are the NGINX request logs.
- ./php_logs:/var/log/php83 # Enabled by default. These are the PHP error logs.
- ./php_logs:/var/log/php84 # Enabled by default. These are the PHP error logs.
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
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-fpm83
/bin/sh -c /usr/sbin/php-fpm84

exec nginx -g "daemon off;"
3 changes: 2 additions & 1 deletion docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ server {
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";
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), attribution-reporting=(), autoplay=(), bluetooth=(), browsing-topics=(), camera=(), compute-pressure=(), display-capture=(), document-domain=(), encrypted-media=(), fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), indentity-credentials-get=(), idle-detection=(), local-fonts=(), magnetometer=(), microphone=(), midi=(), otp-credentials=(), payment=(), picture-in-picture=(), publickey-credentials-create=(), publickey-credentials-get=(), screen-wake-lock=(), serial=(), speaker-selection=(), storage-access=(), usb=(), web-share=(), window-management=(), xr-spatial-tracking=()";

root /var/www/html;
index index.php;
Expand All @@ -14,7 +15,7 @@ server {
}

location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm83.sock;
fastcgi_pass unix:/run/php-fpm84.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
Expand Down
42 changes: 42 additions & 0 deletions docs/docker-run-manually-built-tor-proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
> [!IMPORTANT]
> Please note that this heavily relies on [@codedipper](https://github.com/codedipper)'s [work and is basically a copy of his wiki](https://github.com/codedipper/LibreY-Tor/wiki/LibreY-Tor-Proxy-‐-Manually-built-images-with-compose).
Step 0: Install and configure Docker.\
Step 1: Enter a root shell on the host machine.

Step 2: Clone the required git repositories to the host machine.
```sh
git clone https://github.com/Ahwxorg/LibreY.git LibreY/
git clone https://github.com/codedipper/LibreY-Tor.git LibreY-Tor/
docker network create --driver=bridge --subnet=172.4.0.0/16 librey_tor_net
```

Step 3: Manually edit `LibreY-Tor/torrc` to configure Tor to your liking.

Step 4: Build LibreY + LibreY-Tor image.
```sh
cd LibreY/
docker buildx build --rm --no-cache --pull -t librey:latest .
cd ../LibreY-Tor/
docker buildx build --rm --no-cache --pull -t librey-tor:latest .
```

Step 5: Start your desired containers with the options you want.

```sh
cd ../LibreY/
docker run -d --name librey --ip=172.4.0.6 --network librey_tor_net -p 8080:8080 -e TZ="America/New_York" -e CONFIG_GOOGLE_DOMAIN="com" -e CONFIG_LANGUAGE="en" -e CONFIG_NUMBER_OF_RESULTS="10" -e CONFIG_INVIDIOUS_INSTANCE="https://inv.nadeko.net" -e CONFIG_DISABLE_BITTORRENT_SEARCH=false -e CONFIG_HIDDEN_SERVICE_SEARCH=false -e CONFIG_INSTANCE_FALLBACK=true -e CONFIG_RATE_LIMIT_COOLDOWN=25 -e CONFIG_CACHE_TIME=20 -e CONFIG_DISABLE_API=false -e CONFIG_TEXT_SEARCH_ENGINE="auto" -e CURLOPT_PROXY_ENABLED=true -e CURLOPT_PROXY="172.4.0.5:9050" -e CURLOPT_PROXYTYPE="CURLPROXY_SOCKS5_HOSTNAME" -e CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0" -e CURLOPT_FOLLOWLOCATION=true -v ./nginx_logs:/var/log/nginx -v ./php_logs:/var/log/php84 --restart unless-stopped librey:latest
docker run -d --name librey-librey_tor-1 --network librey_tor_net --ip=172.4.0.5 -v $PWD/../LibreY-Tor/torrc:/etc/tor/torrc librey-tor:latest

```

To update containers:
```sh
cd LibreY/
docker stop librey librey-librey_tor-1
docker rm librey librey-librey_tor-1
docker buildx build --rm --no-cache --pull -t librey:latest .
cd ../LibreY-Tor/
docker buildx build --rm --no-cache --pull -t librey-tor:latest .
# Repeat run commands
```
2 changes: 1 addition & 1 deletion docs/docker-run-prebuilt-tor-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Step 4: Manually edit `LibreY-Tor/torrc` to configure Tor to your liking.
Step 5: Run it!
```sh
cd LibreY/
docker run -d --name librey --ip=172.4.0.6 --network librey_tor_net -p 8080:8080 -e TZ="America/New_York" -e CONFIG_GOOGLE_DOMAIN="com" -e CONFIG_LANGUAGE="en" -e CONFIG_NUMBER_OF_RESULTS="10" -e CONFIG_INVIDIOUS_INSTANCE="https://yt.ahwx.org" -e CONFIG_DISABLE_BITTORRENT_SEARCH=false -e CONFIG_HIDDEN_SERVICE_SEARCH=false -e CONFIG_INSTANCE_FALLBACK=true -e CONFIG_RATE_LIMIT_COOLDOWN=25 -e CONFIG_CACHE_TIME=20 -e CONFIG_DISABLE_API=false -e CONFIG_TEXT_SEARCH_ENGINE="auto" -e CURLOPT_PROXY_ENABLED=true -e CURLOPT_PROXY="172.4.0.5:9050" -e CURLOPT_PROXYTYPE="CURLPROXY_SOCKS5_HOSTNAME" -e CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0" -e CURLOPT_FOLLOWLOCATION=true -v ./nginx_logs:/var/log/nginx -v ./php_logs:/var/log/php83 --restart unless-stopped ghcr.io/ahwxorg/librey:latest
docker run -d --name librey --ip=172.4.0.6 --network librey_tor_net -p 8080:8080 -e TZ="America/New_York" -e CONFIG_GOOGLE_DOMAIN="com" -e CONFIG_LANGUAGE="en" -e CONFIG_NUMBER_OF_RESULTS="10" -e CONFIG_INVIDIOUS_INSTANCE="https://inv.nadeko.net" -e CONFIG_DISABLE_BITTORRENT_SEARCH=false -e CONFIG_HIDDEN_SERVICE_SEARCH=false -e CONFIG_INSTANCE_FALLBACK=true -e CONFIG_RATE_LIMIT_COOLDOWN=25 -e CONFIG_CACHE_TIME=20 -e CONFIG_DISABLE_API=false -e CONFIG_TEXT_SEARCH_ENGINE="auto" -e CURLOPT_PROXY_ENABLED=true -e CURLOPT_PROXY="172.4.0.5:9050" -e CURLOPT_PROXYTYPE="CURLPROXY_SOCKS5_HOSTNAME" -e CURLOPT_USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0" -e CURLOPT_FOLLOWLOCATION=true -v ./nginx_logs:/var/log/nginx -v ./php_logs:/var/log/php84 --restart unless-stopped ghcr.io/ahwxorg/librey:latest
docker run -d --name librey-watchtower-1 -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower
docker run -d --name librey-librey_tor-1 --network librey_tor_net --ip=172.4.0.5 -v $PWD/../LibreY-Tor/torrc:/etc/tor/torrc ghcr.io/codedipper/librey-tor:latest
```
Expand Down
120 changes: 18 additions & 102 deletions instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"clearnet": "https://search.revvy.de/",
"tor": "http://search.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/",
"i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/",
"country": "CL",
"country": "FI",
"librey": true
},
{
Expand All @@ -21,81 +21,53 @@
"country": "GB",
"librey": true
},
{
"clearnet": "https://search.uwabaki.party/",
"tor": null,
"i2p": null,
"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.org/",
"tor": "http://jxhkfulu6wpdl4apuy4dyivuowmpprvsd7e3el2z73crq7fmyv7rjkyd.onion/",
"i2p": null,
"country": "US",
"librey": true
},
{
"clearnet": "https://librey.milivojevic.in.rs/",
"tor": "http://a5zlmx66wvhhuwyy7i4zqqyasqqbivy5a24ynioyzkdnmvttvycr63ad.onion/",
"i2p": null,
"country": "RS",
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.retro-hax.net",
"tor": null,
"clearnet": "https://libre-find.online/",
"tor": "http://ug3lz3wdjxljv5fxyoicgcugmcsuym5e4zgxggotjdscdrdwid7s2mqd.onion/",
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.4o1x5.dev",
"tor": null,
"clearnet": "https://librey.darkness.services/",
"tor": "http://librey.darknessrdor43qkl2ngwitj72zdavfz2cead4t5ed72bybgauww5lyd.onion/",
"i2p": null,
"country": "HU",
"country": "US",
"librey": true
},
{
"clearnet": "https://librey.franklyflawless.org/",
"clearnet": "https://librey.org/",
"tor": null,
"i2p": null,
"country": "IS",
"librey": true
},
{
"clearnet": "https://libre-find.online/",
"tor": "http://ug3lz3wdjxljv5fxyoicgcugmcsuym5e4zgxggotjdscdrdwid7s2mqd.onion/",
"i2p": null,
"country": "DE",
"country": "US",
"librey": true
},
{
"clearnet": "https://glass.prpl.wtf/",
"clearnet": "https://search.technicalvoid.dev/",
"tor": null,
"i2p": null,
"country": "GB",
"country": "RO",
"librey": true
},
{
"clearnet": "https://librex.uk.to/",
"tor": null,
"i2p": null,
"country": "GB",
"librey": true
"clearnet": "https://search.uwabaki.party/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.ix.tc/",
"clearnet": "https://librey.4o1x5.dev/",
"tor": null,
"i2p": null,
"country": "GB",
"country": "HU",
"librey": true
},
{
Expand All @@ -112,76 +84,20 @@
"country": "MX",
"librey": true
},
{
"clearnet": "https://search.pabloferreiro.es/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.baczek.me/",
"tor": null,
"i2p": null,
"country": "PL",
"librey": true
},
{
"clearnet": "https://lx.benike.me/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://search.seitan-ayoub.lol/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://librey.darkness.services/",
"tor": "http://librey.darknessrdor43qkl2ngwitj72zdavfz2cead4t5ed72bybgauww5lyd.onion/",
"i2p": null,
"country": "US",
"librey": true
},
{
"clearnet": "https://librey.myroware.net/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://search.zeroish.xyz/",
"tor": null,
"i2p": null,
"country": "US",
"librey": true
},
{
"clearnet": "https://librey.nirn.quest/",
"tor": null,
"i2p": null,
"country": "US",
"librey": true
},
{
"clearnet": "https://libre.blitzw.in/",
"tor": null,
"i2p": null,
"country": "ZA",
"librey": true
},
{
"clearnet": "https://search.technicalvoid.dev/",
"tor": "http://ezjfq3zz5mquiwdl4q7zg4v26u74e4sjsdyg3z67ozn3dxqslvb7pzyd.onion/",
"i2p": null,
"country": "RO",
"librey": true
},
{
"clearnet": "https://serp.catswords.net/",
"tor": null,
Expand Down
6 changes: 4 additions & 2 deletions instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ function list_instances($instances)
list_instances($librey_instances);
?>

<p><?php printftext("instances_librex", "<a href=\"https://github.com/hnhx/librex\">LibreX</a>")?>:</p>
<?php
list_instances($librex_instances);
if (sizeof($librex_instances) > 0){
echo "<p>"; printftext("instances_librex", "<a href=\"https://github.com/hnhx/librex\">LibreX</a>:</p>");
list_instances($librex_instances);
}
?>
</center>
</div>
Expand Down

0 comments on commit 85c020c

Please sign in to comment.