adds (extremely basic) certificate renewal
:: +register: create ACME service account
::
:: Note: accepts services ToS.
+ :: XX add rekey mechanism
::
++ register
^+ this
/acme/register/(scot %p our.bow)
%^ signed-request reg.dir i.nonces
[%o (my [['termsOfServiceAgreed' b+&] ~])]
- :: XX rekey
+ :: +renew: renew certificate
::
+ ++ renew
+ ^+ this
+ ~| %renew-effect-fail
+ ?. ?=(^ reg.act) ~|(%no-account !!)
+ ?. ?=(^ liv) ~|(%no-live-config !!)
+ new-order:effect(pen `dom.u.liv)
:: +new-order: create a new certificate order
::
++ new-order
:: XX expiration date
::
[dom.u.rod key.u.rod cer (add now.bow ~d90) ego.u.rod]
+ :: archive live config
+ ::
=? fig.hit ?=(^ liv) [u.liv fig.hit]
- :: XX set renewal timer
+ :: set live config, install certificate, set renewal timer
::
- install:effect(liv `fig, rod ~)
+ =< install:effect
+ (retry:effect(liv `fig, rod ~) /renew (add now.bow ~d60))
:: +get-authz: accept ACME service authorization object
::
++ get-authz
~&(unknown-retry+wir this)
%directory directory:effect
%register register:effect
+ %renew renew:effect
%new-order new-order:effect
%finalize-order finalize-order:effect
%check-order check-order:effect
