Skip to content

Commit 1752a42

Browse files
authored
Merge pull request #727 from buchdag/ci-fix
Fix LETSENCRYPT_KEYSIZE feature and tests
2 parents 2cc81fc + 6bfdd87 commit 1752a42

File tree

16 files changed

+31
-18
lines changed

16 files changed

+31
-18
lines changed

app/cleanup_test_artifacts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,16 @@ done
3131
for domain in le1.wtf le2.wtf le3.wtf le4.wtf lim.it; do
3232
folder="/etc/nginx/certs/$domain"
3333
[[ -d "$folder" ]] && rm -rf "$folder"
34+
folder="/etc/acme.sh/default/$domain"
35+
[[ -d "$folder" ]] && rm -rf "$folder"
36+
folder="/etc/acme.sh/default/${domain}_ecc"
37+
[[ -d "$folder" ]] && rm -rf "$folder"
3438
location_file="/etc/nginx/vhost.d/$domain"
3539
[[ -f "$location_file" ]] && rm -rf "$location_file" 2> /dev/null
3640
for extension in key crt chain.pem dhparam.pem; do
3741
symlink="/etc/nginx/certs/${domain}.${extension}"
3842
[[ -L "$symlink" ]] && rm -rf "$symlink"
3943
done
4044
done
45+
46+
exit 0

app/letsencrypt_service

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function update_cert {
143143

144144
local -n cert_keysize="LETSENCRYPT_${cid}_KEYSIZE"
145145
if [[ -z "$cert_keysize" || "$cert_keysize" == "<no value>" ]] || \
146-
[[ ! "$cert_keysize" =~ ^(2048|3072|4096|8192|ec-256|ec-384|ec-512)$ ]]; then
146+
[[ ! "$cert_keysize" =~ ^(2048|3072|4096|ec-256|ec-384)$ ]]; then
147147
cert_keysize=$DEFAULT_KEY_SIZE
148148
fi
149149
params_issue_arr+=(--keylength "$cert_keysize")
@@ -281,7 +281,9 @@ function update_cert {
281281
# Using amce.sh --preferred-chain to select alternate chain.
282282
params_issue_arr+=(--preferred-chain "$acme_preferred_chain")
283283
fi
284-
[[ "$RENEW_PRIVATE_KEYS" == false || "$REUSE_PRIVATE_KEYS" == true ]] && params_issue_arr+=(--always-force-new-domain-key)
284+
if [[ "$RENEW_PRIVATE_KEYS" != 'false' && "$REUSE_PRIVATE_KEYS" != 'true' ]]; then
285+
params_issue_arr+=(--always-force-new-domain-key)
286+
fi
285287
[[ "${2:-}" == "--force-renew" ]] && params_issue_arr+=(--force)
286288

287289
# Create directory for the first domain

docs/Let's-Encrypt-and-ACME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The `LETSENCRYPT_EMAIL` environment variable must be a valid email and will be u
5050

5151
#### Private key size
5252

53-
The `LETSENCRYPT_KEYSIZE` environment variable determines the type and size of the requested key. Supported values are `2048`, `3072`, `4096` and `8192` for RSA keys, and `ec-256`, `ec-384` or `ec-512` for elliptic curve keys. The default is RSA 4096.
53+
The `LETSENCRYPT_KEYSIZE` environment variable determines the type and size of the requested key. Supported values are `2048`, `3072` and `4096` for RSA keys, and `ec-256` or `ec-384` for elliptic curve keys. The default is RSA 4096.
5454

5555
#### Test certificates
5656

test/config.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
testAlias+=(
5-
[jrcs/letsencrypt-nginx-proxy-companion]='le-companion'
6-
)
7-
8-
imageTests+=(
9-
[le-companion]='
4+
globalTests+=(
105
docker_api
116
location_config
127
default_cert
@@ -21,5 +16,4 @@ imageTests+=(
2116
permissions_default
2217
permissions_custom
2318
symlinks
24-
'
2519
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)