Skip to content

Commit e565ac5

Browse files
authored
v1.4.5 (#23)
Major updates * Adding support for setting bit length of RSA keys via SSL_KEY_BITS (default: 4096) * Add `ssl-regenerate-full` executable, which removes everything except DH parameters
1 parent 7ccb0b3 commit e565ac5

File tree

9 files changed

+32
-9
lines changed

9 files changed

+32
-9
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ENV \
1818
CLEAN_INSTALL=0 \
1919
# set to 1 to use live instead of staging server
2020
LETS_ENCRYPT_LIVE=0 \
21+
# set to the number of bits to use for generating private key
22+
SSL_KEY_BITS=4096 \
2123
# set to the number of bits to use for generating DHPARAM
2224
SSL_DHPARAM_BITS=4096 \
2325
# canonical domain name redirection

Dockerfile-automated

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ENV \
1818
CLEAN_INSTALL=0 \
1919
# set to 1 to use live instead of staging server
2020
LETS_ENCRYPT_LIVE=0 \
21+
# set to the number of bits to use for generating private key
22+
SSL_KEY_BITS=4096 \
2123
# set to the number of bits to use for generating DHPARAM
2224
SSL_DHPARAM_BITS=4096 \
2325
# canonical domain name redirection

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.4
1+
1.4.5

overlay/etc/cont-init.d/20-paths

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ add_env "TEMPLATES" "/etc/templates"
3131

3232
SSL=/ssl
3333
add_env "SSL" ${SSL}
34+
add_env "SSL_DHPARAM" "${SSL}/dhparam.pem"
3435

3536
SSL_CERTS=${SSL}/certs
3637
add_env "SSL_CERTS" "${SSL_CERTS}"
37-
add_env "SSL_DHPARAM" "${SSL_CERTS}/dhparam.pem"
3838
add_env "SSL_GLOBAL_CFG" "${SSL_CERTS}/${GETSSL_CFG}"
39+
add_env "SSL_ACCOUNT_KEY" "${SSL_CERTS}/account.key"
3940

4041
add_env "SITES" "/sites"
4142

overlay/etc/cont-init.d/21-ssl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if [ "${CLEAN_INSTALL}" = "1" ] ; then
1111

1212
bcg-echo "Clean install detected..."
1313
bcg-rmrf "${SSL_GLOBAL_CFG}"
14+
bcg-rmrf "${SSL_DHPARAM}"
1415
bcg-rmrf "${SSL_CERTS}/*"
1516
bcg-rmrf "${SITES}/*"
1617
bcg-done

overlay/etc/ssl/inc/setup-ssl.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88

99
generate_temp_cert () {
1010

11-
openssl req -newkey rsa:1024 \
11+
openssl req \
1212
-x509 \
1313
-sha256 \
14-
-days 3650 \
1514
-nodes \
16-
-out ${1} \
15+
-days 3650 \
16+
-newkey rsa:${SSL_KEY_BITS} \
1717
-keyout ${2} \
18+
-out ${1} \
1819
-subj "/C=NA/ST=NA/L=NA/O=NA/OU=NA/CN=${3}"
1920

2021
}

overlay/etc/templates/getssl-global.conf.esh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ CA="https://acme-staging-v02.api.letsencrypt.org"
1919
#AGREEMENT=""
2020

2121
# Set an email address associated with your account - generally set at account level rather than domain.
22-
ACCOUNT_EMAIL=<%= "${LETS_ENCRYPT_EMAIL}" %>
22+
ACCOUNT_EMAIL=<%= ${LETS_ENCRYPT_EMAIL} %>
2323
ACCOUNT_KEY_LENGTH=4096
24-
ACCOUNT_KEY="<%= "${SSL_CERTS}account.key" %>"
24+
ACCOUNT_KEY="<%= ${SSL_ACCOUNT_KEY} %>"
2525

2626
# Account key and private key types - can be rsa, prime256v1, secp384r1 or secp521r1
2727
#ACCOUNT_KEY_TYPE="rsa"
@@ -49,4 +49,4 @@ CHECK_REMOTE="true"
4949
#DNS_ADD_COMMAND=
5050
#DNS_DEL_COMMAND=
5151

52-
SKIP_HTTP_TOKEN_CHECK=<%= "${GETSSL_SKIP_HTTP_TOKEN_CHECK}" %>
52+
SKIP_HTTP_TOKEN_CHECK=<%= ${GETSSL_SKIP_HTTP_TOKEN_CHECK} %>

overlay/usr/local/bin/ssl-regenerate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -euo pipefail
77
# Delete SSL files and reinitialise
88
#======================================================================================================================
99

10-
bcg-echo "Removing SSL configuration files and certificates..."
10+
bcg-echo "Removing SSL certificates and configuration..."
1111
bcg-rmrf "${SSL_CERTS}/*"
1212
bcg-done
1313

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
set -euo pipefail
4+
5+
6+
#======================================================================================================================
7+
# Delete SSL files and reinitialise
8+
#======================================================================================================================
9+
10+
ssl-regenerate
11+
12+
bcg-echo "Removing DH parameters..."
13+
bcg-rmrf "${SSL_DHPARAM}"
14+
bcg-done
15+
16+
ssl-init

0 commit comments

Comments
 (0)