acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
38.82k stars 4.93k forks source link

Deploy hook writes data for that delay hook into the domain conf file, which makes it impossible to run the same hook to different targets #5004

Open skynw opened 7 months ago

skynw commented 7 months ago

Steps to reproduce

  1. run works: acme.sh --deploy --deploy-hook synology_dsm -d *.schwarzwald.ua --accountconf data/horst1.conf But now the data from Synology deploy hook is written into my domain config:

data/*.schwarzwald.ua_ecc/'*.schwarzwald.ua.conf'

So when I run the same deploy hook with different accountconf it fails:

acme.sh --deploy --deploy-hook synology_dsm -d *.schwarzwald.ua --accountconf data/horst2.conf

Only after I delete the deployment hooks config from the domain file it works

But then of course the data from horst2.conf deploy hook is written into the domain file *.schwarzwald.ua.conf

and the following run to another target fails again, until the data is deleted again

Any idea, how to do this in a correct way?

Cheers Marcel

github-actions[bot] commented 7 months ago

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.

skynw commented 7 months ago

acme.sh is upgraded to the newest version, please see the debug log:

acme.sh --deploy --deploy-hook synology_dsm -d .schwarzwald.ua --accountconf data/horst1.conf --debug 2 [Sat Feb 17 09:36:59 PM EET 2024] Lets find script dir. [Sat Feb 17 09:36:59 PM EET 2024] SCRIPT='/home/heinz/mycerts/acme.sh' [Sat Feb 17 09:36:59 PM EET 2024] _script='/home/heinz/mycerts/acme.sh' [Sat Feb 17 09:36:59 PM EET 2024] _script_home='/home/heinz/mycerts' [Sat Feb 17 09:36:59 PM EET 2024] Using config home:/home/heinz/mycerts/data [Sat Feb 17 09:36:59 PM EET 2024] LE_WORKING_DIR='/home/heinz/mycerts' https://github.com/acmesh-official/acme.sh v3.0.8 [Sat Feb 17 09:36:59 PM EET 2024] Running cmd: deploy [Sat Feb 17 09:36:59 PM EET 2024] Using config home:/home/heinz/mycerts/data [Sat Feb 17 09:36:59 PM EET 2024] default_acme_server [Sat Feb 17 09:36:59 PM EET 2024] ACME_DIRECTORY='https://acme.zerossl.com/v2/DV90' [Sat Feb 17 09:36:59 PM EET 2024] _ACME_SERVER_HOST='acme.zerossl.com' [Sat Feb 17 09:36:59 PM EET 2024] _ACME_SERVER_PATH='v2/DV90' [Sat Feb 17 09:36:59 PM EET 2024] The domain '.schwarzwald.ua' seems to have a ECC cert already, lets use ecc cert. [Sat Feb 17 09:36:59 PM EET 2024] DOMAIN_PATH='/home/heinz/mycerts/data/.schwarzwald.ua_ecc' [Sat Feb 17 09:36:59 PM EET 2024] DOMAIN_CONF='/home/heinz/mycerts/data/.schwarzwald.ua_ecc/.schwarzwald.ua.conf' [Sat Feb 17 09:36:59 PM EET 2024] _deployApi='/home/heinz/mycerts/deploy/synology_dsm.sh' [Sat Feb 17 09:36:59 PM EET 2024] _cdomain='.schwarzwald.ua' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Username='synouser' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Password='[hidden](please add '--output-insecure' to see this value)' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Create [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Device_Name='CertRenewal' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Device_ID='[hidden](please add '--output-insecure' to see this value)' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Scheme='https' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Hostname='horst2.schwarzwald.ua' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Port='5501' [Sat Feb 17 09:36:59 PM EET 2024] SYNO_Certificate [Sat Feb 17 09:36:59 PM EET 2024] _base_url='https://horst2.schwarzwald.ua:5501' [Sat Feb 17 09:36:59 PM EET 2024] Getting API version [Sat Feb 17 09:36:59 PM EET 2024] GET [Sat Feb 17 09:36:59 PM EET 2024] url='https://horst2.schwarzwald.ua:5501/webapi/query.cgi?api=SYNO.API.Info&version=1&method=query&query=SYNO.API.Auth' [Sat Feb 17 09:36:59 PM EET 2024] timeout= [Sat Feb 17 09:36:59 PM EET 2024] CURL='curl --silent --dump-header /home/heinz/mycerts/data/http.header -L --trace-ascii /tmp/tmp.gzrC36xu2V -g ' [Sat Feb 17 09:36:59 PM EET 2024] ret='0' [Sat Feb 17 09:36:59 PM EET 2024] Logging into horst2.schwarzwald.ua:5501 [Sat Feb 17 09:36:59 PM EET 2024] GET [Sat Feb 17 09:36:59 PM EET 2024] url='https://horst2.schwarzwald.ua:5501/webapi/entry.cgi?api=SYNO.API.Auth&version=7&method=login&format=sid&account=synouser&passwd=%3d%2aU8t3Tl%26~x&enable_syno_token=yes&device_name=CertRenewal&device_id=Pi3tYprA6stGT8Ib_sd_IN5_bFYw7bXalc6cpT6K-bR1yOwTuwHoEf126ASlOsKrrz70sGboQN2t5ngbxoZbPA' [Sat Feb 17 09:36:59 PM EET 2024] timeout= [Sat Feb 17 09:37:00 PM EET 2024] _CURL='curl --silent --dump-header /home/heinz/mycerts/data/http.header -L --trace-ascii /tmp/tmp.KOrrRKjksg -g ' [Sat Feb 17 09:37:00 PM EET 2024] ret='0' [Sat Feb 17 09:37:00 PM EET 2024] Session ID='UcK_7YUV2V3e4xPgxlc2ktVcGaZrammEc2OchkvvoZ411uz8F3V7F3yDHFYVzbMcyGv7HWX1vzenc_Mx4vy4' [Sat Feb 17 09:37:00 PM EET 2024] SynoToken='Sa6ceRtkap1Po' [Sat Feb 17 09:37:00 PM EET 2024] H1='X-SYNO-TOKEN: Sa6ceRtkap1Po' [Sat Feb 17 09:37:00 PM EET 2024] Getting certificates in Synology DSM [Sat Feb 17 09:37:00 PM EET 2024] POST [Sat Feb 17 09:37:00 PM EET 2024] _post_url='https://horst2.schwarzwald.ua:5501/webapi/entry.cgi' [Sat Feb 17 09:37:00 PM EET 2024] body='api=SYNO.Core.Certificate.CRT&method=list&version=1&_sid=UcK_7YUV2V3e4xPgxlc2ktVcGaZrammEc2OchkvvoZ411uz8F3V7F3yDHFYVzbMcyGv7HWX1vze__nc_Mx4vy4' [Sat Feb 17 09:37:00 PM EET 2024] _postContentType [Sat Feb 17 09:37:01 PM EET 2024] _CURL='curl --silent --dump-header /home/heinz/mycerts/data/http.header -L --trace-ascii /tmp/tmp.u7eu6oRG7n -g ' [Sat Feb 17 09:37:01 PM EET 2024] _ret='0' [Sat Feb 17 09:37:01 PM EET 2024] escaped_certificate [Sat Feb 17 09:37:01 PM EET 2024] id='cLmm4f' [Sat Feb 17 09:37:01 PM EET 2024] Generate form POST request [Sat Feb 17 09:37:01 PM EET 2024] default='This is the default certificate' [Sat Feb 17 09:37:01 PM EET 2024] Upload certificate to the Synology DSM [Sat Feb 17 09:37:01 PM EET 2024] POST [Sat Feb 17 09:37:01 PM EET 2024] _post_url='https://horst2.schwarzwald.ua:5501/webapi/entry.cgi?api=SYNO.Core.Certificate&method=import&version=1&SynoToken=Sa6ceRtkap1Po&_sid=UcK_7YUV2V3e4xPgxlc2ktVcGaZrammEc2OchkvvoZ411uz8F3V7F3yDHFYVzbMcyGv7HWX1vzenc_Mx4vy4' [Sat Feb 17 09:37:01 PM EET 2024] body='----------------------------20240217193701 Content-Disposition: form-data; name="key"; filename="*.schwarzwald.ua.key" Content-Type: application/octet-stream

-----BEGIN EC PRIVATE KEY----- MHcCAQEEIBhqGS/2Ucnoe+weM2oTNWlQbmCG6tr5hwiQDMxS0gShoAoGCCqGSM49 AwEHoUQDQgAEZ1B5WYmbpfFOMG+9FUrc0/y0TiXffNUe5YcUWuVgNz57aab8+Pyh CBf92/cbkwZQbHgip7hjghwflTjuAqVMfQ== -----END EC PRIVATE KEY-----

----------------------------20240217193701 Content-Disposition: form-data; name="cert"; filename="*.schwarzwald.ua.cer" Content-Type: application/octet-stream

-----BEGIN CERTIFICATE----- MIIELDCCAxSgAwIBAgISAzKr04yJlZHBx24PgCN4v9tPMA0GCSqGSIb3DQEBCwUA r65l3iDuupon7ktgi0t7Cg== -----END CERTIFICATE-----

----------------------------20240217193701 Content-Disposition: form-data; name="inter_cert"; filename="ca.cer" Content-Type: application/octet-stream

-----BEGIN CERTIFICATE----- MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw nLRbwHOoq7hHwg== -----END CERTIFICATE-----

----------------------------20240217193701 Content-Disposition: form-data; name="id"

cLmm4f ----------------------------20240217193701 Content-Disposition: form-data; name="desc"

----------------------------20240217193701 Content-Disposition: form-data; name="as_default"

true ----------------------------20240217193701-- ' [Sat Feb 17 09:37:01 PM EET 2024] _postContentType='multipart/form-data; boundary=--------------------------20240217193701' [Sat Feb 17 09:37:01 PM EET 2024] _CURL='curl --silent --dump-header /home/heinz/mycerts/data/http.header -L --trace-ascii /tmp/tmp.QZ7SSpZlQB -g ' [Sat Feb 17 09:37:11 PM EET 2024] _ret='0' [Sat Feb 17 09:37:11 PM EET 2024] Restarting HTTP services succeeded [Sat Feb 17 09:37:11 PM EET 2024] GET [Sat Feb 17 09:37:11 PM EET 2024] url='https://horst2.schwarzwald.ua:5501/webapi/entry.cgi?api=SYNO.API.Auth&version=7&method=logout&_sid=UcK_7YUV2V3e4xPgxlc2ktVcGaZrammEc2OchkvvoZ411uz8F3V7F3yDHFYVzbMcyGv7HWX1vze__nc_Mx4vy4' [Sat Feb 17 09:37:11 PM EET 2024] timeout= [Sat Feb 17 09:37:11 PM EET 2024] _CURL='curl --silent --dump-header /home/heinz/mycerts/data/http.header -L --trace-ascii /tmp/tmp.SysX1CkfeZ -g ' [Sat Feb 17 09:37:12 PM EET 2024] ret='0' [Sat Feb 17 09:37:12 PM EET 2024] Success

Cookie-Monster-Coder commented 3 months ago

I have the same issue. Have you found a solution?