From 6931bf0d952aade8845ccfa3178acb81f79db338 Mon Sep 17 00:00:00 2001 From: rrattani <108565092+rrattani@users.noreply.github.com> Date: Sun, 9 Aug 2026 14:18:14 -0700 Subject: [PATCH] Read .env variables from shell environment Update .env file to read from shell environment as well. This helps in updating the .env file without modifying the file itself...and keeping the template clean. --- .env | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 82ab841..bce43f4 100644 --- a/.env +++ b/.env @@ -4,12 +4,12 @@ # The timezone to use, find your timezone database name from # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones # Use the value from the 'TZ identifier' column -TZ=Etc/UTC +TZ=${TZ:-Etc/UTC} # Directory configuration. This .env file should be in /opt/docker, using the defaults below. # You MUST use absolute paths, otherwise each bind mount would be created relative to each compose file, and not # the current directory -DOCKER_DIR=/opt/docker +DOCKER_DIR=${DOCKER_DIR:-/opt/docker} DOCKER_DATA_DIR=${DOCKER_DIR}/data DOCKER_APP_DIR=${DOCKER_DIR}/apps @@ -21,8 +21,8 @@ DOCKER_APP_DIR=${DOCKER_DIR}/apps # You can run # sudo chown $PUID:$PGID -R $DOCKER_DATA_DIR # replacing the variables with the actual values e.g sudo chown 1001:1001 -R /opt/docker/data -PUID=1000 -PGID=1000 +PUID=${PUID:-1000} +PGID=${PGID:-1000} # ========================================================= @@ -62,13 +62,13 @@ COMPOSE_PROFILES="required" # Traefik is the reverse proxy which provides external access to our apps. # Email provided to Let's Encrypt for notifications -LETSENCRYPT_EMAIL= +LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-} # The domain name to use for all services that are going to be exposed with Traefik. # This will be the default domain used for all services that are exposed with Traefik. # You can modify the domain used for specific services by editing the app specific hostname variables below. # If you have multiple domains, I would recommend providing a second domain here (e.g. 'DOMAIN2=example.io') and then editing the app specific hostname variables to use `DOMAIN2` instead of `DOMAIN`. # FOR DUCKDNS USERS: create only 1 record at duckdns e.g. example.duckdns.org and set the DOMAIN variable below to that value. You will access your apps via subdomains of it e.g. aiostreams.example.duckdns.org -DOMAIN=example.com +DOMAIN=${DOMAIN:-example.com} # ========================================================= @@ -79,9 +79,9 @@ DOMAIN=example.com # These should all be different random strings of at least 64 characters. # You can use the following command to generate them: # echo "$(openssl rand -base64 64 | tr -d '=/' | tr -d '\n')" -AUTHELIA_SESSION_SECRET="" -AUTHELIA_STORAGE_ENCRYPTION_KEY="" -AUTHELIA_JWT_SECRET="" +AUTHELIA_SESSION_SECRET=${AUTHELIA_SESSION_SECRET:-} +AUTHELIA_STORAGE_ENCRYPTION_KEY=${AUTHELIA_STORAGE_ENCRYPTION_KEY:-} +AUTHELIA_JWT_SECRET=${AUTHELIA_JWT_SECRET:-} # You can find additional configuration for Authelia in Authelia's .env file which will also # tell you how to add users @@ -100,7 +100,7 @@ AUTHELIA_JWT_SECRET="" # - Add 'cloudflare-ddns' to the 'COMPOSE_PROFILES' variable above. (or use the 'all' profile) # Then, obtain a cloudflare API token at (https://dash.cloudflare.com/profile/api-tokens) using the 'Edit zone DNS' template and # provide it here. -CLOUDFLARE_API_TOKEN= +CLOUDFLARE_API_TOKEN=${CLOUDFLARE_API_TOKEN:-} # WARNING: if you do not want to use Cloudflare DDNS, you must make sure to manually add the DNS A records for each subdomain you choose to use. # If you use DuckDNS, there isn't a need to create additional records, you only need one record created e.g. example.duckdns.org