From 843632a22c44bd3563d4b692b9b2e79d4ae917c4 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 18 Oct 2021 15:01:48 -0600 Subject: [PATCH 1/2] Refactor whoogle.env -> whoogle.template.env Renamed to avoid collision issues for users who update the env file when running their instance. Non-template env file is gitignored to avoid accidental tracking. Fixes #467 --- .gitignore | 3 +++ whoogle.env => whoogle.template.env | 3 +++ 2 files changed, 6 insertions(+) rename whoogle.env => whoogle.template.env (95%) diff --git a/.gitignore b/.gitignore index 32c54ce..3738d16 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ app/static/bangs /build/ dist/ *.egg-info/ + +# env +whoogle.env diff --git a/whoogle.env b/whoogle.template.env similarity index 95% rename from whoogle.env rename to whoogle.template.env index c3b65f2..754686c 100644 --- a/whoogle.env +++ b/whoogle.template.env @@ -1,3 +1,6 @@ +# ---------------------------------- +# Rename to "whoogle.env" before use +# ---------------------------------- # You can set Whoogle environment variables here, but must # modify your deployment to enable these values: # - Local: Set WHOOGLE_DOTENV=1 From ca782875c2bd4f47c22b7f09aad1fff4ac3a4330 Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Mon, 18 Oct 2021 15:12:20 -0600 Subject: [PATCH 2/2] Conditionally load .env file in Dockerfile With 843632a, whoogle.env is now gitignored and should only be created by users from the whoogle.template.env file. Since the file no longer exists, the docker build cannot copy it in by default. This just conditionally copies the file in if it exists. --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c925aa..073d4d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,8 +66,7 @@ COPY --from=builder /install /usr/local COPY misc/tor/torrc /etc/tor/torrc COPY misc/tor/start-tor.sh misc/tor/start-tor.sh COPY app/ app/ -COPY run . -COPY whoogle.env . +COPY run whoogle.env* . # Allow writing symlinks to build dir RUN chown 102:102 app/static/build