Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new upload provider for Azure Blob Storage #2266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BlackSud0
Copy link

@BlackSud0 BlackSud0 commented Feb 27, 2023

Related issue
#2265

Description

Azure Blob is the Microsoft equivalent to Amazon’s S3-based object storage services. Within that, a “blob” is like a bucket as the framework for retention of objects. You can upload, download, list, move and carry out other commands in Azure Blobs using Azure Storage client library which is available for multiple languages that include .Net, Java, Node.js, Python, PHP and Ruby.

Blob storage offers three types of resources:

  • The storage account
  • A container in the storage account
  • A blob in the container

The following diagram shows the relationship between these resources:

image

Configuration options

AZURE_STORAGE_ACCOUNT_NAME : The storage account name to authenticate to the Azure container.
AZURE_STORAGE_ACCESS_KEY : The account key, also called shared key or access key.
AZURE_STORAGE_CONTAINER : The name of the container that the blob is in, blob container is like an S3 bucket.
AZURE_STORAGE_ENDPOINT : The URL to the blob storage account.

Does this introduce a breaking change?

[ ] Yes
[x] No

Tests

  • Each of the features listed below passed all tests without any errors.
  • Upload files.
  • Download files.
  • Delete files.
  • Store files (CTF import).
  • Sync the blob storage with local storage (CTF export).

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Merging #2266 (5bc4e62) into master (68da009) will decrease coverage by 0.44%.
The diff coverage is 24.59%.

❗ Current head 5bc4e62 differs from pull request most recent head 0851965. Consider uploading reports for the commit 0851965 to get more accurate results

@@            Coverage Diff             @@
##           master    #2266      +/-   ##
==========================================
- Coverage   87.61%   87.18%   -0.44%     
==========================================
  Files         145      145              
  Lines        8851     8908      +57     
==========================================
+ Hits         7755     7766      +11     
- Misses       1096     1142      +46     
Impacted Files Coverage Δ
CTFd/config.py 76.22% <20.00%> (-2.04%) ⬇️
CTFd/utils/uploads/uploaders.py 65.82% <22.22%> (-22.86%) ⬇️
CTFd/utils/uploads/__init__.py 88.88% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ColdHeat ColdHeat added this to the 3.6 milestone Jun 30, 2023
@ColdHeat
Copy link
Member

ColdHeat commented Jul 3, 2023

I thought for a bit about this PR and I won't be accepting it into the main codebase at this time. In the future if I see a need for this PR I will merge it in.

The rationale is that s3 has cemented itself as the defacto cloud provider object storage interface. Azure should accept this reality and add a compatibility layer for Azure Blob Storage. Every other object storage provider has an S3-like API so why should we special case Azure.

In addition, there are online solutions for adding S3 compatibility via applications like https://github.com/gaul/s3proxy.

In the meantime, this functionality could be added as a CTFd plugin if you wish.

@ColdHeat ColdHeat removed this from the 3.6 milestone Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants