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
33f07fcc
Commit
33f07fcc
authored
Mar 30, 2016
by
Lukas Schauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test and fix bug with upper-case domains (fixes #176)
parent
1f6a80a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
letsencrypt.sh
letsencrypt.sh
+1
-1
test.sh
test.sh
+5
-2
No files found.
letsencrypt.sh
View file @
33f07fcc
...
...
@@ -572,7 +572,7 @@ command_sign_domains() {
# Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire
ORIGIFS
=
"
${
IFS
}
"
IFS
=
$'
\n
'
for
line
in
$(
<
"
${
DOMAINS_TXT
}
"
tr
-d
'\r'
| _sed
-e
's/^[[:space:]]*//g'
-e
's/[[:space:]]*$//g'
-e
's/[[:space:]]+/ /g'
|
(
grep
-vE
'^(#|$)'
||
true
)
)
;
do
for
line
in
$(
<
"
${
DOMAINS_TXT
}
"
tr
-d
'\r'
|
tr
'[:upper:]'
'[:lower:]'
|
_sed
-e
's/^[[:space:]]*//g'
-e
's/[[:space:]]*$//g'
-e
's/[[:space:]]+/ /g'
|
(
grep
-vE
'^(#|$)'
||
true
)
)
;
do
IFS
=
"
${
ORIGIFS
}
"
domain
=
"
$(
printf
'%s\n'
"
${
line
}
"
|
cut
-d
' '
-f1
)
"
morenames
=
"
$(
printf
'%s\n'
"
${
line
}
"
|
cut
-s
-d
' '
-f2-
)
"
...
...
test.sh
View file @
33f07fcc
...
...
@@ -148,9 +148,12 @@ _CHECK_LOG "Creating fullchain.pem"
_CHECK_LOG
"Done!"
_CHECK_ERRORLOG
# Add domain to domains.txt and run in cron mode again (should find a non-expiring certificate and do nothing)
# Prepare domains.txt
# Modify TMP3_URL to be uppercase to check for upper-lower-case mismatch bugs
echo
"
${
TMP_URL
}
${
TMP2_URL
}
$(
tr
'a-z'
'A-Z'
<<<
"
${
TMP3_URL
}
"
)
"
>>
domains.txt
# Run in cron mode again (should find a non-expiring certificate and do nothing)
_TEST
"Run in cron mode again, this time with domain in domains.txt, should find non-expiring certificate"
echo
"
${
TMP_URL
}
${
TMP2_URL
}
${
TMP3_URL
}
"
>>
domains.txt
./letsencrypt.sh
--cron
>
tmplog 2> errorlog
||
_FAIL
"Script execution failed"
_CHECK_LOG
"Checking domain name(s) of existing cert... unchanged."
_CHECK_LOG
"Skipping renew"
...
...
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