From 77bb3beecc16bd3e905d832ecccc5568863b1ae7 Mon Sep 17 00:00:00 2001 From: chrystinne Date: Tue, 24 Oct 2023 00:12:39 -0400 Subject: [PATCH] Configure server access logging for an S3 bucket. It enables access logging, directing logs to the 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 | 435 +++--------------- physionet-django/project/views.py | 2 - 6 files changed, 80 insertions(+), 381 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 %}