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

177 lines
4.2 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: '-'
logColors: false
jsonLogs: false
logLevel: 'info'
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')}"
% if config.get('signing_key_path'):
signingKeyPath: "${config['signing_key_path']}"
% endif
% endfor
accessTokens:
2024-09-04 21:06:07 +00:00
maxCacheTimeSeconds: 10
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
maxPending: 5
maxAgeSeconds: 1800
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
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
2024-09-04 21:06:07 +00:00
requestsPerSecond: 100
burst: 5000
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