@omnibase/cli 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/auth.d.ts +6 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +94 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/cloud.d.ts +10 -0
- package/dist/commands/cloud.d.ts.map +1 -0
- package/dist/commands/cloud.js +435 -0
- package/dist/commands/cloud.js.map +1 -0
- package/dist/commands/db.d.ts +10 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +399 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/email.d.ts +4 -0
- package/dist/commands/email.d.ts.map +1 -1
- package/dist/commands/email.js +87 -65
- package/dist/commands/email.js.map +1 -1
- package/dist/commands/environment.d.ts.map +1 -1
- package/dist/commands/environment.js +7 -52
- package/dist/commands/environment.js.map +1 -1
- package/dist/commands/migrate.d.ts +6 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +204 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/permissions.d.ts +6 -17
- package/dist/commands/permissions.d.ts.map +1 -1
- package/dist/commands/permissions.js +125 -104
- package/dist/commands/permissions.js.map +1 -1
- package/dist/commands/restart.d.ts +3 -0
- package/dist/commands/restart.d.ts.map +1 -0
- package/dist/commands/restart.js +196 -0
- package/dist/commands/restart.js.map +1 -0
- package/dist/commands/stripe.d.ts +4 -0
- package/dist/commands/stripe.d.ts.map +1 -1
- package/dist/commands/stripe.js +489 -190
- package/dist/commands/stripe.js.map +1 -1
- package/dist/commands/sync.d.ts +3 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +144 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/config/services.d.ts +19 -0
- package/dist/config/services.d.ts.map +1 -0
- package/dist/config/services.js +34 -0
- package/dist/config/services.js.map +1 -0
- package/dist/index.js +50 -55
- package/dist/index.js.map +1 -1
- package/dist/utils/api-client.d.ts +17 -0
- package/dist/utils/api-client.d.ts.map +1 -0
- package/dist/utils/api-client.js +65 -0
- package/dist/utils/api-client.js.map +1 -0
- package/dist/utils/context.d.ts +23 -0
- package/dist/utils/context.d.ts.map +1 -0
- package/dist/utils/context.js +30 -0
- package/dist/utils/context.js.map +1 -0
- package/dist/utils/credentials.d.ts +19 -0
- package/dist/utils/credentials.d.ts.map +1 -0
- package/dist/utils/credentials.js +77 -0
- package/dist/utils/credentials.js.map +1 -0
- package/dist/utils/docker.d.ts +27 -0
- package/dist/utils/docker.d.ts.map +1 -0
- package/dist/utils/docker.js +126 -0
- package/dist/utils/docker.js.map +1 -0
- package/dist/utils/environment.d.ts +14 -4
- package/dist/utils/environment.d.ts.map +1 -1
- package/dist/utils/environment.js +65 -21
- package/dist/utils/environment.js.map +1 -1
- package/dist/utils/errors.d.ts +3 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +30 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +66 -0
- package/dist/utils/logger.js.map +1 -0
- package/docker/db/000000_users.up.sql +29 -0
- package/docker/db/{001-seed.sql → 000001_seed.up.sql} +1 -0
- package/docker/db/{002-rls.sql → 000002_rls.up.sql} +53 -5
- package/docker/db/000003_keto.up.sql +1 -0
- package/docker/db/000005_neon_rls.up.sql +23 -0
- package/docker/db/000006_db_events.up.sql +28 -0
- package/docker/db/000007_add_rbac_system.up.sql +33 -0
- package/docker/db/000008_stripe_id_history.up.sql +2 -0
- package/docker/db/000009_not_null_fix.up.sql +15 -0
- package/docker/db/000010_add_role_templates.up.sql +29 -0
- package/docker/db/000011_add_subject_relations.up.sql +7 -0
- package/docker/db/000012_stripe_webhooks.up.sql +21 -0
- package/docker/db/000013_stripe_webhooks_connect.up.sql +5 -0
- package/docker/db/000014_add_enterprise_pricing.up.sql +11 -0
- package/docker/docker-compose.base.yml +326 -0
- package/docker/docker-compose.dev.yml +15 -270
- package/docker/docker-compose.local.yml +15 -0
- package/docker/docker-compose.perf-test.yml +58 -0
- package/docker/docker-compose.test.yml +43 -0
- package/docker/pgbouncer/pgbouncer.ini +51 -0
- package/package.json +16 -6
- package/templates/.omnibase-config +1 -1
- package/templates/db/README.md +91 -0
- package/templates/environments/.env.dev +8 -31
- package/templates/environments/.env.local +34 -0
- package/templates/environments/.env.prod +8 -9
- package/templates/environments/.env.staging +8 -9
- package/templates/permissions/roles.config.json +38 -0
- package/templates/permissions/tenants.ts +28 -12
- package/templates/{stripe.config.json → stripe/example.config.json} +14 -0
- package/templates/{edge → workers}/package.json +1 -0
- package/templates/{edge → workers}/src/index.ts +3 -1
- package/docker/db/003-keto.sql +0 -1
- package/docker/docker-compose.yml +0 -258
- package/templates/edge/dev.ts +0 -13
- /package/docker/db/{004-email.sql → 000004_email.up.sql} +0 -0
- /package/templates/{edge → workers}/bun.lock +0 -0
- /package/templates/{edge → workers}/tsconfig.json +0 -0
- /package/templates/{edge → workers}/wrangler.toml +0 -0
|
@@ -1,298 +1,43 @@
|
|
|
1
|
+
# Development overrides - local builds with hot-reload
|
|
1
2
|
services:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
image: postgres:17-alpine
|
|
5
|
-
container_name: postgres
|
|
6
|
-
environment:
|
|
7
|
-
POSTGRES_DB: db
|
|
8
|
-
POSTGRES_USER: postgres
|
|
9
|
-
POSTGRES_PASSWORD: postgres
|
|
10
|
-
ports:
|
|
11
|
-
- "5432:5432"
|
|
12
|
-
volumes:
|
|
13
|
-
# - postgres_data:/var/lib/pos/tgresql/data
|
|
14
|
-
- ./db:/docker-entrypoint-initdb.d
|
|
15
|
-
networks:
|
|
16
|
-
- app-network
|
|
17
|
-
restart: unless-stopped
|
|
18
|
-
|
|
19
|
-
kratos-migrate:
|
|
3
|
+
auth-migrate:
|
|
4
|
+
image: ""
|
|
20
5
|
build:
|
|
21
6
|
context: ../../../docker/auth
|
|
22
7
|
dockerfile: Dockerfile
|
|
23
|
-
environment:
|
|
24
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=auth
|
|
25
|
-
- IDENTITY_SCHEMA_URL=http://rest-api:8080/api/v1/auth/identity-schema
|
|
26
8
|
volumes:
|
|
27
9
|
- type: bind
|
|
28
10
|
source: ../../../docker/auth
|
|
29
|
-
target: /etc/config/
|
|
30
|
-
command: migrate sql -e --yes
|
|
31
|
-
restart: on-failure
|
|
32
|
-
networks:
|
|
33
|
-
- app-network
|
|
34
|
-
depends_on:
|
|
35
|
-
- postgres
|
|
36
|
-
- rest-api
|
|
11
|
+
target: /etc/config/auth
|
|
37
12
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- kratos-migrate
|
|
13
|
+
auth:
|
|
14
|
+
image: ""
|
|
41
15
|
build:
|
|
42
16
|
context: ../../../docker/auth
|
|
43
17
|
dockerfile: Dockerfile
|
|
44
|
-
env_file:
|
|
45
|
-
- ${OMNIBASE_PROJECT_DIR}/omnibase/environments/.env.dev
|
|
46
|
-
ports:
|
|
47
|
-
- "4433:4433" # public
|
|
48
|
-
- "4434:4434" # admin
|
|
49
|
-
restart: unless-stopped
|
|
50
|
-
environment:
|
|
51
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=auth
|
|
52
|
-
- IDENTITY_SCHEMA_URL=http://rest-api:8080/api/v1/auth/identity-schema
|
|
53
|
-
|
|
54
|
-
# Required - will fail if not set
|
|
55
|
-
- WEBSITE_URL=${WEBSITE_URL}
|
|
56
|
-
- COOKIE_SECRET=${COOKIE_SECRET}
|
|
57
|
-
- CIPHER_SECRET=${CIPHER_SECRET}
|
|
58
|
-
- COOKIE_DOMAIN=${COOKIE_DOMAIN:-127.0.0.1}
|
|
59
|
-
|
|
60
|
-
# Optional with defaults
|
|
61
|
-
- LOG_LEVEL=${AUTH_LOG_LEVEL:-info}
|
|
62
|
-
- AUTH_URL=${AUTH_URL:-http://127.0.0.1:4433}
|
|
63
|
-
- AUTH_ADMIN_URL=${AUTH_ADMIN_URL:-http://kratos:4434}
|
|
64
|
-
|
|
65
|
-
- WEBSITE_AUTH_ERROR_URL=${WEBSITE_AUTH_ERROR_URL:-${WEBSITE_URL}/auth/error}
|
|
66
|
-
- WEBSITE_SETTING_URL=${WEBSITE_SETTING_URL:-${WEBSITE_URL}/auth/settings}
|
|
67
|
-
- WEBSITE_RECOVERY_URL=${WEBSITE_RECOVERY_URL:-${WEBSITE_URL}/auth/recovery}
|
|
68
|
-
- WEBSITE_VERIFICATION_RECOVERY_URL=${WEBSITE_VERIFICATION_RECOVERY_URL:-${WEBSITE_URL}/auth/verification}
|
|
69
|
-
- WEBSITE_LOGIN_URL=${WEBSITE_LOGIN_URL:-${WEBSITE_URL}/auth/login}
|
|
70
|
-
- WEBSITE_REGISTRATION_URL=${WEBSITE_REGISTRATION_URL:-${WEBSITE_URL}/auth/registration}
|
|
71
|
-
|
|
72
|
-
- SMTP_CONNECTION_URI=${SMTP_CONNECTION_URI:-smtp://mailpit:1025?disable_starttls=true}
|
|
73
18
|
volumes:
|
|
74
19
|
- type: bind
|
|
75
20
|
source: ../../../docker/auth
|
|
76
|
-
target: /etc/config/
|
|
77
|
-
command: serve --dev --watch-courier
|
|
78
|
-
networks:
|
|
79
|
-
- app-network
|
|
21
|
+
target: /etc/config/auth
|
|
80
22
|
|
|
81
|
-
mailpit:
|
|
82
|
-
image: axllent/mailpit:latest
|
|
83
|
-
container_name: mailpit
|
|
84
|
-
ports:
|
|
85
|
-
- "8025:8025" # Web UI
|
|
86
|
-
- "1025:1025" # SMTP server
|
|
87
|
-
environment:
|
|
88
|
-
MP_MAX_MESSAGES: 5000
|
|
89
|
-
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
|
90
|
-
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
|
91
|
-
networks:
|
|
92
|
-
- app-network
|
|
93
|
-
restart: unless-stopped
|
|
94
|
-
|
|
95
|
-
# MinIO - Object Storage
|
|
96
|
-
minio:
|
|
97
|
-
image: minio/minio:latest
|
|
98
|
-
container_name: minio
|
|
99
|
-
ports:
|
|
100
|
-
- "9000:9000"
|
|
101
|
-
- "9001:9001"
|
|
102
|
-
environment:
|
|
103
|
-
MINIO_ROOT_USER: minioadmin
|
|
104
|
-
MINIO_ROOT_PASSWORD: minioadmin123
|
|
105
|
-
MINIO_API_CORS_ALLOW_ORIGIN: "*"
|
|
106
|
-
volumes:
|
|
107
|
-
- minio_data:/data
|
|
108
|
-
command: server /data --console-address ":9001"
|
|
109
|
-
networks:
|
|
110
|
-
- app-network
|
|
111
|
-
restart: unless-stopped
|
|
112
|
-
# Create MinIO bucket on startup
|
|
113
|
-
minio-init:
|
|
114
|
-
image: minio/mc:latest
|
|
115
|
-
container_name: minio-init
|
|
116
|
-
depends_on:
|
|
117
|
-
- minio
|
|
118
|
-
entrypoint: >
|
|
119
|
-
/bin/sh -c "
|
|
120
|
-
until /usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin123; do
|
|
121
|
-
echo 'Waiting for MinIO to be ready...';
|
|
122
|
-
sleep 2;
|
|
123
|
-
done;
|
|
124
|
-
/usr/bin/mc mb myminio/dev --ignore-existing;
|
|
125
|
-
/usr/bin/mc mb myminio/permission-namespaces --ignore-existing;
|
|
126
|
-
echo 'MinIO buckets created successfully';
|
|
127
|
-
"
|
|
128
|
-
networks:
|
|
129
|
-
- app-network
|
|
130
|
-
|
|
131
|
-
# Adminer - Simple Database Management Interface
|
|
132
|
-
adminer:
|
|
133
|
-
image: adminer:latest
|
|
134
|
-
container_name: adminer
|
|
135
|
-
ports:
|
|
136
|
-
- "8081:8080"
|
|
137
|
-
depends_on:
|
|
138
|
-
- postgres
|
|
139
|
-
networks:
|
|
140
|
-
- app-network
|
|
141
|
-
restart: unless-stopped
|
|
142
|
-
|
|
143
|
-
# PostgREST - Auto-generated REST API from PostgreSQL schema
|
|
144
|
-
postgrest:
|
|
145
|
-
image: postgrest/postgrest:v12.2.0
|
|
146
|
-
container_name: postgrest
|
|
147
|
-
ports:
|
|
148
|
-
- "8001:3000"
|
|
149
|
-
environment:
|
|
150
|
-
PGRST_DB_URI: postgres://postgres:postgres@postgres:5432/db
|
|
151
|
-
PGRST_DB_SCHEMAS: public,auth,storage
|
|
152
|
-
PGRST_DB_ANON_ROLE: anon_user
|
|
153
|
-
PGRST_JWT_SECRET: ${JWT_SIGNING_KEY:-your-secret-jwt-signing-key-change-this-in-production}
|
|
154
|
-
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost:8001
|
|
155
|
-
depends_on:
|
|
156
|
-
- postgres
|
|
157
|
-
networks:
|
|
158
|
-
- app-network
|
|
159
|
-
restart: unless-stopped
|
|
160
|
-
|
|
161
|
-
# REST API Service
|
|
162
23
|
rest-api:
|
|
24
|
+
image: ""
|
|
163
25
|
build:
|
|
164
26
|
context: ../../../apps/api
|
|
165
|
-
dockerfile: Dockerfile
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- "8080:8080"
|
|
27
|
+
dockerfile: Dockerfile.dev
|
|
28
|
+
environment:
|
|
29
|
+
- ENABLE_PPROF=true
|
|
169
30
|
volumes:
|
|
170
31
|
- ../../../apps/api:/app
|
|
171
|
-
depends_on:
|
|
172
|
-
- postgres
|
|
173
|
-
networks:
|
|
174
|
-
- app-network
|
|
175
|
-
restart: unless-stopped
|
|
176
|
-
environment:
|
|
177
|
-
# Application
|
|
178
|
-
- PORT=8080
|
|
179
|
-
- KRATOS_URL=http://kratos:4433
|
|
180
|
-
- KRATOS_ADMIN_URL=http://kratos:4434
|
|
181
|
-
|
|
182
|
-
# Database
|
|
183
|
-
- DB_HOST=postgres
|
|
184
|
-
- DB_PORT=5432
|
|
185
|
-
- DB_USER=postgres
|
|
186
|
-
- DB_PASSWORD=postgres
|
|
187
|
-
- DB_NAME=db
|
|
188
|
-
|
|
189
|
-
# S3/MinIO Configuration
|
|
190
|
-
- S3_ENDPOINT=http://minio:9000
|
|
191
|
-
- S3_PUBLIC_ENDPOINT=http://127.0.0.1:9000
|
|
192
|
-
- S3_ACCESS_KEY=minioadmin
|
|
193
|
-
- S3_SECRET_KEY=minioadmin123
|
|
194
|
-
- S3_BUCKET_NAME=files
|
|
195
|
-
- S3_REGION=us-east-1
|
|
196
|
-
- S3_USE_SSL=false
|
|
197
|
-
- S3_FORCE_PATH_STYLE=true
|
|
198
|
-
- S3_BUCKET_NAME=dev
|
|
199
|
-
|
|
200
|
-
# Email Configuration
|
|
201
|
-
- SMTP_CONNECTION_URI=smtp://mailpit:1025
|
|
202
|
-
- SMTP_FROM_EMAIL=noreply@yourapp.com
|
|
203
|
-
- FRONTEND_URL=http://localhost:3000
|
|
204
|
-
|
|
205
|
-
# JWT Configuration
|
|
206
|
-
- JWT_SIGNING_KEY=${JWT_SIGNING_KEY:-your-secret-jwt-signing-key-change-this-in-production}
|
|
207
|
-
|
|
208
|
-
# Keto Configuration
|
|
209
|
-
- KETO_READ_URL=http://keto:4466
|
|
210
|
-
- KETO_WRITE_URL=http://keto:4467
|
|
211
|
-
|
|
212
|
-
# PostgREST Configuration
|
|
213
|
-
- POSTGREST_URL=http://postgrest:3000
|
|
214
|
-
|
|
215
|
-
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
|
|
216
|
-
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY}
|
|
217
|
-
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
|
|
218
32
|
|
|
219
|
-
|
|
33
|
+
permissions-migrate:
|
|
34
|
+
image: ""
|
|
220
35
|
build:
|
|
221
36
|
context: ../../../docker/permissions
|
|
222
37
|
dockerfile: Dockerfile
|
|
223
|
-
environment:
|
|
224
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=keto
|
|
225
|
-
command: migrate up -c /etc/config/keto/keto.yml --yes
|
|
226
|
-
restart: on-failure
|
|
227
|
-
networks:
|
|
228
|
-
- app-network
|
|
229
|
-
depends_on:
|
|
230
|
-
- postgres
|
|
231
|
-
- rest-api
|
|
232
38
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- keto-migrate
|
|
39
|
+
permissions:
|
|
40
|
+
image: ""
|
|
236
41
|
build:
|
|
237
42
|
context: ../../../docker/permissions
|
|
238
43
|
dockerfile: Dockerfile
|
|
239
|
-
ports:
|
|
240
|
-
- "4466:4466" # read API
|
|
241
|
-
- "4467:4467" # write API
|
|
242
|
-
restart: unless-stopped
|
|
243
|
-
environment:
|
|
244
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=keto
|
|
245
|
-
- LOG_LEVEL=debug
|
|
246
|
-
- NAMESPACE_BUCKET=permission-namespaces
|
|
247
|
-
- TENANT_ID=local
|
|
248
|
-
- R2_ENDPOINT=http://minio:9000
|
|
249
|
-
- R2_ACCESS_KEY=minioadmin
|
|
250
|
-
- R2_SECRET_KEY=minioadmin123
|
|
251
|
-
command: serve -c /etc/config/keto/keto.yml
|
|
252
|
-
networks:
|
|
253
|
-
- app-network
|
|
254
|
-
|
|
255
|
-
postgres-type-gen:
|
|
256
|
-
image: supabase/postgres-meta:canary-pr-971
|
|
257
|
-
ports:
|
|
258
|
-
- 8079:8080
|
|
259
|
-
environment:
|
|
260
|
-
- PG_META_DB_HOST=postgres
|
|
261
|
-
- PG_META_DB_NAME=db
|
|
262
|
-
- PG_META_DB_USER=postgres
|
|
263
|
-
- PG_META_DB_PASSWORD=postgres
|
|
264
|
-
- PG_META_DB_PORT=5432
|
|
265
|
-
depends_on:
|
|
266
|
-
- postgres
|
|
267
|
-
networks:
|
|
268
|
-
- app-network
|
|
269
|
-
# Edge Functions (Hono)
|
|
270
|
-
edge:
|
|
271
|
-
image: oven/bun:1
|
|
272
|
-
container_name: edge
|
|
273
|
-
working_dir: /app
|
|
274
|
-
command: ["sh", "-c", "bun install && bun run --watch dev.ts"]
|
|
275
|
-
ports:
|
|
276
|
-
- "8787:8787"
|
|
277
|
-
volumes:
|
|
278
|
-
- ${OMNIBASE_PROJECT_DIR}/omnibase/edge:/app
|
|
279
|
-
env_file:
|
|
280
|
-
- ${OMNIBASE_PROJECT_DIR}/omnibase/environments/.env.dev
|
|
281
|
-
environment:
|
|
282
|
-
- PORT=8787
|
|
283
|
-
- NODE_ENV=development
|
|
284
|
-
networks:
|
|
285
|
-
- app-network
|
|
286
|
-
restart: unless-stopped
|
|
287
|
-
depends_on:
|
|
288
|
-
- rest-api
|
|
289
|
-
|
|
290
|
-
volumes:
|
|
291
|
-
postgres_data:
|
|
292
|
-
driver: local
|
|
293
|
-
minio_data:
|
|
294
|
-
driver: local
|
|
295
|
-
|
|
296
|
-
networks:
|
|
297
|
-
app-network:
|
|
298
|
-
driver: bridge
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Local development overrides - persistent data volumes
|
|
2
|
+
services:
|
|
3
|
+
postgres:
|
|
4
|
+
volumes:
|
|
5
|
+
- postgres_data:/var/lib/postgresql/data
|
|
6
|
+
|
|
7
|
+
minio:
|
|
8
|
+
volumes:
|
|
9
|
+
- minio_data:/data
|
|
10
|
+
|
|
11
|
+
volumes:
|
|
12
|
+
postgres_data:
|
|
13
|
+
driver: local
|
|
14
|
+
minio_data:
|
|
15
|
+
driver: local
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Performance test overrides - uses stripe-mock for load testing without rate limits
|
|
2
|
+
services:
|
|
3
|
+
auth-migrate:
|
|
4
|
+
image: ""
|
|
5
|
+
build:
|
|
6
|
+
context: ../../../docker/auth
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
volumes:
|
|
9
|
+
- type: bind
|
|
10
|
+
source: ../../../docker/auth
|
|
11
|
+
target: /etc/config/auth
|
|
12
|
+
|
|
13
|
+
auth:
|
|
14
|
+
image: ""
|
|
15
|
+
build:
|
|
16
|
+
context: ../../../docker/auth
|
|
17
|
+
dockerfile: Dockerfile
|
|
18
|
+
volumes:
|
|
19
|
+
- type: bind
|
|
20
|
+
source: ../../../docker/auth
|
|
21
|
+
target: /etc/config/auth
|
|
22
|
+
|
|
23
|
+
rest-api:
|
|
24
|
+
image: ""
|
|
25
|
+
build:
|
|
26
|
+
context: ../../../apps/api
|
|
27
|
+
dockerfile: Dockerfile
|
|
28
|
+
volumes:
|
|
29
|
+
- ../../../apps/api:/app
|
|
30
|
+
environment:
|
|
31
|
+
- STRIPE_API_URL=http://stripe-mock:12111
|
|
32
|
+
- ENABLE_PPROF=true
|
|
33
|
+
depends_on:
|
|
34
|
+
- stripe-mock
|
|
35
|
+
deploy:
|
|
36
|
+
resources:
|
|
37
|
+
limits:
|
|
38
|
+
memory: 512M
|
|
39
|
+
cpus: "0.25"
|
|
40
|
+
|
|
41
|
+
stripe-mock:
|
|
42
|
+
image: stripe/stripe-mock:latest
|
|
43
|
+
ports:
|
|
44
|
+
- "12111:12111"
|
|
45
|
+
networks:
|
|
46
|
+
- app-network
|
|
47
|
+
|
|
48
|
+
permissions-migrate:
|
|
49
|
+
image: ""
|
|
50
|
+
build:
|
|
51
|
+
context: ../../../docker/permissions
|
|
52
|
+
dockerfile: Dockerfile
|
|
53
|
+
|
|
54
|
+
permissions:
|
|
55
|
+
image: ""
|
|
56
|
+
build:
|
|
57
|
+
context: ../../../docker/permissions
|
|
58
|
+
dockerfile: Dockerfile
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Test overrides - local builds without hot-reload (runs Go binary directly)
|
|
2
|
+
services:
|
|
3
|
+
auth-migrate:
|
|
4
|
+
image: ""
|
|
5
|
+
build:
|
|
6
|
+
context: ../../../docker/auth
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
volumes:
|
|
9
|
+
- type: bind
|
|
10
|
+
source: ../../../docker/auth
|
|
11
|
+
target: /etc/config/auth
|
|
12
|
+
|
|
13
|
+
auth:
|
|
14
|
+
image: ""
|
|
15
|
+
build:
|
|
16
|
+
context: ../../../docker/auth
|
|
17
|
+
dockerfile: Dockerfile
|
|
18
|
+
volumes:
|
|
19
|
+
- type: bind
|
|
20
|
+
source: ../../../docker/auth
|
|
21
|
+
target: /etc/config/auth
|
|
22
|
+
|
|
23
|
+
rest-api:
|
|
24
|
+
image: ""
|
|
25
|
+
build:
|
|
26
|
+
context: ../../../apps/api
|
|
27
|
+
dockerfile: Dockerfile.test
|
|
28
|
+
environment:
|
|
29
|
+
- ENABLE_PPROF=true
|
|
30
|
+
volumes:
|
|
31
|
+
- ../../../apps/api:/app
|
|
32
|
+
|
|
33
|
+
permissions-migrate:
|
|
34
|
+
image: ""
|
|
35
|
+
build:
|
|
36
|
+
context: ../../../docker/permissions
|
|
37
|
+
dockerfile: Dockerfile
|
|
38
|
+
|
|
39
|
+
permissions:
|
|
40
|
+
image: ""
|
|
41
|
+
build:
|
|
42
|
+
context: ../../../docker/permissions
|
|
43
|
+
dockerfile: Dockerfile
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[databases]
|
|
2
|
+
* = host=postgres port=5432
|
|
3
|
+
|
|
4
|
+
[pgbouncer]
|
|
5
|
+
listen_addr = 0.0.0.0
|
|
6
|
+
listen_port = 6432
|
|
7
|
+
auth_type = scram-sha-256
|
|
8
|
+
|
|
9
|
+
; auth_file is auto-generated by edoburu/pgbouncer from DATABASE_URL
|
|
10
|
+
auth_file = /etc/pgbouncer/userlist.txt
|
|
11
|
+
|
|
12
|
+
; Use auth_query for dynamic user authentication from PostgreSQL
|
|
13
|
+
; auth_user connects to PostgreSQL to run auth_query
|
|
14
|
+
auth_user = postgres
|
|
15
|
+
auth_query = SELECT usename, passwd FROM pg_shadow WHERE usename=$1
|
|
16
|
+
|
|
17
|
+
; Pool settings - transaction mode for high concurrency
|
|
18
|
+
; NOTE: These are generous for stress testing. Tune down for production multi-tenant.
|
|
19
|
+
pool_mode = transaction
|
|
20
|
+
max_client_conn = 2000
|
|
21
|
+
default_pool_size = 100
|
|
22
|
+
min_pool_size = 20
|
|
23
|
+
reserve_pool_size = 20
|
|
24
|
+
reserve_pool_timeout = 3
|
|
25
|
+
|
|
26
|
+
; Enable prepared statement tracking (PgBouncer 1.21+)
|
|
27
|
+
; This allows transaction pooling to work with prepared statements
|
|
28
|
+
max_prepared_statements = 100
|
|
29
|
+
|
|
30
|
+
; Connection limits - generous for stress testing
|
|
31
|
+
max_db_connections = 200
|
|
32
|
+
max_user_connections = 200
|
|
33
|
+
|
|
34
|
+
; Timeouts
|
|
35
|
+
server_idle_timeout = 600
|
|
36
|
+
server_lifetime = 3600
|
|
37
|
+
server_connect_timeout = 15
|
|
38
|
+
query_timeout = 0
|
|
39
|
+
query_wait_timeout = 120
|
|
40
|
+
|
|
41
|
+
; Startup parameters to ignore (search_path is handled by user defaults)
|
|
42
|
+
ignore_startup_parameters = extra_float_digits
|
|
43
|
+
|
|
44
|
+
; Logging
|
|
45
|
+
log_connections = 0
|
|
46
|
+
log_disconnections = 0
|
|
47
|
+
log_pooler_errors = 1
|
|
48
|
+
|
|
49
|
+
; Admin access
|
|
50
|
+
admin_users = postgres
|
|
51
|
+
stats_users = postgres
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnibase/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "OmniBase CLI - Manage Docker Compose services and environment configuration",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/PhoenixSolutionsGroup/omnibase"
|
|
8
|
+
},
|
|
5
9
|
"main": "dist/index.js",
|
|
6
10
|
"bin": {
|
|
7
11
|
"omnibase": "./dist/index.js"
|
|
@@ -26,16 +30,22 @@
|
|
|
26
30
|
"author": "Phoenix Solutions Group",
|
|
27
31
|
"license": "MIT",
|
|
28
32
|
"dependencies": {
|
|
33
|
+
"@inquirer/prompts": "^8.1.0",
|
|
34
|
+
"@omnibase/core-js": "0.14.0",
|
|
35
|
+
"@ory/client": "^1.14.3",
|
|
36
|
+
"adm-zip": "^0.5.16",
|
|
37
|
+
"axios": "^1.6.0",
|
|
38
|
+
"chalk": "^5.6.2",
|
|
29
39
|
"commander": "^11.1.0",
|
|
30
40
|
"dotenv": "^16.3.1",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
41
|
+
"form-data": "^4.0.0",
|
|
42
|
+
"jszip": "^3.10.1",
|
|
43
|
+
"ora": "^9.0.0"
|
|
34
44
|
},
|
|
35
45
|
"devDependencies": {
|
|
46
|
+
"@types/bun": "latest",
|
|
36
47
|
"@types/node": "^20.10.0",
|
|
37
48
|
"ts-node": "^10.9.2",
|
|
38
|
-
"typescript": "^5.3.3"
|
|
39
|
-
"@types/bun": "latest"
|
|
49
|
+
"typescript": "^5.3.3"
|
|
40
50
|
}
|
|
41
51
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Database Migrations
|
|
2
|
+
|
|
3
|
+
This directory contains SQL migration files that can be applied to your OmniBase database.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Create a New Migration
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Interactive mode (prompts for name)
|
|
11
|
+
omnibase db migrate new
|
|
12
|
+
|
|
13
|
+
# Or provide name directly
|
|
14
|
+
omnibase db migrate new --name create_users_table
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This creates a timestamped migration file like `1729507200_create_users_table.sql`.
|
|
18
|
+
|
|
19
|
+
### 2. Edit the Migration File
|
|
20
|
+
|
|
21
|
+
Add your SQL commands to the generated file.
|
|
22
|
+
|
|
23
|
+
### 3. Apply Migrations
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Apply to default environment
|
|
27
|
+
omnibase db migrate apply
|
|
28
|
+
|
|
29
|
+
# Apply to specific environment
|
|
30
|
+
omnibase db migrate apply --env production
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## File Naming Convention
|
|
34
|
+
|
|
35
|
+
Migration files are automatically named with timestamps when using `omnibase db migrate new`:
|
|
36
|
+
- `{TIMESTAMP}_{description}.sql` (e.g., `1729507200_create_users_table.sql`)
|
|
37
|
+
|
|
38
|
+
For manual creation, you can use simple numeric prefixes:
|
|
39
|
+
- `001-seed.sql`
|
|
40
|
+
- `002-rls.sql`
|
|
41
|
+
- `003-feature.sql`
|
|
42
|
+
|
|
43
|
+
All files will be automatically converted to golang-migrate format (`001_seed.up.sql`, etc.) when uploaded.
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
### Create Migration
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Interactive mode
|
|
51
|
+
omnibase db migrate new
|
|
52
|
+
|
|
53
|
+
# With name flag
|
|
54
|
+
omnibase db migrate new --name add_user_indexes
|
|
55
|
+
|
|
56
|
+
# Custom directory
|
|
57
|
+
omnibase db migrate new --dir custom/migrations --name init_schema
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Apply Migrations
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Default directory (omnibase/db/)
|
|
64
|
+
omnibase db migrate push
|
|
65
|
+
|
|
66
|
+
# Specific environment
|
|
67
|
+
omnibase db migrate push --env prod
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
- The `OMNIBASE_API_KEY` must be set in your environment configuration (`.env.{environment}` file)
|
|
73
|
+
- The API server must be running and accessible
|
|
74
|
+
- Migration files must have a `.sql` extension
|
|
75
|
+
|
|
76
|
+
## Example Migration File
|
|
77
|
+
|
|
78
|
+
When you run `omnibase db migrate new`, a file is created with this template:
|
|
79
|
+
|
|
80
|
+
**1729507200_create_users.sql:**
|
|
81
|
+
```sql
|
|
82
|
+
-- Migration: create users
|
|
83
|
+
-- Created: 2024-10-21T10:00:00.000Z
|
|
84
|
+
|
|
85
|
+
-- Add your SQL migration here
|
|
86
|
+
-- Example:
|
|
87
|
+
-- CREATE TABLE IF NOT EXISTS users (
|
|
88
|
+
-- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
89
|
+
-- email TEXT NOT NULL UNIQUE,
|
|
90
|
+
-- created_at TIMESTAMP DEFAULT NOW()
|
|
91
|
+
-- );
|
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
# API Configuration
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# OmniBase API Configuration
|
|
2
|
+
OMNIBASE_API_URL=https://api.omnibase.io
|
|
3
|
+
OMNIBASE_SERVICE_KEY=your-service-key-here
|
|
4
|
+
OMNIBASE_PROJECT_ID=SOME-UUID
|
|
5
|
+
|
|
6
|
+
# Managed Hosting API (for cloud operations like worker deployment)
|
|
7
|
+
MANAGED_HOSTING_API_URL=https://api.omnibase.io
|
|
4
8
|
|
|
5
9
|
# Required: Auth Configuration
|
|
6
|
-
WEBSITE_URL=
|
|
10
|
+
WEBSITE_URL=https://your-app.com
|
|
7
11
|
COOKIE_SECRET=PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
|
|
8
12
|
CIPHER_SECRET=32-LONG-SECRET-NOT-SECURE-AT-ALL
|
|
9
|
-
|
|
10
|
-
# Stripe Configuration (update with your keys)
|
|
11
|
-
STRIPE_SECRET_KEY=stripe-secret-key
|
|
12
|
-
STRIPE_PUBLISHABLE_KEY=stripe-publishable-key
|
|
13
|
-
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
|
|
14
|
-
|
|
15
|
-
# Optional: Uncomment and customize as needed
|
|
16
|
-
# Auth URLs (defaults shown)
|
|
17
|
-
# AUTH_LOG_LEVEL=info
|
|
18
|
-
# AUTH_URL=http://127.0.0.1:4433
|
|
19
|
-
# AUTH_ADMIN_URL=http://kratos:4434
|
|
20
|
-
|
|
21
|
-
# Website Auth Flow URLs (all default to ${WEBSITE_URL}/auth/<flow>)
|
|
22
|
-
# WEBSITE_AUTH_ERROR_URL=http://127.0.0.1:3000/auth/error
|
|
23
|
-
# WEBSITE_SETTING_URL=http://127.0.0.1:3000/auth/settings
|
|
24
|
-
# WEBSITE_RECOVERY_URL=http://127.0.0.1:3000/auth/recovery
|
|
25
|
-
# WEBSITE_VERIFICATION_RECOVERY_URL=http://127.0.0.1:3000/auth/verification
|
|
26
|
-
# WEBSITE_LOGIN_URL=http://127.0.0.1:3000/auth/login
|
|
27
|
-
# WEBSITE_REGISTRATION_URL=http://127.0.0.1:3000/auth/registration
|
|
28
|
-
|
|
29
|
-
# SMTP Configuration
|
|
30
|
-
# SMTP_CONNECTION_URI=smtps://test:test@mailslurper:1025/?skip_ssl_verify=true
|
|
31
|
-
|
|
32
|
-
# OIDC Provider Configuration
|
|
33
|
-
# OIDC_GOOGLE_ENABLED=false
|
|
34
|
-
# GOOGLE_CLIENT_ID=
|
|
35
|
-
# GOOGLE_CLIENT_SECRET=
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# OmniBase API Configuration
|
|
2
|
+
OMNIBASE_API_URL=http://localhost:8080
|
|
3
|
+
OMNIBASE_SERVICE_KEY=VERY_SECRET_KEY
|
|
4
|
+
|
|
5
|
+
# Required: Auth Configuration
|
|
6
|
+
WEBSITE_URL=http://127.0.0.1:3000
|
|
7
|
+
COOKIE_SECRET=PLEASE-CHANGE-ME-I-AM-VERY-INSECURE
|
|
8
|
+
CIPHER_SECRET=32-LONG-SECRET-NOT-SECURE-AT-ALL
|
|
9
|
+
|
|
10
|
+
# Stripe Configuration (update with your keys)
|
|
11
|
+
STRIPE_SECRET_KEY=stripe-secret-key
|
|
12
|
+
STRIPE_PUBLISHABLE_KEY=stripe-publishable-key
|
|
13
|
+
|
|
14
|
+
# Optional: Uncomment and customize as needed
|
|
15
|
+
# Auth URLs (defaults shown)
|
|
16
|
+
# AUTH_LOG_LEVEL=info
|
|
17
|
+
# AUTH_URL=http://127.0.0.1:4433
|
|
18
|
+
# AUTH_ADMIN_URL=http://kratos:4434
|
|
19
|
+
|
|
20
|
+
# Website Auth Flow URLs (all default to ${WEBSITE_URL}/auth/<flow>)
|
|
21
|
+
# WEBSITE_AUTH_ERROR_URL=http://127.0.0.1:3000/auth/error
|
|
22
|
+
# WEBSITE_SETTING_URL=http://127.0.0.1:3000/auth/settings
|
|
23
|
+
# WEBSITE_RECOVERY_URL=http://127.0.0.1:3000/auth/recovery
|
|
24
|
+
# WEBSITE_VERIFICATION_RECOVERY_URL=http://127.0.0.1:3000/auth/verification
|
|
25
|
+
# WEBSITE_LOGIN_URL=http://127.0.0.1:3000/auth/login
|
|
26
|
+
# WEBSITE_REGISTRATION_URL=http://127.0.0.1:3000/auth/registration
|
|
27
|
+
|
|
28
|
+
# SMTP Configuration
|
|
29
|
+
# SMTP_CONNECTION_URI=smtps://test:test@mailslurper:1025/?skip_ssl_verify=true
|
|
30
|
+
|
|
31
|
+
# OIDC Provider Configuration
|
|
32
|
+
# OIDC_GOOGLE_ENABLED=false
|
|
33
|
+
# GOOGLE_CLIENT_ID=
|
|
34
|
+
# GOOGLE_CLIENT_SECRET=
|