Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2e78aa8
Implement synapse issue #16751: Treat local_media_directory as option…
drallgood Nov 19, 2025
7cc0aeb
Implement synapse issue #16751: Treat local_media_directory as option…
drallgood Nov 19, 2025
8eed314
Revert lint.sh formatting changes
drallgood Nov 19, 2025
b6ffef6
Fix mypy error for local_media_directory type annotation
drallgood Nov 20, 2025
ccc047d
Merge branch 'develop' into implement-issue-16751-local-media-provider
drallgood Nov 27, 2025
5d272af
Refactor MediaStorage to accept local_provider as optional argument
drallgood Dec 3, 2025
646a051
Convert ensure_media_is_in_local_cache to async context manager
drallgood Dec 3, 2025
94c4358
Document enable_local_media_storage config option
drallgood Dec 3, 2025
f63c91a
Merge branch 'develop' into implement-issue-16751-local-media-provider
drallgood Dec 3, 2025
99eb251
Fix lint formatting in media_repository
drallgood Dec 4, 2025
af958d3
Merge branch 'develop' into implement-issue-16751-local-media-provider
drallgood Dec 7, 2025
316e514
Fix race condition in concurrent remote media downloads
drallgood Jan 2, 2026
c957ae9
Merge branch 'develop' into implement-issue-16751-local-media-provider
drallgood Jan 2, 2026
635c4cc
Update tests/replication/test_multi_media_repo.py
drallgood Jan 5, 2026
8992d11
Apply suggestions from code review
drallgood Jan 5, 2026
84bb64f
Add documentation warning for enable_local_media_storage configuration
drallgood Jan 5, 2026
fedda30
Merge branch 'develop' into implement-issue-16751-local-media-provider
drallgood Jan 5, 2026
96b6703
Add warning log when no media storage backends are configured
drallgood Jan 5, 2026
9459809
Regenerate config documentation
anoadragon453 Jan 6, 2026
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