Merge pull request #4262 from acmesh-official/dev

sync
This commit is contained in:
neil 2022-08-22 21:17:19 +08:00 committed by GitHub
commit fc1df9f9a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 899 additions and 562 deletions

View File

@ -1,467 +1,426 @@
name: DNS name: DNS
on: on:
push: push:
paths: paths:
- 'dnsapi/*.sh' - 'dnsapi/*.sh'
- '.github/workflows/DNS.yml' - '.github/workflows/DNS.yml'
pull_request: pull_request:
branches: branches:
- 'dev' - 'dev'
paths: paths:
- 'dnsapi/*.sh' - 'dnsapi/*.sh'
- '.github/workflows/DNS.yml' - '.github/workflows/DNS.yml'
concurrency:
jobs: group: ${{ github.workflow }}
CheckToken: cancel-in-progress: true
runs-on: ubuntu-latest
outputs: jobs:
hasToken: ${{ steps.step_one.outputs.hasToken }} CheckToken:
steps: runs-on: ubuntu-latest
- name: Set the value outputs:
id: step_one hasToken: ${{ steps.step_one.outputs.hasToken }}
run: | steps:
if [ "${{secrets.TokenName1}}" ] ; then - name: Set the value
echo "::set-output name=hasToken::true" id: step_one
else run: |
echo "::set-output name=hasToken::false" if [ "${{secrets.TokenName1}}" ] ; then
fi echo "::set-output name=hasToken::true"
- name: Check the value else
run: echo ${{ steps.step_one.outputs.hasToken }} echo "::set-output name=hasToken::false"
fi
Fail: - name: Check the value
runs-on: ubuntu-latest run: echo ${{ steps.step_one.outputs.hasToken }}
needs: CheckToken
if: "contains(needs.CheckToken.outputs.hasToken, 'false')" Fail:
steps: runs-on: ubuntu-latest
- name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" needs: CheckToken
run: | if: "contains(needs.CheckToken.outputs.hasToken, 'false')"
echo "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test" steps:
if [ "${{github.repository_owner}}" != "acmesh-official" ]; then - name: "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
false run: |
fi echo "Read this: https://github.com/acmesh-official/acme.sh/wiki/DNS-API-Test"
if [ "${{github.repository_owner}}" != "acmesh-official" ]; then
Docker: false
runs-on: ubuntu-latest fi
needs: CheckToken
if: "contains(needs.CheckToken.outputs.hasToken, 'true')" Docker:
env: runs-on: ubuntu-latest
TEST_DNS : ${{ secrets.TEST_DNS }} needs: CheckToken
TestingDomain: ${{ secrets.TestingDomain }} if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} env:
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_DNS : ${{ secrets.TEST_DNS }}
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} TestingDomain: ${{ secrets.TestingDomain }}
CASE: le_test_dnsapi TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
TEST_LOCAL: 1 TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
DEBUG: ${{ secrets.DEBUG }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
http_proxy: ${{ secrets.http_proxy }} CASE: le_test_dnsapi
https_proxy: ${{ secrets.https_proxy }} TEST_LOCAL: 1
steps: DEBUG: ${{ secrets.DEBUG }}
- uses: actions/checkout@v2 http_proxy: ${{ secrets.http_proxy }}
- name: Clone acmetest https_proxy: ${{ secrets.https_proxy }}
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ steps:
- name: Set env file - uses: actions/checkout@v2
run: | - name: Clone acmetest
cd ../acmetest run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
if [ "${{ secrets.TokenName1}}" ] ; then - name: Set env file
echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env run: |
fi cd ../acmetest
if [ "${{ secrets.TokenName2}}" ] ; then if [ "${{ secrets.TokenName1}}" ] ; then
echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env echo "${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}" >> docker.env
fi fi
if [ "${{ secrets.TokenName3}}" ] ; then if [ "${{ secrets.TokenName2}}" ] ; then
echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env echo "${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}" >> docker.env
fi fi
if [ "${{ secrets.TokenName4}}" ] ; then if [ "${{ secrets.TokenName3}}" ] ; then
echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env echo "${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}" >> docker.env
fi fi
if [ "${{ secrets.TokenName5}}" ] ; then if [ "${{ secrets.TokenName4}}" ] ; then
echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env echo "${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}" >> docker.env
fi fi
echo "TEST_DNS_NO_WILDCARD" >> docker.env if [ "${{ secrets.TokenName5}}" ] ; then
echo "http_proxy" >> docker.env echo "${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}" >> docker.env
echo "https_proxy" >> docker.env fi
- name: Run acmetest echo "TEST_DNS_NO_WILDCARD" >> docker.env
run: cd ../acmetest && ./rundocker.sh testall echo "http_proxy" >> docker.env
echo "https_proxy" >> docker.env
- uses: actions/upload-artifact@v1 - name: Run acmetest
if: failure() run: cd ../acmetest && ./rundocker.sh testall
with:
name: Docker-logs
path: |
../acmetest/*.log
../acmetest/logs MacOS:
runs-on: macos-latest
needs: Docker
MacOS: env:
runs-on: macos-latest TEST_DNS : ${{ secrets.TEST_DNS }}
needs: Docker TestingDomain: ${{ secrets.TestingDomain }}
env: TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
TEST_DNS : ${{ secrets.TEST_DNS }} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
TestingDomain: ${{ secrets.TestingDomain }} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} CASE: le_test_dnsapi
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} TEST_LOCAL: 1
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} DEBUG: ${{ secrets.DEBUG }}
CASE: le_test_dnsapi http_proxy: ${{ secrets.http_proxy }}
TEST_LOCAL: 1 https_proxy: ${{ secrets.https_proxy }}
DEBUG: ${{ secrets.DEBUG }} steps:
http_proxy: ${{ secrets.http_proxy }} - uses: actions/checkout@v2
https_proxy: ${{ secrets.https_proxy }} - name: Install tools
steps: run: brew install socat
- uses: actions/checkout@v2 - name: Clone acmetest
- name: Install tools run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
run: brew install socat - name: Run acmetest
- name: Clone acmetest run: |
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ if [ "${{ secrets.TokenName1}}" ] ; then
- name: Run acmetest export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
run: | fi
if [ "${{ secrets.TokenName1}}" ] ; then if [ "${{ secrets.TokenName2}}" ] ; then
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}} export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
fi fi
if [ "${{ secrets.TokenName2}}" ] ; then if [ "${{ secrets.TokenName3}}" ] ; then
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}} export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
fi fi
if [ "${{ secrets.TokenName3}}" ] ; then if [ "${{ secrets.TokenName4}}" ] ; then
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
fi fi
if [ "${{ secrets.TokenName4}}" ] ; then if [ "${{ secrets.TokenName5}}" ] ; then
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}} export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
fi fi
if [ "${{ secrets.TokenName5}}" ] ; then cd ../acmetest
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} ./letest.sh
fi
cd ../acmetest
./letest.sh
- uses: actions/upload-artifact@v1 Windows:
if: failure() runs-on: windows-latest
with: needs: MacOS
name: MacOS-logs env:
path: | TEST_DNS : ${{ secrets.TEST_DNS }}
../acmetest/*.log 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 }}
Windows: CASE: le_test_dnsapi
runs-on: windows-latest TEST_LOCAL: 1
needs: MacOS DEBUG: ${{ secrets.DEBUG }}
env: http_proxy: ${{ secrets.http_proxy }}
TEST_DNS : ${{ secrets.TEST_DNS }} https_proxy: ${{ secrets.https_proxy }}
TestingDomain: ${{ secrets.TestingDomain }} steps:
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} - name: Set git to use LF
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} run: |
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} git config --global core.autocrlf false
CASE: le_test_dnsapi - uses: actions/checkout@v2
TEST_LOCAL: 1 - name: Install cygwin base packages with chocolatey
DEBUG: ${{ secrets.DEBUG }} run: |
http_proxy: ${{ secrets.http_proxy }} choco config get cacheLocation
https_proxy: ${{ secrets.https_proxy }} choco install --no-progress cygwin
steps: shell: cmd
- name: Set git to use LF - name: Install cygwin additional packages
run: | run: |
git config --global core.autocrlf false C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
- uses: actions/checkout@v2 shell: cmd
- name: Install cygwin base packages with chocolatey - name: Set ENV
run: | shell: cmd
choco config get cacheLocation run: |
choco install --no-progress cygwin echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV%
shell: cmd - name: Clone acmetest
- name: Install cygwin additional packages run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
run: | - name: Run acmetest
C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git shell: bash
shell: cmd run: |
- name: Set ENV if [ "${{ secrets.TokenName1}}" ] ; then
shell: cmd export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
run: | fi
echo PATH=C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin >> %GITHUB_ENV% if [ "${{ secrets.TokenName2}}" ] ; then
- name: Clone acmetest export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ fi
- name: Run acmetest if [ "${{ secrets.TokenName3}}" ] ; then
shell: bash export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
run: | fi
if [ "${{ secrets.TokenName1}}" ] ; then if [ "${{ secrets.TokenName4}}" ] ; then
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}} export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
fi fi
if [ "${{ secrets.TokenName2}}" ] ; then if [ "${{ secrets.TokenName5}}" ] ; then
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}} export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
fi fi
if [ "${{ secrets.TokenName3}}" ] ; then cd ../acmetest
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} ./letest.sh
fi
if [ "${{ secrets.TokenName4}}" ] ; then
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
fi FreeBSD:
if [ "${{ secrets.TokenName5}}" ] ; then runs-on: macos-12
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} needs: Windows
fi env:
cd ../acmetest TEST_DNS : ${{ secrets.TEST_DNS }}
./letest.sh TestingDomain: ${{ secrets.TestingDomain }}
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
- uses: actions/upload-artifact@v1 TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
if: failure() TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
with: CASE: le_test_dnsapi
name: Windows-logs TEST_LOCAL: 1
path: | DEBUG: ${{ secrets.DEBUG }}
../acmetest/*.log http_proxy: ${{ secrets.http_proxy }}
https_proxy: ${{ secrets.https_proxy }}
FreeBSD: steps:
runs-on: macos-12 - uses: actions/checkout@v2
needs: Windows - name: Clone acmetest
env: run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
TEST_DNS : ${{ secrets.TEST_DNS }} - uses: vmactions/freebsd-vm@v0
TestingDomain: ${{ secrets.TestingDomain }} with:
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} prepare: pkg install -y socat curl
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} usesh: true
CASE: le_test_dnsapi copyback: false
TEST_LOCAL: 1 run: |
DEBUG: ${{ secrets.DEBUG }} if [ "${{ secrets.TokenName1}}" ] ; then
http_proxy: ${{ secrets.http_proxy }} export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
https_proxy: ${{ secrets.https_proxy }} fi
steps: if [ "${{ secrets.TokenName2}}" ] ; then
- uses: actions/checkout@v2 export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
- name: Clone acmetest fi
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ if [ "${{ secrets.TokenName3}}" ] ; then
- uses: vmactions/freebsd-vm@v0 export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
with: fi
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' if [ "${{ secrets.TokenName4}}" ] ; then
prepare: pkg install -y socat curl export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
usesh: true fi
copyback: false if [ "${{ secrets.TokenName5}}" ] ; then
run: | export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
if [ "${{ secrets.TokenName1}}" ] ; then fi
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}} cd ../acmetest
fi ./letest.sh
if [ "${{ secrets.TokenName2}}" ] ; then
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
fi
if [ "${{ secrets.TokenName3}}" ] ; then
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} Solaris:
fi runs-on: macos-12
if [ "${{ secrets.TokenName4}}" ] ; then needs: FreeBSD
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}} env:
fi TEST_DNS : ${{ secrets.TEST_DNS }}
if [ "${{ secrets.TokenName5}}" ] ; then TestingDomain: ${{ secrets.TestingDomain }}
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
fi TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
cd ../acmetest TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
./letest.sh CASE: le_test_dnsapi
TEST_LOCAL: 1
- uses: actions/upload-artifact@v1 DEBUG: ${{ secrets.DEBUG }}
if: failure() http_proxy: ${{ secrets.http_proxy }}
with: https_proxy: ${{ secrets.https_proxy }}
name: FreeBSD-logs steps:
path: | - uses: actions/checkout@v2
../acmetest/*.log - name: Clone acmetest
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/solaris-vm@v0
Solaris: with:
runs-on: macos-12 envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
needs: FreeBSD copyback: false
env: prepare: pkgutil -y -i socat
TEST_DNS : ${{ secrets.TEST_DNS }} run: |
TestingDomain: ${{ secrets.TestingDomain }} pkg set-mediator -v -I default@1.1 openssl
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} export PATH=/usr/gnu/bin:$PATH
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} if [ "${{ secrets.TokenName1}}" ] ; then
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
CASE: le_test_dnsapi fi
TEST_LOCAL: 1 if [ "${{ secrets.TokenName2}}" ] ; then
DEBUG: ${{ secrets.DEBUG }} export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
http_proxy: ${{ secrets.http_proxy }} fi
https_proxy: ${{ secrets.https_proxy }} if [ "${{ secrets.TokenName3}}" ] ; then
steps: export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
- uses: actions/checkout@v2 fi
- name: Clone acmetest if [ "${{ secrets.TokenName4}}" ] ; then
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
- uses: vmactions/solaris-vm@v0 fi
with: if [ "${{ secrets.TokenName5}}" ] ; then
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
copyback: false fi
prepare: pkgutil -y -i socat cd ../acmetest
run: | ./letest.sh
pkg set-mediator -v -I default@1.1 openssl
export PATH=/usr/gnu/bin:$PATH
if [ "${{ secrets.TokenName1}}" ] ; then
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
fi OpenBSD:
if [ "${{ secrets.TokenName2}}" ] ; then runs-on: macos-12
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}} needs: Solaris
fi env:
if [ "${{ secrets.TokenName3}}" ] ; then TEST_DNS : ${{ secrets.TEST_DNS }}
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} TestingDomain: ${{ secrets.TestingDomain }}
fi TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
if [ "${{ secrets.TokenName4}}" ] ; then TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}} TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
fi CASE: le_test_dnsapi
if [ "${{ secrets.TokenName5}}" ] ; then TEST_LOCAL: 1
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} DEBUG: ${{ secrets.DEBUG }}
fi http_proxy: ${{ secrets.http_proxy }}
cd ../acmetest https_proxy: ${{ secrets.https_proxy }}
./letest.sh steps:
- uses: actions/checkout@v2
- uses: actions/upload-artifact@v1 - name: Clone acmetest
if: failure() run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
with: - uses: vmactions/openbsd-vm@v0
name: Solaris-logs with:
path: | envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
../acmetest/*.log prepare: pkg_add socat curl
usesh: true
copyback: false
OpenBSD: run: |
runs-on: macos-12 if [ "${{ secrets.TokenName1}}" ] ; then
needs: Solaris export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
env: fi
TEST_DNS : ${{ secrets.TEST_DNS }} if [ "${{ secrets.TokenName2}}" ] ; then
TestingDomain: ${{ secrets.TestingDomain }} export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} fi
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} if [ "${{ secrets.TokenName3}}" ] ; then
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
CASE: le_test_dnsapi fi
TEST_LOCAL: 1 if [ "${{ secrets.TokenName4}}" ] ; then
DEBUG: ${{ secrets.DEBUG }} export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
http_proxy: ${{ secrets.http_proxy }} fi
https_proxy: ${{ secrets.https_proxy }} if [ "${{ secrets.TokenName5}}" ] ; then
steps: export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
- uses: actions/checkout@v2 fi
- name: Clone acmetest cd ../acmetest
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ ./letest.sh
- uses: vmactions/openbsd-vm@v0
with:
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
prepare: pkg_add socat curl
usesh: true NetBSD:
copyback: false runs-on: macos-12
run: | needs: OpenBSD
if [ "${{ secrets.TokenName1}}" ] ; then env:
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}} TEST_DNS : ${{ secrets.TEST_DNS }}
fi TestingDomain: ${{ secrets.TestingDomain }}
if [ "${{ secrets.TokenName2}}" ] ; then TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}} TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
fi TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
if [ "${{ secrets.TokenName3}}" ] ; then CASE: le_test_dnsapi
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} TEST_LOCAL: 1
fi DEBUG: ${{ secrets.DEBUG }}
if [ "${{ secrets.TokenName4}}" ] ; then http_proxy: ${{ secrets.http_proxy }}
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}} https_proxy: ${{ secrets.https_proxy }}
fi steps:
if [ "${{ secrets.TokenName5}}" ] ; then - uses: actions/checkout@v2
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} - name: Clone acmetest
fi run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
cd ../acmetest - uses: vmactions/netbsd-vm@v0
./letest.sh with:
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
- uses: actions/upload-artifact@v1 prepare: |
if: failure() pkg_add curl socat
with: usesh: true
name: OpenBSD-logs copyback: false
path: | run: |
../acmetest/*.log if [ "${{ secrets.TokenName1}}" ] ; then
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
fi
NetBSD: if [ "${{ secrets.TokenName2}}" ] ; then
runs-on: macos-12 export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
needs: OpenBSD fi
env: if [ "${{ secrets.TokenName3}}" ] ; then
TEST_DNS : ${{ secrets.TEST_DNS }} export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
TestingDomain: ${{ secrets.TestingDomain }} fi
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} if [ "${{ secrets.TokenName4}}" ] ; then
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} fi
CASE: le_test_dnsapi if [ "${{ secrets.TokenName5}}" ] ; then
TEST_LOCAL: 1 export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
DEBUG: ${{ secrets.DEBUG }} fi
http_proxy: ${{ secrets.http_proxy }} cd ../acmetest
https_proxy: ${{ secrets.https_proxy }} ./letest.sh
steps:
- uses: actions/checkout@v2
- name: Clone acmetest
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/netbsd-vm@v0 DragonFlyBSD:
with: runs-on: macos-12
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}' needs: NetBSD
prepare: | env:
pkg_add curl socat TEST_DNS : ${{ secrets.TEST_DNS }}
usesh: true TestingDomain: ${{ secrets.TestingDomain }}
copyback: false TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }}
run: | TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }}
if [ "${{ secrets.TokenName1}}" ] ; then TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }}
export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}} CASE: le_test_dnsapi
fi TEST_LOCAL: 1
if [ "${{ secrets.TokenName2}}" ] ; then DEBUG: ${{ secrets.DEBUG }}
export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}} http_proxy: ${{ secrets.http_proxy }}
fi https_proxy: ${{ secrets.https_proxy }}
if [ "${{ secrets.TokenName3}}" ] ; then steps:
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}} - uses: actions/checkout@v2
fi - name: Clone acmetest
if [ "${{ secrets.TokenName4}}" ] ; then run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}} - uses: vmactions/dragonflybsd-vm@v0
fi with:
if [ "${{ secrets.TokenName5}}" ] ; then envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}} prepare: |
fi pkg install -y curl socat
cd ../acmetest usesh: true
./letest.sh copyback: false
run: |
- uses: actions/upload-artifact@v1 if [ "${{ secrets.TokenName1}}" ] ; then
if: failure() export ${{ secrets.TokenName1}}=${{ secrets.TokenValue1}}
with: fi
name: NetBSD-logs if [ "${{ secrets.TokenName2}}" ] ; then
path: | export ${{ secrets.TokenName2}}=${{ secrets.TokenValue2}}
../acmetest/*.log fi
if [ "${{ secrets.TokenName3}}" ] ; then
export ${{ secrets.TokenName3}}=${{ secrets.TokenValue3}}
DragonFlyBSD: fi
runs-on: macos-12 if [ "${{ secrets.TokenName4}}" ] ; then
needs: NetBSD export ${{ secrets.TokenName4}}=${{ secrets.TokenValue4}}
env: fi
TEST_DNS : ${{ secrets.TEST_DNS }} if [ "${{ secrets.TokenName5}}" ] ; then
TestingDomain: ${{ secrets.TestingDomain }} export ${{ secrets.TokenName5}}=${{ secrets.TokenValue5}}
TEST_DNS_NO_WILDCARD: ${{ secrets.TEST_DNS_NO_WILDCARD }} fi
TEST_DNS_NO_SUBDOMAIN: ${{ secrets.TEST_DNS_NO_SUBDOMAIN }} cd ../acmetest
TEST_DNS_SLEEP: ${{ secrets.TEST_DNS_SLEEP }} ./letest.sh
CASE: le_test_dnsapi
TEST_LOCAL: 1
DEBUG: ${{ secrets.DEBUG }}
http_proxy: ${{ secrets.http_proxy }}
https_proxy: ${{ secrets.https_proxy }}
steps:
- uses: actions/checkout@v2
- name: Clone acmetest
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/dragonflybsd-vm@v0
with:
envs: 'TEST_DNS TestingDomain TEST_DNS_NO_WILDCARD TEST_DNS_NO_SUBDOMAIN TEST_DNS_SLEEP CASE TEST_LOCAL DEBUG http_proxy https_proxy ${{ secrets.TokenName1}} ${{ secrets.TokenName2}} ${{ secrets.TokenName3}} ${{ secrets.TokenName4}} ${{ secrets.TokenName5}}'
prepare: |
pkg install -y curl socat
usesh: true
copyback: false
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
- uses: actions/upload-artifact@v1
if: failure()
with:
name: DragonFlyBSD-logs
path: |
../acmetest/*.log

View File

@ -14,6 +14,12 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/DragonFlyBSD.yml' - '.github/workflows/DragonFlyBSD.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
DragonFlyBSD: DragonFlyBSD:

View File

@ -14,6 +14,11 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/FreeBSD.yml' - '.github/workflows/FreeBSD.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
FreeBSD: FreeBSD:
@ -25,6 +30,12 @@ jobs:
CA: "" CA: ""
CA_EMAIL: "" CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1 TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
- TEST_ACME_Server: "LetsEncrypt.org_test"
CA_ECDSA: ""
CA: ""
CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
ACME_USE_WGET: 1
#- TEST_ACME_Server: "ZeroSSL.com" #- TEST_ACME_Server: "ZeroSSL.com"
# CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA" # CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA"
# CA: "ZeroSSL RSA Domain Secure Site CA" # CA: "ZeroSSL RSA Domain Secure Site CA"
@ -38,6 +49,7 @@ jobs:
CA: ${{ matrix.CA }} CA: ${{ matrix.CA }}
CA_EMAIL: ${{ matrix.CA_EMAIL }} CA_EMAIL: ${{ matrix.CA_EMAIL }}
TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }} TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }}
ACME_USE_WGET: ${{ matrix.ACME_USE_WGET }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: vmactions/cf-tunnel@v0.0.3 - uses: vmactions/cf-tunnel@v0.0.3
@ -51,10 +63,10 @@ jobs:
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/freebsd-vm@v0 - uses: vmactions/freebsd-vm@v0
with: with:
envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN' envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN ACME_USE_WGET'
nat: | nat: |
"8080": "80" "8080": "80"
prepare: pkg install -y socat curl prepare: pkg install -y socat curl wget
usesh: true usesh: true
copyback: false copyback: false
run: | run: |

View File

@ -15,6 +15,12 @@ on:
- '.github/workflows/Linux.yml' - '.github/workflows/Linux.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
Linux: Linux:

View File

@ -14,6 +14,11 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/MacOS.yml' - '.github/workflows/MacOS.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
MacOS: MacOS:

View File

@ -14,6 +14,12 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/NetBSD.yml' - '.github/workflows/NetBSD.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
NetBSD: NetBSD:

View File

@ -14,6 +14,11 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/OpenBSD.yml' - '.github/workflows/OpenBSD.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
OpenBSD: OpenBSD:
@ -25,6 +30,12 @@ jobs:
CA: "" CA: ""
CA_EMAIL: "" CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1 TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
- TEST_ACME_Server: "LetsEncrypt.org_test"
CA_ECDSA: ""
CA: ""
CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
ACME_USE_WGET: 1
#- TEST_ACME_Server: "ZeroSSL.com" #- TEST_ACME_Server: "ZeroSSL.com"
# CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA" # CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA"
# CA: "ZeroSSL RSA Domain Secure Site CA" # CA: "ZeroSSL RSA Domain Secure Site CA"
@ -38,6 +49,7 @@ jobs:
CA: ${{ matrix.CA }} CA: ${{ matrix.CA }}
CA_EMAIL: ${{ matrix.CA_EMAIL }} CA_EMAIL: ${{ matrix.CA_EMAIL }}
TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }} TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }}
ACME_USE_WGET: ${{ matrix.ACME_USE_WGET }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: vmactions/cf-tunnel@v0.0.3 - uses: vmactions/cf-tunnel@v0.0.3
@ -51,10 +63,10 @@ jobs:
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/openbsd-vm@v0 - uses: vmactions/openbsd-vm@v0
with: with:
envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN' envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN ACME_USE_WGET'
nat: | nat: |
"8080": "80" "8080": "80"
prepare: pkg_add socat curl prepare: pkg_add socat curl wget
usesh: true usesh: true
copyback: false copyback: false
run: | run: |

View File

@ -13,6 +13,13 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/PebbleStrict.yml' - '.github/workflows/PebbleStrict.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
PebbleStrict: PebbleStrict:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -15,6 +15,11 @@ on:
- '.github/workflows/Solaris.yml' - '.github/workflows/Solaris.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
Solaris: Solaris:
strategy: strategy:
@ -25,6 +30,12 @@ jobs:
CA: "" CA: ""
CA_EMAIL: "" CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1 TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
- TEST_ACME_Server: "LetsEncrypt.org_test"
CA_ECDSA: ""
CA: ""
CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
ACME_USE_WGET: 1
#- TEST_ACME_Server: "ZeroSSL.com" #- TEST_ACME_Server: "ZeroSSL.com"
# CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA" # CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA"
# CA: "ZeroSSL RSA Domain Secure Site CA" # CA: "ZeroSSL RSA Domain Secure Site CA"
@ -38,6 +49,7 @@ jobs:
CA: ${{ matrix.CA }} CA: ${{ matrix.CA }}
CA_EMAIL: ${{ matrix.CA_EMAIL }} CA_EMAIL: ${{ matrix.CA_EMAIL }}
TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }} TEST_PREFERRED_CHAIN: ${{ matrix.TEST_PREFERRED_CHAIN }}
ACME_USE_WGET: ${{ matrix.ACME_USE_WGET }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: vmactions/cf-tunnel@v0.0.3 - uses: vmactions/cf-tunnel@v0.0.3
@ -51,11 +63,11 @@ jobs:
run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
- uses: vmactions/solaris-vm@v0 - uses: vmactions/solaris-vm@v0
with: with:
envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN' envs: 'TEST_LOCAL TestingDomain TEST_ACME_Server CA_ECDSA CA CA_EMAIL TEST_PREFERRED_CHAIN ACME_USE_WGET'
copyback: "false" copyback: "false"
nat: | nat: |
"8080": "80" "8080": "80"
prepare: pkgutil -y -i socat curl prepare: pkgutil -y -i socat curl wget
run: | run: |
cd ../acmetest \ cd ../acmetest \
&& ./letest.sh && ./letest.sh

View File

@ -14,6 +14,11 @@ on:
- '*.sh' - '*.sh'
- '.github/workflows/Ubuntu.yml' - '.github/workflows/Ubuntu.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
Ubuntu: Ubuntu:
@ -25,6 +30,12 @@ jobs:
CA: "" CA: ""
CA_EMAIL: "" CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1 TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
- TEST_ACME_Server: "LetsEncrypt.org_test"
CA_ECDSA: ""
CA: ""
CA_EMAIL: ""
TEST_PREFERRED_CHAIN: (STAGING) Pretend Pear X1
ACME_USE_WGET: 1
- TEST_ACME_Server: "ZeroSSL.com" - TEST_ACME_Server: "ZeroSSL.com"
CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA" CA_ECDSA: "ZeroSSL ECC Domain Secure Site CA"
CA: "ZeroSSL RSA Domain Secure Site CA" CA: "ZeroSSL RSA Domain Secure Site CA"
@ -57,10 +68,11 @@ jobs:
NO_REVOKE: ${{ matrix.NO_REVOKE }} NO_REVOKE: ${{ matrix.NO_REVOKE }}
TEST_IPCERT: ${{ matrix.TEST_IPCERT }} TEST_IPCERT: ${{ matrix.TEST_IPCERT }}
TestingDomain: ${{ matrix.TestingDomain }} TestingDomain: ${{ matrix.TestingDomain }}
ACME_USE_WGET: ${{ matrix.ACME_USE_WGET }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install tools - name: Install tools
run: sudo apt-get install -y socat run: sudo apt-get install -y socat wget
- name: Start StepCA - name: Start StepCA
if: ${{ matrix.TEST_ACME_Server=='https://localhost:9000/acme/acme/directory' }} if: ${{ matrix.TEST_ACME_Server=='https://localhost:9000/acme/acme/directory' }}
run: | run: |

View File

@ -15,6 +15,11 @@ on:
- '.github/workflows/Windows.yml' - '.github/workflows/Windows.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
Windows: Windows:
strategy: strategy:

View File

@ -11,7 +11,11 @@ on:
- "Dockerfile" - "Dockerfile"
- '.github/workflows/dockerhub.yml' - '.github/workflows/dockerhub.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
CheckToken: CheckToken:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -14,11 +14,6 @@ jobs:
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
body: ' body: 'Please upgrade to the latest code and try again first. Maybe it's already fixed. ```acme.sh --upgrade``` If it's still not working, please provide the log with `--debug 2`, otherwise, nobody can help you.'
Please upgrade to the latest code and try again first. Maybe it's already fixed.
`acme.sh --upgrade`
If it's still not working, please provode the log with `--debug 2`, otherwise, nobody can help you.'
}) })

30
.github/workflows/pr_notify.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Check dns api
on:
pull_request_target:
types:
- opened
branches:
- 'dev'
paths:
- 'notify/*.sh'
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Welcome**
Please make sure you're read our [Code-of-conduct](../wiki/Code-of-conduct) and add the usage here: [notify](../wiki/notify).
Then reply on this message, otherwise, your code will not be reviewed or merged.
We look forward to reviewing your Pull request shortly ✨
`
})

View File

@ -13,6 +13,11 @@ on:
- '**.sh' - '**.sh'
- '.github/workflows/shellcheck.yml' - '.github/workflows/shellcheck.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs: jobs:
ShellCheck: ShellCheck:
runs-on: ubuntu-latest runs-on: ubuntu-latest

20
acme.sh
View File

@ -5200,11 +5200,25 @@ $_authorizations_map"
_info "The domain is set to be valid to: $_valid_to" _info "The domain is set to be valid to: $_valid_to"
_info "It can not be renewed automatically" _info "It can not be renewed automatically"
_info "See: $_VALIDITY_WIKI" _info "See: $_VALIDITY_WIKI"
else
_now=$(_time)
_debug2 "_now" "$_now"
_lifetime=$(_math $Le_NextRenewTime - $_now)
_debug2 "_lifetime" "$_lifetime"
if [ $_lifetime -gt 86400 ]; then
#if lifetime is logner than one day, it will renew one day before
Le_NextRenewTime=$(_math $Le_NextRenewTime - 86400)
Le_NextRenewTimeStr=$(_time2str "$Le_NextRenewTime")
else
#if lifetime is less than 24 hours, it will renew one hour before
Le_NextRenewTime=$(_math $Le_NextRenewTime - 3600)
Le_NextRenewTimeStr=$(_time2str "$Le_NextRenewTime")
fi
fi fi
else else
Le_NextRenewTime=$(_math "$Le_CertCreateTime" + "$Le_RenewalDays" \* 24 \* 60 \* 60) Le_NextRenewTime=$(_math "$Le_CertCreateTime" + "$Le_RenewalDays" \* 24 \* 60 \* 60)
Le_NextRenewTimeStr=$(_time2str "$Le_NextRenewTime")
Le_NextRenewTime=$(_math "$Le_NextRenewTime" - 86400) Le_NextRenewTime=$(_math "$Le_NextRenewTime" - 86400)
Le_NextRenewTimeStr=$(_time2str "$Le_NextRenewTime")
fi fi
_savedomainconf "Le_NextRenewTimeStr" "$Le_NextRenewTimeStr" _savedomainconf "Le_NextRenewTimeStr" "$Le_NextRenewTimeStr"
_savedomainconf "Le_NextRenewTime" "$Le_NextRenewTime" _savedomainconf "Le_NextRenewTime" "$Le_NextRenewTime"
@ -6038,6 +6052,8 @@ revoke() {
if [ -z "$response" ]; then if [ -z "$response" ]; then
_info "Revoke success." _info "Revoke success."
rm -f "$CERT_PATH" rm -f "$CERT_PATH"
cat "$CERT_KEY_PATH" >"$CERT_KEY_PATH.revoked"
cat "$CSR_PATH" >"$CSR_PATH.revoked"
return 0 return 0
else else
_err "Revoke error by domain key." _err "Revoke error by domain key."
@ -6054,6 +6070,8 @@ revoke() {
if [ -z "$response" ]; then if [ -z "$response" ]; then
_info "Revoke success." _info "Revoke success."
rm -f "$CERT_PATH" rm -f "$CERT_PATH"
cat "$CERT_KEY_PATH" >"$CERT_KEY_PATH.revoked"
cat "$CSR_PATH" >"$CSR_PATH.revoked"
return 0 return 0
else else
_err "Revoke error." _err "Revoke error."

View File

@ -1,10 +1,12 @@
#!/usr/bin/env sh #!/usr/bin/env sh
#Godaddy domain api #Godaddy domain api
# Get API key and secret from https://developer.godaddy.com/
# #
#GD_Key="sdfsdfsdfljlbjkljlkjsdfoiwje" # GD_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
# GD_Secret="asdfsdfsfsdfsdfdfsdf"
# #
#GD_Secret="asdfsdfsfsdfsdfdfsdf" # Ex.: acme.sh --issue --staging --dns dns_gd -d "*.s.example.com" -d "s.example.com"
GD_Api="https://api.godaddy.com/v1" GD_Api="https://api.godaddy.com/v1"
@ -51,7 +53,8 @@ dns_gd_add() {
_add_data="{\"data\":\"$txtvalue\"}" _add_data="{\"data\":\"$txtvalue\"}"
for t in $(echo "$response" | tr '{' "\n" | grep "\"name\":\"$_sub_domain\"" | tr ',' "\n" | grep '"data"' | cut -d : -f 2); do for t in $(echo "$response" | tr '{' "\n" | grep "\"name\":\"$_sub_domain\"" | tr ',' "\n" | grep '"data"' | cut -d : -f 2); do
_debug2 t "$t" _debug2 t "$t"
if [ "$t" ]; then # ignore empty (previously removed) records, to prevent useless _acme-challenge TXT entries
if [ "$t" ] && [ "$t" != '""' ]; then
_add_data="$_add_data,{\"data\":$t}" _add_data="$_add_data,{\"data\":$t}"
fi fi
done done
@ -59,13 +62,25 @@ dns_gd_add() {
_info "Adding record" _info "Adding record"
if _gd_rest PUT "domains/$_domain/records/TXT/$_sub_domain" "[$_add_data]"; then if _gd_rest PUT "domains/$_domain/records/TXT/$_sub_domain" "[$_add_data]"; then
_info "Added, sleeping 10 seconds" _debug "Checking updated records of '${fulldomain}'"
_sleep 10
#todo: check if the record takes effect if ! _gd_rest GET "domains/$_domain/records/TXT/$_sub_domain"; then
return 0 _err "Validating TXT record for '${fulldomain}' with rest error [$?]." "$response"
return 1
fi
if ! _contains "$response" "$txtvalue"; then
_err "TXT record '${txtvalue}' for '${fulldomain}', value wasn't set!"
return 1
fi
else
_err "Add txt record error, value '${txtvalue}' for '${fulldomain}' was not set."
return 1
fi fi
_err "Add txt record error."
return 1 _sleep 10
_info "Added TXT record '${txtvalue}' for '${fulldomain}'."
return 0
} }
#fulldomain #fulldomain
@ -107,11 +122,20 @@ dns_gd_rm() {
fi fi
done done
if [ -z "$_add_data" ]; then if [ -z "$_add_data" ]; then
_add_data="{\"data\":\"\"}" # delete empty record
_debug "Delete last record for '${fulldomain}'"
if ! _gd_rest DELETE "domains/$_domain/records/TXT/$_sub_domain"; then
_err "Cannot delete empty TXT record for '$fulldomain'"
return 1
fi
else
# remove specific TXT value, keeping other entries
_debug2 _add_data "$_add_data"
if ! _gd_rest PUT "domains/$_domain/records/TXT/$_sub_domain" "[$_add_data]"; then
_err "Cannot update TXT record for '$fulldomain'"
return 1
fi
fi fi
_debug2 _add_data "$_add_data"
_gd_rest PUT "domains/$_domain/records/TXT/$_sub_domain" "[$_add_data]"
} }
#################### Private functions below ################################## #################### Private functions below ##################################
@ -156,15 +180,15 @@ _gd_rest() {
export _H1="Authorization: sso-key $GD_Key:$GD_Secret" export _H1="Authorization: sso-key $GD_Key:$GD_Secret"
export _H2="Content-Type: application/json" export _H2="Content-Type: application/json"
if [ "$data" ]; then if [ "$data" ] || [ "$m" = "DELETE" ]; then
_debug data "$data" _debug "data ($m): " "$data"
response="$(_post "$data" "$GD_Api/$ep" "" "$m")" response="$(_post "$data" "$GD_Api/$ep" "" "$m")"
else else
response="$(_get "$GD_Api/$ep")" response="$(_get "$GD_Api/$ep")"
fi fi
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
_err "error $ep" _err "error on rest call ($m): $ep"
return 1 return 1
fi fi
_debug2 response "$response" _debug2 response "$response"

View File

@ -5,55 +5,81 @@
# Environment variables: # Environment variables:
# #
# - $KAS_Login (Kasserver API login name) # - $KAS_Login (Kasserver API login name)
# - $KAS_Authtype (Kasserver API auth type. Default: sha1) # - $KAS_Authtype (Kasserver API auth type. Default: plain)
# - $KAS_Authdata (Kasserver API auth data.) # - $KAS_Authdata (Kasserver API auth data.)
# #
# Author: Martin Kammerlander, Phlegx Systems OG <martin.kammerlander@phlegx.com> # Author: squared GmbH <github@squaredgmbh.de>
# Updated by: Marc-Oliver Lange <git@die-lang.es> # Credits:
# Credits: Inspired by dns_he.sh. Thanks a lot man! # Inspired by dns_he.sh. Thanks a lot man!
# Git repo: https://github.com/phlegx/acme.sh # Previous version by Martin Kammerlander, Phlegx Systems OG <martin.kammerlander@phlegx.com>
# TODO: Better Error handling # Previous update by Marc-Oliver Lange <git@die-lang.es>
# KASAPI SOAP guideline by https://github.com/o1oo11oo/kasapi.sh
######################################################################## ########################################################################
KAS_Api="https://kasapi.kasserver.com/soap/KasApi.php" KAS_Api_GET="$(_get "https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl")"
KAS_Auth="https://kasapi.kasserver.com/soap/KasAuth.php" KAS_Api="$(echo "$KAS_Api_GET" | tr -d ' ' | grep -i "<soap:addresslocation=" | sed "s/='/\n/g" | grep -i "http" | sed "s/'\/>//g")"
_info "[KAS] -> API URL $KAS_Api"
KAS_Auth_GET="$(_get "https://kasapi.kasserver.com/soap/wsdl/KasAuth.wsdl")"
KAS_Auth="$(echo "$KAS_Auth_GET" | tr -d ' ' | grep -i "<soap:addresslocation=" | sed "s/='/\n/g" | grep -i "http" | sed "s/'\/>//g")"
_info "[KAS] -> AUTH URL $KAS_Auth"
KAS_default_ratelimit=5 # TODO - Every response delivers a ratelimit (seconds) where KASAPI is blocking a request.
######## Public functions ##################### ######## Public functions #####################
dns_kas_add() { dns_kas_add() {
_fulldomain=$1 _fulldomain=$1
_txtvalue=$2 _txtvalue=$2
_info "### -> Using DNS-01 All-inkl/Kasserver hook" _info "[KAS] -> Using DNS-01 All-inkl/Kasserver hook"
_info "### -> Adding $_fulldomain DNS TXT entry on All-inkl/Kasserver" _info "[KAS] -> Adding $_fulldomain DNS TXT entry on all-inkl.com/Kasserver"
_info "### -> Retriving Credential Token" _info "[KAS] -> Retriving Credential Token"
_get_credential_token _get_credential_token
_info "### -> Check and Save Props" _info "[KAS] -> Check and Save Props"
_check_and_save _check_and_save
_info "### -> Checking Zone and Record_Name" _info "[KAS] -> Checking Zone and Record_Name"
_get_zone_and_record_name "$_fulldomain" _get_zone_and_record_name "$_fulldomain"
_info "### -> Checking for existing Record entries" _info "[KAS] -> Checking for existing Record entries"
_get_record_id _get_record_id
# If there is a record_id, delete the entry # If there is a record_id, delete the entry
if [ -n "$_record_id" ]; then if [ -n "$_record_id" ]; then
_info "Existing records found. Now deleting old entries" _info "[KAS] -> Existing records found. Now deleting old entries"
for i in $_record_id; do for i in $_record_id; do
_delete_RecordByID "$i" _delete_RecordByID "$i"
done done
else else
_info "No record found." _info "[KAS] -> No record found."
fi fi
_info "### -> Creating TXT DNS record" _info "[KAS] -> Creating TXT DNS record"
action="add_dns_settings" action="add_dns_settings"
kasReqParam="{\"record_name\":\"$_record_name\",\"record_type\":\"TXT\",\"record_data\":\"$_txtvalue\",\"record_aux\":\"0\",\"zone_host\":\"$_zone\"}" kasReqParam="\"record_name\":\"$_record_name\""
kasReqParam="$kasReqParam,\"record_type\":\"TXT\""
kasReqParam="$kasReqParam,\"record_data\":\"$_txtvalue\""
kasReqParam="$kasReqParam,\"record_aux\":\"0\""
kasReqParam="$kasReqParam,\"zone_host\":\"$_zone\""
response="$(_callAPI "$action" "$kasReqParam")" response="$(_callAPI "$action" "$kasReqParam")"
_debug2 "[KAS] -> Response" "$response"
_debug2 "Response" "$response" if [ -z "$response" ]; then
_info "[KAS] -> Response was empty, please check manually."
if ! _contains "$response" "TRUE"; then return 1
_err "An unkown error occurred, please check manually." elif _contains "$response" "<SOAP-ENV:Fault>"; then
faultstring="$(echo "$response" | tr -d '\n\r' | sed "s/<faultstring>/\n=> /g" | sed "s/<\/faultstring>/\n/g" | grep "=>" | sed "s/=> //g")"
case "${faultstring}" in
"record_already_exists")
_info "[KAS] -> The record already exists, which must not be a problem. Please check manually."
;;
*)
_err "[KAS] -> An error =>$faultstring<= occurred, please check manually."
return 1
;;
esac
elif ! _contains "$response" "<item><key xsi:type=\"xsd:string\">ReturnString</key><value xsi:type=\"xsd:string\">TRUE</value></item>"; then
_err "[KAS] -> An unknown error occurred, please check manually."
return 1 return 1
fi fi
return 0 return 0
@ -63,29 +89,29 @@ dns_kas_rm() {
_fulldomain=$1 _fulldomain=$1
_txtvalue=$2 _txtvalue=$2
_info "### -> Using DNS-01 All-inkl/Kasserver hook" _info "[KAS] -> Using DNS-01 All-inkl/Kasserver hook"
_info "### -> Cleaning up after All-inkl/Kasserver hook" _info "[KAS] -> Cleaning up after All-inkl/Kasserver hook"
_info "### -> Removing $_fulldomain DNS TXT entry on All-inkl/Kasserver" _info "[KAS] -> Removing $_fulldomain DNS TXT entry on All-inkl/Kasserver"
_info "### -> Retriving Credential Token" _info "[KAS] -> Retriving Credential Token"
_get_credential_token _get_credential_token
_info "### -> Check and Save Props" _info "[KAS] -> Check and Save Props"
_check_and_save _check_and_save
_info "### -> Checking Zone and Record_Name" _info "[KAS] -> Checking Zone and Record_Name"
_get_zone_and_record_name "$_fulldomain" _get_zone_and_record_name "$_fulldomain"
_info "### -> Getting Record ID" _info "[KAS] -> Getting Record ID"
_get_record_id _get_record_id
_info "### -> Removing entries with ID: $_record_id" _info "[KAS] -> Removing entries with ID: $_record_id"
# If there is a record_id, delete the entry # If there is a record_id, delete the entry
if [ -n "$_record_id" ]; then if [ -n "$_record_id" ]; then
for i in $_record_id; do for i in $_record_id; do
_delete_RecordByID "$i" _delete_RecordByID "$i"
done done
else # Cannot delete or unkown error else # Cannot delete or unkown error
_info "No record_id found that can be deleted. Please check manually." _info "[KAS] -> No record_id found that can be deleted. Please check manually."
fi fi
return 0 return 0
} }
@ -95,11 +121,27 @@ dns_kas_rm() {
_delete_RecordByID() { _delete_RecordByID() {
recId=$1 recId=$1
action="delete_dns_settings" action="delete_dns_settings"
kasReqParam="{\"record_id\":\"$recId\"}" kasReqParam="\"record_id\":\"$recId\""
response="$(_callAPI "$action" "$kasReqParam")" response="$(_callAPI "$action" "$kasReqParam")"
_debug2 "Response" "$response" _debug2 "[KAS] -> Response" "$response"
if ! _contains "$response" "TRUE"; then
_info "Either the txt record is not found or another error occurred, please check manually." if [ -z "$response" ]; then
_info "[KAS] -> Response was empty, please check manually."
return 1
elif _contains "$response" "<SOAP-ENV:Fault>"; then
faultstring="$(echo "$response" | tr -d '\n\r' | sed "s/<faultstring>/\n=> /g" | sed "s/<\/faultstring>/\n/g" | grep "=>" | sed "s/=> //g")"
case "${faultstring}" in
"record_id_not_found")
_info "[KAS] -> The record was not found, which perhaps is not a problem. Please check manually."
;;
*)
_err "[KAS] -> An error =>$faultstring<= occurred, please check manually."
return 1
;;
esac
elif ! _contains "$response" "<item><key xsi:type=\"xsd:string\">ReturnString</key><value xsi:type=\"xsd:string\">TRUE</value></item>"; then
_err "[KAS] -> An unknown error occurred, please check manually."
return 1
fi fi
} }
# Checks for the ENV variables and saves them # Checks for the ENV variables and saves them
@ -112,7 +154,7 @@ _check_and_save() {
KAS_Login= KAS_Login=
KAS_Authtype= KAS_Authtype=
KAS_Authdata= KAS_Authdata=
_err "No auth details provided. Please set user credentials using the \$KAS_Login, \$KAS_Authtype, and \$KAS_Authdata environment variables." _err "[KAS] -> No auth details provided. Please set user credentials using the \$KAS_Login, \$KAS_Authtype, and \$KAS_Authdata environment variables."
return 1 return 1
fi fi
_saveaccountconf_mutable KAS_Login "$KAS_Login" _saveaccountconf_mutable KAS_Login "$KAS_Login"
@ -125,9 +167,18 @@ _check_and_save() {
# See: https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-Guide # See: https://github.com/Neilpang/acme.sh/wiki/DNS-API-Dev-Guide
_get_zone_and_record_name() { _get_zone_and_record_name() {
action="get_domains" action="get_domains"
kasReqParam="[]" response="$(_callAPI "$action")"
response="$(_callAPI "$action" "$kasReqParam")" _debug2 "[KAS] -> Response" "$response"
_debug2 "Response" "$response"
if [ -z "$response" ]; then
_info "[KAS] -> Response was empty, please check manually."
return 1
elif _contains "$response" "<SOAP-ENV:Fault>"; then
faultstring="$(echo "$response" | tr -d '\n\r' | sed "s/<faultstring>/\n=> /g" | sed "s/<\/faultstring>/\n/g" | grep "=>" | sed "s/=> //g")"
_err "[KAS] -> Either no domains were found or another error =>$faultstring<= occurred, please check manually."
return 1
fi
zonen="$(echo "$response" | sed 's/<item>/\n/g' | sed -r 's/(.*<key xsi:type="xsd:string">domain_name<\/key><value xsi:type="xsd:string">)(.*)(<\/value.*)/\2/' | sed '/^</d')" zonen="$(echo "$response" | sed 's/<item>/\n/g' | sed -r 's/(.*<key xsi:type="xsd:string">domain_name<\/key><value xsi:type="xsd:string">)(.*)(<\/value.*)/\2/' | sed '/^</d')"
domain="$1" domain="$1"
temp_domain="$(echo "$1" | sed 's/\.$//')" temp_domain="$(echo "$1" | sed 's/\.$//')"
@ -142,59 +193,80 @@ _get_zone_and_record_name() {
_zone="${rootzone}." _zone="${rootzone}."
temp_record_name="$(echo "$temp_domain" | sed "s/$rootzone//g")" temp_record_name="$(echo "$temp_domain" | sed "s/$rootzone//g")"
_record_name="$(echo "$temp_record_name" | sed 's/\.$//')" _record_name="$(echo "$temp_record_name" | sed 's/\.$//')"
_debug "Zone:" "$_zone" _debug "[KAS] -> Zone:" "$_zone"
_debug "Domain:" "$domain" _debug "[KAS] -> Domain:" "$domain"
_debug "Record_Name:" "$_record_name" _debug "[KAS] -> Record_Name:" "$_record_name"
return 0 return 0
} }
# Retrieve the DNS record ID # Retrieve the DNS record ID
_get_record_id() { _get_record_id() {
action="get_dns_settings" action="get_dns_settings"
kasReqParam="{\"zone_host\":\"$_zone\",\"nameserver\":\"ns5.kasserver.com\"}" kasReqParam="\"zone_host\":\"$_zone\""
response="$(_callAPI "$action" "$kasReqParam")" response="$(_callAPI "$action" "$kasReqParam")"
_debug2 "[KAS] -> Response" "$response"
_debug2 "Response" "$response" if [ -z "$response" ]; then
_record_id="$(echo "$response" | sed 's/<item xsi:type="ns2:Map">/\n/g' | sed -n -e "/^.*$_record_name.*/Ip" | sed -n -e "/^.*$_txtvalue.*/Ip" | sed -r 's/(.*record_id<\/key><value xsi:type="xsd:string">)([0-9]+)(<\/value.*)/\2/')" _info "[KAS] -> Response was empty, please check manually."
_debug "Record Id: " "$_record_id" return 1
elif _contains "$response" "<SOAP-ENV:Fault>"; then
faultstring="$(echo "$response" | tr -d '\n\r' | sed "s/<faultstring>/\n=> /g" | sed "s/<\/faultstring>/\n/g" | grep "=>" | sed "s/=> //g")"
_err "[KAS] -> Either no domains were found or another error =>$faultstring<= occurred, please check manually."
return 1
fi
_record_id="$(echo "$response" | tr -d '\n\r' | sed "s/<item xsi:type=\"ns2:Map\">/\n/g" | grep -i "$_record_name" | grep -i ">TXT<" | sed "s/<item><key xsi:type=\"xsd:string\">record_id<\/key><value xsi:type=\"xsd:string\">/=>/g" | sed "s/<\/value><\/item>/\n/g" | grep "=>" | sed "s/=>//g")"
_debug "[KAS] -> Record Id: " "$_record_id"
return 0 return 0
} }
# Retrieve credential token # Retrieve credential token
_get_credential_token() { _get_credential_token() {
data="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"urn:xmethodsKasApiAuthentication\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-ENV:Body><ns1:KasAuth>" baseParamAuth="\"kas_login\":\"$KAS_Login\""
data="$data<Params xsi:type=\"xsd:string\">{\"kas_login\":\"$KAS_Login\",\"kas_auth_type\":\"$KAS_Authtype\",\"kas_auth_data\":\"$KAS_Authdata\",\"session_lifetime\":600,\"session_update_lifetime\":\"Y\",\"session_2fa\":123456}</Params>" baseParamAuth="$baseParamAuth,\"kas_auth_type\":\"$KAS_Authtype\""
data="$data</ns1:KasAuth></SOAP-ENV:Body></SOAP-ENV:Envelope>" baseParamAuth="$baseParamAuth,\"kas_auth_data\":\"$KAS_Authdata\""
baseParamAuth="$baseParamAuth,\"session_lifetime\":600"
baseParamAuth="$baseParamAuth,\"session_update_lifetime\":\"Y\""
_debug "Be frindly and wait 10 seconds by default before calling KAS API." data='<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethodsKasApiAuthentication" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:KasAuth><Params xsi:type="xsd:string">{'
_sleep 10 data="$data$baseParamAuth}</Params></ns1:KasAuth></SOAP-ENV:Body></SOAP-ENV:Envelope>"
_debug "[KAS] -> Be friendly and wait $KAS_default_ratelimit seconds by default before calling KAS API."
_sleep $KAS_default_ratelimit
contentType="text/xml" contentType="text/xml"
export _H1="SOAPAction: ns1:KasAuth" export _H1="SOAPAction: urn:xmethodsKasApiAuthentication#KasAuth"
response="$(_post "$data" "$KAS_Auth" "" "POST" "$contentType")" response="$(_post "$data" "$KAS_Auth" "" "POST" "$contentType")"
_debug2 "Response" "$response" _debug2 "[KAS] -> Response" "$response"
_credential_token="$(echo "$response" | tr '\n' ' ' | sed 's/.*return xsi:type="xsd:string">\(.*\)<\/return>/\1/' | sed 's/<\/ns1:KasAuthResponse\(.*\)Envelope>.*//')" _credential_token="$(echo "$response" | tr '\n' ' ' | sed 's/.*return xsi:type="xsd:string">\(.*\)<\/return>/\1/' | sed 's/<\/ns1:KasAuthResponse\(.*\)Envelope>.*//')"
_debug "Credential Token: " "$_credential_token" _debug "[KAS] -> Credential Token: " "$_credential_token"
return 0 return 0
} }
_callAPI() { _callAPI() {
kasaction=$1 kasaction=$1
kasReqParams=$2 kasReqParams=$2
baseParam="<Params xsi:type=\"xsd:string\">{\"kas_login\":\"$KAS_Login\",\"kas_auth_type\":\"session\",\"kas_auth_data\":\"$_credential_token\",\"kas_action\":\"$kasaction\",\"KasRequestParams\":$kasReqParams"
baseParamClosing="}</Params>"
data="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"urn:xmethodsKasApi\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-ENV:Body><ns1:KasApi>"
data="$data$baseParam$baseParamClosing"
data="$data</ns1:KasApi></SOAP-ENV:Body></SOAP-ENV:Envelope>"
_debug2 "Request" "$data"
_debug "Be frindly and wait 10 seconds by default before calling KAS API." baseParamAuth="\"kas_login\":\"$KAS_Login\""
_sleep 10 baseParamAuth="$baseParamAuth,\"kas_auth_type\":\"session\""
baseParamAuth="$baseParamAuth,\"kas_auth_data\":\"$_credential_token\""
data='<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethodsKasApi" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:KasApi><Params xsi:type="xsd:string">{'
data="$data$baseParamAuth,\"kas_action\":\"$kasaction\""
if [ -n "$kasReqParams" ]; then
data="$data,\"KasRequestParams\":{$kasReqParams}"
fi
data="$data}</Params></ns1:KasApi></SOAP-ENV:Body></SOAP-ENV:Envelope>"
_debug2 "[KAS] -> Request" "$data"
_debug "[KAS] -> Be friendly and wait $KAS_default_ratelimit seconds by default before calling KAS API."
_sleep $KAS_default_ratelimit
contentType="text/xml" contentType="text/xml"
export _H1="SOAPAction: ns1:KasApi" export _H1="SOAPAction: urn:xmethodsKasApi#KasApi"
response="$(_post "$data" "$KAS_Api" "" "POST" "$contentType")" response="$(_post "$data" "$KAS_Api" "" "POST" "$contentType")"
_debug2 "Response" "$response" _debug2 "[KAS] -> Response" "$response"
echo "$response" echo "$response"
} }

