Created
May 4, 2020 14:14
-
-
Save vittorio-nardone/97bb7ed679770ab4a9dd3e3101a845c8 to your computer and use it in GitHub Desktop.
Write token file and upload it to correct S3 bucket
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_auth(): | |
''' Write token file and upload it to correct S3 bucket and folder | |
S3 Bucket name and cert domain must be the same! | |
''' | |
f = open("/tmp/verification.txt", "w") | |
f.write(os.environ['CERTBOT_VALIDATION']) | |
f.close() | |
s3object = ".well-known/acme-challenge/" + os.environ['CERTBOT_TOKEN'] | |
upload_file("/tmp/verification.txt", os.environ['CERTBOT_DOMAIN'], s3object) | |
os.remove("/tmp/verification.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment