mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-14 10:53:30 +02:00
Use relative path for certificates, fixes #35
This commit is contained in:
parent
0cf1d82dde
commit
e6c18e6ac3
@ -28,15 +28,17 @@ def certbot_install(domain):
|
|||||||
path = app.config["CERTS_PATH"]
|
path = app.config["CERTS_PATH"]
|
||||||
cert = os.path.join(path, "cert.pem")
|
cert = os.path.join(path, "cert.pem")
|
||||||
key = os.path.join(path, "key.pem")
|
key = os.path.join(path, "key.pem")
|
||||||
live_cert = os.path.join(path, "live", domain, "fullchain.pem")
|
live_cert = os.path.join("live", domain, "fullchain.pem")
|
||||||
live_key = os.path.join(path, "live", domain, "privkey.pem")
|
live_key = os.path.join("live", domain, "privkey.pem")
|
||||||
if not os.path.islink(cert) or os.readlink(cert) != live_cert:
|
if not os.path.islink(cert) or os.readlink(cert) != live_cert:
|
||||||
must_reload = True
|
must_reload = True
|
||||||
os.unlink(cert)
|
if os.path.exists(cert):
|
||||||
|
os.unlink(cert)
|
||||||
os.symlink(live_cert, cert)
|
os.symlink(live_cert, cert)
|
||||||
if not os.path.islink(key) or os.readlink(key) != live_key:
|
if not os.path.islink(key) or os.readlink(key) != live_key:
|
||||||
must_reload = True
|
must_reload = True
|
||||||
os.unlink(key)
|
if os.path.exists(key):
|
||||||
|
os.unlink(key)
|
||||||
os.symlink(live_key, key)
|
os.symlink(live_key, key)
|
||||||
return must_reload
|
return must_reload
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user