Skip to content

Commit 8f378f3

Browse files
pandafynemesifier
authored andcommitted
[fix] Updated auto-install script prompt for SSL certificate #556
Removed CERT_ADMIN_EMAIL setting as Let's Encrypt no long sends expiration email to the user. Fixes #556
1 parent 9d3db88 commit 8f378f3

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ UWSGI_LISTEN=100
2727
# Additional
2828
SSL_CERT_MODE=SelfSigned
2929
TZ=UTC
30-
CERT_ADMIN_EMAIL=example@example.org
3130
DJANGO_LANGUAGE_CODE=en-gb
3231
DB_NAME=openwisp
3332
INFLUXDB_NAME=openwisp

deploy/auto-install.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ setup_docker_openwisp() {
117117
echo -ne ${GRN}"(4/5) Site manager email: "${NON}
118118
read django_default_email
119119
# SSL Configuration
120-
echo -ne ${GRN}"(5/5) Enter letsencrypt email (leave blank for self-signed certificate): "${NON}
121-
read letsencrypt_email
120+
echo -ne ${GRN}"(5/5) Use Let's Encrypt SSL? (y/N, blank for no): "${NON}
121+
read use_letsencrypt
122122
else
123123
cp $env_path $ENV_USER &>>$LOG_FILE
124124
fi
@@ -161,11 +161,11 @@ setup_docker_openwisp() {
161161
python3 $INSTALL_PATH/build.py change-secret-key >/dev/null
162162
python3 $INSTALL_PATH/build.py change-database-credentials >/dev/null
163163
# SSL Configuration
164-
set_env "CERT_ADMIN_EMAIL" "$letsencrypt_email"
165-
if [[ -z "$letsencrypt_email" ]]; then
166-
set_env "SSL_CERT_MODE" "SelfSigned"
167-
else
164+
use_letsencrypt_lower=$(echo "$use_letsencrypt" | tr '[:upper:]' '[:lower:]')
165+
if [[ "$use_letsencrypt_lower" == "y" || "$use_letsencrypt_lower" == "yes" ]]; then
168166
set_env "SSL_CERT_MODE" "Yes"
167+
else
168+
set_env "SSL_CERT_MODE" "SelfSigned"
169169
fi
170170
# Other
171171
hostname=$(echo "$django_default_email" | cut -d @ -f 2)

docs/user/settings.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ properly on your system.
7272
<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`__.
7373
- **Default:** ``UTC``.
7474

75-
``CERT_ADMIN_EMAIL``
76-
~~~~~~~~~~~~~~~~~~~~
77-
78-
- **Explanation:** Required by certbot. Email used for registration and
79-
recovery contact.
80-
- **Valid Values:** A comma separated list of valid email addresses.
81-
- **Default:** ``example@example.com``.
82-
8375
``SSL_CERT_MODE``
8476
~~~~~~~~~~~~~~~~~
8577

images/common/utils.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ function create_prod_certs {
3232
if [ ! -f /etc/letsencrypt/live/${DASHBOARD_DOMAIN}/privkey.pem ]; then
3333
certbot certonly --standalone --noninteractive --agree-tos \
3434
--rsa-key-size 4096 \
35-
--domain ${DASHBOARD_DOMAIN} \
36-
--email ${CERT_ADMIN_EMAIL}
35+
--domain ${DASHBOARD_DOMAIN}
3736
fi
3837
if [ ! -f /etc/letsencrypt/live/${API_DOMAIN}/privkey.pem ]; then
3938
certbot certonly --standalone --noninteractive --agree-tos \
4039
--rsa-key-size 4096 \
41-
--domain ${API_DOMAIN} \
42-
--email ${CERT_ADMIN_EMAIL}
40+
--domain ${API_DOMAIN}
4341
fi
4442
}
4543

images/openwisp_nginx/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ ENV MODULE_NAME=nginx \
2626
DOLLAR=$ \
2727
TZ=UTC \
2828
SSL_CERT_MODE=Yes \
29-
CERT_ADMIN_EMAIL=example@example.com \
3029
NGINX_HTTP2=http2 \
3130
NGINX_CLIENT_BODY_SIZE=30 \
3231
NGINX_ADMIN_ALLOW_NETWORK=all \

0 commit comments

Comments
 (0)