Enhance emulator setup with Caddy support and update documentation

- Added Caddyfile example for HTTPS configuration.
- Updated README to include Caddy as an optional component.
- Modified make-certs.sh to use dynamic account names for certificate generation.
- Improved add-account.sh to handle missing accounts.env file gracefully.
- Enhanced run-server.sh to support Caddy integration and OAuth options.
This commit is contained in:
2026-02-26 21:36:38 +01:00
parent 4ad841e2f1
commit 01b81e41a8
6 changed files with 99 additions and 18 deletions

View File

@@ -4,6 +4,8 @@ CERT_DIR="./storage"
mkdir -p "$CERT_DIR"
ACCOUNT_NAME="${1:-devstoreaccount1}"
# Generate CA certificate and key if they don't exist
if [[ ! -f "$CERT_DIR/ca_cert.pem" || ! -f "$CERT_DIR/ca_key.pem" ]]; then
echo "Generating CA certificate and key..."
@@ -29,11 +31,11 @@ if [[ ! -f "$CERT_DIR/server_cert.pem" || ! -f "$CERT_DIR/server_key.pem" ]]; th
-newkey rsa:4096 \
-keyout "$CERT_DIR/server_key.pem" \
-nodes \
-subj "/CN=terraform.blob.core.windows.net" \
-subj "/CN=${ACCOUNT_NAME}.blob.core.windows.net" \
-addext "basicConstraints=critical,CA:FALSE" \
-addext "keyUsage=digitalSignature,keyEncipherment" \
-addext "extendedKeyUsage=serverAuth,clientAuth" \
-addext "subjectAltName=DNS:terraform.blob.core.windows.net,DNS:localhost,IP:127.0.0.1" \
-addext "subjectAltName=DNS:${ACCOUNT_NAME}.blob.core.windows.net,DNS:${ACCOUNT_NAME}.queue.core.windows.net,DNS:${ACCOUNT_NAME}.table.core.windows.net,DNS:localhost,IP:127.0.0.1" \
| openssl x509 \
-req \
-CA "$CERT_DIR/ca_cert.pem" \
@@ -47,4 +49,3 @@ if [[ ! -f "$CERT_DIR/server_cert.pem" || ! -f "$CERT_DIR/server_key.pem" ]]; th
exit 1
fi
fi