fix the acme email
Build & Deploy / Build & Push Docker Image (push) Successful in 2m50s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m1s
Build & Deploy / Build & Push Docker Image (push) Successful in 2m50s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 3s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m1s
This commit is contained in:
@@ -71,6 +71,39 @@ export_env_value_if_unset() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export_compose_env_from_file() {
|
||||||
|
local line key value
|
||||||
|
|
||||||
|
while IFS= read -r line || [[ -n "${line}" ]]; do
|
||||||
|
line="${line%$'\r'}"
|
||||||
|
|
||||||
|
[[ -z "${line//[[:space:]]/}" || "${line}" =~ ^[[:space:]]*# ]] && continue
|
||||||
|
|
||||||
|
line="${line#"${line%%[![:space:]]*}"}"
|
||||||
|
line="${line#export }"
|
||||||
|
|
||||||
|
[[ "${line}" == *"="* ]] || continue
|
||||||
|
|
||||||
|
key="${line%%=*}"
|
||||||
|
value="${line#*=}"
|
||||||
|
key="${key//[[:space:]]/}"
|
||||||
|
value="${value#"${value%%[![:space:]]*}"}"
|
||||||
|
value="${value%"${value##*[![:space:]]}"}"
|
||||||
|
|
||||||
|
if [[ "${value}" == \"*\" && "${value}" == *\" ]]; then
|
||||||
|
value="${value#\"}"
|
||||||
|
value="${value%\"}"
|
||||||
|
elif [[ "${value}" == \'*\' && "${value}" == *\' ]]; then
|
||||||
|
value="${value#\'}"
|
||||||
|
value="${value%\'}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${key}" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
|
||||||
|
export "${key}=${value}"
|
||||||
|
fi
|
||||||
|
done < "${ENV_FILE}"
|
||||||
|
}
|
||||||
|
|
||||||
load_prod_env_exports() {
|
load_prod_env_exports() {
|
||||||
local key
|
local key
|
||||||
|
|
||||||
@@ -148,10 +181,12 @@ ensure_api_uploads_volume() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prod_compose() {
|
prod_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
APP_ENV_FILE="${ENV_FILE}" DOCKER_PROD_API_UPLOADS_VOLUME="${API_UPLOADS_VOLUME}" docker compose -p "${PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PROD_COMPOSE_FILE}" "$@"
|
APP_ENV_FILE="${ENV_FILE}" DOCKER_PROD_API_UPLOADS_VOLUME="${API_UPLOADS_VOLUME}" docker compose -p "${PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PROD_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
traefik_compose() {
|
traefik_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
docker compose --env-file "${ENV_FILE}" -f "${TRAEFIK_COMPOSE_FILE}" "$@"
|
docker compose --env-file "${ENV_FILE}" -f "${TRAEFIK_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,10 +66,44 @@ export_env_value_if_unset() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export_compose_env_from_file() {
|
||||||
|
local line key value
|
||||||
|
|
||||||
|
while IFS= read -r line || [[ -n "${line}" ]]; do
|
||||||
|
line="${line%$'\r'}"
|
||||||
|
|
||||||
|
[[ -z "${line//[[:space:]]/}" || "${line}" =~ ^[[:space:]]*# ]] && continue
|
||||||
|
|
||||||
|
line="${line#"${line%%[![:space:]]*}"}"
|
||||||
|
line="${line#export }"
|
||||||
|
|
||||||
|
[[ "${line}" == *"="* ]] || continue
|
||||||
|
|
||||||
|
key="${line%%=*}"
|
||||||
|
value="${line#*=}"
|
||||||
|
key="${key//[[:space:]]/}"
|
||||||
|
value="${value#"${value%%[![:space:]]*}"}"
|
||||||
|
value="${value%"${value##*[![:space:]]}"}"
|
||||||
|
|
||||||
|
if [[ "${value}" == \"*\" && "${value}" == *\" ]]; then
|
||||||
|
value="${value#\"}"
|
||||||
|
value="${value%\"}"
|
||||||
|
elif [[ "${value}" == \'*\' && "${value}" == *\' ]]; then
|
||||||
|
value="${value#\'}"
|
||||||
|
value="${value%\'}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${key}" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
|
||||||
|
export "${key}=${value}"
|
||||||
|
fi
|
||||||
|
done < "${ENV_FILE}"
|
||||||
|
}
|
||||||
|
|
||||||
load_prod_env_exports() {
|
load_prod_env_exports() {
|
||||||
local key
|
local key
|
||||||
|
|
||||||
for key in \
|
for key in \
|
||||||
|
ACME_EMAIL \
|
||||||
APP_IMAGE \
|
APP_IMAGE \
|
||||||
APP_VERSION \
|
APP_VERSION \
|
||||||
IMAGE_TAG \
|
IMAGE_TAG \
|
||||||
@@ -84,8 +118,9 @@ load_prod_env_exports() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validate_prod_env_file() {
|
validate_prod_env_file() {
|
||||||
local api_domain public_site_domain cors_origins portainer_domain postgres_password redis_password jwt_secret
|
local acme_email api_domain public_site_domain cors_origins portainer_domain postgres_password redis_password jwt_secret
|
||||||
|
|
||||||
|
acme_email="$(read_env_value ACME_EMAIL)"
|
||||||
api_domain="$(read_env_value API_DOMAIN)"
|
api_domain="$(read_env_value API_DOMAIN)"
|
||||||
public_site_domain="$(read_env_value PUBLIC_SITE_DOMAIN)"
|
public_site_domain="$(read_env_value PUBLIC_SITE_DOMAIN)"
|
||||||
cors_origins="$(read_env_value CORS_ORIGINS)"
|
cors_origins="$(read_env_value CORS_ORIGINS)"
|
||||||
@@ -94,6 +129,11 @@ validate_prod_env_file() {
|
|||||||
redis_password="$(read_env_value REDIS_PASSWORD)"
|
redis_password="$(read_env_value REDIS_PASSWORD)"
|
||||||
jwt_secret="$(read_env_value JWT_SECRET)"
|
jwt_secret="$(read_env_value JWT_SECRET)"
|
||||||
|
|
||||||
|
if [[ -z "${acme_email}" || "${acme_email}" != *@* || "${acme_email}" == *example.com* ]]; then
|
||||||
|
echo "Invalid ACME_EMAIL in ${ENV_FILE}. Set it to a real contact email for Let's Encrypt, not example.com." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "${api_domain}" || "${api_domain}" == *example.com* ]]; then
|
if [[ -z "${api_domain}" || "${api_domain}" == *example.com* ]]; then
|
||||||
echo "Invalid API_DOMAIN in ${ENV_FILE}. Set it to the real production API hostname, not example.com." >&2
|
echo "Invalid API_DOMAIN in ${ENV_FILE}. Set it to the real production API hostname, not example.com." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -144,18 +184,22 @@ ensure_dynamic_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prod_compose() {
|
prod_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
APP_ENV_FILE="${ENV_FILE}" DOCKER_PROD_API_UPLOADS_VOLUME="${API_UPLOADS_VOLUME}" docker compose -p "${PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PROD_COMPOSE_FILE}" "$@"
|
APP_ENV_FILE="${ENV_FILE}" DOCKER_PROD_API_UPLOADS_VOLUME="${API_UPLOADS_VOLUME}" docker compose -p "${PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PROD_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
portainer_compose() {
|
portainer_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
docker compose -p "${PORTAINER_PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PORTAINER_COMPOSE_FILE}" "$@"
|
docker compose -p "${PORTAINER_PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${PORTAINER_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
registry_compose() {
|
registry_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
docker compose -p "${REGISTRY_PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${REGISTRY_COMPOSE_FILE}" "$@"
|
docker compose -p "${REGISTRY_PROJECT_NAME}" --env-file "${ENV_FILE}" -f "${REGISTRY_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
traefik_compose() {
|
traefik_compose() {
|
||||||
|
export_compose_env_from_file
|
||||||
docker compose --env-file "${ENV_FILE}" -f "${TRAEFIK_COMPOSE_FILE}" "$@"
|
docker compose --env-file "${ENV_FILE}" -f "${TRAEFIK_COMPOSE_FILE}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user