Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy-hook synology_dsm fails because api_path is null #4817

Open
sinky opened this issue Oct 3, 2023 · 6 comments
Open

deploy-hook synology_dsm fails because api_path is null #4817

sinky opened this issue Oct 3, 2023 · 6 comments

Comments

@sinky
Copy link

sinky commented Oct 3, 2023

Used deploy-hook synology_dsm first time with DSM 7.2-64570 Update 1` and it failed because the API response parsing with sed failed. Fixed it by replacing sed with jq.

Debug log

./acme.sh -d "my.domain.com" --deploy --deploy-hook synology_dsm --home $PWD --debug 3 --insecure
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_exists:534                    readlink exists=0
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_exists:534                    dirname exists=0
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2641                Lets find script dir.
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2642                _SCRIPT_='./acme.sh'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2644                _script='/usr/local/share/acme.sh/acme.sh'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2646                _script_home='/usr/local/share/acme.sh'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2673                Using config home:/usr/local/share/acme.sh
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2687                ACCOUNT_CONF_PATH='/usr/local/share/acme.sh/account.conf'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_process:7838                  LE_WORKING_DIR='/usr/local/share/acme.sh'
https://github.com/acmesh-official/acme.sh
v3.0.7
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_process:7846                  Running cmd: deploy
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2673                Using config home:/usr/local/share/acme.sh
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:__initHome:2687                ACCOUNT_CONF_PATH='/usr/local/share/acme.sh/account.conf'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2803                 default_acme_server
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2812                 ACME_DIRECTORY='https://acme.zerossl.com/v2/DV90'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2814                 _ACME_SERVER_HOST='acme.zerossl.com'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2817                 _ACME_SERVER_PATH='v2/DV90'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2824                 CA_CONF='/usr/local/share/acme.sh/ca/acme.zerossl.com/v2/DV90/ca.conf'
[Tue Oct  3 06:07:06 PM CEST 2023] The domain 'my.domain.com' seems to have a ECC cert already, lets use ecc cert.
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_initpath:2901                 DOMAIN_PATH='/usr/local/share/acme.sh/my.domain.com_ecc'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:deploy:5766                    DOMAIN_CONF='/usr/local/share/acme.sh/my.domain.com_ecc/my.domain.com.conf'
[Tue Oct  3 06:07:06 PM CEST 2023] ./acme.sh:_setopt:2300                   OK
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2324                   16:Le_DeployHook='synology_dsm,'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_deploy:5722                   _deployApi='/usr/local/share/acme.sh/deploy/synology_dsm.sh'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_exists:534                    synology_dsm_deploy exists=0
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:38 _cdomain='my.domain.com'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:56 SYNO_Username='certadmin'
[Tue Oct  3 06:07:07 PM CEST 2023] SYNO_Password='[hidden](please add '--output-insecure' to see this value)'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:58 SYNO_Create='1'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:59 SYNO_Device_Name
[Tue Oct  3 06:07:07 PM CEST 2023] SYNO_Device_ID='[hidden](please add '--output-insecure' to see this value)'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2300                   OK
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2324                   17:SAVED_SYNO_Scheme='https'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2300                   OK
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2324                   18:SAVED_SYNO_Hostname='my.domain.com'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2300                   OK
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_setopt:2324                   19:SAVED_SYNO_Port='443'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:75 SYNO_Scheme='https'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:76 SYNO_Hostname='my.domain.com'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:77 SYNO_Port='443'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:81 SYNO_Certificate='my.domain.com'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:90 _base_url='https://my.domain.com:443'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:92 Getting API version
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_get:2034                      GET
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_get:2038                      url='https://my.domain.com:443/webapi/query.cgi?api=SYNO.API.Info&version=1&method=query&query=SYNO.API.Auth'
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_get:2039                      timeout=
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_exists:534                    curl exists=0
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_exists:534                    mktemp exists=0
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_exists:534                    wget exists=0
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_get:2051                      _CURL='curl --silent --dump-header /usr/local/share/acme.sh/http.header  -L  --trace-ascii /tmp/tmp.AC3q6CSNJ2  -g  --insecure  '
[Tue Oct  3 06:07:07 PM CEST 2023] ./acme.sh:_get:2103                      ret='0'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:96 response='{"data":{"SYNO.API.Auth":{"maxVersion":7,"minVersion":1,"path":"entry.cgi"}},"success":true}'
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:97 api_path
[Tue Oct  3 06:07:07 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:98 api_version='7'
[Tue Oct  3 06:07:08 PM CEST 2023] Logging into my.domain.com:443
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_exists:534                    od exists=0
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_url_encode:678                _url_encode
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_url_encode:679                _hex_str=' 63 65 72 74 61 64 6d 69 6e'
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_exists:534                    od exists=0
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_url_encode:678                _url_encode
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_url_encode:679                _hex_str=' 73 66 68 6a 67 34 21 37 33 39 44'
[Tue Oct  3 06:07:08 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:146 1here
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_get:2034                      GET
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_get:2038                      url='https://my.domain.com:443/webapi/?api=SYNO.API.Auth&version=7&method=login&format=sid&account=certadmin&passwd=[REDACTED]&enable_syno_token=yes&device_name=&device_id=[REDACTED]'
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_get:2039                      timeout=
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_exists:534                    curl exists=0
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_exists:534                    mktemp exists=0
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_exists:534                    wget exists=0
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_get:2051                      _CURL='curl --silent --dump-header /usr/local/share/acme.sh/http.header  -L  --trace-ascii /tmp/tmp.YPK0fC6sRO  -g  --insecure  '
[Tue Oct  3 06:07:08 PM CEST 2023] ./acme.sh:_get:2103                      ret='0'
[Tue Oct  3 06:07:08 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:148 here
[Tue Oct  3 06:07:08 PM CEST 2023] deploy/synology_dsm.sh:synology_dsm_deploy:149 response='<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>body{font-family:Arial,Helvetica,sans-serif;font-size:12px;text-align:center}h1{color:#06C;font-size:25px;line-height:60px;margin-top:56px}img{margin-top:40px}
</style>
</head>
<body>
<img src="data:image/jpg;base64,/9j/4AAQS[...]
"/>
<h1 id="a"></h1>
<hr>
<p>&copy; 2023 <a href="http://www.synology.com">Synology Inc.</a></p>
</body>
<script type ="text/javascript">
/* Copyright (c) 2023 Synology Inc. All rights reserved. */

(function(){var a={en:"Sorry, the page you are looking for is not found."[...]
</script>
</html>'
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

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.

@mattjgalloway
Copy link

mattjgalloway commented Oct 4, 2023

I think this commit fixes it:
87a7bde

It's on dev, but not on master yet. And I'm awaiting a new docker image pushed with it in too.

#4808 is the issue associated with that commit btw.

@rsporsche
Copy link

FYI @sinky Just want to let you know that the log file you posted contains your DSM username and password

@sinky
Copy link
Author

sinky commented Feb 25, 2024

FYI @sinky Just want to let you know that the log file you posted contains your DSM username and password

hey @rsporsche thanks for drawing my attention but could you specify where do you see the password? REDACTED is not the password.

@rsporsche
Copy link

@sinky

The password is output as a hex string. I've reported the issue but figured I'd search for any instances of _hex_str and let you know.

@sinky
Copy link
Author

sinky commented Feb 25, 2024

@rsporsche
oh wow thank you acme.sh for hiding
I‘ve changed the password, although the Nas is not reachable from outside.
Big thanks 🙏 to @rsporsche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants