Autoload `whoogle.env` if it exists

The whoogle.env file previously needed to be created and enabled using
the WHOOGLE_DOTENV var. This removes the second step and loads the env
file if it's found during app init.

The Dockerfile has also been updated to copy in whoogle.env if it
exists.

Fixes #909
pull/927/head
Ben Busby 1 year ago
parent aa54491ae0
commit fdc63b862e
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1

@ -75,8 +75,7 @@ COPY --from=builder /install /usr/local
COPY misc/tor/torrc /etc/tor/torrc COPY misc/tor/torrc /etc/tor/torrc
COPY misc/tor/start-tor.sh misc/tor/start-tor.sh COPY misc/tor/start-tor.sh misc/tor/start-tor.sh
COPY app/ app/ COPY app/ app/
COPY run . COPY run whoogle.env* ./
#COPY whoogle.env .
# Create user/group to run as # Create user/group to run as
RUN adduser -D -g $DOCKER_USERID -u $DOCKER_USERID $DOCKER_USER RUN adduser -D -g $DOCKER_USERID -u $DOCKER_USERID $DOCKER_USER

@ -28,7 +28,7 @@ dot_env_path = (
'../whoogle.env')) '../whoogle.env'))
# Load .env file if enabled # Load .env file if enabled
if read_config_bool('WHOOGLE_DOTENV'): if os.path.exists(dot_env_path):
load_dotenv(dot_env_path) load_dotenv(dot_env_path)
app.enc_key = generate_key() app.enc_key = generate_key()

Loading…
Cancel
Save