Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 35839a0

Browse files
committed
Move the config option documentation to the config docs
1 parent fb04e7a commit 35839a0

3 files changed

Lines changed: 32 additions & 75 deletions

File tree

docs/sample_config.yaml

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,43 +1043,6 @@ media_store_path: "DATADIR/media_store"
10431043
# height: 600
10441044
# method: scale
10451045

1046-
# Configure media retention settings. Media will be purged if it
1047-
# has not been accessed in at least this amount of time. If the
1048-
# media has never been accessed, the media's creation time is used
1049-
# instead. Both thumbnails and the original media will be removed.
1050-
#
1051-
# Media is 'accessed' when loaded in a room in a client, or
1052-
# otherwise downloaded by a local or remote user.
1053-
#
1054-
# Purging the media will be the carried out by the media worker
1055-
# (whichever worker has the 'enable_media_repo' homeserver config
1056-
# option enabled). This may be the main process.
1057-
#
1058-
media_retention:
1059-
# Whether media retention settings should apply. Defaults to
1060-
# false.
1061-
#
1062-
# Uncomment to enable media retention on this homeserver.
1063-
#
1064-
#enabled: true
1065-
1066-
# How long to keep local media since its last access. Local
1067-
# media that is removed will be permanently deleted.
1068-
#
1069-
# If this option is not set, local media will not have a
1070-
# retention policy applied.
1071-
#
1072-
#local_media_lifetime: 30d
1073-
1074-
# How long to keep downloaded remote media since its last
1075-
# access. Remote media will be downloaded again from the
1076-
# originating server on demand.
1077-
#
1078-
# If this option is not set, remote media will not have a
1079-
# retention policy applied.
1080-
#
1081-
remote_media_lifetime: 7d
1082-
10831046
# Is the preview URL API enabled?
10841047
#
10851048
# 'false' by default: uncomment the following to enable it (and specify a

docs/usage/configuration/config_documentation.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ federation_rr_transactions_per_room_per_second: 40
14071407
```
14081408
---
14091409
## Media Store ##
1410-
Config options relating to Synapse media store.
1410+
Config options related to Synapse's media store.
14111411

14121412
---
14131413
Config option: `enable_media_repo`
@@ -1511,6 +1511,37 @@ thumbnail_sizes:
15111511
height: 600
15121512
method: scale
15131513
```
1514+
---
1515+
Config option: `media_retention`
1516+
1517+
Controls whether local media and entries in the remote media cache
1518+
(media that is downloaded from other homeservers) should be removed
1519+
under certain conditions, typically for the purpose of saving space.
1520+
1521+
Purging media files will be the carried out by the media worker
1522+
(that is, the worker that has the `enable_media_repo` homeserver config
1523+
option set to 'true'). This may be the main process.
1524+
1525+
The `media_retention.enabled` option globally controls whether media
1526+
retention is enabled.
1527+
1528+
The `media_retention.local_media_lifetime` and
1529+
`media_retention.remote_media_lifetime` config options control whether
1530+
media will be purged if it has not been accessed in a given amount of
1531+
time. Note that media is 'accessed' when loaded in a room in a client, or
1532+
otherwise downloaded by a local or remote user. If the media has never
1533+
been accessed, the media's creation time is used instead. Both thumbnails
1534+
and the original media will be removed. If either of these options are unset,
1535+
then media of that type will not be purged.
1536+
1537+
Example configuration:
1538+
```yaml
1539+
media_retention:
1540+
enabled: true
1541+
local_media_lifetime: 30d
1542+
remote_media_lifetime: 7d
1543+
```
1544+
---
15141545
Config option: `url_preview_enabled`
15151546

15161547
This setting determines whether the preview URL API is enabled.

synapse/config/repository.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -306,43 +306,6 @@ def generate_config_section(self, data_dir_path: str, **kwargs: Any) -> str:
306306
#thumbnail_sizes:
307307
%(formatted_thumbnail_sizes)s
308308
309-
# Configure media retention settings. Media will be purged if it
310-
# has not been accessed in at least this amount of time. If the
311-
# media has never been accessed, the media's creation time is used
312-
# instead. Both thumbnails and the original media will be removed.
313-
#
314-
# Media is 'accessed' when loaded in a room in a client, or
315-
# otherwise downloaded by a local or remote user.
316-
#
317-
# Purging the media will be the carried out by the media worker
318-
# (whichever worker has the 'enable_media_repo' homeserver config
319-
# option enabled). This may be the main process.
320-
#
321-
media_retention:
322-
# Whether media retention settings should apply. Defaults to
323-
# false.
324-
#
325-
# Uncomment to enable media retention on this homeserver.
326-
#
327-
#enabled: true
328-
329-
# How long to keep local media since its last access. Local
330-
# media that is removed will be permanently deleted.
331-
#
332-
# If this option is not set, local media will not have a
333-
# retention policy applied.
334-
#
335-
#local_media_lifetime: 30d
336-
337-
# How long to keep downloaded remote media since its last
338-
# access. Remote media will be downloaded again from the
339-
# originating server on demand.
340-
#
341-
# If this option is not set, remote media will not have a
342-
# retention policy applied.
343-
#
344-
remote_media_lifetime: 7d
345-
346309
# Is the preview URL API enabled?
347310
#
348311
# 'false' by default: uncomment the following to enable it (and specify a

0 commit comments

Comments
 (0)