From ad01c8f751c98a1a5ff9c89e1eb4183a5fe0779a Mon Sep 17 00:00:00 2001 From: chrystinne Date: Fri, 20 Oct 2023 18:47:52 -0400 Subject: [PATCH] Configure server access logging for an S3 bucket. It enables access logging, directing logs to the specified target bucket and prefix. Remove unnecessary methods. Raise an exception if the S3 credentials are undefined. --- .env.example | 2 + .../console/manage_published_project.html | 2 +- physionet-django/console/views.py | 17 +- physionet-django/physionet/settings/base.py | 3 + physionet-django/project/cloud/s3.py | 426 +++--------------- physionet-django/project/views.py | 2 - 6 files changed, 81 insertions(+), 371 deletions(-) diff --git a/.env.example b/.env.example index 3ebac56023..2f2a3f46b3 100644 --- a/.env.example +++ b/.env.example @@ -67,6 +67,8 @@ AWS_PROFILE= AWS_SHARED_CREDENTIALS_FILE= # The default bucket name to store projects with an 'OPEN' access policy. S3_OPEN_ACCESS_BUCKET= +# The default bucket name to store logs and metrics related to project usage. +S3_SERVER_ACCESS_LOGS= # Datacite # Used to assign the DOIs diff --git a/physionet-django/console/templates/console/manage_published_project.html b/physionet-django/console/templates/console/manage_published_project.html index 7700cdda73..fda1899ba0 100644 --- a/physionet-django/console/templates/console/manage_published_project.html +++ b/physionet-django/console/templates/console/manage_published_project.html @@ -417,7 +417,7 @@
AWS
are set.)

{% elif not project.aws.bucket_name %} -

Create a bucket on AWS to store the files associated with this project. dsjkbjak {{project.id}} {{project.aws.bucket_name}} {{project.aws.sent_files}}

+

Create a bucket on AWS to store the files associated with this project.

{% csrf_token %}