Skip to content

Commit

Permalink
fix:issue #99
Browse files Browse the repository at this point in the history
  • Loading branch information
vastsa committed Oct 24, 2023
1 parent 2b8ec05 commit 0fd31b4
Show file tree
Hide file tree
Showing 96 changed files with 25 additions and 52 deletions.
1 change: 1 addition & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
's3_secret_access_key': '',
's3_bucket_name': '',
's3_endpoint_url': '',
'aws_session_token': '',
'onedrive_domain': '',
'onedrive_client_id': '',
'onedrive_username': '',
Expand Down
3 changes: 2 additions & 1 deletion core/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def __init__(self):
self.secret_access_key = settings.s3_secret_access_key
self.bucket_name = settings.s3_bucket_name
self.endpoint_url = settings.s3_endpoint_url
self.aws_session_token = settings.aws_session_token
self.session = aioboto3.Session(aws_access_key_id=self.access_key_id, aws_secret_access_key=self.secret_access_key)

async def save_file(self, file: UploadFile, save_path: str):
async with self.session.client("s3", endpoint_url=self.endpoint_url) as s3:
async with self.session.client("s3", endpoint_url=self.endpoint_url, aws_session_token=self.aws_session_token) as s3:
await s3.put_object(Bucket=self.bucket_name, Key=save_path, Body=await file.read(), ContentType=file.content_type)

async def delete_file(self, file_code: FileCodes):
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion fcb-fronted/dist/assets/AdminView-081d8e6f.css

This file was deleted.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion fcb-fronted/dist/assets/CardTools-1689f95b.css

This file was deleted.

Loading

0 comments on commit 0fd31b4

Please sign in to comment.