From 752f3d3a41f34a9ae0572aee7f9cbcf17e2f823c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 29 Jan 2016 09:36:37 +0100 Subject: [PATCH] Add a Uri prop to choose between production or staging CA And default to staging --- root/etc/e-smith/db/configuration/defaults/letsencrypt/Uri | 1 + .../e-smith/templates/etc/letsencrypt.sh/config.sh/10Uri | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 root/etc/e-smith/db/configuration/defaults/letsencrypt/Uri create mode 100644 root/etc/e-smith/templates/etc/letsencrypt.sh/config.sh/10Uri diff --git a/root/etc/e-smith/db/configuration/defaults/letsencrypt/Uri b/root/etc/e-smith/db/configuration/defaults/letsencrypt/Uri new file mode 100644 index 0000000..dcd5906 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/letsencrypt/Uri @@ -0,0 +1 @@ +staging diff --git a/root/etc/e-smith/templates/etc/letsencrypt.sh/config.sh/10Uri b/root/etc/e-smith/templates/etc/letsencrypt.sh/config.sh/10Uri new file mode 100644 index 0000000..8fa1cf5 --- /dev/null +++ b/root/etc/e-smith/templates/etc/letsencrypt.sh/config.sh/10Uri @@ -0,0 +1,14 @@ +{ + +my $uri = $letsencrypt{'Uri'} || 'staging'; +if ($uri =~ m{^https?://}){ + $OUT .= "CA=$uri\n"; +} +elsif ($uri =~ m/^(test(ing)?)|staging$/){ + $OUT .= "CA=https://acme-staging.api.letsencrypt.org/directory\n"; +} +elsif ($uri =~ m/^prod/){ + $OUT .= "CA=https://acme-v01.api.letsencrypt.org/directory\n"; +} + +}