Skip to content

Commit 0f3a1fb

Browse files
committed
build: acme.sh 2.9.0 -> 3.0.7
1 parent 06a5f5e commit 0f3a1fb

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM nginxproxy/docker-gen:0.11.0 AS docker-gen
33
FROM alpine:3.19.0
44

55
ARG GIT_DESCRIBE
6-
ARG ACMESH_VERSION=2.9.0
6+
ARG ACMESH_VERSION=3.0.7
77

88
ENV COMPANION_VERSION=$GIT_DESCRIBE \
99
DOCKER_HOST=unix:///var/run/docker.sock \

app/letsencrypt_service

+7-4
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,12 @@ function update_cert {
198198

199199
# Set relevant --server parameter and ca folder name
200200
params_base_arr+=(--server "$acme_ca_uri")
201-
local ca_dir="${acme_ca_uri##*://}" \
202-
&& ca_dir="${ca_dir%%/*}" \
203-
&& ca_dir="${ca_dir%%:*}"
201+
202+
# Reproduce acme.sh logic to determine the ca account folder path
203+
local ca_host_dir
204+
ca_host_dir="$(echo "$acme_ca_uri" | cut -d : -f 2 | tr -s / | cut -d / -f 2)"
205+
local ca_path_dir
206+
ca_path_dir="$(echo "$acme_ca_uri" | cut -d : -f 2- | tr -s / | cut -d / -f 3-)"
204207

205208
local certificate_dir
206209
# If we're going to use one of LE stating endpoints ...
@@ -223,7 +226,7 @@ function update_cert {
223226

224227
[[ ! -d "$config_home" ]] && mkdir -p "$config_home"
225228
params_base_arr+=(--config-home "$config_home")
226-
local account_file="${config_home}/ca/${ca_dir}/account.json"
229+
local account_file="${config_home}/ca/${ca_host_dir}/${ca_path_dir}/account.json"
227230

228231
# External Account Binding (EAB)
229232
local -n eab_kid="ACME_${cid}_EAB_KID"

install_acme.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apk --no-cache --virtual .acmesh-deps add git
77

88
# Get acme.sh ACME client source
99
mkdir /src
10-
git -C /src clone https://github.com/Neilpang/acme.sh.git
10+
git -C /src clone https://github.com/acmesh-official/acme.sh.git
1111
cd /src/acme.sh
1212
if [[ "$ACMESH_VERSION" != "master" ]]; then
1313
git -c advice.detachedHead=false checkout "$ACMESH_VERSION"

test/tests/acme_accounts/run.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@ run_nginx_container --hosts "${domains[0]}"
3131
# Wait for a symlink at /etc/nginx/certs/${domains[0]}.crt
3232
wait_for_symlink "${domains[0]}" "$le_container_name"
3333

34+
# Hard set the account dir based on the test ACME CA used.
35+
case $ACME_CA in
36+
pebble)
37+
account_dir="pebble/dir"
38+
;;
39+
boulder)
40+
account_dir="boulder/directory"
41+
;;
42+
*)
43+
echo "$0 $ACME_CA: invalid option."
44+
exit 1
45+
esac
46+
3447
# Test if the expected folder / file / content are there.
35-
json_file="/etc/acme.sh/default/ca/$ACME_CA/account.json"
48+
json_file="/etc/acme.sh/default/ca/$account_dir/account.json"
3649
if [[ "$ACME_CA" == 'boulder' ]]; then
3750
no_mail_str='[]'
3851
elif [[ "$ACME_CA" == 'pebble' ]]; then
@@ -64,7 +77,7 @@ run_nginx_container --hosts "${domains[1]}"
6477
wait_for_symlink "${domains[1]}" "$le_container_name"
6578

6679
# Test if the expected folder / file / content are there.
67-
json_file="/etc/acme.sh/${default_email}/ca/$ACME_CA/account.json"
80+
json_file="/etc/acme.sh/${default_email}/ca/$account_dir/account.json"
6881
if docker exec "$le_container_name" [[ ! -d "/etc/acme.sh/$default_email" ]]; then
6982
echo "The /etc/acme.sh/$default_email folder does not exist."
7083
elif docker exec "$le_container_name" [[ ! -f "$json_file" ]]; then
@@ -82,7 +95,7 @@ run_nginx_container --hosts "${domains[2]}" --cli-args "--env LETSENCRYPT_EMAIL=
8295
wait_for_symlink "${domains[2]}" "$le_container_name"
8396

8497
# Test if the expected folder / file / content are there.
85-
json_file="/etc/acme.sh/${container_email}/ca/$ACME_CA/account.json"
98+
json_file="/etc/acme.sh/${container_email}/ca/$account_dir/account.json"
8699
if docker exec "$le_container_name" [[ ! -d "/etc/acme.sh/$container_email" ]]; then
87100
echo "The /etc/acme.sh/$container_email folder does not exist."
88101
elif docker exec "$le_container_name" [[ ! -f "$json_file" ]]; then

test/tests/acme_eab/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ run_nginx_container --hosts "${domains[1]}" \
4646
wait_for_symlink "${domains[0]}" "$le_container_name"
4747

4848
# Test if the expected file is there.
49-
config_path="/etc/acme.sh/default/ca/$ACME_CA"
49+
config_path="/etc/acme.sh/default/ca/$ACME_CA/dir"
5050
json_file="${config_path}/account.json"
5151
conf_file="${config_path}/ca.conf"
5252
if docker exec "$le_container_name" [[ ! -f "$json_file" ]]; then
@@ -59,7 +59,7 @@ fi
5959
wait_for_symlink "${domains[1]}" "$le_container_name"
6060

6161
# Test if the expected file is there.
62-
config_path="/etc/acme.sh/${container_email}/ca/$ACME_CA"
62+
config_path="/etc/acme.sh/${container_email}/ca/$ACME_CA/dir"
6363
json_file="${config_path}/account.json"
6464
conf_file="${config_path}/ca.conf"
6565
if docker exec "$le_container_name" [[ ! -f "$json_file" ]]; then

0 commit comments

Comments
 (0)