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
main
Ben Busby 2023-01-04 10:33:57 -07:00
parent aa54491ae0
commit fdc63b862e
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
2 changed files with 2 additions and 3 deletions

View File

@ -75,8 +75,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* ./
# Create user/group to run as
RUN adduser -D -g $DOCKER_USERID -u $DOCKER_USERID $DOCKER_USER

View File

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