Skip to content

Commit

Permalink
triton-dehydrated#61 clean_challenge doesn't clean manta challenge (#62)
Browse files Browse the repository at this point in the history
Reviewed by: Dan McDonald <[email protected]>
Reviewed by: Travis Paul <[email protected]>
  • Loading branch information
bahamat authored Aug 22, 2023
1 parent ed35d6b commit 9c5b034
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
32 changes: 17 additions & 15 deletions cns-hook-util
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

# Copyright 2021 Joyent, Inc.
# Copyright 2023 MNX Cloud, Inc.

function getservice {
local vmuuid
Expand Down Expand Up @@ -168,7 +169,7 @@ function merge_token {
*)
# We should never hit this becuase it would have been filtered out
# much earlier.
echo "ERROR: Unknown serivce: $vmservice"
echo "ERROR: Unknown service: $vmservice"
;;
esac
fi
Expand Down Expand Up @@ -236,20 +237,21 @@ function clean_challenge {
mdata_delete "triton.cns.acme-challenge"
else
local vmuuid
case "$(getservice "${domain}")" in
cloudapi|adminui|docker|cmon|grafana)
local alias
alias="$(getservice "${domain}")0"
vmuuid="$(vmadm lookup alias="$alias")"
verifyvm "$domain" "$vmuuid"
echo "{\"remove_customer_metadata\":[\"triton.cns.acme-challenge\"]}" | \
vmadm update "$vmuuid"
;;
*)
# We should never hit this becuase it would have been filtered out
# much earlier.
echo "ERROR: Unknown serivce: $vmservice"
;;
vmservice="$(getservice "${domain}")"
case "$vmservice" in
cloudapi|adminui|docker|cmon|grafana|manta)
local alias
alias="$(getservice "${domain}")0"
vmuuid="$(vmadm lookup alias="$alias")"
verifyvm "$domain" "$vmuuid"
echo "{\"remove_customer_metadata\":[\"triton.cns.acme-challenge\"]}" | \
vmadm update "$vmuuid"
;;
*)
# We should never hit this becuase it would have been filtered out
# much earlier.
echo "ERROR: Unknown service: $vmservice"
;;
esac
fi

Expand Down
8 changes: 4 additions & 4 deletions config.ecdsa
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is for serivces that should use an ECDSA certificate. Currently,
# this is strongly recomended for CMON. Docker and AdminUI may also use ECDSA
# but by default will use RSA. CloudAPI and Manta, due to their use of stud,
# will crash if supplied with an ECDSA certificate.
# This file is for services that should use an ECDSA certificate. Currently,
# this is strongly recomended for CMON. All other services and clients support
# both RSA and ECDSA, but if you have an older version of some serives that use
# stud you will need to use RSA.
#
# To deploy an ECDSA certificate for cmon, create `domains.ecdsa.txt` with the
# name of your cmon zone (including a wildcard name). E.g.:
Expand Down

0 comments on commit 9c5b034

Please sign in to comment.