Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions custom-domain/dstack-ingress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ configs:
- `PROXY_READ_TIMEOUT`: Optional value for nginx `proxy_read_timeout` (numeric with optional `s|m|h` suffix, e.g. `30s`) in single-domain mode
- `PROXY_SEND_TIMEOUT`: Optional value for nginx `proxy_send_timeout` (numeric with optional `s|m|h` suffix, e.g. `30s`) in single-domain mode
- `PROXY_CONNECT_TIMEOUT`: Optional value for nginx `proxy_connect_timeout` (numeric with optional `s|m|h` suffix, e.g. `10s`) in single-domain mode
- `CERTBOT_STAGING`: Optional; set this value to the string `true` to set the `--staging` server option on the [`certbot` cli](https://eff-certbot.readthedocs.io/en/stable/using.html#certbot-command-line-options)

**Backward Compatibility:**

Expand Down
2 changes: 2 additions & 0 deletions custom-domain/dstack-ingress/scripts/certman.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def _build_certbot_command(self, action: str, domain: str, email: str) -> List[s
if action == "certonly":
base_cmd.extend(["--agree-tos", "--no-eff-email",
"--email", email, "-d", domain])
if os.environ.get("CERTBOT_STAGING", "false") == "true":
base_cmd.extend(["--staging"])

base_cmd.extend(["--dns-cloudflare-propagation-seconds=120"])

Expand Down
7 changes: 6 additions & 1 deletion custom-domain/dstack-ingress/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,12 @@ set_caa_record() {
return
fi
local ACCOUNT_URI
ACCOUNT_URI=$(jq -j '.uri' /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json)
find /etc/letsencrypt/accounts -name regr.json
path="/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json"
if [ "$CERTBOT_STAGING" == "true" ]; then
path="${path/acme-v02/acme-staging-v02}"
fi
ACCOUNT_URI=$(jq -j '.uri' $path)
echo "Adding CAA record for $domain, accounturi=$ACCOUNT_URI"
dnsman.py set_caa \
--domain "$domain" \
Expand Down
6 changes: 5 additions & 1 deletion custom-domain/dstack-ingress/scripts/generate-evidences.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

set -e

ACME_ACCOUNT_FILE=$(ls /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json)
path="/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/regr.json"
if [ "$CERTBOT_STAGING" == "true" ]; then
path="${path/acme-v02/acme-staging-v02}"
fi
ACME_ACCOUNT_FILE=$(ls $path)

mkdir -p /evidences
cd /evidences || exit
Expand Down
Loading