You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
555 B

  1. import os
  2. from jinja2 import Template
  3. if __name__ == "__main__":
  4. fqdn = os.environ.get("FQDN", "localhost")
  5. context = {
  6. "FQDN": fqdn,
  7. "SSL_CERTIFICATE_FILE": "/etc/httpd/ssl/%s.crt" % fqdn,
  8. "SSL_CERTIFICATE_KEY_FILE": "/etc/httpd/ssl/private/%s.key" % fqdn,
  9. "DEBUG": os.environ.get("DEBUG", "0") == "1",
  10. }
  11. print(context)
  12. jinja_template = Template(open("/webserver/lesspass.conf.j2").read())
  13. with open("/etc/httpd/conf.d/lesspass.conf", "w") as f:
  14. f.write(jinja_template.render(context))