2021-02-12 15:01:35 +00:00
|
|
|
# General repo configuration
|
|
|
|
repo:
|
2023-09-09 18:39:23 +00:00
|
|
|
bindAddress: '${node.metadata.get('matrix-media-repo/listen-addr', '127.0.0.1')}'
|
|
|
|
port: ${node.metadata.get('matrix-media-repo/port', 20090)}
|
2021-02-12 15:01:35 +00:00
|
|
|
logDirectory: '-'
|
|
|
|
trustAnyForwardedAddress: false
|
|
|
|
useForwardedHost: true
|
|
|
|
|
|
|
|
federation:
|
|
|
|
backoffAt: 20
|
|
|
|
|
|
|
|
database:
|
2023-09-09 18:39:23 +00:00
|
|
|
postgres: "postgres://${node.metadata.get('matrix-media-repo/database/user')}:${node.metadata.get('matrix-media-repo/database/password')}@${node.metadata.get('matrix-media-repo/database/host', 'localhost')}/${node.metadata.get('matrix-media-repo/database/database')}?sslmode=disable"
|
2021-02-12 15:01:35 +00:00
|
|
|
|
|
|
|
pool:
|
|
|
|
maxConnections: 25
|
|
|
|
maxIdleConnections: 5
|
|
|
|
|
|
|
|
homeservers:
|
2023-09-09 18:39:23 +00:00
|
|
|
% for homeserver, config in node.metadata.get('matrix-media-repo/homeservers').items():
|
2021-02-12 15:01:35 +00:00
|
|
|
- name: ${homeserver}
|
|
|
|
csApi: "${config['domain']}"
|
|
|
|
backoffAt: ${config.get('backoff_at', 10)}
|
|
|
|
adminApiKind: "${config.get('api', 'matrix')}"
|
|
|
|
% endfor
|
|
|
|
|
|
|
|
accessTokens:
|
|
|
|
maxCacheTimeSeconds: 0
|
|
|
|
useLocalAppserviceConfig: false
|
|
|
|
|
|
|
|
admins:
|
2023-09-09 18:39:23 +00:00
|
|
|
% for user in sorted(node.metadata.get('matrix-media-repo/admins')):
|
2021-02-12 15:01:35 +00:00
|
|
|
- "${user}"
|
|
|
|
% endfor
|
|
|
|
|
|
|
|
sharedSecretAuth:
|
|
|
|
enabled: false
|
2023-09-09 18:39:23 +00:00
|
|
|
token: "${node.metadata.get('matrix-media-repo/shared-secret-token')}"
|
2021-02-12 15:01:35 +00:00
|
|
|
|
|
|
|
datastores:
|
|
|
|
- type: file
|
2023-09-09 18:39:23 +00:00
|
|
|
id: "${node.metadata.get('matrix-media-repo/datastore_id')}"
|
2021-02-12 15:01:35 +00:00
|
|
|
enabled: true
|
2023-09-09 18:39:23 +00:00
|
|
|
forKinds: ['all']
|
2021-02-12 15:01:35 +00:00
|
|
|
opts:
|
|
|
|
path: /var/matrix/media
|
|
|
|
|
|
|
|
archiving:
|
|
|
|
enabled: true
|
2023-09-09 18:39:23 +00:00
|
|
|
selfService: ${str(node.metadata.get('matrix-media-repo/archive/self-service')).lower()}
|
|
|
|
targetBytesPerPart: ${node.metadata.get('matrix-media-repo/archive/mb_per_part', node.metadata.get('matrix-media-repo/upload_max_mb')*2)*1024*1024}
|
2021-02-12 15:01:35 +00:00
|
|
|
|
|
|
|
uploads:
|
2023-09-09 18:39:23 +00:00
|
|
|
maxBytes: ${node.metadata.get('matrix-media-repo/upload_max_mb')*1024*1024}
|
2021-02-12 15:01:35 +00:00
|
|
|
minBytes: 100
|
|
|
|
reportedMaxBytes: 0
|
|
|
|
quotas:
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
downloads:
|
2023-09-09 18:39:23 +00:00
|
|
|
maxBytes: ${node.metadata.get('matrix-media-repo/download_max_mb')*1024*1024}
|
|
|
|
numWorkers: ${node.metadata.get('matrix-media-repo/workers')}
|
2021-02-12 15:01:35 +00:00
|
|
|
failureCacheMinutes: 5
|
|
|
|
cache:
|
|
|
|
enabled: true
|
2023-09-09 18:39:23 +00:00
|
|
|
maxSizeBytes: ${node.metadata.get('matrix-media-repo/download_max_mb')*10*1024*1024}
|
|
|
|
maxFileSizeBytes: ${node.metadata.get('matrix-media-repo/download_max_mb')*1024*1024}
|
2021-02-12 15:01:35 +00:00
|
|
|
trackedMinutes: 30
|
|
|
|
minDownloads: 5
|
|
|
|
minCacheTimeSeconds: 300
|
|
|
|
minEvictedTimeSeconds: 60
|
|
|
|
expireAfterDays: 0
|
|
|
|
|
|
|
|
urlPreviews:
|
|
|
|
enabled: true
|
2023-09-09 18:39:23 +00:00
|
|
|
maxPageSizeBytes: ${node.metadata.get('matrix-media-repo/preview_max_mb')*1024*1024}
|
2021-02-12 15:01:35 +00:00
|
|
|
previewUnsafeCertificates: false
|
|
|
|
numWords: 50
|
|
|
|
maxLength: 200
|
|
|
|
numTitleWords: 30
|
|
|
|
maxTitleLength: 150
|
|
|
|
filePreviewTypes:
|
|
|
|
- "image/*"
|
2023-09-09 18:39:23 +00:00
|
|
|
numWorkers: ${node.metadata.get('matrix-media-repo/workers')}
|
2021-02-12 15:01:35 +00:00
|
|
|
disallowedNetworks:
|
|
|
|
- "127.0.0.1/8"
|
|
|
|
- "10.0.0.0/8"
|
|
|
|
- "172.16.0.0/12"
|
|
|
|
- "192.168.0.0/16"
|
|
|
|
- "100.64.0.0/10"
|
|
|
|
- "169.254.0.0/16"
|
|
|
|
- '::1/128'
|
|
|
|
- 'fe80::/64'
|
|
|
|
- 'fc00::/7'
|
|
|
|
allowedNetworks:
|
|
|
|
- "0.0.0.0/0"
|
|
|
|
- "::/0"
|
|
|
|
expireAfterDays: 0
|
|
|
|
defaultLanguage: "en-US,en"
|
|
|
|
oEmbed: false
|
|
|
|
|
|
|
|
thumbnails:
|
2023-09-09 18:39:23 +00:00
|
|
|
maxSourceBytes: ${node.metadata.get('matrix-media-repo/preview_max_mb')*1024*1024}
|
|
|
|
numWorkers: ${node.metadata.get('matrix-media-repo/workers')}
|
2021-02-12 15:01:35 +00:00
|
|
|
sizes:
|
|
|
|
- width: 32
|
|
|
|
height: 32
|
|
|
|
- width: 96
|
|
|
|
height: 96
|
|
|
|
- width: 320
|
|
|
|
height: 240
|
|
|
|
- width: 640
|
|
|
|
height: 480
|
|
|
|
- width: 768
|
|
|
|
height: 240
|
|
|
|
- width: 800
|
|
|
|
height: 600
|
|
|
|
dynamicSizing: false
|
|
|
|
types:
|
|
|
|
- "image/jpeg"
|
|
|
|
- "image/jpg"
|
|
|
|
- "image/png"
|
|
|
|
- "image/gif"
|
|
|
|
- "image/heif"
|
|
|
|
- "image/webp"
|
|
|
|
- "image/svg+xml"
|
|
|
|
- "audio/mpeg"
|
|
|
|
- "audio/ogg"
|
|
|
|
- "audio/wav"
|
|
|
|
- "audio/flac"
|
|
|
|
- "video/mp4"
|
|
|
|
allowAnimated: true
|
|
|
|
defaultAnimated: false
|
2023-09-09 18:39:23 +00:00
|
|
|
maxAnimateSizeBytes: ${node.metadata.get('matrix-media-repo/preview_max_mb')*1024*1024}
|
2021-02-12 15:01:35 +00:00
|
|
|
stillFrame: 0.5
|
|
|
|
expireAfterDays: 0
|
|
|
|
|
|
|
|
rateLimit:
|
|
|
|
enabled: true
|
2021-07-23 18:17:06 +00:00
|
|
|
requestsPerSecond: 10
|
|
|
|
burst: 50
|
2021-02-12 15:01:35 +00:00
|
|
|
|
|
|
|
identicons:
|
|
|
|
enabled: true
|
|
|
|
|
|
|
|
quarantine:
|
|
|
|
replaceThumbnails: true
|
|
|
|
replaceDownloads: false
|
|
|
|
allowLocalAdmins: true
|
|
|
|
|
|
|
|
timeouts:
|
|
|
|
urlPreviewTimeoutSeconds: 10
|
|
|
|
federationTimeoutSeconds: 120
|
|
|
|
clientServerTimeoutSeconds: 30
|
|
|
|
|
|
|
|
metrics:
|
2021-11-09 17:26:52 +00:00
|
|
|
enabled: true
|
2021-02-12 15:01:35 +00:00
|
|
|
bindAddress: "127.0.0.1"
|
|
|
|
port: 20091
|
|
|
|
|
|
|
|
featureSupport:
|
|
|
|
MSC2448:
|
|
|
|
enabled: false
|
|
|
|
IPFS:
|
|
|
|
enabled: false
|
2021-12-24 08:23:58 +00:00
|
|
|
|
|
|
|
redis:
|
|
|
|
% if node.has_bundle('redis'):
|
|
|
|
enabled: true
|
|
|
|
databaseNumber: ${repo.libs.defaults.redis_databases['matrix-media-repo']}
|
|
|
|
shards:
|
|
|
|
- name: localhost
|
|
|
|
addr: ":6379"
|
|
|
|
% else:
|
|
|
|
enabled: false
|
|
|
|
% endif
|