mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-01-14 20:22:13 +08:00
Merge pull request #6748 from acmesh-official/dev
Some checks failed
DNS / CheckToken (push) Has been cancelled
DragonFlyBSD / DragonFlyBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
FreeBSD / FreeBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
FreeBSD / FreeBSD (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Haiku / Haiku (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Haiku / Haiku (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Linux / Linux (almalinux:latest) (push) Has been cancelled
Linux / Linux (alpine:latest) (push) Has been cancelled
Linux / Linux (archlinux:latest) (push) Has been cancelled
Linux / Linux (debian:latest) (push) Has been cancelled
Linux / Linux (fedora:latest) (push) Has been cancelled
Linux / Linux (gentoo/stage3) (push) Has been cancelled
Linux / Linux (kalilinux/kali) (push) Has been cancelled
Linux / Linux (opensuse/leap:latest) (push) Has been cancelled
Linux / Linux (oraclelinux:8) (push) Has been cancelled
Linux / Linux (ubuntu:latest) (push) Has been cancelled
MacOS / MacOS (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
NetBSD / NetBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Omnios / Omnios (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Omnios / Omnios (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenBSD / OpenBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenIndiana / OpenIndiana (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenIndiana / OpenIndiana (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
PebbleStrict / PebbleStrict (push) Has been cancelled
PebbleStrict / PebbleStrict_IPCert (push) Has been cancelled
Solaris / Solaris (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Windows / Windows (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Build DockerHub / CheckToken (push) Has been cancelled
Shellcheck / ShellCheck (push) Has been cancelled
Shellcheck / shfmt (push) Has been cancelled
DNS / Windows (push) Has been cancelled
DNS / OpenBSD (push) Has been cancelled
DNS / NetBSD (push) Has been cancelled
DNS / Solaris (push) Has been cancelled
DNS / Omnios (push) Has been cancelled
DNS / OpenIndiana (push) Has been cancelled
DNS / Haiku (push) Has been cancelled
OpenBSD / OpenBSD (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Solaris / Solaris (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (Smallstep Intermediate CA, Smallstep Intermediate CA, , 1, https://localhost:9000/acme/acme/directory, ) (push) Has been cancelled
Ubuntu / Ubuntu (Smallstep Intermediate CA, Smallstep Intermediate CA, , 1, https://localhost:9000/acme/acme/directory, 1, , 172.17.0.1) (push) Has been cancelled
Ubuntu / Ubuntu (ZeroSSL RSA Domain Secure Site CA, ZeroSSL ECC Domain Secure Site CA, githubtest@acme.sh, ZeroSSL.com, ) (push) Has been cancelled
DNS / Fail (push) Has been cancelled
DNS / Docker (push) Has been cancelled
DNS / MacOS (push) Has been cancelled
DNS / FreeBSD (push) Has been cancelled
DNS / DragonFlyBSD (push) Has been cancelled
Build DockerHub / build (push) Has been cancelled
Some checks failed
DNS / CheckToken (push) Has been cancelled
DragonFlyBSD / DragonFlyBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
FreeBSD / FreeBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
FreeBSD / FreeBSD (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Haiku / Haiku (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Haiku / Haiku (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Linux / Linux (almalinux:latest) (push) Has been cancelled
Linux / Linux (alpine:latest) (push) Has been cancelled
Linux / Linux (archlinux:latest) (push) Has been cancelled
Linux / Linux (debian:latest) (push) Has been cancelled
Linux / Linux (fedora:latest) (push) Has been cancelled
Linux / Linux (gentoo/stage3) (push) Has been cancelled
Linux / Linux (kalilinux/kali) (push) Has been cancelled
Linux / Linux (opensuse/leap:latest) (push) Has been cancelled
Linux / Linux (oraclelinux:8) (push) Has been cancelled
Linux / Linux (ubuntu:latest) (push) Has been cancelled
MacOS / MacOS (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
NetBSD / NetBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Omnios / Omnios (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Omnios / Omnios (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenBSD / OpenBSD (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenIndiana / OpenIndiana (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
OpenIndiana / OpenIndiana (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
PebbleStrict / PebbleStrict (push) Has been cancelled
PebbleStrict / PebbleStrict_IPCert (push) Has been cancelled
Solaris / Solaris (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Windows / Windows (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Build DockerHub / CheckToken (push) Has been cancelled
Shellcheck / ShellCheck (push) Has been cancelled
Shellcheck / shfmt (push) Has been cancelled
DNS / Windows (push) Has been cancelled
DNS / OpenBSD (push) Has been cancelled
DNS / NetBSD (push) Has been cancelled
DNS / Solaris (push) Has been cancelled
DNS / Omnios (push) Has been cancelled
DNS / OpenIndiana (push) Has been cancelled
DNS / Haiku (push) Has been cancelled
OpenBSD / OpenBSD (1, , , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Solaris / Solaris (, , , LetsEncrypt.org_test, (STAGING)) (push) Has been cancelled
Ubuntu / Ubuntu (Smallstep Intermediate CA, Smallstep Intermediate CA, , 1, https://localhost:9000/acme/acme/directory, ) (push) Has been cancelled
Ubuntu / Ubuntu (Smallstep Intermediate CA, Smallstep Intermediate CA, , 1, https://localhost:9000/acme/acme/directory, 1, , 172.17.0.1) (push) Has been cancelled
Ubuntu / Ubuntu (ZeroSSL RSA Domain Secure Site CA, ZeroSSL ECC Domain Secure Site CA, githubtest@acme.sh, ZeroSSL.com, ) (push) Has been cancelled
DNS / Fail (push) Has been cancelled
DNS / Docker (push) Has been cancelled
DNS / MacOS (push) Has been cancelled
DNS / FreeBSD (push) Has been cancelled
DNS / DragonFlyBSD (push) Has been cancelled
Build DockerHub / build (push) Has been cancelled
sync
This commit is contained in:
58
.github/workflows/DNS.yml
vendored
58
.github/workflows/DNS.yml
vendored
@@ -597,4 +597,62 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Haiku:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: OpenIndiana
|
||||||
|
env:
|
||||||
|
TEST_DNS : ${{ secrets.TEST_DNS }}
|
||||||
|
TestingDomain: ${{ secrets.TestingDomain }}
|
||||||
|
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
|
||||||
|
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
|
||||||
|
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
|
||||||
|
CASE: le_test_dnsapi
|
||||||
|
TEST_LOCAL: 1
|
||||||
|
DEBUG: ${{ secrets.DEBUG }}
|
||||||
|
http_proxy: ${{ secrets.http_proxy }}
|
||||||
|
https_proxy: ${{ secrets.https_proxy }}
|
||||||
|
HTTPS_INSECURE: 1 # always set to 1 to ignore https error, since OpenIndiana doesn't accept the expired ISRG X1 root
|
||||||
|
TokenName1: ${{ secrets.TokenName1}}
|
||||||
|
TokenName2: ${{ secrets.TokenName2}}
|
||||||
|
TokenName3: ${{ secrets.TokenName3}}
|
||||||
|
TokenName4: ${{ secrets.TokenName4}}
|
||||||
|
TokenName5: ${{ secrets.TokenName5}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Clone acmetest
|
||||||
|
run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
|
||||||
|
- uses: vmactions/haiku-vm@v1
|
||||||
|
with:
|
||||||
|
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy HTTPS_INSECURE TokenName1 TokenName2 TokenName3 TokenName4 TokenName5 ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
|
||||||
|
sync: rsync
|
||||||
|
copyback: false
|
||||||
|
prepare: |
|
||||||
|
mkdir -p /boot/home/.cache
|
||||||
|
pkgman install -y cronie
|
||||||
|
|
||||||
|
run: |
|
||||||
|
if [ "${{ secrets.TokenName1}}" ] ; then
|
||||||
|
export ${{ secrets.TokenName1}}="${{ secrets.TokenValue1}}"
|
||||||
|
fi
|
||||||
|
if [ "${{ secrets.TokenName2}}" ] ; then
|
||||||
|
export ${{ secrets.TokenName2}}="${{ secrets.TokenValue2}}"
|
||||||
|
fi
|
||||||
|
if [ "${{ secrets.TokenName3}}" ] ; then
|
||||||
|
export ${{ secrets.TokenName3}}="${{ secrets.TokenValue3}}"
|
||||||
|
fi
|
||||||
|
if [ "${{ secrets.TokenName4}}" ] ; then
|
||||||
|
export ${{ secrets.TokenName4}}="${{ secrets.TokenValue4}}"
|
||||||
|
fi
|
||||||
|
if [ "${{ secrets.TokenName5}}" ] ; then
|
||||||
|
export ${{ secrets.TokenName5}}="${{ secrets.TokenValue5}}"
|
||||||
|
fi
|
||||||
|
cd ../acmetest
|
||||||
|
./letest.sh
|
||||||
|
- name: onError
|
||||||
|
if: ${{ failure() }}
|
||||||
|
run: |
|
||||||
|
echo "See how to debug in VM:"
|
||||||
|
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
83
.github/workflows/Haiku.yml
vendored
Normal file
83
.github/workflows/Haiku.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
name: Haiku
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
paths:
|
||||||
|
- '*.sh'
|
||||||
|
- '.github/workflows/Haiku.yml'
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
paths:
|
||||||
|
- '*.sh'
|
||||||
|
- '.github/workflows/Haiku.yml'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Haiku:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- TEST_ACME_Server: "LetsEncrypt.org_test"
|
||||||
|
CA_ECDSA: ""
|
||||||
|
CA: ""
|
||||||
|
CA_EMAIL: ""
|
||||||
|
TEST_PREFERRED_CHAIN: (STAGING)
|
||||||
|
- TEST_ACME_Server: "LetsEncrypt.org_test"
|
||||||
|
CA_ECDSA: ""
|
||||||
|
CA: ""
|
||||||
|
CA_EMAIL: ""
|
||||||
|
TEST_PREFERRED_CHAIN: (STAGING)
|
||||||
|
ACME_USE_WGET: 1
|
||||||
|
#- TEST_ACME_Server: "ZeroSSL.com"
|
||||||
|
# CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA"
|
||||||
|
# CA: "ZeroSSL RSA Domain Secure Site CA"
|
||||||
|
# CA_EMAIL: "githubtest@acme.sh"
|
||||||
|
# TEST_PREFERRED_CHAIN: ""
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TEST_LOCAL: 1
|
||||||
|
TEST_ACME_Server: ${{ matrix.TEST_ACME_Server }}
|
||||||
|
CA_ECDSA: ${{ matrix.CA_ECDSA }}
|
||||||
|
CA: ${{ matrix.CA }}
|
||||||
|
CA_EMAIL: ${{ matrix.CA_EMAIL }}
|
||||||
|
TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }}
|
||||||
|
ACME_USE_WGET: ${{ matrix.ACME_USE_WGET }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: vmactions/cf-tunnel@v0
|
||||||
|
id: tunnel
|
||||||
|
with:
|
||||||
|
protocol: http
|
||||||
|
port: 8080
|
||||||
|
- name: Set envs
|
||||||
|
run: echo "TestingDomain=${{steps.tunnel.outputs.server}}" >> $GITHUB_ENV
|
||||||
|
- name: Clone acmetest
|
||||||
|
run: cd .. && git clone --depth=1 https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
|
||||||
|
- uses: vmactions/haiku-vm@v1
|
||||||
|
with:
|
||||||
|
envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN ACME_USE_WGET'
|
||||||
|
nat: |
|
||||||
|
"8080": "80"
|
||||||
|
prepare: |
|
||||||
|
mkdir -p /boot/home/.cache
|
||||||
|
pkgman install -y cronie
|
||||||
|
sync: rsync
|
||||||
|
copyback: false
|
||||||
|
run: |
|
||||||
|
cd ../acmetest \
|
||||||
|
&& ./letest.sh
|
||||||
|
- name: onError
|
||||||
|
if: ${{ failure() }}
|
||||||
|
run: |
|
||||||
|
echo "See how to debug in VM:"
|
||||||
|
echo "https://github.com/acmesh-official/acme.sh/wiki/debug-in-VM"
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/DragonFlyBSD.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/DragonFlyBSD.yml/badge.svg" alt="DragonFlyBSD"></a>
|
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/DragonFlyBSD.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/DragonFlyBSD.yml/badge.svg" alt="DragonFlyBSD"></a>
|
||||||
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/Omnios.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/Omnios.yml/badge.svg" alt="Omnios"></a>
|
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/Omnios.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/Omnios.yml/badge.svg" alt="Omnios"></a>
|
||||||
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/OpenIndiana.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/OpenIndiana.yml/badge.svg" alt="OpenIndiana"></a>
|
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/OpenIndiana.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/OpenIndiana.yml/badge.svg" alt="OpenIndiana"></a>
|
||||||
|
<a href="https://github.com/acmesh-official/acme.sh/actions/workflows/Haiku.yml"><img src="https://github.com/acmesh-official/acme.sh/actions/workflows/Haiku.yml/badge.svg" alt="Haiku"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -108,6 +109,7 @@
|
|||||||
|21|-----| Cloud Linux https://github.com/acmesh-official/acme.sh/issues/111
|
|21|-----| Cloud Linux https://github.com/acmesh-official/acme.sh/issues/111
|
||||||
|22|-----| OpenWRT: Tested and working. See [wiki page](https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-OpenWRT)
|
|22|-----| OpenWRT: Tested and working. See [wiki page](https://github.com/acmesh-official/acme.sh/wiki/How-to-run-on-OpenWRT)
|
||||||
|23|[](https://github.com/acmesh-official/letest#here-are-the-latest-status)| Proxmox: See Proxmox VE Wiki. Version [4.x, 5.0, 5.1](https://pve.proxmox.com/wiki/HTTPS_Certificate_Configuration_(Version_4.x,_5.0_and_5.1)#Let.27s_Encrypt_using_acme.sh), version [5.2 and up](https://pve.proxmox.com/wiki/Certificate_Management)
|
|23|[](https://github.com/acmesh-official/letest#here-are-the-latest-status)| Proxmox: See Proxmox VE Wiki. Version [4.x, 5.0, 5.1](https://pve.proxmox.com/wiki/HTTPS_Certificate_Configuration_(Version_4.x,_5.0_and_5.1)#Let.27s_Encrypt_using_acme.sh), version [5.2 and up](https://pve.proxmox.com/wiki/Certificate_Management)
|
||||||
|
|24|[](https://github.com/acmesh-official/acme.sh/actions/workflows/Haiku.yml)|Haiku OS
|
||||||
|
|
||||||
|
|
||||||
> 🧪 Check our [testing project](https://github.com/acmesh-official/acmetest)
|
> 🧪 Check our [testing project](https://github.com/acmesh-official/acmetest)
|
||||||
|
|||||||
104
acme.sh
104
acme.sh
@@ -250,6 +250,13 @@ _dlg_versions() {
|
|||||||
socat -V 2>&1
|
socat -V 2>&1
|
||||||
else
|
else
|
||||||
_debug "socat doesn't exist."
|
_debug "socat doesn't exist."
|
||||||
|
if _exists "python3"; then
|
||||||
|
python3 -V 2>&1
|
||||||
|
elif _exists "python2"; then
|
||||||
|
python2 -V 2>&1
|
||||||
|
elif _exists "python"; then
|
||||||
|
python -V 2>&1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2559,41 +2566,76 @@ _startserver() {
|
|||||||
_debug Le_Listen_V4 "$Le_Listen_V4"
|
_debug Le_Listen_V4 "$Le_Listen_V4"
|
||||||
_debug Le_Listen_V6 "$Le_Listen_V6"
|
_debug Le_Listen_V6 "$Le_Listen_V6"
|
||||||
|
|
||||||
_NC="socat"
|
if _exists "socat"; then
|
||||||
if [ "$Le_Listen_V6" ]; then
|
_NC="socat"
|
||||||
_NC="$_NC -6"
|
if [ "$Le_Listen_V6" ]; then
|
||||||
SOCAT_OPTIONS=TCP6-LISTEN
|
_NC="$_NC -6"
|
||||||
elif [ "$Le_Listen_V4" ]; then
|
SOCAT_OPTIONS=TCP6-LISTEN
|
||||||
_NC="$_NC -4"
|
elif [ "$Le_Listen_V4" ]; then
|
||||||
SOCAT_OPTIONS=TCP4-LISTEN
|
_NC="$_NC -4"
|
||||||
else
|
SOCAT_OPTIONS=TCP4-LISTEN
|
||||||
SOCAT_OPTIONS=TCP-LISTEN
|
else
|
||||||
fi
|
SOCAT_OPTIONS=TCP-LISTEN
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$DEBUG" ] && [ "$DEBUG" -gt "1" ]; then
|
if [ "$DEBUG" ] && [ "$DEBUG" -gt "1" ]; then
|
||||||
_NC="$_NC -d -d -v"
|
_NC="$_NC -d -d -v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SOCAT_OPTIONS=$SOCAT_OPTIONS:$Le_HTTPPort,crlf,reuseaddr,fork
|
SOCAT_OPTIONS=$SOCAT_OPTIONS:$Le_HTTPPort,crlf,reuseaddr,fork
|
||||||
|
|
||||||
#Adding bind to local-address
|
#Adding bind to local-address
|
||||||
if [ "$ncaddr" ]; then
|
if [ "$ncaddr" ]; then
|
||||||
SOCAT_OPTIONS="$SOCAT_OPTIONS,bind=${ncaddr}"
|
SOCAT_OPTIONS="$SOCAT_OPTIONS,bind=${ncaddr}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_content_len="$(printf "%s" "$content" | wc -c)"
|
_content_len="$(printf "%s" "$content" | wc -c)"
|
||||||
_debug _content_len "$_content_len"
|
_debug _content_len "$_content_len"
|
||||||
_debug "_NC" "$_NC $SOCAT_OPTIONS"
|
_debug "_NC" "$_NC $SOCAT_OPTIONS"
|
||||||
export _SOCAT_ERR="$(_mktemp)"
|
export _SOCAT_ERR="$(_mktemp)"
|
||||||
$_NC $SOCAT_OPTIONS SYSTEM:"sleep 1; \
|
$_NC $SOCAT_OPTIONS SYSTEM:"sleep 1; \
|
||||||
echo 'HTTP/1.0 200 OK'; \
|
echo 'HTTP/1.0 200 OK'; \
|
||||||
echo 'Content-Length\: $_content_len'; \
|
echo 'Content-Length\: $_content_len'; \
|
||||||
echo ''; \
|
echo ''; \
|
||||||
printf '%s' '$content';" 2>"$_SOCAT_ERR" &
|
printf '%s' '$content';" 2>"$_SOCAT_ERR" &
|
||||||
serverproc="$!"
|
serverproc="$!"
|
||||||
|
else
|
||||||
|
_PYTHON=""
|
||||||
|
if _exists "python3"; then
|
||||||
|
_PYTHON="python3"
|
||||||
|
elif _exists "python2"; then
|
||||||
|
_PYTHON="python2"
|
||||||
|
elif _exists "python"; then
|
||||||
|
_PYTHON="python"
|
||||||
|
fi
|
||||||
|
if [ "$_PYTHON" ]; then
|
||||||
|
_debug "Using python: $_PYTHON"
|
||||||
|
_AF="socket.AF_INET"
|
||||||
|
_BIND_ADDR="0.0.0.0"
|
||||||
|
if [ "$Le_Listen_V6" ]; then
|
||||||
|
_AF="socket.AF_INET6"
|
||||||
|
_BIND_ADDR="::"
|
||||||
|
fi
|
||||||
|
if [ "$ncaddr" ]; then
|
||||||
|
_BIND_ADDR="$ncaddr"
|
||||||
|
fi
|
||||||
|
export _SOCAT_ERR="$(_mktemp)"
|
||||||
|
$_PYTHON -c "import socket,sys;s=socket.socket($_AF,socket.SOCK_STREAM);s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1);s.bind((sys.argv[2],int(sys.argv[1])));s.listen(5);res='HTTP/1.0 200 OK\r\nContent-Length: '+str(len(sys.argv[3]))+'\r\n\r\n'+sys.argv[3];
|
||||||
|
while True:
|
||||||
|
c,a=s.accept()
|
||||||
|
c.sendall(res.encode() if hasattr(res, 'encode') else res)
|
||||||
|
c.close()" "$Le_HTTPPort" "$_BIND_ADDR" "$content" 2>"$_SOCAT_ERR" &
|
||||||
|
serverproc="$!"
|
||||||
|
_NC="$_PYTHON"
|
||||||
|
else
|
||||||
|
_err "Please install socat or python first for standalone mode."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f "$_SOCAT_ERR" ]; then
|
if [ -f "$_SOCAT_ERR" ]; then
|
||||||
if grep "Permission denied" "$_SOCAT_ERR" >/dev/null; then
|
if grep "Permission denied" "$_SOCAT_ERR" >/dev/null; then
|
||||||
_err "socat: $(cat $_SOCAT_ERR)"
|
_err "$_NC: $(cat $_SOCAT_ERR)"
|
||||||
_err "Can not listen for user: $(whoami)"
|
_err "Can not listen for user: $(whoami)"
|
||||||
_err "Maybe try with root again?"
|
_err "Maybe try with root again?"
|
||||||
rm -f "$_SOCAT_ERR"
|
rm -f "$_SOCAT_ERR"
|
||||||
@@ -3557,9 +3599,9 @@ _on_before_issue() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if _hasfield "$_chk_web_roots" "$NO_VALUE"; then
|
if _hasfield "$_chk_web_roots" "$NO_VALUE" && [ "$_chk_web_roots" = "$NO_VALUE" ]; then
|
||||||
if ! _exists "socat"; then
|
if ! _exists "socat" && ! _exists "python" && ! _exists "python2" && ! _exists "python3"; then
|
||||||
_err "Please install socat tools first."
|
_err "Please install socat or python tools first."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -6664,9 +6706,9 @@ _precheck() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! _exists "socat"; then
|
if ! _exists "socat" && ! _exists "python" && ! _exists "python2" && ! _exists "python3"; then
|
||||||
_err "It is recommended to install socat first."
|
_err "It is recommended to install socat or python first."
|
||||||
_err "We use socat for the standalone server, which is used for standalone mode."
|
_err "We use socat or python for the standalone server, which is used for standalone mode."
|
||||||
_err "If you don't want to use standalone mode, you may ignore this warning."
|
_err "If you don't want to use standalone mode, you may ignore this warning."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ _cyon_load_parameters() {
|
|||||||
# This header is required for curl calls.
|
# This header is required for curl calls.
|
||||||
_H1="X-Requested-With: XMLHttpRequest"
|
_H1="X-Requested-With: XMLHttpRequest"
|
||||||
export _H1
|
export _H1
|
||||||
|
_H3="User-Agent: cyon-dns-acmesh/1.0"
|
||||||
|
export _H3
|
||||||
}
|
}
|
||||||
|
|
||||||
_cyon_print_header() {
|
_cyon_print_header() {
|
||||||
@@ -125,7 +127,11 @@ _cyon_print_header() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_cyon_get_cookie_header() {
|
_cyon_get_cookie_header() {
|
||||||
printf "Cookie: %s" "$(grep "cyon=" "$HTTP_HEADER" | grep "^Set-Cookie:" | _tail_n 1 | _egrep_o 'cyon=[^;]*;' | tr -d ';')"
|
# Extract all cookies from the response headers (case-insensitive)
|
||||||
|
_cookies="$(grep -i "^set-cookie:" "$HTTP_HEADER" | sed 's/^[Ss]et-[Cc]ookie: //' | sed 's/;.*//' | tr '\n' '; ' | sed 's/; $//')"
|
||||||
|
if [ -n "$_cookies" ]; then
|
||||||
|
printf "Cookie: %s" "$_cookies"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_cyon_login() {
|
_cyon_login() {
|
||||||
@@ -155,7 +161,12 @@ _cyon_login() {
|
|||||||
|
|
||||||
_get "https://my.cyon.ch/" >/dev/null
|
_get "https://my.cyon.ch/" >/dev/null
|
||||||
|
|
||||||
# todo: instead of just checking if the env variable is defined, check if we actually need to do a 2FA auth request.
|
# Update cookie after loading main page (only if new cookies are set)
|
||||||
|
_new_cookies="$(_cyon_get_cookie_header)"
|
||||||
|
if [ -n "$_new_cookies" ]; then
|
||||||
|
_H2="$_new_cookies"
|
||||||
|
export _H2
|
||||||
|
fi
|
||||||
|
|
||||||
# 2FA authentication with OTP?
|
# 2FA authentication with OTP?
|
||||||
if [ -n "${CY_OTP_Secret}" ]; then
|
if [ -n "${CY_OTP_Secret}" ]; then
|
||||||
@@ -184,6 +195,13 @@ _cyon_login() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
_info " success"
|
_info " success"
|
||||||
|
|
||||||
|
# Update cookie after 2FA (only if new cookies are set)
|
||||||
|
_new_cookies="$(_cyon_get_cookie_header)"
|
||||||
|
if [ -n "$_new_cookies" ]; then
|
||||||
|
_H2="$_new_cookies"
|
||||||
|
export _H2
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_info ""
|
_info ""
|
||||||
@@ -205,7 +223,17 @@ _cyon_change_domain_env() {
|
|||||||
domain_env="$(printf "%s" "${fulldomain}" | sed -E -e 's/.*\.(.*\..*)$/\1/')"
|
domain_env="$(printf "%s" "${fulldomain}" | sed -E -e 's/.*\.(.*\..*)$/\1/')"
|
||||||
_debug "Changing domain environment to ${domain_env}"
|
_debug "Changing domain environment to ${domain_env}"
|
||||||
|
|
||||||
gloo_item_key="$(_get "https://my.cyon.ch/domain/" | tr '\n' ' ' | sed -E -e "s/.*data-domain=\"${domain_env}\"[^<]*data-itemkey=\"([^\"]*).*/\1/")"
|
domain_page_response="$(_get "https://my.cyon.ch/domain/")"
|
||||||
|
_debug domain_page_response "${domain_page_response}"
|
||||||
|
|
||||||
|
# Check if we got an error response (JSON) instead of HTML
|
||||||
|
if printf "%s" "${domain_page_response}" | grep -q '"iserror":true'; then
|
||||||
|
_err " $(printf "%s" "${domain_page_response}" | _cyon_get_response_message)"
|
||||||
|
_err ""
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gloo_item_key="$(printf "%s" "${domain_page_response}" | tr '\n' ' ' | sed -E -e "s/.*data-domain=\"${domain_env}\"[^<]*data-itemkey=\"([^\"]*).*/\1/")"
|
||||||
_debug gloo_item_key "${gloo_item_key}"
|
_debug gloo_item_key "${gloo_item_key}"
|
||||||
|
|
||||||
domain_env_url="https://my.cyon.ch/user/environment/setdomain/d/${domain_env}/gik/${gloo_item_key}"
|
domain_env_url="https://my.cyon.ch/user/environment/setdomain/d/${domain_env}/gik/${gloo_item_key}"
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ _get_domain() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
_err "Either their is no such host on your dnyv6 account or it cannot be accessed with this key"
|
_err "Either there is no such host on your dynv6 account, or it cannot be accessed with this key"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,8 +179,8 @@ _dns_dynv6_rm_http() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#Usage: _get_zone_id $record
|
||||||
#get the zoneid for a specifc record or zone
|
#get the zoneid for a specifc record or zone
|
||||||
#usage: _get_zone_id §record
|
|
||||||
#where $record is the record to get the id for
|
#where $record is the record to get the id for
|
||||||
#returns _zone_id the id of the zone
|
#returns _zone_id the id of the zone
|
||||||
_get_zone_id() {
|
_get_zone_id() {
|
||||||
@@ -189,7 +189,6 @@ _get_zone_id() {
|
|||||||
_dynv6_rest GET zones
|
_dynv6_rest GET zones
|
||||||
|
|
||||||
zones="$(echo "$response" | tr '}' '\n' | tr ',' '\n' | grep name | sed 's/\[//g' | tr -d '{' | tr -d '"')"
|
zones="$(echo "$response" | tr '}' '\n' | tr ',' '\n' | grep name | sed 's/\[//g' | tr -d '{' | tr -d '"')"
|
||||||
#echo $zones
|
|
||||||
|
|
||||||
selected=""
|
selected=""
|
||||||
for z in $zones; do
|
for z in $zones; do
|
||||||
@@ -217,9 +216,9 @@ _get_zone_name() {
|
|||||||
_zone_name="${_zone_name#name:}"
|
_zone_name="${_zone_name#name:}"
|
||||||
}
|
}
|
||||||
|
|
||||||
#usaage _get_record_id $zone_id $record
|
#usage _get_record_id $zone_id $record
|
||||||
# where zone_id is thevalue returned by _get_zone_id
|
# where zone_id is the value returned by _get_zone_id
|
||||||
# and record ist in the form _acme.www for an fqdn of _acme.www.example.com
|
# and record is in the form _acme.www for an fqdn of _acme.www.example.com
|
||||||
# returns _record_id
|
# returns _record_id
|
||||||
_get_record_id() {
|
_get_record_id() {
|
||||||
_zone_id="$1"
|
_zone_id="$1"
|
||||||
@@ -234,8 +233,7 @@ _get_record_id() {
|
|||||||
|
|
||||||
_get_record_id_from_response() {
|
_get_record_id_from_response() {
|
||||||
response="$1"
|
response="$1"
|
||||||
_record_id="$(echo "$response" | tr '}' '\n' | grep "\"name\":\"$record\"" | grep "\"data\":\"$value\"" | tr ',' '\n' | grep id | tr -d '"' | tr -d 'id:')"
|
_record_id="$(echo "$response" | tr '}' '\n' | grep "\"name\":\"$record\"" | grep "\"data\":\"$value\"" | tr ',' '\n' | grep '"id":' | tr -d '"' | tr -d 'id:' | tr -d '{')"
|
||||||
#_record_id="${_record_id#id:}"
|
|
||||||
if [ -z "$_record_id" ]; then
|
if [ -z "$_record_id" ]; then
|
||||||
_err "no such record: $record found in zone $_zone_id"
|
_err "no such record: $record found in zone $_zone_id"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user