176 lines
4.2 KiB
YAML
176 lines
4.2 KiB
YAML
# General repo configuration
|
|
repo:
|
|
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:
|
|
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:
|
|
% 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:
|
|
maxCacheTimeSeconds: 0
|
|
useLocalAppserviceConfig: false
|
|
|
|
admins:
|
|
% for user in sorted(node.metadata.get('matrix-media-repo/admins')):
|
|
- "${user}"
|
|
% endfor
|
|
|
|
sharedSecretAuth:
|
|
enabled: false
|
|
token: "${node.metadata.get('matrix-media-repo/shared-secret-token')}"
|
|
|
|
datastores:
|
|
- type: file
|
|
id: "${node.metadata.get('matrix-media-repo/datastore_id')}"
|
|
enabled: true
|
|
forKinds: ['all']
|
|
opts:
|
|
path: /var/matrix/media
|
|
|
|
archiving:
|
|
enabled: true
|
|
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:
|
|
maxBytes: ${node.metadata.get('matrix-media-repo/upload_max_mb')*1024*1024}
|
|
minBytes: 100
|
|
#reportedMaxBytes: 0
|
|
maxPending: 5
|
|
maxAgeSeconds: 1800
|
|
quotas:
|
|
enabled: false
|
|
|
|
downloads:
|
|
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
|
|
maxPageSizeBytes: ${node.metadata.get('matrix-media-repo/preview_max_mb')*1024*1024}
|
|
previewUnsafeCertificates: false
|
|
numWords: 50
|
|
maxLength: 200
|
|
numTitleWords: 30
|
|
maxTitleLength: 150
|
|
filePreviewTypes:
|
|
- "image/*"
|
|
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:
|
|
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
|
|
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
|
|
|
|
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
|