Skip to content
Merged

sync #6409

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
24a1b93
Add deploy/zyxel_gs1900.sh
coderjoe Mar 2, 2024
ca73e1f
added deploy/kemplm.sh for deploying certs on Kemp Loadmaster
ecm75 May 12, 2025
7543d52
fixed kemplm.sh formatting
ecm75 May 12, 2025
bf2e99e
fixed quoting in kemplm.sh
ecm75 May 12, 2025
b82f680
Set DNS Record TTL to 60 instead of 300 sec
youpsie May 16, 2025
4f5a70b
Apply suggested fixes from shfmt diffs
coderjoe May 18, 2025
5528285
implemented all suggestions
ecm75 May 19, 2025
426305d
Merge branch 'dev' into dev
youpsie May 19, 2025
f132010
dns_edgecenter.sh: fix structural info
stokito May 19, 2025
133ae85
dns_freemyip.sh: fix strutural info
stokito May 19, 2025
8241b07
docs (dns_tencent) : update documentation links
KincaidYang May 23, 2025
9e75b70
Merge pull request #1 from KincaidYang/KincaidYang-patch-1
KincaidYang May 23, 2025
af5d046
Merge pull request #6367 from KincaidYang/dev
Neilpang May 24, 2025
58a7b9f
Merge pull request #6366 from stokito/patch-1
Neilpang May 24, 2025
ed1adfd
Merge pull request #6355 from ymol-spraaklab/dev
Neilpang May 24, 2025
d420ff0
Merge pull request #5043 from coderjoe/feature/deploy-to-zyxel-gs1900…
Neilpang May 25, 2025
28687ad
Issue 3968: Fix missing api password encoding.
schlegel11 May 31, 2025
7b76502
Merge pull request #6352 from ecm75/kemploadmaster
Neilpang May 31, 2025
3d8b682
Merge pull request #6380 from schlegel11/master
Neilpang May 31, 2025
f2b2482
Configure 10 second timeout to ACME_DIRECTORY API call
diamondo25 Jun 10, 2025
242085d
add support for AIX style netstat
laDanz Jun 17, 2025
c338f1a
Merge pull request #6404 from laDanz/master
Neilpang Jun 21, 2025
21c758c
Merge pull request #6393 from diamondo25/dev-configure-acme_directory…
Neilpang Jun 21, 2025
4a16aaa
add
Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/wiki-monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Notify via Issue on Wiki Edit

on:
gollum:

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Generate wiki change message
run: |
echo "Wiki page:" > wiki-change-msg.txt
echo "User: ${{ github.actor }}" >> wiki-change-msg.txt
echo "Time: $(date '+%Y-%m-%d %H:%M:%S')" >> wiki-change-msg.txt
echo "" >> wiki-change-msg.txt
for page in $(jq -r '.gollum.pages[].html_url' "$GITHUB_EVENT_PATH"); do
echo "Path: $page" >> wiki-change-msg.txt
done

- name: Create issue to notify Neilpang
uses: peter-evans/create-issue-from-file@v5
with:
title: "Wiki page"
content-filepath: ./wiki-change-msg.txt
assignees: Neilpang
env:
TZ: Asia/Shanghai





8 changes: 7 additions & 1 deletion acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,12 @@ _ss() {
return 0
fi

if [ "$(uname)" = "AIX" ]; then
_debug "Using: AIX netstat"
netstat -an | grep "^tcp" | grep "LISTEN" | grep "\.$_port "
return 0
fi

if _exists "netstat"; then
_debug "Using: netstat"
if netstat -help 2>&1 | grep "\-p proto" >/dev/null; then
Expand Down Expand Up @@ -2761,7 +2767,7 @@ _initAPI() {
_request_retry_times=0
while [ -z "$ACME_NEW_ACCOUNT" ] && [ "${_request_retry_times}" -lt "$MAX_API_RETRY_TIMES" ]; do
_request_retry_times=$(_math "$_request_retry_times" + 1)
response=$(_get "$_api_server")
response=$(_get "$_api_server" "" 10)
if [ "$?" != "0" ]; then
_debug2 "response" "$response"
_info "Cannot init API for: $_api_server."
Expand Down
98 changes: 98 additions & 0 deletions deploy/kemplm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env sh

#Here is a script to deploy cert to a Kemp Loadmaster.

#returns 0 means success, otherwise error.

#DEPLOY_KEMP_TOKEN="token"
#DEPLOY_KEMP_URL="https://kemplm.example.com"

######## Public functions #####################

#domain keyfile certfile cafile fullchain
kemplm_deploy() {
_domain="$1"
_key_file="$2"
_cert_file="$3"
_ca_file="$4"
_fullchain_file="$5"

_debug _domain "$_domain"
_debug _key_file "$_key_file"
_debug _cert_file "$_cert_file"
_debug _ca_file "$_ca_file"
_debug _fullchain_file "$_fullchain_file"

if ! _exists jq; then
_err "jq not found"
return 1
fi

# Rename wildcard certs, kemp accepts only alphanumeric names so we delete '*.' from filename
_kemp_domain=$(echo "${_domain}" | sed 's/\*\.//')
_debug _kemp_domain "$_kemp_domain"

# Read config from saved values or env
_getdeployconf DEPLOY_KEMP_TOKEN
_getdeployconf DEPLOY_KEMP_URL

_debug DEPLOY_KEMP_URL "$DEPLOY_KEMP_URL"
_secure_debug DEPLOY_KEMP_TOKEN "$DEPLOY_KEMP_TOKEN"

if [ -z "$DEPLOY_KEMP_TOKEN" ]; then
_err "Kemp Loadmaster token is not found, please define DEPLOY_KEMP_TOKEN."
return 1
fi
if [ -z "$DEPLOY_KEMP_URL" ]; then
_err "Kemp Loadmaster URL is not found, please define DEPLOY_KEMP_URL."
return 1
fi

# Save current values
_savedeployconf DEPLOY_KEMP_TOKEN "$DEPLOY_KEMP_TOKEN"
_savedeployconf DEPLOY_KEMP_URL "$DEPLOY_KEMP_URL"

# Check if certificate is already installed
_info "Check if certificate is already present"
_list_request="{\"cmd\": \"listcert\", \"apikey\": \"${DEPLOY_KEMP_TOKEN}\"}"
_debug3 _list_request "${_list_request}"
_kemp_cert_count=$(HTTPS_INSECURE=1 _post "${_list_request}" "${DEPLOY_KEMP_URL}/accessv2" | jq -r '.cert[] | .name' | grep -c "${_kemp_domain}")
_debug2 _kemp_cert_count "${_kemp_cert_count}"

_kemp_replace_cert=1
if [ "${_kemp_cert_count}" -eq 0 ]; then
_kemp_replace_cert=0
_info "Certificate does not exist on Kemp Loadmaster"
else
_info "Certificate already exists on Kemp Loadmaster"
fi
_debug _kemp_replace_cert "${_kemp_replace_cert}"

# Upload new certificate to Kemp Loadmaster
_kemp_upload_cert=$(_mktemp)
cat "${_fullchain_file}" "${_key_file}" | base64 | tr -d '\n' >"${_kemp_upload_cert}"

_info "Uploading certificate to Kemp Loadmaster"
_add_data=$(cat "${_kemp_upload_cert}")
_add_request="{\"cmd\": \"addcert\", \"apikey\": \"${DEPLOY_KEMP_TOKEN}\", \"replace\": ${_kemp_replace_cert}, \"cert\": \"${_kemp_domain}\", \"data\": \"${_add_data}\"}"
_debug3 _add_request "${_add_request}"
_kemp_post_result=$(HTTPS_INSECURE=1 _post "${_add_request}" "${DEPLOY_KEMP_URL}/accessv2")
_retval=$?
_debug2 _kemp_post_result "${_kemp_post_result}"
if [ "${_retval}" -eq 0 ]; then
_kemp_post_status=$(echo "${_kemp_post_result}" | jq -r '.status')
_kemp_post_message=$(echo "${_kemp_post_result}" | jq -r '.message')
if [ "${_kemp_post_status}" = "ok" ]; then
_info "Upload successful"
else
_err "Upload failed: ${_kemp_post_message}"
fi
else
_err "Upload failed"
_retval=1
fi

rm "${_kemp_upload_cert}"

return $_retval
}
Loading