From f91647ba5094cb013f25869796a5e202c6ecfc13 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Wed, 8 Apr 2020 13:15:22 +0200 Subject: [PATCH] More Minio things --- expephalon/custom_settings.dist.py | 2 ++ expephalon/settings.py | 5 +++-- iam.json | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 iam.json diff --git a/expephalon/custom_settings.dist.py b/expephalon/custom_settings.dist.py index 537800e..8161f86 100644 --- a/expephalon/custom_settings.dist.py +++ b/expephalon/custom_settings.dist.py @@ -18,6 +18,8 @@ DB_NAME = "expephalon" AWS_ACCESS_KEY_ID = None AWS_SECRET_ACCESS_KEY = None +AWS_STORAGE_BUCKET_NAME = None +AWS_S3_ENDPOINT_URL = None # Whether debug messages should be output - set to False in production (exposes sensitive data) diff --git a/expephalon/settings.py b/expephalon/settings.py index 7afb374..b0253e1 100644 --- a/expephalon/settings.py +++ b/expephalon/settings.py @@ -117,7 +117,7 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] -#STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' +STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' # Password hasher # https://docs.djangoproject.com/en/3.0/topics/auth/passwords/#how-django-stores-passwords @@ -131,4 +131,5 @@ PASSWORD_HASHERS = [ # Media -#DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' \ No newline at end of file +DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage' +AWS_DEFAULT_ACL = None \ No newline at end of file diff --git a/iam.json b/iam.json new file mode 100644 index 0000000..e76f5bc --- /dev/null +++ b/iam.json @@ -0,0 +1,21 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "VisualEditor0", + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObjectAcl", + "s3:GetObject", + "s3:ListBucket", + "s3:DeleteObject", + "s3:PutObjectAcl" + ], + "Resource": [ + "arn:aws:s3:::example-bucket-name/*", + "arn:aws:s3:::example-bucket-name" + ] + } + ] +} \ No newline at end of file