From a1465ed575d2c29c081a392f33cc22ab4973e01a Mon Sep 17 00:00:00 2001 From: Maxim Kravets Date: Fri, 29 Jul 2022 12:40:04 +0200 Subject: [PATCH 1/2] Make AWS credentials optional to support other authentication methods offered by boto3 --- backup.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/backup.py b/backup.py index 4fa5203..5c0d7b6 100644 --- a/backup.py +++ b/backup.py @@ -65,16 +65,6 @@ def check_config(self): if not "S3_BUCKET" in os.environ or not re.match(r"(?=^.{3,63}$)(?!^(\d+\.)+\d+$)(^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$)", os.environ['S3_BUCKET']): print("Error: invalid S3_BUCKET") config_errors=True - - # Check AWS_ACCESS_KEY_ID - if not "AWS_ACCESS_KEY_ID" in os.environ or os.environ['AWS_ACCESS_KEY_ID'] == "": - print("Error: AWS_ACCESS_KEY_ID") - config_errors=True - - # Check AWS_SECRET_ACCESS_KEY - if not "AWS_SECRET_ACCESS_KEY" in os.environ or os.environ['AWS_SECRET_ACCESS_KEY'] == "": - print("Error: AWS_SECRET_ACCESS_KEY") - config_errors=True if not ("BACKUP_JIRA" in os.environ and (os.environ['BACKUP_JIRA'] == "true" or os.environ['BACKUP_JIRA'] == "false")): From 0c407535aa765b4b02b1eb839cb36b82e3dde3b9 Mon Sep 17 00:00:00 2001 From: Maxim Kravets Date: Fri, 29 Jul 2022 12:41:14 +0200 Subject: [PATCH 2/2] Mention additional authentication methods in the documentation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d148071..ad53de1 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ Start by creating an API Token for your Atlassian account: https://id.atlassian. ] } ``` +Additional authentication methods such as [IAM Roles for Amazon EC2](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) are supported. You many need to set additional environment variables to configure certain methods. See [boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html) for details. + ### Docker To use the container, replace all placeholders with the actual values and run the following command: