Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
mediaserver
envsetup
Commits
d020dcf1
Commit
d020dcf1
authored
6 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed file for SSL certificate (refs
#27515
).
parent
ed064b84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
2.Common_services/5.Nginx/0_setup.py
+8
-1
8 additions, 1 deletion
2.Common_services/5.Nginx/0_setup.py
2.Common_services/7.LetsEncrypt/0_setup.py
+9
-2
9 additions, 2 deletions
2.Common_services/7.LetsEncrypt/0_setup.py
with
17 additions
and
3 deletions
2.Common_services/5.Nginx/0_setup.py
+
8
−
1
View file @
d020dcf1
...
...
@@ -103,8 +103,15 @@ def setup(interactive=True):
utils
.
log
(
'
/etc/hosts updated.
'
)
else
:
utils
.
log
(
'
/etc/hosts is already up to date.
'
)
#
Update certificate in
ssl.conf
#
Move
ssl.conf
ssl_conf
=
'
/etc/nginx/conf.d/ssl.conf
'
if
os
.
path
.
exists
(
ssl_conf
):
utils
.
run_commands
([
'
grep ssl_certificate /etc/nginx/conf.d/ssl.conf > /etc/nginx/conf.d/ssl_certificate.conf
'
,
'
mv /etc/nginx/conf.d/ssl.conf /etc/nginx/conf.d/ssl.conf.old
'
,
])
# Update certificate in ssl_certificate.conf
ssl_conf
=
'
/etc/nginx/conf.d/ssl_certificate.conf
'
if
not
os
.
path
.
exists
(
ssl_conf
):
utils
.
log
(
'
The SSL configuration file
"
%s
"
does not exist, SSL certificate not updated.
'
%
ssl_conf
)
else
:
...
...
This diff is collapsed.
Click to expand it.
2.Common_services/7.LetsEncrypt/0_setup.py
+
9
−
2
View file @
d020dcf1
...
...
@@ -7,8 +7,15 @@ import utils
def
setup
(
interactive
=
True
):
#
Check if a custom SSL certificate is used
#
Move ssl.conf
ssl_conf
=
'
/etc/nginx/conf.d/ssl.conf
'
if
os
.
path
.
exists
(
ssl_conf
):
utils
.
run_commands
([
'
grep ssl_certificate /etc/nginx/conf.d/ssl.conf > /etc/nginx/conf.d/ssl_certificate.conf
'
,
'
mv /etc/nginx/conf.d/ssl.conf /etc/nginx/conf.d/ssl.conf.old
'
,
])
# Check if a custom SSL certificate is used
ssl_conf
=
'
/etc/nginx/conf.d/ssl_certificate.conf
'
if
not
os
.
path
.
exists
(
ssl_conf
):
utils
.
log
(
'
The SSL configuration file
"
%s
"
does not exist, letsencrypt will not be used.
'
%
ssl_conf
)
return
...
...
@@ -52,7 +59,7 @@ def setup(interactive=True):
'
certbot certonly --agree-tos --no-eff-email --rsa-key-size 4096 --webroot --webroot-path /tmp/letsencrypt --domains
"
%s
"
--email sysadmin@ubicast.eu
'
%
(
'
,
'
.
join
(
domains
)),
]
utils
.
run_commands
(
cmds
)
# Update Nginx configuration in ssl.conf
# Update Nginx configuration in ssl
_certificate
.conf
ssl_cert
=
'
/etc/letsencrypt/live/%s/fullchain.pem
'
%
domains
[
0
]
ssl_key
=
'
/etc/letsencrypt/live/%s/privkey.pem
'
%
domains
[
0
]
if
not
os
.
path
.
exists
(
ssl_cert
):
...
...
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