Skip to content

Commit d1b719a

Browse files
committed
feat: use azure SAS-token with custom azure storage class
Refs: KK-1509
1 parent e8806c4 commit d1b719a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

kukkuu/settings.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
ILMOITIN_QUEUE_NOTIFICATIONS=(bool, True),
7575
STORAGES_DEFAULT_BACKEND=(str, "django.core.files.storage.FileSystemStorage"),
7676
AZURE_ACCOUNT_NAME=(str, ""),
77-
AZURE_ACCOUNT_KEY=(str, ""),
77+
AZURE_BLOB_STORAGE_SAS_TOKEN=(str, ""),
7878
AZURE_CONTAINER=(str, ""),
7979
AZURE_URL_EXPIRATION_SECS=(str, None),
8080
ENABLE_GRAPHIQL=(bool, False),
@@ -252,15 +252,13 @@ def sentry_before_send(event: Event, hint: Hint):
252252
MEDIA_URL = env("MEDIA_URL")
253253
STATIC_URL = env("STATIC_URL")
254254

255-
# For staging env, we use Google Cloud Storage
256255
STORAGES_DEFAULT_BACKEND = env("STORAGES_DEFAULT_BACKEND")
257256

258-
# For prod, it's Azure Storage
259-
if STORAGES_DEFAULT_BACKEND == "storages.backends.azure_storage.AzureStorage":
257+
if STORAGES_DEFAULT_BACKEND == "utils.storage.AzureStorageWithoutQuerystringAuth":
258+
AZURE_SAS_TOKEN = env("AZURE_BLOB_STORAGE_SAS_TOKEN")
260259
AZURE_ACCOUNT_NAME = env("AZURE_ACCOUNT_NAME")
261260
AZURE_CONTAINER = env("AZURE_CONTAINER")
262261
AZURE_URL_EXPIRATION_SECS = env("AZURE_URL_EXPIRATION_SECS")
263-
AZURE_ACCOUNT_KEY = env("AZURE_ACCOUNT_KEY")
264262

265263
STORAGES = {
266264
"default": {

0 commit comments

Comments
 (0)