Add NPM certificate selection and read-only VDS certificate renewal sync
All checks were successful
Test and publish Homegate / checks (push) Successful in 28s
Test and publish Homegate / publish (push) Successful in 12m47s

This commit is contained in:
2026-10-15 05:12:03 +03:00
parent b305cc1ba8
commit eeffcfb616
18 changed files with 838 additions and 49 deletions

View File

@@ -77,10 +77,13 @@ class Transport:
message = BytesParser(policy=default).parsebytes(raw)
fields = {p.get_param("name", header="content-disposition"): p.get_payload(decode=True)
for p in message.iter_parts()}
assert set(fields) == {"certificate", "certificate_key"}
x509.load_pem_x509_certificate(fields["certificate"])
assert set(fields) in ({"certificate", "certificate_key"},
{"certificate", "certificate_key", "intermediate_certificate"})
leaf = x509.load_pem_x509_certificate(fields["certificate"])
self.uploads[cert_id] = fields
self.certs[cert_id - 1]["meta"] = {"certificate": True, "certificate_key": True}
self.certs[cert_id - 1].update(meta={k: v.decode() for k, v in fields.items()},
expires_on=leaf.not_valid_after_utc.isoformat(),
domain_names=leaf.extensions.get_extension_for_class(x509.SubjectAlternativeName).value.get_values_for_type(x509.DNSName))
body = {"certificate_key": "SECRET_NOT_TO_LOG"}
else:
raise AssertionError(path)