Refactor storage directory structure and update scripts for consistency
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
storage
|
||||
test
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
AZURITE_DIR="storage/azurite"
|
||||
AZURITE_DIR="storage"
|
||||
|
||||
if [[ ! -d "$AZURITE_DIR" ]]; then
|
||||
echo "No accounts found"
|
||||
|
||||
@@ -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
26
run-server.sh
Executable 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
|
||||
Reference in New Issue
Block a user