25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
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))