Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dehydrated-zope-hook
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dehydrated-zope-hook
Commits
3fd7d17a
Commit
3fd7d17a
authored
Feb 15, 2019
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Script (Python) to support token starts with "_" character.
parent
d4454764
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
README.md
README.md
+2
-2
zope-hook.sh
zope-hook.sh
+6
-10
No files found.
README.md
View file @
3fd7d17a
This is a hook script of
[
dehydrated
](
https://github.com/lukas2511/dehydrated
)
(
former
name was letsencrypt.sh) for Zope backends.
First, you need to prepare the target Zope folder beforehand so that URL like http://example.com/.well-known/
acme-challenge/
xxx works.
For example, you can create the target folder in "portal_skins/custom/.well-known
/acme-challenge
".
First, you need to prepare the target Zope folder beforehand so that URL like http://example.com/.well-known/xxx works.
For example, you can create the target folder in "portal_skins/custom/.well-known".
Next, you need to provide Zope's username and password in ~/.netrc like :
...
...
zope-hook.sh
View file @
3fd7d17a
...
...
@@ -11,17 +11,13 @@ case "${operation}" in
domain
=
"
${
1
}
"
;
shift
token_id
=
"
${
1
}
"
;
shift
token
=
"
${
1
}
"
;
shift
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
acme-challenge/manage_addFile?id=
${
token_id
}
"
)
"
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
manage_delObjects?ids:list=acme-challenge
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/acme-challenge/manage_addFile?id=
${
token_id
}
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
echo
'Failed'
exit
1
fi
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/manage_delObjects?ids:list=acme-challenge"
)
"
fi
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
acme-challenge/
${
token_id
}
/manage_edit?title=&content_type=text/plain&filedata=
${
token
}
"
)
"
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
manage_addProduct/PythonScripts/manage_addPythonScript?id=acme-challenge&file=return%20%27
${
token
}
%27
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/
acme-challenge/
${
token_id
}
/manage_edit?title=&content_type=text/plain&filedata=
${
token
}
"
)
"
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/
manage_addProduct/PythonScripts/manage_addPythonScript?id=acme-challenge&file=return%20%27
${
token
}
%27
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
echo
'Failed'
exit
1
...
...
@@ -34,9 +30,9 @@ case "${operation}" in
domain
=
"
${
1
}
"
;
shift
token_id
=
"
${
1
}
"
;
shift
token
=
"
${
1
}
"
;
shift
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
acme-challenge/manage_delObjects?ids:list=
${
token_id
}
"
)
"
statuscode
=
"
$(
curl
-s
-k
-n
-L
-o
/dev/null
-w
"%{http_code}"
"https://
${
domain
}
/.well-known/
manage_delObjects?ids:list=acme-challenge
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/
acme-challenge/manage_delObjects?ids:list=
${
token_id
}
"
)
"
statuscode
=
"
$(
curl
-s
-n
-L
-o
/dev/null
-w
"%{http_code}"
"http://
${
domain
}
/.well-known/
manage_delObjects?ids:list=acme-challenge
"
)
"
if
[[
!
"
${
statuscode
:0:1
}
"
=
"2"
]]
;
then
echo
'Failed'
exit
1
...
...
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