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
e4d90941
Commit
e4d90941
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Preparations for let's encrypt
parent
c40de1dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-renew-cert
+14
-2
14 additions, 2 deletions
src/freedombone-renew-cert
src/freedombone-sec
+71
-3
71 additions, 3 deletions
src/freedombone-sec
with
85 additions
and
5 deletions
src/freedombone-renew-cert
+
14
−
2
View file @
e4d90941
...
...
@@ -39,11 +39,19 @@ function show_help {
echo
''
echo
' --help Show help'
echo
' -h --hostname [name] Hostname'
echo
' -p --provider [name] eg. startssl'
echo
' -p --provider [name] eg. startssl
/letsencrypt
'
echo
''
exit
0
}
function
renew_startssl
{
echo
"Renewing Let's Encrypt certificate"
letsencrypt renew
--cert-path
/etc/ssl/certs/
$HOSTNAME
.pem
if
[
!
"
$?
"
=
"0"
]
;
then
echo
"Unable to renew Let's encrypt certificate"
fi
}
function
renew_startssl
{
echo
'Renewing StartSSL certificate'
if
[
-s
/etc/ssl/certs/
$HOSTNAME
.new.crt
]
;
then
...
...
@@ -184,7 +192,11 @@ fi
if
[[
$PROVIDER
==
'startssl'
||
$PROVIDER
==
'StartSSL'
]]
;
then
renew_startssl
else
echo
"
$PROVIDER
is not currently supported"
if
[[
$PROVIDER
==
'letsencrypt'
]]
;
then
renew_letsencrypt
else
echo
"
$PROVIDER
is not currently supported"
fi
fi
exit
0
This diff is collapsed.
Click to expand it.
src/freedombone-sec
+
71
−
3
View file @
e4d90941
...
...
@@ -376,6 +376,7 @@ function regenerate_dh_keys {
}
function
renew_startssl
{
renew_domain
=
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--title
"Renew a StartSSL certificate"
\
...
...
@@ -385,11 +386,74 @@ function renew_startssl {
case
$sel
in
0
)
renew_domain
=
$(
<
$data
)
if
[[
$renew_domain
==
*
"."
*
]]
;
then
freedombone-renew-cert
-h
$renew_domain
-p
startssl
fi
;;
esac
if
[
!
$renew_domain
]
;
then
return
fi
if
[[
$renew_domain
==
"http"
*
]]
;
then
dialog
--title
"Renew a StartSSL certificate"
\
--msgbox
"Don't include the https://"
6 40
return
fi
if
[
!
-f
/etc/ssl/certs/
${
renew_domain
}
.dhparam
]
;
then
dialog
--title
"Renew a StartSSL certificate"
\
--msgbox
"An existing certificate for
$renew_domain
was not found"
6 40
return
fi
if
[[
$renew_domain
!=
*
"."
*
]]
;
then
dialog
--title
"Renew a StartSSL certificate"
\
--msgbox
"Invalid domain name:
$renew_domain
"
6 40
return
fi
freedombone-renew-cert
-h
$renew_domain
-p
startssl
exit
0
}
function
renew_letsencrypt
{
renew_domain
=
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
dialog
--title
"Renew a Let's Encrypt certificate"
\
--backtitle
"Freedombone Security Settings"
\
--inputbox
"Enter the domain name"
8 60 2>
$data
sel
=
$?
case
$sel
in
0
)
renew_domain
=
$(
<
$data
)
;;
esac
if
[
!
$renew_domain
]
;
then
return
fi
if
[[
$renew_domain
==
"http"
*
]]
;
then
dialog
--title
"Renew a Let's Encrypt certificate"
\
--msgbox
"Don't include the https://"
6 40
return
fi
if
[
!
-f
/etc/ssl/certs/
${
renew_domain
}
.dhparam
]
;
then
dialog
--title
"Renew a Let's Encrypt certificate"
\
--msgbox
"An existing certificate for
$renew_domain
was not found"
6 40
return
fi
if
[[
$renew_domain
!=
*
"."
*
]]
;
then
dialog
--title
"Renew a Let's Encrypt certificate"
\
--msgbox
"Invalid domain name:
$renew_domain
"
6 40
return
fi
freedombone-renew-cert
-h
$renew_domain
-p
letsencrypt
exit
0
}
...
...
@@ -401,6 +465,7 @@ function housekeeping {
options
=(
1
"Regenerate ssh host keys"
off
2
"Regenerate Diffie-Hellman keys"
off
3
"Renew a StartSSL certificate"
off
)
4
"Renew Let's Encrypt certificate"
off
)
choices
=
$(
"
${
cmd
[@]
}
"
"
${
options
[@]
}
"
2>&1
>
/dev/tty
)
clear
for
choice
in
$choices
...
...
@@ -415,6 +480,9 @@ function housekeeping {
3
)
renew_startssl
;;
4
)
renew_letsencrypt
;;
esac
done
}
...
...
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