Repository navigation
Expand file tree
/
Copy pathrender.yaml
More file actions
619 lines (555 loc) · 18.2 KB
/
Copy pathrender.yaml
File metadata and controls
619 lines (555 loc) · 18.2 KB
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
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# Render Blueprint for My Nethesis
# =============================================================================
# Architecture: Private services exposed via proxy
# PRODUCTION: my.nethesis.it (release-based deployment)
# QA: qa.my.nethesis.it (auto-deploy + PR previews)
#
# Env vars are organized in 5 groups per environment (qa, prod):
# - infra-{env} internal service URLs (e.g. MIMIR_URL)
# - spaces-{env} DigitalOcean Spaces credentials and buckets
# - app-secrets-{env} cross-service shared secrets
# - logto-{env} Logto tenant + JWT auth config
# - smtp-{env} SMTP / email config
# Group values are managed in Render Dashboard. Values declared with
# `sync: false` must be set there before first deploy.
# =============================================================================
# =============================================================================
# DATABASES
# =============================================================================
databases:
# Production PostgreSQL Database
- name: my-postgres-prod
plan: 0.5c-1g
region: frankfurt
databaseName: noc
ipAllowList:
- source: 2.119.67.169/32
description: Nethesis HQ
# QA PostgreSQL Database
- name: my-postgres-qa
plan: basic-256mb
databaseName: noc
ipAllowList:
- source: 2.119.67.169/32
description: Nethesis HQ
# =============================================================================
# ENVIRONMENT VARIABLE GROUPS
# =============================================================================
envVarGroups:
# ---------- PROD ----------
- name: infra-prod
envVars:
- key: MIMIR_URL
value: http://my-mimir-prod:9009
- name: spaces-prod
envVars:
# Shared DigitalOcean Spaces credentials (used by mimir, backend, collect)
- key: S3_ENDPOINT
sync: false
- key: S3_ACCESS_KEY
sync: false
- key: S3_SECRET_KEY
sync: false
# Service-specific buckets
- key: MIMIR_S3_ALERTMANAGER_BUCKET
sync: false
- key: BACKUP_S3_BUCKET
sync: false
- name: app-secrets-prod
envVars:
- key: ALERTING_HISTORY_WEBHOOK_SECRET
sync: false
- name: logto-prod
envVars:
- key: LOGTO_TENANT_ID
sync: false
- key: LOGTO_TENANT_DOMAIN
sync: false
- key: LOGTO_API_RESOURCE
sync: false # resource indicator the SPA requests ({API_BASE_URL}/permissions)
- key: LOGTO_FRONTEND_APP_ID
sync: false # SPA client id bound at /auth/exchange
- key: APP_URL
sync: false
- key: JWT_SECRET
sync: false
- key: LOGTO_BACKEND_APP_ID
sync: false
- key: LOGTO_BACKEND_APP_SECRET
sync: false
- name: smtp-prod
envVars:
- key: SMTP_HOST
sync: false
- key: SMTP_PORT
sync: false
- key: SMTP_USERNAME
sync: false
- key: SMTP_PASSWORD
sync: false
- key: SMTP_FROM
sync: false
- key: SMTP_FROM_NAME
sync: false
- key: SMTP_TLS
sync: false
# ---------- QA ----------
- name: infra-qa
envVars:
- key: MIMIR_URL
value: http://my-mimir-qa:9009
- name: spaces-qa
envVars:
# Shared DigitalOcean Spaces credentials (used by mimir, backend, collect)
- key: S3_ENDPOINT
sync: false
- key: S3_ACCESS_KEY
sync: false
- key: S3_SECRET_KEY
sync: false
# Service-specific buckets
- key: MIMIR_S3_ALERTMANAGER_BUCKET
sync: false
- key: BACKUP_S3_BUCKET
sync: false
- name: app-secrets-qa
envVars:
- key: ALERTING_HISTORY_WEBHOOK_SECRET
sync: false
- name: logto-qa
envVars:
- key: LOGTO_TENANT_ID
sync: false
- key: LOGTO_TENANT_DOMAIN
sync: false
- key: LOGTO_API_RESOURCE
sync: false # resource indicator the SPA requests ({API_BASE_URL}/permissions)
- key: LOGTO_FRONTEND_APP_ID
sync: false # SPA client id bound at /auth/exchange
- key: APP_URL
sync: false
- key: JWT_SECRET
sync: false
- key: LOGTO_BACKEND_APP_ID
sync: false
- key: LOGTO_BACKEND_APP_SECRET
sync: false
- name: smtp-qa
envVars:
- key: SMTP_HOST
sync: false
- key: SMTP_PORT
sync: false
- key: SMTP_USERNAME
sync: false
- key: SMTP_PASSWORD
sync: false
- key: SMTP_FROM
sync: false
- key: SMTP_FROM_NAME
sync: false
- key: SMTP_TLS
sync: false
services:
# =============================================================================
# PRODUCTION ENVIRONMENT - my.nethesis.it
# Release-based deployment (GitHub Actions)
# =============================================================================
# Production Redis Cache
- type: keyvalue
name: my-redis-prod
plan: starter
region: frankfurt
maxmemoryPolicy: allkeys-lru
ipAllowList: []
# Production Mimir (Private Service - NOT internet accessible)
# standard (2 GB): one Alertmanager tenant per reseller/distributor — ~640
# tenants after the fleet migration. starter (512 MB) OOM-loops at this tenant
# count (memory scales with tenant count, not alert volume); do not downgrade.
- type: pserv
name: my-mimir-prod
runtime: image
plan: standard
region: frankfurt
image:
url: ghcr.io/nethserver/my/mimir:v0.10.8
envVars:
- fromGroup: spaces-prod
- key: PORT
value: 9009
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 2 GB plan.
- key: GOMEMLIMIT
value: 1600MiB
- key: GOGC
value: 50
# Production Backend API Server (Private Service)
- type: pserv
name: my-backend-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/backend:v0.10.8
envVars:
- fromGroup: infra-prod
- fromGroup: spaces-prod
- fromGroup: app-secrets-prod
- fromGroup: logto-prod
- fromGroup: smtp-prod
# Server Configuration
- key: GIN_MODE
value: release
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: info
- key: LOG_FORMAT
value: json
# Public path prefix where the API is reachable behind the proxy
- key: API_BASE_URL
value: /backend/api
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-prod
property: connectionString
- key: REDIS_DB
value: 0
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-prod
property: connectionString
# Connection pool: kept small for the 256MB Postgres tier (each backend
# process costs a few MB, so an oversized pool OOMs the DB, not scales it).
# Honoured once the prod image ships the env-driven pool. 10/3 gives the
# user-facing API concurrency headroom while staying well within the
# 256MB tier's budget (backend 10 + collect 10 << max_connections 103).
- key: DATABASE_MAX_CONNS
value: 10
- key: DATABASE_MAX_IDLE
value: 3
# Backend-only alerting webhook URL (env-specific public URL)
- key: ALERTING_HISTORY_WEBHOOK_URL
sync: false
# Production Collect Service (Private Service)
- type: pserv
name: my-collect-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/collect:v0.10.8
envVars:
- fromGroup: infra-prod
- fromGroup: spaces-prod
- fromGroup: app-secrets-prod
# Public path prefix where the API is reachable behind the proxy
- key: API_BASE_URL
value: /collect/api
# Server Configuration
- key: GIN_MODE
value: release
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: info
- key: LOG_FORMAT
value: json
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-prod
property: connectionString
- key: REDIS_DB
value: 1
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-prod
property: connectionString
# Connection pool: kept small for the 256MB Postgres tier. collect is the
# heavy writer so it gets a touch more than backend. The running v0.7.2
# image already reads DATABASE_MAX_CONNS/IDLE, so this applies on sync.
- key: DATABASE_MAX_CONNS
value: 10
- key: DATABASE_MAX_IDLE
value: 3
# Heartbeat auth cache. Appliances beat every ~5 min; with the 10 min
# default every second or third beat re-read systems, so a one-minute
# Postgres stall turned into hundreds of 503s (2026-09-23). Suspend,
# reactivate, delete and regenerate-secret invalidate the entry at once
# (backend cache.InvalidateSystemAuth), so a longer TTL delays no revoke.
- key: SYSTEM_AUTH_CACHE_TTL
value: 1h
# Production Frontend (Private Service)
- type: pserv
name: my-frontend-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/frontend:v0.10.8
envVars:
- key: VITE_PRODUCT_NAME
value: "My Nethesis"
- key: VITE_LOGTO_ENDPOINT
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_APP_ID
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_API_RESOURCE
sync: false # = backend LOGTO_API_RESOURCE
- key: VITE_API_BASE_URL
value: "/backend/api"
- key: VITE_SIGNIN_REDIRECT_URI
value: "login-redirect"
- key: VITE_SIGNOUT_REDIRECT_URI
value: "login"
- key: VITE_SHOP_BASE_URL
value: "https://nethshop.nethesis.it"
# Production Proxy - Public Entry Point (my.nethesis.it)
- type: web
name: my-proxy-prod
runtime: image
plan: starter
region: frankfurt
image:
url: ghcr.io/nethserver/my/proxy:v0.10.8
domains:
- my.nethesis.it
envVars:
# Service names for automatic URL generation
- key: BACKEND_SERVICE_NAME
value: my-backend-prod
- key: COLLECT_SERVICE_NAME
value: my-collect-prod
- key: FRONTEND_SERVICE_NAME
value: my-frontend-prod
# Logto endpoint allowed by the Content-Security-Policy
- key: LOGTO_ENDPOINT
value: https://id.nethesis.it
# Third-party app origins allowed in the CSP connect-src (info_url
# widgets) plus the Kapa AI widget API (proxy, metrics)
# and the reCAPTCHA Enterprise calls it makes from the page
- key: THIRD_PARTY_CONNECT_SRC
value: https://nethshop.nethesis.it https://my.nethspot.com https://formazione.nethesis.it https://proxy.kapa.ai https://metrics.kapa.ai https://www.google.com
# Kapa AI widget bundle, its reCAPTCHA and the source favicons it loads
# from Google (s2/favicons redirects to *.gstatic.com)
- key: THIRD_PARTY_SCRIPT_SRC
value: https://widget.kapa.ai https://www.google.com https://www.gstatic.com
- key: THIRD_PARTY_FRAME_SRC
value: https://www.google.com
- key: THIRD_PARTY_IMG_SRC
value: https://www.google.com https://*.gstatic.com
# =============================================================================
# QA ENVIRONMENT - qa.my.nethesis.it
# Auto-deploy on every commit + PR previews
# =============================================================================
# QA Redis Cache
- type: keyvalue
name: my-redis-qa
plan: starter
maxmemoryPolicy: allkeys-lru
ipAllowList: []
# QA Mimir (Private Service)
- type: pserv
name: my-mimir-qa
runtime: docker
plan: starter
rootDir: services/mimir
dockerfilePath: Containerfile
envVars:
- fromGroup: spaces-qa
- key: PORT
value: 9009
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
autoDeploy: true
branch: main
pullRequestPreviewsEnabled: true
# QA Backend API Server (Private Service)
- type: pserv
name: my-backend-qa
runtime: docker
plan: starter
rootDir: backend
dockerfilePath: Containerfile
envVars:
- fromGroup: infra-qa
- fromGroup: spaces-qa
- fromGroup: app-secrets-qa
- fromGroup: logto-qa
- fromGroup: smtp-qa
# Server Configuration
- key: GIN_MODE
value: debug
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: debug
- key: LOG_FORMAT
value: json
# Public path prefix where the API is reachable behind the proxy
- key: API_BASE_URL
value: /backend/api
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-qa
property: connectionString
- key: REDIS_DB
value: 0
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-qa
property: connectionString
# Connection pool: kept small for the 256MB Postgres tier (each backend
# process costs a few MB, so an oversized pool OOMs the DB, not scales it).
- key: DATABASE_MAX_CONNS
value: 6
- key: DATABASE_MAX_IDLE
value: 2
# Backend-only alerting webhook URL (env-specific public URL)
- key: ALERTING_HISTORY_WEBHOOK_URL
sync: false
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Collect Service (Private Service)
- type: pserv
name: my-collect-qa
runtime: docker
plan: starter
rootDir: collect
dockerfilePath: Containerfile
envVars:
- fromGroup: infra-qa
- fromGroup: spaces-qa
- fromGroup: app-secrets-qa
# Public path prefix where the API is reachable behind the proxy
- key: API_BASE_URL
value: /collect/api
# Server Configuration
- key: GIN_MODE
value: debug
- key: LISTEN_ADDRESS
value: 0.0.0.0:10000
- key: LOG_LEVEL
value: debug
- key: LOG_FORMAT
value: json
# Go must honor the cgroup limit, otherwise GC waits too long and the
# container is OOM-killed before any GC pass. ~78% of the 512 MB plan.
- key: GOMEMLIMIT
value: 400MiB
- key: GOGC
value: 50
# Redis Configuration
- key: REDIS_URL
fromService:
type: keyvalue
name: my-redis-qa
property: connectionString
- key: REDIS_DB
value: 1
# PostgreSQL Configuration
- key: DATABASE_URL
fromDatabase:
name: my-postgres-qa
property: connectionString
# Connection pool: kept small for the 256MB Postgres tier. collect is the
# heavy writer (heartbeat/inventory/alert ingestion) so it gets a touch
# more than backend; the managed-connection semaphore tracks 80% of this.
- key: DATABASE_MAX_CONNS
value: 10
- key: DATABASE_MAX_IDLE
value: 3
# Heartbeat auth cache. Appliances beat every ~5 min; with the 10 min
# default every second or third beat re-read systems, so a one-minute
# Postgres stall turned into hundreds of 503s (2026-09-23). Suspend,
# reactivate, delete and regenerate-secret invalidate the entry at once
# (backend cache.InvalidateSystemAuth), so a longer TTL delays no revoke.
- key: SYSTEM_AUTH_CACHE_TTL
value: 1h
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Frontend (Private Service)
- type: pserv
name: my-frontend-qa
runtime: docker
plan: starter
rootDir: frontend
dockerfilePath: Containerfile
envVars:
- key: PORT
value: 10000
- key: VITE_PRODUCT_NAME
value: "My Nethesis"
- key: VITE_LOGTO_ENDPOINT
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_APP_ID
sync: false # Configure in Render dashboard
- key: VITE_LOGTO_API_RESOURCE
sync: false # = backend LOGTO_API_RESOURCE
- key: VITE_API_BASE_URL
value: "/backend/api"
- key: VITE_SIGNIN_REDIRECT_URI
value: "login-redirect"
- key: VITE_SIGNOUT_REDIRECT_URI
value: "login"
- key: VITE_SHOP_BASE_URL
value: "https://nethshop2.nethesis.it/test" # staging shop for QA testing
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled
# QA Proxy - Public Entry Point (qa.my.nethesis.it)
- type: web
name: my-proxy-qa
runtime: docker
plan: starter
rootDir: proxy
dockerfilePath: Containerfile
domains:
- qa.my.nethesis.it
envVars:
# Dynamic service names from other services
- key: BACKEND_SERVICE_NAME
fromService:
name: my-backend-qa
type: pserv
property: host
- key: COLLECT_SERVICE_NAME
fromService:
name: my-collect-qa
type: pserv
property: host
- key: FRONTEND_SERVICE_NAME
fromService:
name: my-frontend-qa
type: pserv
property: host
# Logto endpoint allowed by the Content-Security-Policy
- key: LOGTO_ENDPOINT
value: https://qa.id.nethesis.it
# Third-party app origins allowed in the CSP connect-src (info_url widgets)
- key: THIRD_PARTY_CONNECT_SRC
value: https://nethshop2.nethesis.it https://my.staging.nethspot.com https://formazione.nethesis.it
autoDeploy: true # Auto-deploy on every commit
branch: main
pullRequestPreviewsEnabled: true # PR previews enabled