You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openwrt-22.03/patches/package/acme-common/files/acme.sh
+32-14Lines changed: 32 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,9 @@
8
8
#
9
9
# Authors: Toke Høiland-Jørgensen <toke@toke.dk>
10
10
11
-
export state_dir='/etc/acme'
12
-
export account_email=
13
-
export debug=0
14
-
export challenge_dir='/var/run/acme/challenge'
11
+
run_dir=/var/run/acme
12
+
export CHALLENGE_DIR=$run_dir/challenge
13
+
export CERT_DIR=/etc/ssl/acme
15
14
NFT_HANDLE=
16
15
HOOK=/usr/lib/acme/hook
17
16
LOG_TAG=acme
@@ -23,6 +22,9 @@ LOG_TAG=acme
23
22
24
23
cleanup() {
25
24
log debug "cleaning up"
25
+
if [ -e$run_dir/lock ];then
26
+
rm $run_dir/lock
27
+
fi
26
28
if [ "$NFT_HANDLE" ];then
27
29
# $NFT_HANDLE contains the string 'handle XX' so pass it unquoted to nft
28
30
nft delete rule inet fw4 input $NFT_HANDLE
@@ -33,7 +35,7 @@ load_options() {
33
35
section=$1
34
36
35
37
# compatibility for old option name
36
-
config_get_bool use_staging"$section"staging
38
+
config_get_bool staging"$section"use_staging
37
39
if [ -z"$staging" ];then
38
40
config_get_bool staging "$section" staging 0
39
41
fi
@@ -56,11 +58,13 @@ load_options() {
56
58
export days
57
59
config_get standalone "$section" standalone 0
58
60
export standalone
61
+
config_get dns_wait "$section" dns_wait
62
+
export dns_wait
59
63
60
64
config_get webroot "$section" webroot
61
65
export webroot
62
66
if [ "$webroot" ];then
63
-
log warn "Option \"webroot\" is deprecated, please remove it and change your web server's config so it serves ACME challenge requests from /var/run/acme/challenge."
67
+
log warn "Option \"webroot\" is deprecated, please remove it and change your web server's config so it serves ACME challenge requests from $CHALLENGE_DIR."
64
68
fi
65
69
}
66
70
@@ -76,7 +80,7 @@ get_cert() {
76
80
77
81
load_options "$section"
78
82
if [ -z"$dns" ] && [ "$standalone"= 0 ];then
79
-
mkdir -p "$challenge_dir"
83
+
mkdir -p "$CHALLENGE_DIR"
80
84
fi
81
85
82
86
if [ "$standalone"= 1 ] && [ -z"$NFT_HANDLE" ];then
@@ -102,11 +106,19 @@ load_globals() {
102
106
log err "account_email option is required"
103
107
exit 1
104
108
fi
109
+
export account_email
110
+
111
+
config_get state_dir "$section" state_dir
112
+
if [ "$state_dir" ];then
113
+
log warn "Option \"state_dir\" is deprecated, please remove it. Certificates now exist in $CERT_DIR."
0 commit comments