From 32a438dee2dda635c61a3c69205a3c7ec38394cd Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Fri, 27 Feb 2026 14:49:24 +0100 Subject: [PATCH] fix: refactor port exposure functions and improve --oauth flag handling in run script --- run.sh | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/run.sh b/run.sh index c8b20ef..728b155 100755 --- a/run.sh +++ b/run.sh @@ -1,17 +1,34 @@ #!/usr/bin/env bash -EXPOSED_PORTS=("-p" "443:10000") -OAUTH_ENABLED="" +function expose_caddy() { + # Expose Caddy on port 443 and forward to Azurite's blob service on port 10010 + EXPOSED_PORTS=("-p" "443:443") +} + +function expose_azurite() { + # Expose Azurite's blob, queue, and table services on ports 10010, 10011, and 10012 respectively + EXPOSED_PORTS=("-p" "10000:10010" "-p" "10001:10011" "-p" "10002:10012") +} + +function expose_azurite_ssl() { + # Expose Azurite's blob service on port 443 with SSL, and queue and table services on ports 10011 and 10012 respectively + EXPOSED_PORTS=("-p" "443:10010") +} + +expose_caddy while [[ $# -gt 0 ]]; do case "$1" in --oauth) - if [[ -n "$OAUTH_ENABLED" ]]; then - echo "Error: --oauth flag specified multiple times." >&2 - exit 1 - fi - OAUTH_ENABLED=true - EXPOSED_PORTS=("-p" "443:10000" "-p" "10001:10001" "-p" "10002:10002") + expose_azurite_ssl + shift + ;; + --ssl) + expose_azurite_ssl + shift + ;; + --no-caddy) + expose_azurite shift ;; esac