@ductape/cli 0.5.0 → 0.5.3

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.
@@ -1,38 +1,44 @@
1
- # Ductape platform — Docker Hub release compose
2
- # Written by `ductape install` to ~/.ductape/platform/docker-compose.yml
3
- # Run `ductape start` to bring the stack up.
1
+ # Ductape platform: the published images, run on your machine.
2
+ # Written by `ductape install` to ~/.ductape/platform/docker-compose.yml. Do not edit: `ductape install` replaces it. Put your settings in .env next to it.
3
+ # Generated from platform/docker-compose.yml by platform/scripts/render-release.mjs.
4
+ # Run `ductape start` to bring the stack up. Pin a release with DUCTAPE_TAG (default: latest) in .env.
4
5
 
5
6
  name: ductape-platform
6
7
 
7
- x-api-image: &api-image
8
- image: ductape/platform-api:latest
8
+ x-backend: &backend
9
9
  restart: unless-stopped
10
+ env_file:
11
+ - path: .env
12
+ required: false
10
13
  depends_on:
11
14
  mongo:
12
15
  condition: service_healthy
13
- kafka:
14
- condition: service_started
15
16
  networks:
16
17
  - platform
17
18
 
18
- x-api-env: &api-env
19
- NODE_ENV: production
20
- DB_HOST: mongodb://mongo:27017/ductape
21
- KAFKA_BROKERS: kafka:29092
22
- KAFKA_TOPIC_PREFIX: ductape
23
- USE_KAFKA: "true"
24
- KAFKA_RPC_TIMEOUT_MS: "15000"
19
+ x-backend-env: &backend-env
20
+ NODE_ENV: ${NODE_ENV:-development}
21
+ # "self" marks a self-hosted install: licence checks and read-only mode apply.
22
+ APP_ENV: ${APP_ENV:-self}
23
+ DB_HOST: ${DB_HOST:-mongodb://mongo:27017/ductape}
24
+ ENC_KEY: ${ENC_KEY:?Set ENC_KEY in platform/.env (any long random string, the same for every service)}
25
+ ENV_STRICT: ${ENV_STRICT:-false}
25
26
  EMAIL_SERVICE: http://emails:8003
26
27
  USER_SERVICE: http://users:8002
27
28
  WORKSPACE_SERVICE: http://workspaces:8001
29
+ DEVELOPER_SERVICE: http://workspaces:8001
30
+ APP_SERVICE: http://apps:8004
28
31
  PRICING_SERVICE: http://pricing:8011
29
32
  NOTIFICATION_SERVICE: http://notifications:8013
30
33
  ADMIN_SERVICE: http://admins:8018
31
- APPS_SERVICE: http://apps:8004
32
- DEFAULT_ADMIN_ROLE_ID: ${DEFAULT_ADMIN_ROLE_ID:-}
33
- CORS_ORIGINS: http://localhost:4310,http://127.0.0.1:4310,http://localhost:4320,http://127.0.0.1:4320,http://localhost:3000,http://localhost
34
- AWS_ACCOUNT_ID: ${AWS_ACCOUNT_ID:-480358138685}
35
- AWS_DUCTAPE_ACCOUNT_ID: ${AWS_DUCTAPE_ACCOUNT_ID:-${AWS_ACCOUNT_ID:-480358138685}}
34
+ JOB_SERVICE: http://jobs:8015
35
+ # Services that use the Ductape SDK (healthcheck probes, integrations, proxy, jobs) call the platform API
36
+ # through the gateway. Without this the SDK defaults to https://api.ductape.app, the hosted cloud.
37
+ DUCTAPE_API_BASE_URL: http://api-gateway:8000
38
+ # The address of this install's gateway as seen from outside (see .env.example). Webhook URLs and file links use it.
39
+ DUCTAPE_PUBLIC_URL: ${DUCTAPE_PUBLIC_URL:-http://localhost:4311}
40
+ DUCTAPE_SIGNIN_URL: ${DUCTAPE_SIGNIN_URL:-http://localhost:4310/login}
41
+ DUCTAPE_SIGNUP_URL: ${DUCTAPE_SIGNUP_URL:-http://localhost:4310/signup}
36
42
 
37
43
  services:
38
44
  mongo:
@@ -50,32 +56,16 @@ services:
50
56
  networks:
51
57
  - platform
52
58
 
53
- zookeeper:
54
- image: confluentinc/cp-zookeeper:7.6.1
55
- environment:
56
- ZOOKEEPER_CLIENT_PORT: 2181
57
- ZOOKEEPER_TICK_TIME: 2000
58
- ports:
59
- - "2181:2181"
60
- networks:
61
- - platform
62
-
63
- kafka:
64
- image: confluentinc/cp-kafka:7.6.1
65
- depends_on:
66
- - zookeeper
67
- ports:
68
- - "9092:9092"
69
- environment:
70
- KAFKA_BROKER_ID: 1
71
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
72
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
73
- KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
74
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
75
- KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
76
- KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
77
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
78
- KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
59
+ redis:
60
+ image: redis:7-alpine
61
+ restart: unless-stopped
62
+ volumes:
63
+ - redis_data:/data
64
+ healthcheck:
65
+ test: ["CMD", "redis-cli", "ping"]
66
+ interval: 5s
67
+ timeout: 5s
68
+ retries: 10
79
69
  networks:
80
70
  - platform
81
71
 
@@ -95,163 +85,190 @@ services:
95
85
  - platform
96
86
 
97
87
  users:
98
- <<: *api-image
88
+ <<: *backend
89
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-users:${DUCTAPE_TAG:-latest}
99
90
  environment:
100
- <<: *api-env
101
- NEST_APP: users
91
+ <<: *backend-env
92
+ MODULE: users
102
93
  PORT: "8002"
103
94
  ports:
104
95
  - "8002:8002"
105
96
 
106
97
  workspaces:
107
- <<: *api-image
98
+ <<: *backend
99
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-workspaces:${DUCTAPE_TAG:-latest}
108
100
  environment:
109
- <<: *api-env
110
- NEST_APP: workspaces
101
+ <<: *backend-env
102
+ MODULE: workspaces
111
103
  PORT: "8001"
104
+ GCS_PUBLIC_BUCKET: ${GCS_PUBLIC_BUCKET:-}
105
+ GCS_PRIVATE_BUCKET: ${GCS_PRIVATE_BUCKET:-}
106
+ GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS:-}
107
+ AWS_ACCESS_KEY: ${AWS_ACCESS_KEY:-}
108
+ AWS_SECRET_KEY: ${AWS_SECRET_KEY:-}
109
+ # Uploaded files (logos, attachments) are kept on this install's disk unless UPLOAD_DRIVER=gcs.
110
+ UPLOAD_DIR: /data/uploads
111
+ volumes:
112
+ - uploads_data:/data/uploads
112
113
  ports:
113
114
  - "8001:8001"
114
115
 
115
116
  emails:
116
- <<: *api-image
117
+ <<: *backend
118
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-emails:${DUCTAPE_TAG:-latest}
117
119
  environment:
118
- <<: *api-env
119
- NEST_APP: emails
120
+ <<: *backend-env
121
+ MODULE: emails
120
122
  PORT: "8003"
121
123
  ports:
122
124
  - "8003:8003"
123
125
 
124
126
  apps:
125
- <<: *api-image
127
+ <<: *backend
128
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-apps:${DUCTAPE_TAG:-latest}
126
129
  environment:
127
- <<: *api-env
128
- NEST_APP: apps
130
+ <<: *backend-env
131
+ MODULE: apps
129
132
  PORT: "8004"
130
133
  ports:
131
134
  - "8004:8004"
132
135
 
133
136
  integrations:
134
- <<: *api-image
135
- env_file:
136
- - .env
137
+ <<: *backend
138
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-integrations:${DUCTAPE_TAG:-latest}
137
139
  environment:
138
- <<: *api-env
139
- NEST_APP: integrations
140
+ <<: *backend-env
141
+ MODULE: integrations
140
142
  PORT: "8009"
141
143
  AWS_REGION: ${AWS_REGION:-us-east-1}
144
+ AWS_ACCOUNT_ID: ${AWS_ACCOUNT_ID:-480358138685}
145
+ AWS_DUCTAPE_ACCOUNT_ID: ${AWS_DUCTAPE_ACCOUNT_ID:-${AWS_ACCOUNT_ID:-480358138685}}
142
146
  AWS_SDK_LOAD_CONFIG: ${AWS_SDK_LOAD_CONFIG:-1}
143
147
  AWS_PROFILE: ${AWS_PROFILE:-}
148
+ # For AssumeRole during cloud connection validate (or use the ~/.aws mount below).
144
149
  AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
145
150
  AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
146
151
  AWS_SESSION_TOKEN: ${AWS_SESSION_TOKEN:-}
147
152
  volumes:
153
+ # Use local AWS CLI credentials when keys are not in platform/.env
148
154
  - ${HOME}/.aws:/root/.aws:ro
149
155
  ports:
150
156
  - "8009:8009"
151
157
 
152
158
  pricing:
153
- <<: *api-image
159
+ <<: *backend
160
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-pricing:${DUCTAPE_TAG:-latest}
154
161
  environment:
155
- <<: *api-env
156
- NEST_APP: pricing
162
+ <<: *backend-env
163
+ MODULE: pricing
157
164
  PORT: "8011"
158
165
  ports:
159
166
  - "8011:8011"
160
167
 
161
168
  logs:
162
- <<: *api-image
169
+ <<: *backend
170
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-logs:${DUCTAPE_TAG:-latest}
163
171
  environment:
164
- <<: *api-env
165
- NEST_APP: logs
172
+ <<: *backend-env
173
+ MODULE: logs
166
174
  PORT: "8008"
167
175
  ports:
168
176
  - "8008:8008"
169
177
 
170
178
  proxy:
171
- <<: *api-image
179
+ <<: *backend
180
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-proxy:${DUCTAPE_TAG:-latest}
172
181
  environment:
173
- <<: *api-env
174
- NEST_APP: proxy
182
+ <<: *backend-env
183
+ MODULE: proxy
175
184
  PORT: "8020"
176
- DUCTAPE_API_BASE_URL: http://api-gateway:8000
177
185
  ports:
178
186
  - "8020:8020"
179
187
 
180
188
  admins:
181
- <<: *api-image
189
+ <<: *backend
190
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-admins:${DUCTAPE_TAG:-latest}
182
191
  environment:
183
- <<: *api-env
184
- NEST_APP: admins
192
+ <<: *backend-env
193
+ MODULE: admins
185
194
  PORT: "8018"
186
195
  ports:
187
196
  - "8018:8018"
188
197
 
189
198
  notifications:
190
- <<: *api-image
199
+ <<: *backend
200
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-notifications:${DUCTAPE_TAG:-latest}
191
201
  environment:
192
- <<: *api-env
193
- NEST_APP: notifications
202
+ <<: *backend-env
203
+ MODULE: notifications
194
204
  PORT: "8013"
195
205
  ports:
196
206
  - "8013:8013"
197
207
 
198
208
  webhooks:
199
- <<: *api-image
209
+ <<: *backend
210
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-webhooks:${DUCTAPE_TAG:-latest}
200
211
  environment:
201
- <<: *api-env
202
- NEST_APP: webhooks
212
+ <<: *backend-env
213
+ MODULE: webhooks
203
214
  PORT: "8012"
215
+ # Webhook URLs handed to providers are BASE_URL + /webhooks/v1/process/<id>. They must be the address of THIS install.
216
+ BASE_URL: ${WEBHOOKS_BASE_URL:-${DUCTAPE_PUBLIC_URL:-http://localhost:4311}}
204
217
  ports:
205
218
  - "8012:8012"
206
219
 
207
220
  jobs:
208
- <<: *api-image
221
+ <<: *backend
222
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-jobs:${DUCTAPE_TAG:-latest}
223
+ depends_on:
224
+ mongo:
225
+ condition: service_healthy
226
+ redis:
227
+ condition: service_healthy
209
228
  environment:
210
- <<: *api-env
211
- NEST_APP: jobs
229
+ <<: *backend-env
230
+ MODULE: jobs
212
231
  PORT: "8015"
232
+ REDIS_HOST: redis://redis:6379
213
233
  ports:
214
234
  - "8015:8015"
215
235
 
216
236
  marketplace:
217
- <<: *api-image
237
+ <<: *backend
238
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-marketplace:${DUCTAPE_TAG:-latest}
218
239
  environment:
219
- <<: *api-env
220
- NEST_APP: marketplace
240
+ <<: *backend-env
241
+ MODULE: marketplace
221
242
  PORT: "8007"
222
243
  ports:
223
244
  - "8007:8007"
224
245
 
225
246
  partnerships:
226
- <<: *api-image
247
+ <<: *backend
248
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-partnerships:${DUCTAPE_TAG:-latest}
227
249
  environment:
228
- <<: *api-env
229
- NEST_APP: partnerships
250
+ <<: *backend-env
251
+ MODULE: partnerships
230
252
  PORT: "8014"
231
253
  ports:
232
254
  - "8014:8014"
233
255
 
234
256
  tickets:
235
- <<: *api-image
257
+ <<: *backend
258
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-tickets:${DUCTAPE_TAG:-latest}
236
259
  environment:
237
- <<: *api-env
238
- NEST_APP: tickets
260
+ <<: *backend-env
261
+ MODULE: tickets
239
262
  PORT: "9002"
240
263
  ports:
241
264
  - "9002:9002"
242
265
 
243
- realtime:
244
- <<: *api-image
245
- environment:
246
- <<: *api-env
247
- NEST_APP: realtime
248
- PORT: "3030"
249
- ports:
250
- - "3030:3030"
251
-
252
266
  workbench:
253
- image: ductape/platform-workbench:latest
267
+ image: ${DUCTAPE_IMAGE_ORG:-ductape}/platform-workbench:${DUCTAPE_TAG:-latest}
254
268
  restart: unless-stopped
269
+ environment:
270
+ # Read when the container starts (see workbench/docker/40-runtime-config.sh), so the published image works on any domain.
271
+ DUCTAPE_PUBLIC_URL: ${DUCTAPE_PUBLIC_URL:-http://localhost:4311}
255
272
  ports:
256
273
  - "4310:80"
257
274
  networks:
@@ -263,3 +280,5 @@ networks:
263
280
 
264
281
  volumes:
265
282
  mongo_data:
283
+ redis_data:
284
+ uploads_data:
@@ -0,0 +1,58 @@
1
+ # Workbench only: the Workbench, pointed at another API. Used by `ductape start --remote`.
2
+ name: ductape-platform
3
+
4
+ services:
5
+ mongo:
6
+ profiles:
7
+ - never
8
+ redis:
9
+ profiles:
10
+ - never
11
+ api-gateway:
12
+ profiles:
13
+ - never
14
+ users:
15
+ profiles:
16
+ - never
17
+ workspaces:
18
+ profiles:
19
+ - never
20
+ emails:
21
+ profiles:
22
+ - never
23
+ apps:
24
+ profiles:
25
+ - never
26
+ integrations:
27
+ profiles:
28
+ - never
29
+ pricing:
30
+ profiles:
31
+ - never
32
+ logs:
33
+ profiles:
34
+ - never
35
+ proxy:
36
+ profiles:
37
+ - never
38
+ admins:
39
+ profiles:
40
+ - never
41
+ notifications:
42
+ profiles:
43
+ - never
44
+ webhooks:
45
+ profiles:
46
+ - never
47
+ jobs:
48
+ profiles:
49
+ - never
50
+ marketplace:
51
+ profiles:
52
+ - never
53
+ partnerships:
54
+ profiles:
55
+ - never
56
+ tickets:
57
+ profiles:
58
+ - never
@@ -1,16 +1,74 @@
1
- # Ductape platform environment — edit and save as ~/.ductape/platform/.env
2
- # Required for AWS cloud connections. All other vars have working defaults.
1
+ # Ductape platform settings. `ductape install` created this file and gave it an ENC_KEY of its own. Back it up: without ENC_KEY, stored secrets cannot be read.
2
+ # Compose passes this file to every backend service.
3
3
 
4
- # --- AWS cloud connections ---
5
- # Needed for workbench → Cloud → "Complete setup". Leave blank to skip cloud connections.
4
+ # Required: the key every backend service uses to encrypt stored secrets and sign service tokens.
5
+ # Use one long random value (for example: openssl rand -hex 32) and keep it the same for every service.
6
+ # Changing it later makes previously stored secrets unreadable.
7
+ ENC_KEY=
8
+ # Optional: key for login tokens
9
+ # LOGIN_ENC_KEY=
10
+
11
+ # The address of THIS install's API gateway, as seen from outside (no trailing slash). The default only works on the
12
+ # machine running it. Set it to the public address you serve the gateway on, for example https://ductape.example.com.
13
+ # It is used for:
14
+ # - the webhook URLs Ductape gives to providers (they must point at your system, not Ductape cloud),
15
+ # - the API address the Workbench calls,
16
+ # - the links to uploaded files.
17
+ # Third parties (payment providers, GitHub, and so on) must be able to reach <this address>/webhooks/v1/process/* from the
18
+ # internet. Allow that path through your firewall or load balancer; everything else can stay private.
19
+ # DUCTAPE_PUBLIC_URL=http://localhost:4311
20
+
21
+ # Every other variable the backend reads is listed in backend/ENV.md. Add any of them here to
22
+ # change it; compose passes this file to every backend service.
23
+
24
+ # Optional override for bootstrap admin role (defaults to auto-created "Super Admin")
25
+ # DEFAULT_ADMIN_ROLE_ID=
26
+
27
+ # Workbench image build arg (only when rebuilding the workbench service)
28
+ # VITE_API_BASE_URL=http://localhost:4311/
29
+
30
+ # --- AWS cloud connections (required for workbench → Cloud → Complete setup) ---
31
+ # The integrations service calls sts:AssumeRole to validate connections. Without these,
32
+ # "Complete setup" fails with "Missing credentials in config".
33
+
34
+ # 12-digit AWS account ID where Ductape runs (shown in IAM trust policies as the trusting principal).
6
35
  AWS_ACCOUNT_ID=480358138685
36
+ # Optional alias; defaults to AWS_ACCOUNT_ID if unset.
37
+ # AWS_DUCTAPE_ACCOUNT_ID=480358138685
38
+
39
+ # IAM user access keys in that same account. The user needs permission to sts:AssumeRole
40
+ # on the DuctapeAccess role (e.g. arn:aws:iam::480358138685:role/DuctapeAccess).
41
+ # Workbench shows the exact IAM user ARN (e.g. arn:aws:iam::480358138685:user/Ductape).
7
42
  AWS_ACCESS_KEY_ID=
8
43
  AWS_SECRET_ACCESS_KEY=
9
44
  AWS_REGION=us-east-1
45
+
46
+ # Ductape file/image uploads (separate public and private GCS buckets).
47
+ GCS_PUBLIC_BUCKET=
48
+ GCS_PRIVATE_BUCKET=
49
+ # Full single-line service-account JSON (single-quote the value in .env).
50
+ GOOGLE_APPLICATION_CREDENTIALS=
51
+ # Optional session token for temporary credentials
10
52
  # AWS_SESSION_TOKEN=
53
+
54
+ # Alternative to keys above: use a profile from `aws configure` on the host (mounts ~/.aws).
11
55
  # AWS_PROFILE=default
12
56
  # AWS_SDK_LOAD_CONFIG=1
13
57
 
14
- # --- Optional overrides ---
15
- # DEFAULT_ADMIN_ROLE_ID=
16
- # AWS_DUCTAPE_ACCOUNT_ID=480358138685
58
+ # --- Ductape Deploy (deploy your own functions and services into your own cloud account) ---
59
+ # Everything here is off until you turn it on. Plans can be made and read with all of it off; nothing changes in any cloud.
60
+ # Details: https://docs.ductape.app/deploy/operate
61
+ #
62
+ # Let Deploy change your clouds. Without it, plans can be made and approved and nothing is applied.
63
+ # DEPLOY_ALLOW_MUTATIONS=true
64
+ # Read the state of your cloud when planning (the Workbench needs this to make plans).
65
+ # DEPLOY_OBSERVE_FROM_PROVIDER=true
66
+ # Run the worker that advances builds and deployments. Run it in one integrations container.
67
+ # DEPLOY_RECONCILER=true
68
+ # Limit Deploy to some workspaces (comma-separated workspace ids). Unset allows every workspace.
69
+ # DEPLOY_ENABLED_WORKSPACES=
70
+ # Only workspace owners and admins can approve plans, retire versions and change policy.
71
+ # DEPLOY_ADMIN_ONLY=true
72
+ # The addresses your install calls deployed services from, so customers can allow them on a Fargate load balancer
73
+ # (comma-separated CIDR blocks, such as 203.0.113.7/32).
74
+ # DEPLOY_CONTROL_PLANE_CIDRS=