Skip to content

Commit b7e3aff

Browse files
committed
Keep ACME staging private through a scoped transaction wrapper
1 parent 32d23eb commit b7e3aff

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎telemt-web-manager.sh‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,14 +492,15 @@ acme_probe() {
492492
return "$code"
493493
}
494494

495-
issue_webroot_certificate() (
495+
issue_webroot_certificate() {
496+
local parent_tmp=$TMP
497+
local TMP
498+
TMP=$(mktemp -d "$parent_tmp/acme.XXXXXXXX")
499+
(
496500
# Separate transaction: successful issuance keeps the renewal vhost even if
497501
# a later Telemt installation fails. Failure restores only ACME mutations.
498502
CERT_ONLY=1 INSTALLING=1 PLAN_MODE=acme
499503
CHANGED=() ORIGINAL=()
500-
local parent_tmp=$TMP
501-
local TMP
502-
TMP=$(mktemp -d "$parent_tmp/acme.XXXXXXXX")
503504
trap cleanup EXIT
504505
trap 'exit 130' INT
505506
trap 'exit 143' TERM HUP
@@ -527,7 +528,8 @@ issue_webroot_certificate() (
527528
validate_certificate
528529
helper renewal-contract "$CERT_ROOT" "$DOMAIN" "$ACME_ROOT" || die 'Certbot renewal webroot was not recorded as expected'
529530
ARMED=0
530-
)
531+
)
532+
}
531533

532534
prompt_install() {
533535
[[ -t 0 ]] || die 'Non-interactive install requires --domain and --public-ip (see --help)'

0 commit comments

Comments
 (0)