Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
letsencrypt.sh
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
letsencrypt.sh
Commits
81512f23
Commit
81512f23
authored
Jan 26, 2016
by
Lukas Schauer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #113 from hilbix/master
pass IO descriptors to HOOK transparently
parents
3432f60e
0c429af9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
letsencrypt.sh
letsencrypt.sh
+7
-4
No files found.
letsencrypt.sh
View file @
81512f23
...
@@ -8,6 +8,9 @@ set -u
...
@@ -8,6 +8,9 @@ set -u
set
-o
pipefail
set
-o
pipefail
umask
077
# paranoid umask, we're creating private keys
umask
077
# paranoid umask, we're creating private keys
# duplicate scripts IO handles
exec
4<&0 5>&1 6>&2
# Get the directory in which this script is stored
# Get the directory in which this script is stored
SCRIPTDIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
SCRIPTDIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
BASEDIR
=
"
${
SCRIPTDIR
}
"
BASEDIR
=
"
${
SCRIPTDIR
}
"
...
@@ -244,7 +247,7 @@ http_request() {
...
@@ -244,7 +247,7 @@ http_request() {
# Wait for hook script to clean the challenge if used
# Wait for hook script to clean the challenge if used
if
[[
-n
"
${
HOOK
}
"
]]
&&
[[
-n
"
${
challenge_token
:+set
}
"
]]
;
then
if
[[
-n
"
${
HOOK
}
"
]]
&&
[[
-n
"
${
challenge_token
:+set
}
"
]]
;
then
${
HOOK
}
"clean_challenge"
''
"
${
challenge_token
}
"
"
${
keyauth
}
"
${
HOOK
}
"clean_challenge"
''
"
${
challenge_token
}
"
"
${
keyauth
}
"
<&4
>
&5 2>&6
fi
fi
# remove temporary domains.txt file if used
# remove temporary domains.txt file if used
...
@@ -363,7 +366,7 @@ sign_csr() {
...
@@ -363,7 +366,7 @@ sign_csr() {
esac
esac
# Wait for hook script to deploy the challenge if used
# Wait for hook script to deploy the challenge if used
[[
-n
"
${
HOOK
}
"
]]
&&
${
HOOK
}
"deploy_challenge"
"
${
altname
}
"
"
${
challenge_token
}
"
"
${
keyauth_hook
}
"
[[
-n
"
${
HOOK
}
"
]]
&&
${
HOOK
}
"deploy_challenge"
"
${
altname
}
"
"
${
challenge_token
}
"
"
${
keyauth_hook
}
"
<&4
>
&5 2>&6
# Ask the acme-server to verify our challenge and wait until it is no longer pending
# Ask the acme-server to verify our challenge and wait until it is no longer pending
echo
" + Responding to challenge for
${
altname
}
..."
echo
" + Responding to challenge for
${
altname
}
..."
...
@@ -381,7 +384,7 @@ sign_csr() {
...
@@ -381,7 +384,7 @@ sign_csr() {
# Wait for hook script to clean the challenge if used
# Wait for hook script to clean the challenge if used
if
[[
-n
"
${
HOOK
}
"
]]
&&
[[
-n
"
${
challenge_token
}
"
]]
;
then
if
[[
-n
"
${
HOOK
}
"
]]
&&
[[
-n
"
${
challenge_token
}
"
]]
;
then
${
HOOK
}
"clean_challenge"
"
${
altname
}
"
"
${
challenge_token
}
"
"
${
keyauth_hook
}
"
${
HOOK
}
"clean_challenge"
"
${
altname
}
"
"
${
challenge_token
}
"
"
${
keyauth_hook
}
"
<&4
>
&5 2>&6
fi
fi
if
[[
"
${
status
}
"
=
"valid"
]]
;
then
if
[[
"
${
status
}
"
=
"valid"
]]
;
then
...
@@ -470,7 +473,7 @@ sign_domain() {
...
@@ -470,7 +473,7 @@ sign_domain() {
ln
-sf
"cert-
${
timestamp
}
.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/cert.pem"
ln
-sf
"cert-
${
timestamp
}
.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/cert.pem"
# Wait for hook script to clean the challenge and to deploy cert if used
# Wait for hook script to clean the challenge and to deploy cert if used
[[
-n
"
${
HOOK
}
"
]]
&&
${
HOOK
}
"deploy_cert"
"
${
domain
}
"
"
${
BASEDIR
}
/certs/
${
domain
}
/privkey.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/cert.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/fullchain.pem"
[[
-n
"
${
HOOK
}
"
]]
&&
${
HOOK
}
"deploy_cert"
"
${
domain
}
"
"
${
BASEDIR
}
/certs/
${
domain
}
/privkey.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/cert.pem"
"
${
BASEDIR
}
/certs/
${
domain
}
/fullchain.pem"
<&4
>
&5 2>&6
unset
challenge_token
unset
challenge_token
echo
" + Done!"
echo
" + Done!"
...
...
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