diff --git a/PKG-INFO b/PKG-INFO index d4e9eaecd34f136d9c33b7723cb378898fde9548..2282411c55d84afaa0ac425840165bc81dae41b9 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: swh.deposit -Version: 1.4.1 +Version: 1.4.2 Summary: Software Heritage Deposit Server Home-page: https://forge.softwareheritage.org/source/swh-deposit/ Author: Software Heritage developers diff --git a/swh.deposit.egg-info/PKG-INFO b/swh.deposit.egg-info/PKG-INFO index d4e9eaecd34f136d9c33b7723cb378898fde9548..2282411c55d84afaa0ac425840165bc81dae41b9 100644 --- a/swh.deposit.egg-info/PKG-INFO +++ b/swh.deposit.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: swh.deposit -Version: 1.4.1 +Version: 1.4.2 Summary: Software Heritage Deposit Server Home-page: https://forge.softwareheritage.org/source/swh-deposit/ Author: Software Heritage developers diff --git a/swh/deposit/settings/production.py b/swh/deposit/settings/production.py index 81e6b7055b3d541acc18471e8d649a233a50dffa..61b5ee6065b9f082f95076b136cb1f35a54c1387 100644 --- a/swh/deposit/settings/production.py +++ b/swh/deposit/settings/production.py @@ -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, }, }