Skip to content

Commit 49ed112

Browse files
authored
Merge pull request #6523 from acmesh-official/dev
sync
2 parents 20c80f5 + 471e0c0 commit 49ed112

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

.github/workflows/Linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
Linux:
2727
strategy:
2828
matrix:
29-
os: ["ubuntu:latest", "debian:latest", "almalinux:latest", "fedora:latest", "opensuse/leap:latest", "alpine:latest", "oraclelinux:8", "kalilinux/kali", "archlinux:latest", "mageia", "gentoo/stage3"]
29+
os: ["ubuntu:latest", "debian:latest", "almalinux:latest", "fedora:latest", "opensuse/leap:latest", "alpine:latest", "oraclelinux:8", "kalilinux/kali", "archlinux:latest", "gentoo/stage3"]
3030
runs-on: ubuntu-latest
3131
env:
3232
TEST_LOCAL: 1

acme.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ _SUB_FOLDERS="$_SUB_FOLDER_DNSAPI $_SUB_FOLDER_DEPLOY $_SUB_FOLDER_NOTIFY"
2323
CA_LETSENCRYPT_V2="https://acme-v02.api.letsencrypt.org/directory"
2424
CA_LETSENCRYPT_V2_TEST="https://acme-staging-v02.api.letsencrypt.org/directory"
2525

26-
CA_BUYPASS="https://api.buypass.com/acme/directory"
27-
CA_BUYPASS_TEST="https://api.test4.buypass.no/acme/directory"
28-
2926
CA_ZEROSSL="https://acme.zerossl.com/v2/DV90"
3027
_ZERO_EAB_ENDPOINT="https://api.zerossl.com/acme/eab-credentials-email"
3128

@@ -42,14 +39,12 @@ CA_NAMES="
4239
ZeroSSL.com,zerossl
4340
LetsEncrypt.org,letsencrypt
4441
LetsEncrypt.org_test,letsencrypt_test,letsencrypttest
45-
BuyPass.com,buypass
46-
BuyPass.com_test,buypass_test,buypasstest
4742
SSL.com,sslcom
4843
Google.com,google
4944
Google.com_test,googletest,google_test
5045
"
5146

52-
CA_SERVERS="$CA_ZEROSSL,$CA_LETSENCRYPT_V2,$CA_LETSENCRYPT_V2_TEST,$CA_BUYPASS,$CA_BUYPASS_TEST,$CA_SSLCOM_RSA,$CA_GOOGLE,$CA_GOOGLE_TEST"
47+
CA_SERVERS="$CA_ZEROSSL,$CA_LETSENCRYPT_V2,$CA_LETSENCRYPT_V2_TEST,$CA_SSLCOM_RSA,$CA_GOOGLE,$CA_GOOGLE_TEST"
5348

5449
DEFAULT_USER_AGENT="$PROJECT_NAME/$VER ($PROJECT)"
5550

@@ -5478,10 +5473,6 @@ renew() {
54785473
_info "Switching back to $CA_LETSENCRYPT_V2"
54795474
Le_API="$CA_LETSENCRYPT_V2"
54805475
;;
5481-
"$CA_BUYPASS_TEST")
5482-
_info "Switching back to $CA_BUYPASS"
5483-
Le_API="$CA_BUYPASS"
5484-
;;
54855476
"$CA_GOOGLE_TEST")
54865477
_info "Switching back to $CA_GOOGLE"
54875478
Le_API="$CA_GOOGLE"

