diff --git a/compose.yaml b/compose.yaml index 0544dff..34d3265 100644 --- a/compose.yaml +++ b/compose.yaml @@ -120,6 +120,9 @@ services: gateway: image: ${CUSTOCRM_GATEWAY_IMAGE:-caddy:2.8.4} restart: unless-stopped + environment: + CUSTOCRM_DOMAIN: ${CUSTOCRM_DOMAIN:?CUSTOCRM_DOMAIN is required} + CUSTOCRM_ACME_EMAIL: ${CUSTOCRM_ACME_EMAIL:?CUSTOCRM_ACME_EMAIL is required} ports: - "${CUSTOCRM_WEB_LISTENING_IP:-0.0.0.0}:80:80" - "${CUSTOCRM_WEB_LISTENING_IP:-0.0.0.0}:443:443" diff --git a/deploy/cli/lib/doctor.sh b/deploy/cli/lib/doctor.sh index ab72c3f..be0f909 100644 --- a/deploy/cli/lib/doctor.sh +++ b/deploy/cli/lib/doctor.sh @@ -93,6 +93,14 @@ cmd_doctor() { _doctor_report 0 "CUSTOCRM_DOMAIN not set" fi + local acme_email + acme_email="$(env_get "$(instance_env_file)" CUSTOCRM_ACME_EMAIL)" + if [[ -n "$acme_email" ]]; then + _doctor_report 1 "CUSTOCRM_ACME_EMAIL set" + else + _doctor_report 0 "CUSTOCRM_ACME_EMAIL not set" + fi + local pg_pwd pg_pwd="$(env_get "$(instance_env_file)" POSTGRES_PASSWORD)" if [[ -n "$pg_pwd" ]]; then diff --git a/tests/cli/test_custocrm_cli.py b/tests/cli/test_custocrm_cli.py index 8733219..c6a80a9 100644 --- a/tests/cli/test_custocrm_cli.py +++ b/tests/cli/test_custocrm_cli.py @@ -197,6 +197,17 @@ def test_doctor_fails_on_default_secret_and_missing_password(fake_env): assert "HUB_SECRET_KEY" in r.stderr +def test_doctor_fails_when_acme_email_missing(fake_env): + fake_env.write_env(CUSTOCRM_ACME_EMAIL="") + fake_env.install_docker() + fake_env.install_flock(held=False) + + result = _run(fake_env, "doctor") + + assert result.returncode == 1 + assert "CUSTOCRM_ACME_EMAIL" in result.stderr + + # --------------------------------------------------------------------------- # status # ---------------------------------------------------------------------------