underpost 2.8.65 → 2.8.71

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.
Files changed (44) hide show
  1. package/.vscode/extensions.json +3 -2
  2. package/.vscode/settings.json +2 -0
  3. package/CHANGELOG.md +24 -4
  4. package/README.md +39 -2
  5. package/bin/deploy.js +1351 -145
  6. package/bin/file.js +8 -0
  7. package/bin/index.js +1 -240
  8. package/cli.md +451 -0
  9. package/docker-compose.yml +1 -1
  10. package/jsdoc.json +1 -1
  11. package/manifests/calico-custom-resources.yaml +25 -0
  12. package/manifests/deployment/adminer/deployment.yaml +32 -0
  13. package/manifests/deployment/adminer/kustomization.yaml +7 -0
  14. package/manifests/deployment/adminer/service.yaml +13 -0
  15. package/manifests/deployment/fastapi/backend-deployment.yml +120 -0
  16. package/manifests/deployment/fastapi/backend-service.yml +19 -0
  17. package/manifests/deployment/fastapi/frontend-deployment.yml +54 -0
  18. package/manifests/deployment/fastapi/frontend-service.yml +15 -0
  19. package/manifests/deployment/fastapi/initial_data.sh +56 -0
  20. package/manifests/deployment/kafka/deployment.yaml +69 -0
  21. package/manifests/kubeadm-calico-config.yaml +119 -0
  22. package/manifests/mongodb-4.4/service-deployment.yaml +1 -1
  23. package/manifests/postgresql/configmap.yaml +9 -0
  24. package/manifests/postgresql/kustomization.yaml +10 -0
  25. package/manifests/postgresql/pv.yaml +15 -0
  26. package/manifests/postgresql/pvc.yaml +13 -0
  27. package/manifests/postgresql/service.yaml +10 -0
  28. package/manifests/postgresql/statefulset.yaml +37 -0
  29. package/manifests/valkey/statefulset.yaml +6 -4
  30. package/package.json +2 -1
  31. package/src/cli/cluster.js +163 -18
  32. package/src/cli/deploy.js +68 -8
  33. package/src/cli/fs.js +14 -3
  34. package/src/cli/image.js +1 -1
  35. package/src/cli/index.js +312 -0
  36. package/src/cli/monitor.js +93 -39
  37. package/src/client/components/core/JoyStick.js +2 -2
  38. package/src/client/components/core/Modal.js +1 -0
  39. package/src/index.js +1 -1
  40. package/src/server/client-build.js +13 -0
  41. package/src/server/conf.js +5 -1
  42. package/src/server/dns.js +47 -17
  43. package/src/server/runtime.js +2 -0
  44. package/src/server/start.js +0 -1
package/cli.md ADDED
@@ -0,0 +1,451 @@
1
+ ## underpost ci/cd cli v2.8.71
2
+
3
+ ### Usage: `underpost [options] [command]`
4
+ ```
5
+ Options:
6
+ -V, --version output the version number
7
+ -h, --help display help for command
8
+
9
+ Commands:
10
+ new <app-name> Create a new project
11
+ start [options] <deploy-id> [env] Start up server, build pipelines, or services
12
+ clone [options] <uri> Clone github repository
13
+ pull <path> <uri> Pull github repository
14
+ cmt [options] <path> <commit-type> [module-tag] [message] Commit github repository
15
+ push [options] <path> <uri> Push github repository
16
+ env <deploy-id> [env] Set environment variables files and conf related to <deploy-id>
17
+ config <operator> [key] [value] Manage configuration, operators
18
+ root Get npm root path
19
+ cluster [options] [pod-name] Manage cluster, for default initialization base kind cluster
20
+ deploy [options] <deploy-list> [env] Manage deployment, for default deploy development pods
21
+ secret [options] <platform> Manage secrets
22
+ dockerfile-image-build [options] Build image from Dockerfile
23
+ dockerfile-pull-base-images Pull underpost dockerfile images requirements
24
+ install Fast import underpost npm dependencies
25
+ db [options] <deploy-list> Manage databases
26
+ script [options] <operator> <script-name> [script-value] Supports a number of built-in underpost global scripts and their preset life cycle events as well as arbitrary scripts
27
+ cron [options] [deploy-list] [job-list] Cron jobs management
28
+ fs [options] [path] File storage management, for default upload file
29
+ test [options] [deploy-list] Manage Test, for default run current underpost default test
30
+ monitor [options] <deploy-id> [env] Monitor health server management
31
+ help [command] display help for command
32
+
33
+ ```
34
+
35
+ ## Commands:
36
+
37
+
38
+ ### `new` :
39
+ ```
40
+ Usage: underpost new [options] <app-name>
41
+
42
+ Create a new project
43
+
44
+ Arguments:
45
+ app-name Application name
46
+
47
+ Options:
48
+ -h, --help display help for command
49
+
50
+ ```
51
+
52
+
53
+ ### `start` :
54
+ ```
55
+ Usage: underpost start [options] <deploy-id> [env]
56
+
57
+ Start up server, build pipelines, or services
58
+
59
+ Arguments:
60
+ deploy-id Deploy configuration id
61
+ env Optional environment, for default is development
62
+
63
+ Options:
64
+ --run Run app servers and monitor health server
65
+ --build Build app client
66
+ -h, --help display help for command
67
+
68
+ ```
69
+
70
+
71
+ ### `clone` :
72
+ ```
73
+ Usage: underpost clone [options] <uri>
74
+
75
+ Clone github repository
76
+
77
+ Arguments:
78
+ uri e.g. username/repository
79
+
80
+ Options:
81
+ --bare Clone only .git files
82
+ -h, --help display help for command
83
+
84
+ ```
85
+
86
+
87
+ ### `pull` :
88
+ ```
89
+ Usage: underpost pull [options] <path> <uri>
90
+
91
+ Pull github repository
92
+
93
+ Arguments:
94
+ path Absolute or relative directory
95
+ uri e.g. username/repository
96
+
97
+ Options:
98
+ -h, --help display help for command
99
+
100
+ ```
101
+
102
+
103
+ ### `cmt` :
104
+ ```
105
+ Usage: underpost cmt [options] <path> <commit-type> [module-tag] [message]
106
+
107
+ Commit github repository
108
+
109
+ Arguments:
110
+ path Absolute or relative directory
111
+ commit-type Options:
112
+ feat,fix,docs,style,refactor,perf,cd,test,build,ci,chore,revert,backup
113
+ module-tag Optional set module tag
114
+ message Optional set additional message
115
+
116
+ Options:
117
+ --empty Allow empty files
118
+ --copy Copy to clipboard message
119
+ --info Info commit types
120
+ -h, --help display help for command
121
+
122
+ ```
123
+
124
+
125
+ ### `push` :
126
+ ```
127
+ Usage: underpost push [options] <path> <uri>
128
+
129
+ Push github repository
130
+
131
+ Arguments:
132
+ path Absolute or relative directory
133
+ uri e.g. username/repository
134
+
135
+ Options:
136
+ -f Force push overwriting repository
137
+ -h, --help display help for command
138
+
139
+ ```
140
+
141
+
142
+ ### `env` :
143
+ ```
144
+ Usage: underpost env [options] <deploy-id> [env]
145
+
146
+ Set environment variables files and conf related to <deploy-id>
147
+
148
+ Arguments:
149
+ deploy-id deploy configuration id, if 'clean' restore default
150
+ env Optional environment, for default is production
151
+
152
+ Options:
153
+ -h, --help display help for command
154
+
155
+ ```
156
+
157
+
158
+ ### `config` :
159
+ ```
160
+ Usage: underpost config [options] <operator> [key] [value]
161
+
162
+ Manage configuration, operators
163
+
164
+ Arguments:
165
+ operator Options: set,delete,get,list,clean
166
+ key Config key
167
+ value Config value
168
+
169
+ Options:
170
+ -h, --help display help for command
171
+
172
+ ```
173
+
174
+
175
+ ### `root` :
176
+ ```
177
+ Usage: underpost root [options]
178
+
179
+ Get npm root path
180
+
181
+ Options:
182
+ -h, --help display help for command
183
+
184
+ ```
185
+
186
+
187
+ ### `cluster` :
188
+ ```
189
+ Usage: underpost cluster [options] [pod-name]
190
+
191
+ Manage cluster, for default initialization base kind cluster
192
+
193
+ Arguments:
194
+ pod-name Optional pod name filter
195
+
196
+ Options:
197
+ --reset Delete all clusters and prune all data and caches
198
+ --mariadb Init with mariadb statefulset
199
+ --mongodb Init with mongodb statefulset
200
+ --postgresql Init with postgresql statefulset
201
+ --mongodb4 Init with mongodb 4.4 service
202
+ --istio Init base istio cluster
203
+ --valkey Init with valkey service
204
+ --contour Init with project contour base HTTPProxy and envoy
205
+ --cert-manager Init with letsencrypt-prod ClusterIssuer
206
+ --info Get all kinds objects deployed
207
+ --full Init with all statefulsets and services available
208
+ --ns-use <ns-name> Switches current context to namespace
209
+ --dev init with dev cluster
210
+ --list-pods Display list pods information
211
+ --info-capacity display current total machine capacity info
212
+ --info-capacity-pod display current machine capacity pod info
213
+ --pull-image Set optional pull associated image
214
+ -h, --help display help for command
215
+
216
+ ```
217
+
218
+
219
+ ### `deploy` :
220
+ ```
221
+ Usage: underpost deploy [options] <deploy-list> [env]
222
+
223
+ Manage deployment, for default deploy development pods
224
+
225
+ Arguments:
226
+ deploy-list Deploy id list, e.g. default-a,default-b
227
+ env Optional environment, for default is
228
+ development
229
+
230
+ Options:
231
+ --remove Delete deployments and services
232
+ --sync Sync deployments env, ports, and replicas
233
+ --info-router Display router structure
234
+ --expose Expose service match deploy-list
235
+ --info-util Display kubectl util management commands
236
+ --cert Reset tls/ssl certificate secrets
237
+ --build-manifest Build kind yaml manifests: deployments,
238
+ services, proxy and secrets
239
+ --dashboard-update Update dashboard instance data with current
240
+ router config
241
+ --replicas <replicas> Set custom number of replicas
242
+ --versions <deployment-versions> Comma separated custom deployment versions
243
+ --traffic <traffic-versions> Comma separated custom deployment traffic
244
+ --disable-update-deployment Disable update deployments
245
+ --info-traffic get traffic conf form current resources
246
+ deployments
247
+ --rebuild-clients-bundle Inside container, rebuild clients bundle,
248
+ only static public or storage client files
249
+ -h, --help display help for command
250
+
251
+ ```
252
+
253
+
254
+ ### `secret` :
255
+ ```
256
+ Usage: underpost secret [options] <platform>
257
+
258
+ Manage secrets
259
+
260
+ Arguments:
261
+ platform Options: docker,underpost
262
+
263
+ Options:
264
+ --init Init secrets platform environment
265
+ --create-from-file <path-env-file> Create secret from env file
266
+ --list Lists secrets
267
+ -h, --help display help for command
268
+
269
+ ```
270
+
271
+
272
+ ### `dockerfile-image-build` :
273
+ ```
274
+ Usage: underpost dockerfile-image-build [options]
275
+
276
+ Build image from Dockerfile
277
+
278
+ Options:
279
+ --path [path] Dockerfile path
280
+ --image-name [image-name] Set image name
281
+ --image-path [image-path] Set tar image path
282
+ --dockerfile-name [dockerfile-name] set Dockerfile name
283
+ --podman-save Export tar file from podman
284
+ --kind-load Import tar image to Kind cluster
285
+ --secrets Dockerfile env secrets
286
+ --secrets-path [secrets-path] Dockerfile custom path env secrets
287
+ --no-cache Build without using cache
288
+ -h, --help display help for command
289
+
290
+ ```
291
+
292
+
293
+ ### `dockerfile-pull-base-images` :
294
+ ```
295
+ Usage: underpost dockerfile-pull-base-images [options]
296
+
297
+ Pull underpost dockerfile images requirements
298
+
299
+ Options:
300
+ -h, --help display help for command
301
+
302
+ ```
303
+
304
+
305
+ ### `install` :
306
+ ```
307
+ Usage: underpost install [options]
308
+
309
+ Fast import underpost npm dependencies
310
+
311
+ Options:
312
+ -h, --help display help for command
313
+
314
+ ```
315
+
316
+
317
+ ### `db` :
318
+ ```
319
+ Usage: underpost db [options] <deploy-list>
320
+
321
+ Manage databases
322
+
323
+ Arguments:
324
+ deploy-list Deploy id list, e.g. default-a,default-b
325
+
326
+ Options:
327
+ --import Import container backups from repositories
328
+ --export Export container backups to repositories
329
+ --pod-name <pod-name> Optional pod context
330
+ --collections <collections> Comma separated collections
331
+ --out-path <out-path> Custom out path backup
332
+ --drop Drop databases
333
+ --preserveUUID Preserve Ids
334
+ --git Upload to github
335
+ --hosts <hosts> Comma separated hosts
336
+ --paths <paths> Comma separated paths
337
+ --ns <ns-name> Optional name space context
338
+ -h, --help display help for command
339
+
340
+ ```
341
+
342
+
343
+ ### `script` :
344
+ ```
345
+ Usage: underpost script [options] <operator> <script-name> [script-value]
346
+
347
+ Supports a number of built-in underpost global scripts and their preset life
348
+ cycle events as well as arbitrary scripts
349
+
350
+ Arguments:
351
+ operator Options: set,run,get
352
+ script-name Script name
353
+ script-value Literal command, or path
354
+
355
+ Options:
356
+ --itc Inside container execution context
357
+ --itc-path Inside container path options
358
+ --ns <ns-name> Options name space context
359
+ --pod-name <pod-name>
360
+ -h, --help display help for command
361
+
362
+ ```
363
+
364
+
365
+ ### `cron` :
366
+ ```
367
+ Usage: underpost cron [options] [deploy-list] [job-list]
368
+
369
+ Cron jobs management
370
+
371
+ Arguments:
372
+ deploy-list Deploy id list, e.g. default-a,default-b
373
+ job-list Deploy id list, e.g. callback,updateDashboardData, for
374
+ default all available jobs
375
+
376
+ Options:
377
+ --itc Inside container execution context
378
+ --init Init cron jobs for cron job default deploy id
379
+ --git Upload to github
380
+ --dashboard-update Update dashboard cron data with current jobs config
381
+ -h, --help display help for command
382
+
383
+ ```
384
+
385
+
386
+ ### `fs` :
387
+ ```
388
+ Usage: underpost fs [options] [path]
389
+
390
+ File storage management, for default upload file
391
+
392
+ Arguments:
393
+ path Absolute or relative directory
394
+
395
+ Options:
396
+ --rm Remove file
397
+ --git Current git changes
398
+ --recursive Upload files recursively
399
+ --deploy-id <deploy-id> Deploy configuration id
400
+ --pull Download file
401
+ --force Force action
402
+ --storage-file-path <storage-file-path> custom file storage path
403
+ -h, --help display help for command
404
+
405
+ ```
406
+
407
+
408
+ ### `test` :
409
+ ```
410
+ Usage: underpost test [options] [deploy-list]
411
+
412
+ Manage Test, for default run current underpost default test
413
+
414
+ Arguments:
415
+ deploy-list Deploy id list, e.g. default-a,default-b
416
+
417
+ Options:
418
+ --itc Inside container execution context
419
+ --sh Copy to clipboard, container entrypoint shell
420
+ command
421
+ --logs Display container logs
422
+ --pod-name <pod-name>
423
+ --pod-status <pod-status>
424
+ --kind-type <kind-type>
425
+ -h, --help display help for command
426
+
427
+ ```
428
+
429
+
430
+ ### `monitor` :
431
+ ```
432
+ Usage: underpost monitor [options] <deploy-id> [env]
433
+
434
+ Monitor health server management
435
+
436
+ Arguments:
437
+ deploy-id Deploy configuration id
438
+ env Optional environment, for default is development
439
+
440
+ Options:
441
+ --ms-interval <ms-interval> Custom ms interval delta time
442
+ --now Exec immediately monitor script
443
+ --single Disable recurrence
444
+ --replicas <replicas> Set custom number of replicas
445
+ --type <type> Set custom monitor type
446
+ --sync Sync with current proxy deployments proxy
447
+ traffic
448
+ -h, --help display help for command
449
+
450
+ ```
451
+
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.8.65'
61
+ engine.version: '2.8.71'
62
62
  networks:
63
63
  - load-balancer
64
64
 
package/jsdoc.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "homepageTitle": "Docs",
24
24
  "favicon": "./public/www.nexodev.org/"
25
25
  },
26
- "tutorials": "./public/www.nexodev.org/docs/learn"
26
+ "tutorials": "./public/www.nexodev.org/docs/references"
27
27
  },
28
28
  "markdown": {
29
29
  "hardwrap": false,
@@ -0,0 +1,25 @@
1
+ # This section includes base Calico installation configuration.
2
+ # For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation
3
+ apiVersion: operator.tigera.io/v1
4
+ kind: Installation
5
+ metadata:
6
+ name: default
7
+ spec:
8
+ # Configures Calico networking.
9
+ calicoNetwork:
10
+ # Note: The ipPools section cannot be modified post-install.
11
+ ipPools:
12
+ - blockSize: 26
13
+ cidr: 192.168.0.0/16
14
+ encapsulation: VXLANCrossSubnet
15
+ natOutgoing: Enabled
16
+ nodeSelector: all()
17
+
18
+ ---
19
+ # This section configures the Calico API server.
20
+ # For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer
21
+ apiVersion: operator.tigera.io/v1
22
+ kind: APIServer
23
+ metadata:
24
+ name: default
25
+ spec: {}
@@ -0,0 +1,32 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: adminer
5
+ labels:
6
+ app: adminer
7
+ group: db
8
+ spec:
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: adminer
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: adminer
17
+ group: db
18
+ spec:
19
+ containers:
20
+ - name: adminer
21
+ image: adminer:4.7.6-standalone
22
+ ports:
23
+ - containerPort: 8080
24
+ env:
25
+ - name: ADMINER_DESIGN
26
+ value: pepa-linha
27
+ - name: ADMINER_DEFAULT_SERVER
28
+ value: postgres
29
+ resources:
30
+ limits:
31
+ memory: '256Mi'
32
+ cpu: '500m'
@@ -0,0 +1,7 @@
1
+ ---
2
+ # kubectl apply -k manifests/deployment/adminer/.
3
+ apiVersion: kustomize.config.k8s.io/v1beta1
4
+ kind: Kustomization
5
+ resources:
6
+ - deployment.yaml
7
+ - service.yaml
@@ -0,0 +1,13 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: adminer
5
+ labels:
6
+ group: db
7
+ spec:
8
+ type: ClusterIP
9
+ selector:
10
+ app: adminer
11
+ ports:
12
+ - port: 8080
13
+ targetPort: 8080
@@ -0,0 +1,120 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: fastapi-backend
5
+ labels:
6
+ app: fastapi-backend
7
+ spec:
8
+ replicas: 2
9
+ selector:
10
+ matchLabels:
11
+ app: fastapi-backend
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: fastapi-backend
16
+ spec:
17
+ containers:
18
+ - name: fastapi-backend-container
19
+ image: localhost/fastapi-backend:latest
20
+ imagePullPolicy: IfNotPresent
21
+
22
+ ports:
23
+ - containerPort: 8000
24
+ name: http-api
25
+
26
+ env:
27
+ - name: POSTGRES_SERVER
28
+ value: postgres-service
29
+ - name: POSTGRES_PORT
30
+ value: '5432'
31
+ - name: POSTGRES_DB
32
+ valueFrom:
33
+ secretKeyRef:
34
+ name: fastapi-postgres-credentials
35
+ key: POSTGRES_DB
36
+ - name: POSTGRES_USER
37
+ valueFrom:
38
+ secretKeyRef:
39
+ name: fastapi-postgres-credentials
40
+ key: POSTGRES_USER
41
+ - name: POSTGRES_PASSWORD
42
+ valueFrom:
43
+ secretKeyRef:
44
+ name: fastapi-postgres-credentials
45
+ key: POSTGRES_PASSWORD
46
+
47
+ - name: PROJECT_NAME
48
+ value: 'Full Stack FastAPI Project'
49
+ - name: STACK_NAME
50
+ value: 'full-stack-fastapi-project'
51
+
52
+ - name: BACKEND_CORS_ORIGINS
53
+ value: 'http://localhost,http://localhost:5173,https://localhost,https://localhost:5173'
54
+ - name: SECRET_KEY
55
+ valueFrom:
56
+ secretKeyRef:
57
+ name: fastapi-backend-config-secret
58
+ key: SECRET_KEY
59
+ - name: FIRST_SUPERUSER
60
+ valueFrom:
61
+ secretKeyRef:
62
+ name: fastapi-backend-config-secret
63
+ key: FIRST_SUPERUSER
64
+ - name: FIRST_SUPERUSER_PASSWORD
65
+ valueFrom:
66
+ secretKeyRef:
67
+ name: fastapi-backend-config-secret
68
+ key: FIRST_SUPERUSER_PASSWORD
69
+ - name: USERS_OPEN_REGISTRATION
70
+ value: 'True'
71
+
72
+ # - name: SMTP_HOST
73
+ # valueFrom:
74
+ # secretKeyRef:
75
+ # name: fastapi-backend-config-secret
76
+ # key: SMTP_HOST
77
+ # - name: SMTP_USER
78
+ # valueFrom:
79
+ # secretKeyRef:
80
+ # name: fastapi-backend-config-secret
81
+ # key: SMTP_USER
82
+ # - name: SMTP_PASSWORD
83
+ # valueFrom:
84
+ # secretKeyRef:
85
+ # name: fastapi-backend-config-secret
86
+ # key: SMTP_PASSWORD
87
+ - name: EMAILS_FROM_EMAIL
88
+ value: 'info@example.com'
89
+ - name: SMTP_TLS
90
+ value: 'True'
91
+ - name: SMTP_SSL
92
+ value: 'False'
93
+ - name: SMTP_PORT
94
+ value: '587'
95
+
96
+ livenessProbe:
97
+ httpGet:
98
+ path: /docs
99
+ port: 8000
100
+ initialDelaySeconds: 30
101
+ periodSeconds: 20
102
+ timeoutSeconds: 10
103
+ failureThreshold: 3
104
+
105
+ readinessProbe:
106
+ httpGet:
107
+ path: /docs
108
+ port: 8000
109
+ initialDelaySeconds: 30
110
+ periodSeconds: 20
111
+ timeoutSeconds: 10
112
+ failureThreshold: 3
113
+
114
+ resources:
115
+ requests:
116
+ cpu: 200m
117
+ memory: 256Mi
118
+ limits:
119
+ cpu: 1000m
120
+ memory: 1Gi
@@ -0,0 +1,19 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: fastapi-backend-service
5
+ labels:
6
+ app: fastapi-backend
7
+ spec:
8
+ selector:
9
+ app: fastapi-backend
10
+ ports:
11
+ - name: 'tcp-8000'
12
+ protocol: TCP
13
+ port: 8000
14
+ targetPort: 8000
15
+ - name: 'udp-8000'
16
+ protocol: UDP
17
+ port: 8000
18
+ targetPort: 8000
19
+ type: ClusterIP