bundlewrap/bundles/matrix-media-repo/files/config.yaml

177 lines
4.3 KiB
YAML
Raw Permalink Normal View History

# 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)}
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"
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():
- 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')):
- "${user}"
% endfor
sharedSecretAuth:
enabled: false
2023-09-09 18:39:23 +00:00
token: "${node.metadata.get('matrix-media-repo/shared-secret-token')}"
datastores:
- type: file
2023-09-09 18:39:23 +00:00
id: "${node.metadata.get('matrix-media-repo/datastore_id')}"
enabled: true
2023-09-09 18:39:23 +00:00
forKinds: ['all']
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}
uploads:
2023-09-09 18:39:23 +00:00
maxBytes: ${node.metadata.get('matrix-media-repo/upload_max_mb')*1024*1024}
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')}
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}
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}
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')}
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')}
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}
stillFrame: 0.5
expireAfterDays: 0
rateLimit:
enabled: true
requestsPerSecond: 10
burst: 50
identicons:
enabled: true
quarantine:
replaceThumbnails: true
replaceDownloads: false
allowLocalAdmins: true
timeouts:
urlPreviewTimeoutSeconds: 10
federationTimeoutSeconds: 120
clientServerTimeoutSeconds: 30
metrics:
enabled: true
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