Skip to content

Commit

Permalink
wip: fix validation and some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Nov 20, 2024
1 parent f8fb6b0 commit 43e398e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/admin/guides/configure-pulp/configure-storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Here is an example configuration that will use a bucket called `pulp3` that is h
region `eu-central-1`:

```python
MEDIA_ROOT = ""
STORAGES = {
"default": {
"BACKEND": "storages.backends.s3.S3Storage",
Expand All @@ -88,7 +89,6 @@ STORAGES = {
},
},
}
MEDIA_ROOT = ""
```

Compreheensive options for Amazon S3 can be found in
Expand Down Expand Up @@ -125,20 +125,20 @@ pip install django-storages[azure]
#### Configure

```python
MEDIA_ROOT = ""
STORAGES = {
"default": {
"BACKEND": "storages.backends.azure_storage.AzureStorage",
"OPTIONS": {
"account_name": '<storage account name>',
"container": '<container name>', # As created within the blob service of your storage account
"azure_container": '<container name>', # As created within the blob service of your storage account
"account_key": '<Key1 or Key2>', # From the access keys of your storage account
"url_expiration_secs": 60,
"expiration_secs": 60,
"overwrite_files": 'True',
"location": '<path>' # The folder within the container where your pulp objects will be stored
},
},
}
MEDIA_ROOT = ""
```

Compreheensive options for Azure Blob can be found in
Expand Down
11 changes: 9 additions & 2 deletions docs/admin/reference/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ For a zero downtime key rotation you can follow the slightly more complex recipe
By default Pulp uses PostgreSQL on localhost. PostgreSQL is the only supported database. For
instructions on how to configure the database, refer to `database installation <database-install>`.

### DEFULT_FILE_STORAGE

!!! warning "Removed in `3.70`"
The `DEFAULT_FILE_STORAGE` setting was deprecated in
[django `4.2`](https://docs.djangoproject.com/en/4.2/ref/settings/#default-file-storage).
Use [`STORAGES`](#STORAGES) instead.

### STORAGES

!!! warning "Changed in `3.70`"
This replaces `DEFAULT_FILE_STORAGE` which [was deprecated in django `4.2`](https://docs.djangoproject.com/en/4.2/ref/settings/#default-file-storage).
!!! note "Added in `3.70`"
Replaces [`DEFAULT_DJANGO_STORAGES`](#DEFULT_FILE_STORAGE).

Pulp uses [django-storages](https://django-storages.readthedocs.io/en/latest/index.html) to support multiple storage backends.
If no backend is configured, Pulp will by default use the local filesystem (`pulpcore.app.models.storage.FileSystem`).
Expand Down
8 changes: 4 additions & 4 deletions pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@
# Validators
storage_validator = (
Validator("REDIRECT_TO_OBJECT_STORAGE", eq=False)
| Validator("STORAGES.default", eq="pulpcore.app.models.storage.FileSystem")
| Validator("STORAGES.default", eq="storages.backends.azure_storage.AzureStorage")
| Validator("STORAGES.default", eq="storages.backends.s3boto3.S3Boto3Storage")
| Validator("STORAGES.default", eq="storages.backends.gcloud.GoogleCloudStorage")
| Validator("STORAGES.default.BACKEND", eq="pulpcore.app.models.storage.FileSystem")
| Validator("STORAGES.default.BACKEND", eq="storages.backends.azure_storage.AzureStorage")
| Validator("STORAGES.default.BACKEND", eq="storages.backends.s3boto3.S3Boto3Storage")
| Validator("STORAGES.default.BACKEND", eq="storages.backends.gcloud.GoogleCloudStorage")
)
storage_validator.messages["combined"] = (
"'REDIRECT_TO_OBJECT_STORAGE=True' is only supported with the local file, S3, GCP or Azure"
Expand Down

0 comments on commit 43e398e

Please sign in to comment.