From c1af891707a62228fd6fe5a6f3a9961a360a5173 Mon Sep 17 00:00:00 2001 From: pelag0s Date: Sat, 12 Jan 2019 11:06:44 +0100 Subject: [PATCH 1/2] docker: allow configuring http proxy via env variables --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1680c7bb2..51ecf9bd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,9 @@ RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \ && echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \ && echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \ && echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \ + && echo 'if [ -n "$HTTP_PROXY_URL" ] || [ -n "$HTTPS_PROXY_URL" ]; then' >> run.sh \ + && echo ' sed -i "s~^# proxies :~ proxies:\\n http: ${HTTP_PROXY_URL}\\n https: ${HTTPS_PROXY_URL}\\n~" searx/settings.yml' >> run.sh \ + && echo 'fi' >> run.sh \ && echo 'python searx/webapp.py' >> run.sh \ && chmod +x run.sh From 2061c59ca1f857ae9b9744c2b873c09f18eae7a6 Mon Sep 17 00:00:00 2001 From: pelag0s Date: Mon, 14 Jan 2019 09:24:57 +0100 Subject: [PATCH 2/2] Define http proxy variables in Dockerfile before using them --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 51ecf9bd3..95e21813f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.8 LABEL maintainer="searx " LABEL description="A privacy-respecting, hackable metasearch engine." -ENV BASE_URL=False IMAGE_PROXY=False +ENV BASE_URL=False IMAGE_PROXY=False HTTP_PROXY_URL= HTTPS_PROXY_URL= EXPOSE 8888 WORKDIR /usr/local/searx CMD ["/sbin/tini","--","/usr/local/searx/run.sh"]