Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
0b8fc22d
Commit
0b8fc22d
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Convert between pem and crt if letsencrypt fails
parent
1d5edecc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-utils-web
+24
-17
24 additions, 17 deletions
src/freedombone-utils-web
with
24 additions
and
17 deletions
src/freedombone-utils-web
+
24
−
17
View file @
0b8fc22d
...
...
@@ -156,26 +156,33 @@ function check_certificates {
USE_LETSENCRYPT
=
$2
fi
if
[[
$USE_LETSENCRYPT
==
'no'
]]
;
then
if
[
!
-f
/etc/ssl/private/
$
1
.key
]
;
then
echo
$"Private certificate for
$CHECK_HOSTNAME
was not created"
if
[
!
-f
/etc/ssl/private/
$
{
1
}
.key
]
;
then
echo
$"Private certificate for
$
{
CHECK_HOSTNAME
}
was not created"
exit
63959
fi
if
[
!
-f
/etc/ssl/certs/
$
1
.crt
]
;
then
echo
$"Public certificate for
$CHECK_HOSTNAME
was not created"
if
[
!
-f
/etc/ssl/certs/
$
{
1
}
.crt
]
;
then
echo
$"Public certificate for
$
{
CHECK_HOSTNAME
}
was not created"
exit
7679
fi
if
grep
-q
"
${
1
}
.pem"
/etc/nginx/sites-available/
${
1
}
;
then
sed
-i
"s|
${
1
}
.pem|
${
1
}
.crt|g"
/etc/nginx/sites-available/
${
1
}
fi
else
if
[
!
-f
/etc/letsencrypt/live/
${
1
}
/privkey.pem
]
;
then
echo
$"Private certificate for
$CHECK_HOSTNAME
was not created"
echo
$"Private certificate for
$
{
CHECK_HOSTNAME
}
was not created"
exit
6282
fi
if
[
!
-f
/etc/letsencrypt/live/
${
1
}
/fullchain.pem
]
;
then
echo
$"Public certificate for
$CHECK_HOSTNAME
was not created"
echo
$"Public certificate for
$
{
CHECK_HOSTNAME
}
was not created"
exit
5328
fi
if
grep
-q
"
${
1
}
.crt"
/etc/nginx/sites-available/
${
1
}
;
then
sed
-i
"s|
${
1
}
.crt|
${
1
}
.pem|g"
/etc/nginx/sites-available/
${
1
}
fi
fi
if
[
!
-f
/etc/ssl/certs/
$
1
.dhparam
]
;
then
echo
$"Diffie–Hellman parameters for
$CHECK_HOSTNAME
were not created"
if
[
!
-f
/etc/ssl/certs/
$
{
1
}
.dhparam
]
;
then
echo
$"Diffie–Hellman parameters for
$
{
CHECK_HOSTNAME
}
were not created"
exit
5989
fi
}
...
...
@@ -190,26 +197,26 @@ function create_site_certificate {
fi
if
[[
$ONION_ONLY
==
"no"
]]
;
then
if
[
!
-f
/etc/ssl/certs/
$SITE_DOMAIN_NAME
.dhparam
]
;
then
if
[
!
-f
/etc/ssl/certs/
$
{
SITE_DOMAIN_NAME
}
.dhparam
]
;
then
if
[[
$LETSENCRYPT_ENABLED
!=
"yes"
]]
;
then
${
PROJECT_NAME
}
-addcert
-h
$SITE_DOMAIN_NAME
--dhkey
$DH_KEYLENGTH
${
PROJECT_NAME
}
-addcert
-h
$
{
SITE_DOMAIN_NAME
}
--dhkey
$
{
DH_KEYLENGTH
}
function_check check_certificates
check_certificates
$SITE_DOMAIN_NAME
check_certificates
$
{
SITE_DOMAIN_NAME
}
else
${
PROJECT_NAME
}
-addcert
-e
$SITE_DOMAIN_NAME
-s
$LETSENCRYPT_SERVER
--dhkey
$DH_KEYLENGTH
--email
$MY_EMAIL_ADDRESS
${
PROJECT_NAME
}
-addcert
-e
$
{
SITE_DOMAIN_NAME
}
-s
$
{
LETSENCRYPT_SERVER
}
--dhkey
$
{
DH_KEYLENGTH
}
--email
$
{
MY_EMAIL_ADDRESS
}
if
[
!
"
$?
"
=
"0"
]
;
then
if
[[
$NO_SELF_SIGNED
==
'no'
]]
;
then
echo
$"Lets Encrypt failed for
$SITE_DOMAIN_NAME
, so try making a self-signed cert"
${
PROJECT_NAME
}
-addcert
-h
$SITE_DOMAIN_NAME
--dhkey
$DH_KEYLENGTH
if
[[
$
{
NO_SELF_SIGNED
}
==
'no'
]]
;
then
echo
$"Lets Encrypt failed for
$
{
SITE_DOMAIN_NAME
}
, so try making a self-signed cert"
${
PROJECT_NAME
}
-addcert
-h
$
{
SITE_DOMAIN_NAME
}
--dhkey
$
{
DH_KEYLENGTH
}
function_check check_certificates
check_certificates
$SITE_DOMAIN_NAME
check_certificates
$
{
SITE_DOMAIN_NAME
}
else
echo
$"Lets Encrypt failed for
$SITE_DOMAIN_NAME
"
exit
682529
fi
else
function_check check_certificates
check_certificates
$SITE_DOMAIN_NAME
'yes'
check_certificates
$
{
SITE_DOMAIN_NAME
}
'yes'
fi
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment