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.
 
 
 
 
 
 

18 rindas
552 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("/opt/app/lesspass.conf.j2").read())
  13. with open("/etc/httpd/conf.d/lesspass.conf", "w") as f:
  14. f.write(jinja_template.render(context))