-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdefaults.yml
261 lines (217 loc) · 8.67 KB
/
defaults.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
app:
# A server instance, exposed in the TX-CDS-ID Header.
# Can be used to debug responses when CDS is installed
# in multiple regions/servers. This can be modified using
# an environment variable, e.g.
# TX__APP__ID=aws-eu-west-1
id: tx
# The name of the service, used in the logs and prometheus metrics
# Modify it if you need to seperate logs (e.g. beta, staging) when
# logs and metrics are drained into a common instance. e.g.
# TX__APP__NAME=beta
name: transifex-delivery
# Listening port of the service
port: 10300
settings:
# Express "Trust proxy" setting to detect client IP
# https://expressjs.com/en/guide/behind-proxies.html
trust_proxy: true
# Upload size limit for pushing content
# https://github.com/expressjs/body-parser#limit
request_size_limit: '50mb'
# Minutes to cache authentication credentials (invalidate endpoints)
# When a request is made, CDS will try to authenticate with Transifex the project
# token/secret. The result will be cached for X minutes, before trying to re-authenticate
# again.
auth_cache_min: 30
# Minutes to cache successful pulls in the registry
pull_success_cache_min: 10080
# Minutes to cache failed pulls in the registry
pull_error_cache_min: 5
# Minutes to cache job status in registry
job_status_cache_min: 480
# Max-age header for cached responses:
# Related code: res.setHeader('Cache-Control', `max-age=${maxAge}`);
cache_ttl: 1800
# Interval for auto-syncing content and refreshing content cache
# By default, content cached in CDS is considered stale after 1h has
# passed. After an hour, content will be re-fetched and re-cached with
# fresh data. Lower this value if you need more frequent updates. e.g.
# TX__SETTINGS__AUTOSYNC_MIN=15
# ---
# To disable autosync, set to zero, e.g.
# TX__SETTINGS__AUTOSYNC_MIN=0
autosync_min: 60
# A jitter to add to autosync functionality to randomly
# distribute cache invalidations over time. Cache will automatically
# invalidate at lastUpdate + autosync_min + random(autosync_jitter_min)
# TX__SETTINGS__AUTOSYNC_JITTER_MIN=15
autosync_jitter_min: 30
# Optionally, a whitelist of project tokens. Set this value if you need
# to limit access to only a subset of Native Project Tokens, vs having
# CDS cache everything. e.g.
# TX__SETTINGS__TOKEN_WHITELIST=key1,key2
token_whitelist: ''
# Optional secret for trusting communication between CDS and Transifex.
# Used for requests supporting the X-TRANSIFEX-TRUST-SECRET authentication
# header. This is used for server-2-server authentication, e.g.
# invalidate the cache of a project token, without having
# to provide a secret key. e.g.
# TX__SETTINGS__TRUST_SECRET=supersecret
trust_secret: ''
# Syncer strategy to use, i.e. where to get content data from and cache them
# in CDS.
# Options are: [transifex]
syncer: transifex
# Cache strategy. Defines where cached content is stored.
# Options are: [redis, s3, gcs, azure]
# e.g. TX__SETTINGS__CACHE=redis
cache: redis
# Registry is a key/value storage for storing metadata. This setting
# defines which registry engine to use.
# Options are: [redis, dynamodb, dynamodb-redis]
# e.g. TX__SETTINGS__REGISTRY=dynamodb-redis
registry: redis
# Number of seconds to keep alive idle connections
# https://nodejs.org/api/http.html#serverkeepalivetimeout
keep_alive_timeout_sec: ''
transifex:
# Endpoint of Transifex APIv3 (do not modify)
api_host: https://rest.api.transifex.com
# Page limit for Transifex APIv3 requests (do not modify)
page_limit: 1000
redis:
# Redis host
host: redis://transifex-delivery-redis
dynamodb:
# Table name of DynamoDB, modify using:
# TX__DYNAMODB__TABLE_NAME=mytable
table_name: transifex-delivery
registry:
# Prefix namespace for registry in Redis. Modify if you want to separate
# data, between multiple environments (e.g. beta, staging) that are using
# the same Redis instance, e.g.
# TX__REGISTRY__PREFIX="beta:registry:"
prefix: 'registry:'
cache:
# Redis cache strategy options
redis:
# Redis cache strategy namespace. Modify if you want to separate data,
# data, between multiple environments (e.g. beta, staging) that are using
# the same Redis instance, e.g.
# TX__CACHE__REDIS__PREFIX="beta:storage:"
prefix: 'storage:'
# How long should content stay in redis cache strategy before considered expired.
expire_min: 10080
# S3 cache strategy options
s3:
# Name of S3 bucket to use for storing cached content. Modify using:
# TX__CACHE__S3__BUCKET=mybucket
bucket: 'transifex-delivery'
# Control ACL attribute of S3 buckets
acl: 'private'
# Location of content during GET requests. By default CDS will read from S3 bucket
# and return the content. If you want CDS to redirect response and have clients read
# directly from S3 or Cloudfront, you should modify this value. e.g.
# TX__CACHE__S3__LOCATION="https://abcd.cloudfront.net/" (<-- note the trailing slash)
location: 'cache://'
# Controls the following S3 attribute:
# CacheControl: `max-age=${maxAge}`
max_age: 86400
# Google Cloud Storage cache options
gcs:
# Name of S3 bucket to use for storing cached content. Modify using:
# TX__CACHE__GCS__BUCKET=mybucket
bucket: 'transifex-delivery'
# Location of content during GET requests. By default CDS will read from GCS bucket
# and return the content. If you want CDS to redirect response and have clients read
# directly from Google Cloud, you should modify this value. e.g.
# TX__CACHE__GCS__LOCATION="https://storage.googleapis.com/<name of bucket>/" (<-- note the trailing slash)
location: 'cache://'
# Controls the following GCS attribute:
# CacheControl: `max-age=${maxAge}`
max_age: 86400
# Azure blob storage cache options
azure:
# Name of the Storage account. Modify using
# TX__CACHE__AZURE__ACCOUNT=myaccount
account: 'txdelivery'
# Name of the Storage account container. Modify using
# TX__CACHE__AZURE__CONTAINER=mycontainer
container: 'txdelivery'
# Use connection string or leave empty for default identity credentials.
# https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string#configure-a-connection-string-for-an-azure-storage-account
# https://www.npmjs.com/package/@azure/storage-blob#create-the-blob-service-client
#
# Modify using:
# TX__CACHE__AZURE__CONNECTION_STRING="DefaultEndpointsProtocol=https;AccountName=..."
connection_string: ''
# Location of content during GET requests. By default CDS will read from Azure blob
# and return the content. If you want CDS to redirect response and have clients read
# directly from Azure CDN, you should modify this value. e.g.
# TX__CACHE__AZURE__LOCATION="https://cds.azureedge.net/txdelivery/" (<-- note the trailing slash)
location: 'cache://'
metrics:
# Enable Prometheus metrics under /metric endpoint
enabled: false
# Prometheus port for /metrics endpoint
port: 9090
log:
transports:
console:
level: info
queue:
# Queue name (Redis broker)
# https://github.com/OptimalBits/bull
name: sync
# Number of workers to fetch content from Transifex
# Setting this to zero, will make queue processing within the same
# Node instance (slow).
workers: 1
limits:
# Rate limits for push content (max requests per seconds)
# https://github.com/nfriedly/express-rate-limit
pull:
window_sec: 4
max_req: 1000
push:
window_sec: 60
max_req: 20
invalidate:
window_sec: 5
max_req: 120
jobs:
window_sec: 5
max_req: 120
# Prefix namespace for keys in Redis. Modify if you want to separate
# data, between multiple environments (e.g. beta, staging) that are using
# the same Redis instance, e.g.
# TX__LIMITS__PREFIX="beta:ratelimit:"
prefix: 'ratelimit:'
telemetry:
# If usage telemetry should be enabled
enabled: true
# Telemetry service host
host: https://telemetry.svc.transifex.net
# Request timeout to Telemetry service
req_timeout_sec: 5
# Max concurrent requests per process
max_concurrent_req: 10
# Prefix namespace for keys in Redis. Modify if you want to separate
# data, between multiple environments (e.g. beta, staging) that are using
# the same Redis instance, e.g.
# TX__TELEMETRY__PREFIX="beta:telemetry:"
prefix: 'telemetry:'
# # Manually pass AWS config (local testing)
# aws:
# config:
# common:
# region: eu-west-1
# credentials:
# accessKeyId: accesskey
# secretAccessKey: secretkey
# s3:
# endpoint: http://transifex-delivery-moto:5000
# s3ForcePathStyle: true
# dynamodb:
# endpoint: http://transifex-delivery-dynamodb:8000