Update server.py

This commit is contained in:
Nova Cat 2025-01-14 20:40:07 -08:00
parent 933ef74c70
commit 6e34c499ed

View file

@ -38,8 +38,8 @@ def loadcert_backend():
return "Please upload a certificate and private key."
if allowed_file(cert.filename) and allowed_file(privkey.filename):
random_name = ''.join(random.choice(string.ascii_lowercase+string.digits+string.ascii_uppercase) for i in range(8))
cert.save(homefolder + "/certs/" + randomname + "-chain.pem")
privkey.save(homefolder + "/certs/" + randomname + "-privkey.pem")
cert.save(homefolder + "/certs/" + random_name + "-chain.pem")
privkey.save(homefolder + "/certs/" + random_name + "-privkey.pem")
resp = make_response("<meta http-equiv=\"refresh\" content=\"0; url=//\" />Success!")
resp.set_cookie('certname',random_name)
return resp