Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/19204.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Made the local media directory optional by treating it as a storage provider. This allows off-site media storage without local cache, where media is stored directly to remote providers only, with temporary files used for thumbnail generation when needed. Contributed by Patrice Brend'amour @dr.allgood.
9 changes: 9 additions & 0 deletions docs/usage/configuration/config_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,15 @@ Example configuration:
enable_media_repo: false
```
---
### `enable_local_media_storage`

*(boolean)* Enable the local on-disk media storage provider. When disabled, media is stored only in configured media_storage_providers and temporary files are used for processing. Defaults to `true`.

Example configuration:
```yaml
enable_local_media_storage: false
```
---
### `media_store_path`

*(string)* Directory where uploaded images and attachments are stored. Defaults to `"media_store"`.
Expand Down
9 changes: 9 additions & 0 deletions schema/synapse-config.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,15 @@ properties:
default: true
examples:
- false
enable_local_media_storage:
type: boolean
description: >-
Enable the local on-disk media storage provider. When disabled, media is
stored only in configured media_storage_providers and temporary files are
used for processing.
default: true
examples:
- false
media_store_path:
type: string
description: Directory where uploaded images and attachments are stored.
Expand Down
5 changes: 5 additions & 0 deletions synapse/config/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
config.get("media_store_path", "media_store")
)

# Whether to enable the local media storage provider. When disabled,
# media will only be stored in configured storage providers and temp
# files will be used for processing.
self.enable_local_media_storage = config.get("enable_local_media_storage", True)

backup_media_store_path = config.get("backup_media_store_path")

synchronous_backup_media_store = config.get(
Expand Down
Loading