Refactor storage directory structure and update scripts for consistency

This commit is contained in:
2026-02-26 19:50:13 +01:00
parent 27fb1a6211
commit 1aa97dc00b
5 changed files with 33 additions and 6 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
storage
test

View File

@@ -11,7 +11,7 @@ else
PASSWORD=$(echo -n "$2" | base64)
fi
AZURITE_DIR="storage/azurite"
AZURITE_DIR="storage"
mkdir -p "$AZURITE_DIR"
AZURITE_ACCOUNTS_FILE="$AZURITE_DIR/accounts.env"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
AZURITE_DIR="storage/azurite"
AZURITE_DIR="storage"
if [[ ! -d "$AZURITE_DIR" ]]; then
echo "No accounts found"

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
CERT_DIR="./storage/caddy/config"
CERT_DIR="./storage"
mkdir -p "$CERT_DIR"
@@ -12,7 +12,7 @@ if [[ ! -f "$CERT_DIR/ca_cert.pem" || ! -f "$CERT_DIR/ca_key.pem" ]]; then
-newkey rsa:4096 \
-keyout "$CERT_DIR/ca_key.pem" \
-out "$CERT_DIR/ca_cert.pem" \
-days 365 \
-days 3650 \
-nodes \
-subj "/CN=Azurite CA" \
-text \
@@ -29,11 +29,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=localhost" \
-subj "/CN=terraform.blob.core.windows.net" \
-addext "basicConstraints=critical,CA:FALSE" \
-addext "keyUsage=digitalSignature,keyEncipherment" \
-addext "extendedKeyUsage=serverAuth,clientAuth" \
-addext "subjectAltName=DNS:localhost,DNS:terraform.blob.core.windows.net,IP:127.0.0.1" \
-addext "subjectAltName=DNS:terraform.blob.core.windows.net,DNS:localhost,IP:127.0.0.1" \
| openssl x509 \
-req \
-CA "$CERT_DIR/ca_cert.pem" \

26
run-server.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
AZURITE_DIR="storage"
if [[ ! -d "$AZURITE_DIR" ]]; then
echo "No accounts found"
exit 0
fi
if ! command -v azurite &> /dev/null; then
echo "Azurite is not installed. Please install it with 'npm install -g azurite'"
exit 1
fi
AZURITE_ACCOUNTS_FILE="$AZURITE_DIR/accounts.env"
set -a
. $AZURITE_ACCOUNTS_FILE
set +a
azurite \
--disableTelemetry \
--location "$AZURITE_DIR" \
--key "$AZURITE_DIR/server_key.pem" \
--cert "$AZURITE_DIR/server_cert.pem" \
--blobHost 0.0.0.0 \
--blobPort 443