Skip to content
Snippets Groups Projects
Verified Commit 99bfc3ca authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

settings.production: Allow extra azure configuration

Currently, the writing in the azure objstorage adds extra headers to the blobs. Which
prevents the correct reading of those blobs when checking the tarballs.

According to the documentation, this option opening should allow to configure more
appropriately.

Refs. swh/infra/sysadm-environment#5129
parent 3417639a
No related branches found
No related tags found
No related merge requests found
......@@ -123,15 +123,27 @@ if cfg_azure:
f"Production: invalid configuration; missing {key} config entry."
)
# Default options
options = dict(
azure_container=cfg_azure["container_name"],
connection_string=cfg_azure["connection_string"],
)
# Which may be enhanced with some extra options, lookup "object_parameters" in
# https://django-storages.readthedocs.io/en/latest/backends/azure.html
object_parameters = {}
for optional_config_key in ["content_type", "content_disposition"]:
if optional_config_key in cfg_azure:
object_parameters[optional_config_key] = cfg_azure[optional_config_key]
options.update(dict(object_parameters=object_parameters))
STORAGES = {
"staticfiles": {
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage"
},
"default": {
"BACKEND": "storages.backends.azure_storage.AzureStorage",
"OPTIONS": {
"azure_container": cfg_azure["container_name"],
"connection_string": cfg_azure["connection_string"],
},
"OPTIONS": options,
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment