From 8e65f0253afccde6f66f03aaf5699e0a6d116f3a Mon Sep 17 00:00:00 2001 From: "Junior L. Botelho (JLB)" Date: Sun, 12 Feb 2023 14:34:38 -0300 Subject: [PATCH] this resolves the issue with a variable that was defined with the value '.com' when it should only be 'com' --- Dockerfile | 4 ++-- docker/entrypoint.sh | 3 +-- docker/php/config.php | 2 +- docker/php/php.dockerfile | 8 ++++---- docker/php/prepare.sh | 9 +++++++++ docker/server/prepare.sh | 9 --------- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffe38eb..602d52c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,11 +33,11 @@ RUN chmod u+x "${DOCKER_SCRIPTS}/php/prepare.sh" &&\ chmod u+x "${DOCKER_SCRIPTS}/entrypoint.sh" &&\ chmod u+x "${DOCKER_SCRIPTS}/attributes.sh" -RUN apk add openrc abuild-rootbld --no-cache +RUN apk add abuild-rootbld --no-cache # The following lines import all Dockerfiles from other folders so that they can be built together in the final build -INCLUDE+ docker/server/nginx.dockerfile INCLUDE+ docker/php/php.dockerfile +INCLUDE+ docker/server/nginx.dockerfile EXPOSE ${NGINX_PORT} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index da9f92b..525dd18 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -5,7 +5,6 @@ sh "docker/php/prepare.sh" sh "docker/server/prepare.sh" -service php-fpm7 start -service nginx start +/bin/sh -c /usr/sbin/php-fpm7 exec nginx -g "daemon off;" diff --git a/docker/php/config.php b/docker/php/config.php index dc2d7d6..a341396 100644 --- a/docker/php/config.php +++ b/docker/php/config.php @@ -3,7 +3,7 @@ "google_domain" => "${CONFIG_GOOGLE_DOMAIN}", "google_language" => "${CONFIG_GOOGLE_LANGUAGUE}", "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}, diff --git a/docker/php/php.dockerfile b/docker/php/php.dockerfile index 9b44ed6..392353c 100644 --- a/docker/php/php.dockerfile +++ b/docker/php/php.dockerfile @@ -6,14 +6,14 @@ ARG WWW_CONFIG="/etc/php7/php-fpm.d/www.conf" ENV OPEN_SEARCH_TITLE="LibreX" ENV OPEN_SEARCH_DESCRIPTION="Framework and javascript free privacy respecting meta search engine" ENV OPEN_SEARCH_ENCODING="UTF-8" -ENV OPEN_SEARCH_LONG_NAME="LibreX Search" -ENV OPEN_SEARCH_HOST="http://localhost:${NGINX_PORT}" +ENV OPEN_SEARCH_LONG_NAME="LibreX 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_DOMAIN="com" ENV CONFIG_GOOGLE_LANGUAGUE="en" -ENV CONFIG_INVIDIOUS_INSTANCE="invidious.namazso.eu" +ENV CONFIG_INVIDIOUS_INSTANCE="https://invidious.namazso.eu" 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" diff --git a/docker/php/prepare.sh b/docker/php/prepare.sh index 34660ec..bd4c77d 100755 --- a/docker/php/prepare.sh +++ b/docker/php/prepare.sh @@ -5,6 +5,15 @@ 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-fpm7.sock' does not already exist. +# This fixes an issue where Nginx starts but does not serve content +if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then + mkdir "/run/php7" + touch "/run/php7/php-fpm7.sock" + chmod 0660 "/run/php7/php-fpm7.sock" + chown nginx:nginx "/run/php7/php-fpm7.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 # 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}; diff --git a/docker/server/prepare.sh b/docker/server/prepare.sh index fd55d10..322beac 100755 --- a/docker/server/prepare.sh +++ b/docker/server/prepare.sh @@ -5,15 +5,6 @@ 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-fpm7.sock' does not already exist. -# This fixes an issue where Nginx starts but does not serve content -if [ ! -d "/run/php7" ] || [ ! -S "/run/php7/php-fpm7.sock" ]; then - mkdir "/run/php7" - touch "/run/php7/php-fpm7.sock" - chmod 0660 "/run/php7/php-fpm7.sock" - chown nginx:nginx "/run/php7/php-fpm7.sock" -fi - 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