Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Stan
scripts
Commits
c80739f9
Commit
c80739f9
authored
Mar 09, 2016
by
Valentin Samir
Browse files
[config/proxy] Résolution nom de domaine -> nom du certificat dans le config du proxy
parent
34bca8a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
gestion/config/proxy.py
View file @
c80739f9
...
...
@@ -24,6 +24,25 @@ max_upload = {
}
def
server_name_to_cert_name
(
serveur
):
"""
A un nom de domain, on associe le certificat correspondant.
Retourne None si le certificat n'est pas trouvé.
"""
if
serveur
.
endswith
(
".ens-cachan.fr"
)
or
serveur
==
"ens-cachan.fr"
:
return
"crans.ens-cachan.fr"
elif
serveur
.
endswith
(
".crans.org"
)
or
serveur
==
"crans.org"
:
if
serveur
[
0
]
<=
'm'
and
serveur
!=
"hostnames-n-z.crans.org"
:
return
"hostnames-a-m.crans.org"
else
:
return
"bakdaur.crans.org"
elif
serveur
.
endswith
(
".crans.fr"
)
or
serveur
==
"crans.fr"
:
if
serveur
[
0
]
<=
'm'
and
serveur
!=
"hostnames-n-z.crans.fr"
:
return
"hostnames-a-m.crans.fr"
else
:
return
"hostnames-n-z.crans.fr"
site_template
=
"""server {
server_name %(serveur)s;
include "snippets/proxy-common.conf";
...
...
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