147
dnsapi/dns_la.sh Normal file
View File

@ -0,0 +1,147 @@
#!/usr/bin/env sh
#LA_Id="test123"
#LA_Key="d1j2fdo4dee3948"
LA_Api="https://api.dns.la/api"
######## Public functions #####################
#Usage: dns_la_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns_la_add() {
fulldomain=$1
txtvalue=$2
LA_Id="${LA_Id:-$(_readaccountconf_mutable LA_Id)}"
LA_Key="${LA_Key:-$(_readaccountconf_mutable LA_Key)}"
if [ -z "$LA_Id" ] || [ -z "$LA_Key" ]; then
LA_Id=""
LA_Key=""
_err "You didn't specify a dnsla api id and key yet."
return 1
fi
#save the api key and email to the account conf file.
_saveaccountconf_mutable LA_Id "$LA_Id"
_saveaccountconf_mutable LA_Key "$LA_Key"
_debug "First detect the root zone"
if ! _get_root "$fulldomain"; then
_err "invalid domain"
return 1
fi
_debug _domain_id "$_domain_id"
_debug _sub_domain "$_sub_domain"
_debug _domain "$_domain"
_info "Adding record"
if _la_rest "record.ashx?cmd=create&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&host=$_sub_domain&recordtype=TXT&recorddata=$txtvalue&recordline="; then
if _contains "$response" '"resultid":'; then
_info "Added, OK"
return 0
elif _contains "$response" '"code":532'; then
_info "Already exists, OK"
return 0
else
_err "Add txt record error."
return 1
fi
fi
_err "Add txt record error."
return 1
}
#fulldomain txtvalue
dns_la_rm() {
fulldomain=$1
txtvalue=$2
LA_Id="${LA_Id:-$(_readaccountconf_mutable LA_Id)}"
LA_Key="${LA_Key:-$(_readaccountconf_mutable LA_Key)}"
_debug "First detect the root zone"
if ! _get_root "$fulldomain"; then
_err "invalid domain"
return 1
fi
_debug _domain_id "$_domain_id"
_debug _sub_domain "$_sub_domain"
_debug _domain "$_domain"
_debug "Getting txt records"
if ! _la_rest "record.ashx?cmd=listn&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&host=$_sub_domain&recordtype=TXT&recorddata=$txtvalue"; then
_err "Error"
return 1
fi
if ! _contains "$response" '"recordid":'; then
_info "Don't need to remove."
return 0
fi
record_id=$(printf "%s" "$response" | grep '"recordid":' | cut -d : -f 2 | cut -d , -f 1 | tr -d '\r' | tr -d '\n')
_debug "record_id" "$record_id"
if [ -z "$record_id" ]; then
_err "Can not get record id to remove."
return 1
fi
if ! _la_rest "record.ashx?cmd=remove&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domainid=$_domain_id&domain=$_domain&recordid=$record_id"; then
_err "Delete record error."
return 1
fi
_contains "$response" '"code":300'
}
#################### Private functions below ##################################
#_acme-challenge.www.domain.com
#returns
# _sub_domain=_acme-challenge.www
# _domain=domain.com
# _domain_id=sdjkglgdfewsdfg
_get_root() {
domain=$1
i=1
p=1
while true; do
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
if [ -z "$h" ]; then
#not valid
return 1
fi
if ! _la_rest "domain.ashx?cmd=get&apiid=$LA_Id&apipass=$LA_Key&rtype=json&domain=$h"; then
return 1
fi
if _contains "$response" '"domainid":'; then
_domain_id=$(printf "%s" "$response" | grep '"domainid":' | cut -d : -f 2 | cut -d , -f 1 | tr -d '\r' | tr -d '\n')
if [ "$_domain_id" ]; then
_sub_domain=$(printf "%s" "$domain" | cut -d . -f 1-$p)
_domain="$h"
return 0
fi
return 1
fi
p="$i"
i=$(_math "$i" + 1)
done
return 1
}
#Usage: URI
_la_rest() {
url="$LA_Api/$1"
_debug "$url"
if ! response="$(_get "$url" | tr -d ' ' | tr "}" ",")"; then
_err "Error: $url"
return 1
fi
_debug2 response "$response"
return 0
}