/ opencodehub / render.yaml
Swadhin Biswas Feat/federation (#82) · 8/19/2026
c0437ed
198 lines · 7.4 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
# ──────────────────────────────────────────────────────────────────────────────
# OpenCodeHub — Render Blueprint (production-ready)
#
# Deploy with: Render Dashboard → New → Blueprint → Select this repo
#
# What this provisions:
#   1. Web Service (app + API + Git HTTP) — Docker image, built from Dockerfile
#   2. Background Worker (queues, webhooks, cron, scheduler)
#   3. PostgreSQL database (Render managed, free tier)
#   4. Redis (Render managed, free tier)
#   5. Persistent disk (git repos, storage, SSH keys)
#
# Post-deploy:
#   1. The first deploy runs migrations automatically (docker-entrypoint.sh)
#   2. Visit your URL → /setup to create the admin account
#   3. For SSH git: deploy separately with PROCESS_TYPE=ssh (Render supports
#      this via a second service or a "command" on the main service)
#
# SSH git note: Render does not expose non-HTTP ports. To use SSH git,
# deploy a separate "Background Worker" with PROCESS_TYPE=ssh and use
# Render's built-in TCP proxy (or serve SSH over WebSocket).
# For most users: HTTP git (`https://your-domain.git`) works identically.
# ──────────────────────────────────────────────────────────────────────────────

services:
  # ── Web Service (app + API + Git HTTP) ──────────────────────────────────────
  - type: web
    name: opencodehub-web
    runtime: image
    image:
      url: ghcr.io/swadhinbiswas/opencodehub:latest
    plan: free
    region: singapore
    healthCheckPath: /api/health
    envVars:
      # ── Server ──────────────────────────────────────────────────────────
      - key: NODE_ENV
        value: production
      - key: PORT
        value: "4321"
      - key: HOST
        value: "0.0.0.0"
      - key: SITE_URL
        sync: false
      # TODO: After first deploy, set this to your Render URL
      # (e.g. https://opencodehub.onrender.com)

      # ── Database (Render PostgreSQL — injected via fromDatabase) ───────
      - key: DATABASE_DRIVER
        value: postgres
      - key: DATABASE_URL
        fromDatabase:
          name: opencodehub-db
          property: connectionString
      - key: DATABASE_SSL
        value: "true"

      # ── Redis (Render managed) ──────────────────────────────────────────
      - key: REDIS_URL
        fromRedis:
          name: opencodehub-redis
          property: connectionString

      # ── Secrets (auto-generated, unique per deploy) ─────────────────────
      - key: JWT_SECRET
        generateValue: true
      - key: SESSION_SECRET
        generateValue: true
      - key: INTERNAL_HOOK_SECRET
        generateValue: true
      - key: CRON_SECRET
        generateValue: true
      - key: RUNNER_SECRET
        generateValue: true
      - key: AI_CONFIG_ENCRYPTION_KEY
        generateValue: true
      - key: WORKFLOW_SECRET_ENCRYPTION_KEY
        generateValue: true

      # ── Storage (persistent disk) ───────────────────────────────────────
      - key: STORAGE_TYPE
        value: local
      - key: GIT_REPOS_PATH
        value: /data/repositories
      - key: STORAGE_PATH
        value: /data/storage

      # ── Git SSH ─────────────────────────────────────────────────────────
      - key: GIT_SSH_PORT
        value: "2222"
      - key: GIT_SSH_HOST_KEY
        value: /data/ssh/host_key

      # ── Features ───────────────────────────────────────────────────────
      - key: ENABLE_REGISTRATION
        value: "true"
      - key: ENABLE_WIKI
        value: "true"
      - key: ENABLE_ISSUES
        value: "true"
      - key: ENABLE_ACTIONS
        value: "true"
      - key: ENABLE_PACKAGES
        value: "false"
      - key: ENABLE_AI_ASSISTANT
        value: "true"

      # ── Rate Limiting & Security ───────────────────────────────────────
      - key: RATE_LIMIT_ENABLED
        value: "true"
      - key: RATE_LIMIT_SKIP_DEV
        value: "false"
      - key: CSRF_SKIP_DEV
        value: "false"

      # ── Logging ────────────────────────────────────────────────────────
      - key: LOG_LEVEL
        value: info

    # Persistent disk for git repos, storage, SSH host key
    disk:
      name: opencodehub-data
      mountPath: /data
      sizeGB: 10

  # ── Background Worker (queues, webhooks, cron, scheduler, digests) ────
  - type: worker
    name: opencodehub-worker
    runtime: image
    image:
      url: ghcr.io/swadhinbiswas/opencodehub:latest
    plan: free
    envVars:
      - key: NODE_ENV
        value: production
      - key: PROCESS_TYPE
        value: worker
      - key: DATABASE_DRIVER
        value: postgres
      - key: DATABASE_URL
        fromDatabase:
          name: opencodehub-db
          property: connectionString
      - key: DATABASE_SSL
        value: "true"
      - key: REDIS_URL
        fromRedis:
          name: opencodehub-redis
          property: connectionString
      - key: JWT_SECRET
        generateValue: true
      - key: SESSION_SECRET
        generateValue: true
      - key: INTERNAL_HOOK_SECRET
        generateValue: true
      - key: CRON_SECRET
        generateValue: true
      - key: RUNNER_SECRET
        generateValue: true
      - key: WORKFLOW_SECRET_ENCRYPTION_KEY
        generateValue: true
      - key: AI_CONFIG_ENCRYPTION_KEY
        generateValue: true
      - key: GIT_REPOS_PATH
        value: /data/repositories
      - key: STORAGE_TYPE
        value: local
      - key: STORAGE_PATH
        value: /data/storage
      - key: LOG_LEVEL
        value: info
      - key: SCHEDULE_INTERVAL
        value: "60000"
      - key: MIRROR_SYNC_INTERVAL
        value: "60000"
      - key: CLEANUP_INTERVAL
        value: "3600000"
      - key: DIGEST_INTERVAL
        value: "300000"

      # Persistent disk (shared with web service — mounted at same path)
      # Note: Render workers share the same disk as the web service by name.
      # If using separate disks, mount at /data with the same disk name.

# ── PostgreSQL Database (Render managed) ─────────────────────
databases:
  - name: opencodehub-db
    plan: free
    databaseName: opencodehub
    ipAllowList: []  # Restrict to Render private network

# ── Redis (Render managed) ──────────────────────────────────
# Render now provides managed Redis — no Upstash needed.
redis:
  - name: opencodehub-redis
    plan: free
    ipAllowList: []  # Restrict to Render private network