IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
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.

25 lines
755B

  1. import json
  2. import subprocess
  3. def main():
  4. with open('/certbot/data/metadata.json', 'r') as f:
  5. data = json.load(f)
  6. ips = data['ips'][0]
  7. domains = data['domains'][0]
  8. for ds in domains:
  9. cmd = [ '/usr/local/bin/certbot', 'certonly', '--webroot',
  10. '-w', '/certbot/webroot', '--server', 'https://127.0.11.1:14000/dir',
  11. '--email', 's.adaszewski@gmail.com', '--no-verify-ssl', '-n',
  12. '--agree-tos', '--expand' ]
  13. for d in ds:
  14. cmd.append('-d')
  15. cmd.append(d)
  16. ret = subprocess.run(cmd)
  17. if ret.returncode != 0:
  18. raise RuntimeError('Failed certbot certonly for:', ' '.join(ds))
  19. if __name__ == '__main__':
  20. main()