deploy/truenas_ws.sh

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ _ws_call() {
3939
_debug "_ws_call arg2" "$2"
4040
_debug "_ws_call arg3" "$3"
4141
if [ $# -eq 3 ]; then
42-
_ws_response=$(midclt -K "$DEPLOY_TRUENAS_APIKEY" call "$1" "$2" "$3")
42+
_ws_response=$(midclt --uri "$_ws_uri" -K "$DEPLOY_TRUENAS_APIKEY" call "$1" "$2" "$3")
4343
fi
4444
if [ $# -eq 2 ]; then
45-
_ws_response=$(midclt -K "$DEPLOY_TRUENAS_APIKEY" call "$1" "$2")
45+
_ws_response=$(midclt --uri "$_ws_uri" -K "$DEPLOY_TRUENAS_APIKEY" call "$1" "$2")
4646
fi
4747
if [ $# -eq 1 ]; then
48-
_ws_response=$(midclt -K "$DEPLOY_TRUENAS_APIKEY" call "$1")
48+
_ws_response=$(midclt --uri "$_ws_uri" -K "$DEPLOY_TRUENAS_APIKEY" call "$1")
4949
fi
5050
_debug "_ws_response" "$_ws_response"
5151
printf "%s" "$_ws_response"
@@ -60,7 +60,7 @@ _ws_upload_cert() {
6060
import sys
6161
6262
from truenas_api_client import Client
63-
with Client() as c:
63+
with Client(uri="$_ws_uri") as c:
6464
6565
### Login with API key
6666
print("I:Trying to upload new certificate...")
@@ -121,7 +121,7 @@ _ws_check_jobid() {
121121
# n/a
122122
_ws_get_job_result() {
123123
while true; do
124-
sleep 2
124+
_sleep 2
125125
_ws_response=$(_ws_call "core.get_jobs" "[[\"id\", \"=\", $1]]")
126126
if [ "$(printf "%s" "$_ws_response" | jq -r '.[]."state"')" != "RUNNING" ]; then
127127
_ws_result="$(printf "%s" "$_ws_response" | jq '.[]."result"')"
@@ -179,11 +179,27 @@ truenas_ws_deploy() {
179179

180180
_info "Checking environment variables..."
181181
_getdeployconf DEPLOY_TRUENAS_APIKEY
182+
_getdeployconf DEPLOY_TRUENAS_HOSTNAME
183+
_getdeployconf DEPLOY_TRUENAS_PROTOCOL
182184
# Check API Key
183185
if [ -z "$DEPLOY_TRUENAS_APIKEY" ]; then
184186
_err "TrueNAS API key not found, please set the DEPLOY_TRUENAS_APIKEY environment variable."
185187
return 1
186188
fi
189+
# Check Hostname, default to localhost if not set
190+
if [ -z "$DEPLOY_TRUENAS_HOSTNAME" ]; then
191+
_info "TrueNAS hostname not set. Using 'localhost'."
192+
DEPLOY_TRUENAS_HOSTNAME="localhost"
193+
fi
194+
# Check protocol, default to ws if not set
195+
if [ -z "$DEPLOY_TRUENAS_PROTOCOL" ]; then
196+
_info "TrueNAS protocol not set. Using 'ws'."
197+
DEPLOY_TRUENAS_PROTOCOL="ws"
198+
fi
199+
_ws_uri="$DEPLOY_TRUENAS_PROTOCOL://$DEPLOY_TRUENAS_HOSTNAME/websocket"
200+
_debug2 DEPLOY_TRUENAS_HOSTNAME "$DEPLOY_TRUENAS_HOSTNAME"
201+
_debug2 DEPLOY_TRUENAS_PROTOCOL "$DEPLOY_TRUENAS_PROTOCOL"
202+
_debug _ws_uri "$_ws_uri"
187203
_secure_debug2 DEPLOY_TRUENAS_APIKEY "$DEPLOY_TRUENAS_APIKEY"
188204
_info "Environment variables: OK"
189205

@@ -205,6 +221,8 @@ truenas_ws_deploy() {
205221
return 2
206222
fi
207223
_savedeployconf DEPLOY_TRUENAS_APIKEY "$DEPLOY_TRUENAS_APIKEY"
224+
_savedeployconf DEPLOY_TRUENAS_HOSTNAME "$DEPLOY_TRUENAS_HOSTNAME"
225+
_savedeployconf DEPLOY_TRUENAS_PROTOCOL "$DEPLOY_TRUENAS_PROTOCOL"
208226
_info "TrueNAS health: OK"
209227

210228
########## System info
@@ -304,7 +322,7 @@ truenas_ws_deploy() {
304322
_info "Restarting WebUI..."
305323
_ws_response=$(_ws_call "system.general.ui_restart")
306324
_info "Waiting for UI restart..."
307-
sleep 6
325+
_sleep 15
308326

309327
########## Certificates
310328

0 commit comments

Comments
 (0)