From a55a506eede07ef19e311ab6aedc7feef8fac94f Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Sun, 8 Mar 2026 11:43:25 -0600 Subject: [PATCH 1/2] feat: Save stoat domain in a .env file and alias Caddy to it internally This commit was made without the use of generative AI. Signed-off-by: Jacob Schlecht --- compose.yml | 4 ++++ generate_config.sh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/compose.yml b/compose.yml index 8f71467..db5b027 100644 --- a/compose.yml +++ b/compose.yml @@ -70,6 +70,10 @@ services: - ./Caddyfile:/etc/caddy/Caddyfile - ./data/caddy-data:/data - ./data/caddy-config:/config + networks: + default: + aliases: + - "${STOAT_DOMAIN}" # API server api: diff --git a/generate_config.sh b/generate_config.sh index d93aa0e..e9dfaef 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -76,6 +76,8 @@ echo "Configuring Stoat with hostname $DOMAIN" STOAT_HOSTNAME="https://$DOMAIN" +echo "STOAT_DOMAIN=$DOMAIN" > .env + read -rp "Would you like to place Stoat behind another reverse proxy? [y/N]: " if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then echo "Yes received. Configuring for reverse proxy." From 125f25cc441289a5c8049a193c54a963c4acafe9 Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Sun, 8 Mar 2026 14:30:20 -0600 Subject: [PATCH 2/2] fix: This doesn't work on reverse proxied setups thanks to @agentflemme for help testing This commit was made without the use of generative AI. Signed-off-by: Jacob Schlecht --- compose.yml | 2 +- generate_config.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compose.yml b/compose.yml index db5b027..e038978 100644 --- a/compose.yml +++ b/compose.yml @@ -73,7 +73,7 @@ services: networks: default: aliases: - - "${STOAT_DOMAIN}" + - "${STOAT_DOMAIN:-caddy}" # API server api: diff --git a/generate_config.sh b/generate_config.sh index e9dfaef..263e34e 100755 --- a/generate_config.sh +++ b/generate_config.sh @@ -76,8 +76,6 @@ echo "Configuring Stoat with hostname $DOMAIN" STOAT_HOSTNAME="https://$DOMAIN" -echo "STOAT_DOMAIN=$DOMAIN" > .env - read -rp "Would you like to place Stoat behind another reverse proxy? [y/N]: " if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then echo "Yes received. Configuring for reverse proxy." @@ -88,8 +86,10 @@ if [ "$REPLY" = "y" ] || [ "$REPLY" = "Y" ]; then echo " ports: !override" >> compose.override.yml echo " - \"8880:80\"" >> compose.override.yml echo "caddy is configured to host on :8880. If you need a different port, modify the compose.override.yml." + echo "STOAT_DOMAIN=" > .env else echo "No received. Configuring with built in caddy as primary reverse proxy." + echo "STOAT_DOMAIN=$DOMAIN" > .env fi # Generate secrets