Skip to content

Commit 3c7fe02

Browse files
committed
Feature: Enable Letsencrypt staging enviorment
when LE_STAGING=TRUE is present in hestia.conf - prevents hitting LE cert limits when testing - cannot switch between PROD and STAGING and back, LE user profiles are bound to the URL (a cleanup on LE config is required to make this posibble)
1 parent 2f45700 commit 3c7fe02

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

bin/v-add-letsencrypt-domain

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ domain=$2
1515
aliases=$3
1616
mail=$4
1717

18-
# LE API
19-
LE_API='https://acme-v02.api.letsencrypt.org'
20-
2118
# Includes
2219
source $HESTIA/func/main.sh
2320
source $HESTIA/func/domain.sh
2421
source $HESTIA/conf/hestia.conf
2522

23+
# LE API
24+
LE_API='https://acme-v02.api.letsencrypt.org'
25+
26+
if [[ "$LE_STAGING" =~ ^(YES|TRUE)$ ]]; then
27+
LE_API='https://acme-staging-v02.api.letsencrypt.org'
28+
fi
29+
2630
# encode base64
2731
encode_base64() {
2832
cat |base64 |tr '+/' '-_' |tr -d '\r\n='

bin/v-add-letsencrypt-user

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
# Argument definition
1313
user=$1
1414

15-
# LE API
16-
LE_API='https://acme-v02.api.letsencrypt.org'
17-
1815
# Includes
1916
source $HESTIA/func/main.sh
2017
source $HESTIA/conf/hestia.conf
2118

19+
# LE API
20+
LE_API='https://acme-v02.api.letsencrypt.org'
21+
22+
if [[ "$LE_STAGING" =~ ^(YES|TRUE)$ ]]; then
23+
LE_API='https://acme-staging-v02.api.letsencrypt.org'
24+
fi
25+
2226
# encode base64
2327
encode_base64() {
2428
cat |base64 |tr '+/' '-_' |tr -d '\r\n='

0 commit comments

Comments
 (0)