-
-
Notifications
You must be signed in to change notification settings - Fork 124
/
render.yaml
496 lines (476 loc) · 13.2 KB
/
render.yaml
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
version: "1"
services:
################
## PRODUCTION ##
################
# API
- type: web
name: api
runtime: image
image:
url: ghcr.io/polarsource/polar:latest
creds:
fromRegistryCreds:
name: Registry Credentials (by fvoron)
plan: standard
preDeployCommand: "uv run task pre_deploy"
region: ohio
healthCheckPath: /readyz
autoDeploy: false # deploys are triggered by github actions
domains:
- api.polar.sh
envVars:
- key: WEB_CONCURRENCY
value: 2
- key: FORWARDED_ALLOW_IPS
value: '*'
- key: POLAR_ALLOWED_HOSTS
value: '["polar.sh","docs.polar.sh"]'
- key: POLAR_CORS_ORIGINS
value: '["https://dashboard.polar.sh", "https://github.com" , "https://polar.sh", "https://docs.polar.sh", "https://polar-polar-sh.vercel.app"]'
- key: POLAR_POSTGRES_DATABASE
fromDatabase:
name: db
property: database
- key: POLAR_POSTGRES_HOST
fromDatabase:
name: db
property: host
- key: POLAR_POSTGRES_PORT
fromDatabase:
name: db
property: port
- key: POLAR_POSTGRES_PWD
fromDatabase:
name: db
property: password
- key: POLAR_POSTGRES_USER
fromDatabase:
name: db
property: user
- key: POLAR_REDIS_HOST
fromService:
type: redis
name: redis
property: host
- key: POLAR_REDIS_PORT
fromService:
type: redis
name: redis
property: port
- key: POLAR_REDIS_DB
value: 0
- fromGroup: aws-s3-production
- fromGroup: google-production
- fromGroup: github-production
- fromGroup: backend-production
- fromGroup: stripe-production
- fromGroup: logfire-server
# Worker
- type: worker
name: worker-default
runtime: image
image:
url: ghcr.io/polarsource/polar:latest
creds:
fromRegistryCreds:
name: Registry Credentials (by fvoron)
plan: standard
dockerCommand: uv run python -m run_worker --default-worker-num 2
region: ohio
numInstances: 1
autoDeploy: false # deploys are triggered by github actions
envVars:
- key: POLAR_POSTGRES_DATABASE
fromDatabase:
name: db
property: database
- key: POLAR_POSTGRES_HOST
fromDatabase:
name: db
property: host
- key: POLAR_POSTGRES_PORT
fromDatabase:
name: db
property: port
- key: POLAR_POSTGRES_PWD
fromDatabase:
name: db
property: password
- key: POLAR_POSTGRES_USER
fromDatabase:
name: db
property: user
- key: POLAR_REDIS_HOST
fromService:
type: redis
name: redis
property: host
- key: POLAR_REDIS_PORT
fromService:
type: redis
name: redis
property: port
- key: POLAR_REDIS_DB
value: 0
- fromGroup: google-production
- fromGroup: github-production
- fromGroup: backend-production
- fromGroup: stripe-production
- fromGroup: logfire-worker
- type: redis
name: redis
plan: standard
region: ohio
maxmemoryPolicy: noeviction
ipAllowList: []
################
## SANDBOX ##
################
# API
- type: web
name: api-sandbox
runtime: image
image:
url: ghcr.io/polarsource/polar:latest
creds:
fromRegistryCreds:
name: Registry Credentials (by fvoron)
plan: standard
preDeployCommand: "uv run task pre_deploy"
region: ohio
numInstances: 1
healthCheckPath: /readyz
autoDeploy: false # deploys are triggered by github actions
domains:
- sandbox-api.polar.sh
envVars:
- key: WEB_CONCURRENCY
value: 2
- key: FORWARDED_ALLOW_IPS
value: '*'
- key: POLAR_ALLOWED_HOSTS
value: '["sandbox.polar.sh"]'
- key: POLAR_CORS_ORIGINS
value: '["https://sandbox.polar.sh", "https://github.com"]'
- key: POLAR_POSTGRES_DATABASE
value: polar_sandbox
- key: POLAR_POSTGRES_HOST
fromDatabase:
name: db
property: host
- key: POLAR_POSTGRES_PORT
fromDatabase:
name: db
property: port
- key: POLAR_POSTGRES_PWD
fromDatabase:
name: db
property: password
- key: POLAR_POSTGRES_USER
fromDatabase:
name: db
property: user
- key: POLAR_REDIS_HOST
fromService:
type: redis
name: redis
property: host
- key: POLAR_REDIS_PORT
fromService:
type: redis
name: redis
property: port
- key: POLAR_REDIS_DB
value: 1
- fromGroup: aws-s3-sandbox
- fromGroup: google-sandbox
- fromGroup: github-sandbox
- fromGroup: backend-sandbox
- fromGroup: stripe-sandbox
# Worker
- type: worker
name: worker-default-sandbox
runtime: image
image:
url: ghcr.io/polarsource/polar:latest
creds:
fromRegistryCreds:
name: Registry Credentials (by fvoron)
plan: standard
dockerCommand: uv run python -m run_worker --default-worker-num 2
region: ohio
numInstances: 1
autoDeploy: false # deploys are triggered by github actions
envVars:
- key: POLAR_POSTGRES_DATABASE
value: polar_sandbox
- key: POLAR_POSTGRES_HOST
fromDatabase:
name: db
property: host
- key: POLAR_POSTGRES_PORT
fromDatabase:
name: db
property: port
- key: POLAR_POSTGRES_PWD
fromDatabase:
name: db
property: password
- key: POLAR_POSTGRES_USER
fromDatabase:
name: db
property: user
- key: POLAR_REDIS_HOST
fromService:
type: redis
name: redis
property: host
- key: POLAR_REDIS_PORT
fromService:
type: redis
name: redis
property: port
- key: POLAR_REDIS_DB
value: 1
- fromGroup: google-sandbox
- fromGroup: github-sandbox
- fromGroup: backend-sandbox
- fromGroup: stripe-sandbox
databases:
- name: db
databaseName: polar_cpit
user: polar_cpit_user
plan: basic-1gb
diskSizeGB: 16
region: ohio
postgresMajorVersion: "15"
readReplicas:
- name: polar-replica
envVarGroups:
- name: google-production
envVars:
- key: POLAR_GOOGLE_CLIENT_ID
sync: false
- key: POLAR_GOOGLE_CLIENT_SECRET
sync: false
- name: backend-production
envVars:
- key: POLAR_AUTH_COOKIE_DOMAIN
value: polar.sh
- key: POLAR_BASE_URL
value: https://api.polar.sh/v1
- key: POLAR_CURRENT_JWK_KID
sync: false
- key: POLAR_DEBUG
value: 0
- key: POLAR_DISCORD_BOT_TOKEN
sync: false
- key: POLAR_DISCORD_CLIENT_ID
sync: false
- key: POLAR_DISCORD_CLIENT_SECRET
sync: false
- key: POLAR_DISCORD_WEBHOOK_URL
sync: false
- key: POLAR_EMAIL_SENDER
value: resend
- key: POLAR_EMAIL_FROM_NAME
value: Polar
- key: POLAR_EMAIL_FROM_EMAIL_ADDRESS
value: [email protected]
- key: POLAR_ENV
value: production
- key: POLAR_FRONTEND_BASE_URL
value: https://polar.sh
- key: POLAR_CHECKOUT_BASE_URL
value: https://buy.polar.sh/{client_secret}
- key: POLAR_GITHUB_APP_NAMESPACE
value: polar-sh
- key: POLAR_GITHUB_BADGE_EMBED
value: 1
- key: POLAR_GITHUB_POLAR_USER_ACCESS_TOKEN
sync: false
- key: POLAR_JWKS
value: /etc/secrets/jwks.json
- key: POLAR_LOG_LEVEL
value: INFO
- key: POLAR_LOOPS_API_KEY
sync: false
- key: POLAR_POSTHOG_PROJECT_API_KEY
sync: false
- key: POLAR_RESEND_API_KEY
sync: false
- key: POLAR_SECRET
sync: false
- key: POLAR_SENTRY_DSN
sync: false
- key: POLAR_TESTING
value: 0
- name: aws-s3-production
envVars:
- key: POLAR_AWS_ACCESS_KEY_ID
sync: false
- key: POLAR_AWS_REGION
value: us-east-2
- key: POLAR_AWS_SECRET_ACCESS_KEY
sync: false
- key: POLAR_AWS_SIGNATURE_VERSION
value: v4
- key: POLAR_S3_FILES_BUCKET_NAME
value: polar-production-files
- key: POLAR_S3_FILES_DOWNLOAD_SALT
sync: false
- key: POLAR_S3_FILES_DOWNLOAD_SECRET
sync: false
- key: POLAR_S3_FILES_PRESIGN_TTL
value: 600
- key: POLAR_S3_FILES_PUBLIC_BUCKET_NAME
value: polar-public-files
- name: github-production
envVars:
- key: POLAR_GITHUB_APP_IDENTIFIER
sync: false
- key: POLAR_GITHUB_APP_PRIVATE_KEY
sync: false
- key: POLAR_GITHUB_APP_WEBHOOK_SECRET
sync: false
- key: POLAR_GITHUB_CLIENT_ID
sync: false
- key: POLAR_GITHUB_CLIENT_SECRET
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_IDENTIFIER
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_NAMESPACE
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_PRIVATE_KEY
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_CLIENT_ID
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_CLIENT_SECRET
sync: false
- name: stripe-production
envVars:
- key: POLAR_STRIPE_CONNECT_WEBHOOK_SECRET
sync: false
- key: POLAR_STRIPE_SECRET_KEY
sync: false
- key: POLAR_STRIPE_WEBHOOK_SECRET
sync: false
- name: google-sandbox
envVars:
- key: POLAR_GOOGLE_CLIENT_ID
sync: false
- key: POLAR_GOOGLE_CLIENT_SECRET
sync: false
- name: backend-sandbox
envVars:
- key: POLAR_AUTH_COOKIE_KEY
value: polar_sandbox_session
- key: POLAR_AUTH_COOKIE_DOMAIN
value: polar.sh
- key: POLAR_BASE_URL
value: https://sandbox-api.polar.sh/v1
- key: POLAR_CURRENT_JWK_KID
sync: false
- key: POLAR_DEBUG
value: 0
- key: POLAR_DISCORD_BOT_TOKEN
sync: false
- key: POLAR_DISCORD_CLIENT_ID
sync: false
- key: POLAR_DISCORD_CLIENT_SECRET
sync: false
- key: POLAR_DISCORD_WEBHOOK_URL
sync: false
- key: POLAR_EMAIL_SENDER
value: resend
- key: POLAR_EMAIL_FROM_NAME
value: "[SANDBOX] Polar"
- key: POLAR_EMAIL_FROM_EMAIL_ADDRESS
value: [email protected]
- key: POLAR_ENV
value: sandbox
- key: POLAR_FRONTEND_BASE_URL
value: https://sandbox.polar.sh
- key: POLAR_CHECKOUT_BASE_URL
value: https://sandbox-api.polar.sh/v1/checkout-links/{client_secret}/redirect
- key: POLAR_GITHUB_APP_NAMESPACE
value: polar-sandbox
- key: POLAR_GITHUB_BADGE_EMBED
value: 1
- key: POLAR_GITHUB_POLAR_USER_ACCESS_TOKEN
sync: false
- key: POLAR_JWKS
value: /etc/secrets/jwks.json
- key: POLAR_LOG_LEVEL
value: INFO
- key: POLAR_LOOPS_API_KEY
sync: false
- key: POLAR_POSTHOG_PROJECT_API_KEY
sync: false
- key: POLAR_RESEND_API_KEY
sync: false
- key: POLAR_SECRET
sync: false
- key: POLAR_SENTRY_DSN
sync: false
- key: POLAR_TESTING
value: 0
- name: aws-s3-sandbox
envVars:
- key: POLAR_AWS_ACCESS_KEY_ID
sync: false
- key: POLAR_AWS_REGION
value: us-east-2
- key: POLAR_AWS_SECRET_ACCESS_KEY
sync: false
- key: POLAR_AWS_SIGNATURE_VERSION
value: v4
- key: POLAR_S3_FILES_BUCKET_NAME
value: polar-sandbox-files
- key: POLAR_S3_FILES_DOWNLOAD_SALT
sync: false
- key: POLAR_S3_FILES_DOWNLOAD_SECRET
sync: false
- key: POLAR_S3_FILES_PRESIGN_TTL
value: 600
- key: POLAR_S3_FILES_PUBLIC_BUCKET_NAME
value: polar-public-sandbox-files
- name: github-sandbox
envVars:
- key: POLAR_GITHUB_APP_IDENTIFIER
sync: false
- key: POLAR_GITHUB_APP_PRIVATE_KEY
sync: false
- key: POLAR_GITHUB_APP_WEBHOOK_SECRET
sync: false
- key: POLAR_GITHUB_CLIENT_ID
sync: false
- key: POLAR_GITHUB_CLIENT_SECRET
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_IDENTIFIER
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_NAMESPACE
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_APP_PRIVATE_KEY
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_CLIENT_ID
sync: false
- key: POLAR_GITHUB_REPOSITORY_BENEFITS_CLIENT_SECRET
sync: false
- name: stripe-sandbox
envVars:
- key: POLAR_STRIPE_CONNECT_WEBHOOK_SECRET
sync: false
- key: POLAR_STRIPE_SECRET_KEY
sync: false
- key: POLAR_STRIPE_WEBHOOK_SECRET
sync: false
- name: logfire-server
envVars:
- key: POLAR_LOGFIRE_TOKEN
sync: false
- name: logfire-worker
envVars:
- key: POLAR_LOGFIRE_TOKEN
sync: false