Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

17 rindas
529 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. jinja_template = Template(open("/app/lesspass.conf.j2").read())
  12. with open("/etc/httpd/conf.d/lesspass.conf", "w") as f:
  13. f.write(jinja_template.render(context))