Mercurial Hosting > luan
changeset 2059:e22d4489aa7c acme-tiny
dont call acme_tiny in local test
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 13 Nov 2025 00:13:16 -0700 |
| parents | 1b0c38e26c94 |
| children | 546daa22aa39 |
| files | host/test/test_https.luan src/luan/host/https.luan |
| diffstat | 2 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/host/test/test_https.luan Wed Nov 12 23:42:12 2025 -0700 +++ b/host/test/test_https.luan Thu Nov 13 00:13:16 2025 -0700 @@ -14,7 +14,7 @@ local domain = "https.s3.luan.software" local site_dir = uri("file:local") local luanhost_dir = uri("file:..") -local dry_run = true +local dry_run = nil -- don't call acme_tiny site_dir.mkdir()
--- a/src/luan/host/https.luan Wed Nov 12 23:42:12 2025 -0700 +++ b/src/luan/host/https.luan Thu Nov 13 00:13:16 2025 -0700 @@ -92,25 +92,25 @@ local s = uri("bash:"..cmd).read_text() logger.info("create cert\n"..s) - -- Finally, get our cert signed by letsencrypt. - local cmd = [[ - ]]..luanhost_dir_str..[[/acme_tiny --account-key ]]..luanhost_dir_str..[[/local/tiny_account.key \ - --csr ]]..csr_file_str..[[ \ - --acme-dir ]]..acme_challenges..[[ \ - ]] - if dry_run then - local dry_run_dir_url = "https://acme-staging-v02.api.letsencrypt.org/directory" - cmd = cmd.." --directory-url "..dry_run_dir_url + if dry_run == nil then + logger.info("don't call acme_tiny") + else + -- Finally, get our cert signed by letsencrypt. + local cmd = [[ + ./acme_tiny --account-key ./local/tiny_account.key \ + --csr ]]..csr_file_str..[[ \ + --acme-dir ]]..acme_challenges..[[ \ + ]] + if dry_run then + local dry_run_dir_url = "https://acme-staging-v02.api.letsencrypt.org/directory" + cmd = cmd.." --directory-url "..dry_run_dir_url + end + local local_cer_file_str = local_cer_file.canonical().to_string() + cmd = cmd.."> "..local_cer_file_str + + local s = uri("bash:"..cmd).read_text() + logger.info("get cert signed by letsencrypt\n"..s) end - local local_cer_file_str = local_cer_file.canonical().to_string() - cmd = cmd.."> "..local_cer_file_str - - local s = uri("bash:"..cmd).read_text() - logger.info("get cert signed by letsencrypt\n"..s) - - -- The above http requests made by acme_tiny are the only thing - -- that could cause a recursion so it is safe to delete the guard here. - catch e logger.error("Error setting up ACME: "..e) finally
