Commit c80739f9 authored by Valentin Samir's avatar Valentin Samir

[config/proxy] Résolution nom de domaine -> nom du certificat dans le config du proxy

parent 34bca8a3
......@@ -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";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment