Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
1e34ccbe
Unverified
Commit
1e34ccbe
authored
Mar 14, 2020
by
neil
Committed by
GitHub
Mar 14, 2020
Browse files
Merge pull request #2782 from lippertmarkus/feature-deployhook-synology-otp
Add OTP support to Synology DSM deployhook
parents
3d816411
fd64c208
Changes
1
Show whitespace changes
Inline
Side-by-side
deploy/synology_dsm.sh
View file @
1e34ccbe
...
...
@@ -15,6 +15,7 @@
# SYNO_Scheme - defaults to http
# SYNO_Hostname - defaults to localhost
# SYNO_Port - defaults to 5000
# SYNO_DID - device ID to skip OTP - defaults to empty
#
#returns 0 means success, otherwise error.
...
...
@@ -38,6 +39,7 @@ synology_dsm_deploy() {
_getdeployconf SYNO_Username
_getdeployconf SYNO_Password
_getdeployconf SYNO_Create
_getdeployconf SYNO_DID
if
[
-z
"
$SYNO_Username
"
]
||
[
-z
"
$SYNO_Password
"
]
;
then
SYNO_Username
=
""
SYNO_Password
=
""
...
...
@@ -79,7 +81,7 @@ synology_dsm_deploy() {
# Login, get the token from JSON and session id from cookie
_info
"Logging into
$SYNO_Hostname
:
$SYNO_Port
"
response
=
$(
_get
"
$_base_url
/webman/login.cgi?username=
$SYNO_Username
&passwd=
$SYNO_Password
&enable_syno_token=yes"
)
response
=
$(
_get
"
$_base_url
/webman/login.cgi?username=
$SYNO_Username
&passwd=
$SYNO_Password
&enable_syno_token=yes
&device_id=
$SYNO_DID
"
)
token
=
$(
echo
"
$response
"
|
grep
"SynoToken"
|
sed
-n
's/.*"SynoToken" *: *"\([^"]*\).*/\1/p'
)
_debug3 response
"
$response
"
...
...
@@ -99,6 +101,7 @@ synology_dsm_deploy() {
# Now that we know the username and password are good, save them
_savedeployconf SYNO_Username
"
$SYNO_Username
"
_savedeployconf SYNO_Password
"
$SYNO_Password
"
_savedeployconf SYNO_DID
"
$SYNO_DID
"
_debug token
"
$token
"
_info
"Getting certificates in Synology DSM"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment