indraq_cli 2.4.0 → 2.6.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/CHANGELOG_v2.5.0.md +67 -0
- package/CHANGELOG_v2.6.0.md +9 -0
- package/LICENSE +21 -21
- package/README.md +422 -605
- package/RELEASE_CHECKS_v2.5.0.md +93 -0
- package/TEST_RESULTS_v2.5.0.txt +46 -0
- package/TEST_RESULTS_v2.6.0.txt +16 -0
- package/cloud-api/.dockerignore +18 -18
- package/cloud-api/.env.example +14 -14
- package/cloud-api/.indraq/project.json +4 -0
- package/cloud-api/Dockerfile +19 -19
- package/cloud-api/README.md +3 -3
- package/cloud-api/dist/index.js +57 -7
- package/cloud-api/dist/index.js.map +1 -0
- package/cloud-api/package.json +1 -1
- package/cloud-api/sql/001_init.sql +8 -8
- package/cloud-api/sql/002_user_providers_and_project_resources.sql +40 -40
- package/cloud-api/sql/003_environment_infrastructure.sql +19 -19
- package/cloud-api/sql/004_managed_aws_credentials.sql +20 -20
- package/cloud-api/sql/005_project_members_and_resource_grants.sql +22 -22
- package/cloud-api/sql/006_catalog_identity_password_security.sql +96 -96
- package/cloud-api/sql/007_aws_access_key_rotation.sql +16 -16
- package/cloud-api/sql/008_provider_scopes.sql +91 -91
- package/cloud-api/src/index.ts +50 -6
- package/cloud-api/tsconfig.json +18 -18
- package/dist/cli/doctor.command.js +1 -1
- package/dist/cli/doctor.command.js.map +1 -1
- package/dist/cli/help-content.d.ts.map +1 -1
- package/dist/cli/help-content.js +19 -18
- package/dist/cli/help-content.js.map +1 -1
- package/dist/modules/access/commands/access.command.js +34 -34
- package/dist/modules/access/commands/access.command.js.map +1 -1
- package/dist/modules/aws/commands/dns.command.d.ts.map +1 -1
- package/dist/modules/aws/commands/dns.command.js +3 -2
- package/dist/modules/aws/commands/dns.command.js.map +1 -1
- package/dist/modules/cloud/commands/cloud.command.d.ts +3 -0
- package/dist/modules/cloud/commands/cloud.command.d.ts.map +1 -1
- package/dist/modules/cloud/commands/cloud.command.js +121 -34
- package/dist/modules/cloud/commands/cloud.command.js.map +1 -1
- package/dist/modules/cloud/commands/environment.command.js +1 -1
- package/dist/modules/cloud/commands/environment.command.js.map +1 -1
- package/dist/modules/cloud/commands/provider.command.js +1 -1
- package/dist/modules/cloud/commands/provider.command.js.map +1 -1
- package/dist/modules/cloud/index.js +2 -2
- package/dist/modules/cloud/index.js.map +1 -1
- package/dist/modules/cloud/services/cloud-aws.service.d.ts +1 -1
- package/dist/modules/cloud/services/cloud-aws.service.d.ts.map +1 -1
- package/dist/modules/cloud/services/cloud-aws.service.js +2 -2
- package/dist/modules/cloud/services/cloud-aws.service.js.map +1 -1
- package/dist/modules/cloud/services/cloud-ghcr.service.js +2 -2
- package/dist/modules/cloud/services/cloud-ghcr.service.js.map +1 -1
- package/dist/modules/cloud/services/cloud-jenkins.service.d.ts +1 -1
- package/dist/modules/cloud/services/cloud-jenkins.service.d.ts.map +1 -1
- package/dist/modules/cloud/services/cloud-jenkins.service.js +157 -33
- package/dist/modules/cloud/services/cloud-jenkins.service.js.map +1 -1
- package/dist/modules/cloud/services/cloud-npm.service.d.ts +1 -1
- package/dist/modules/cloud/services/cloud-npm.service.d.ts.map +1 -1
- package/dist/modules/cloud/services/cloud-npm.service.js +2 -2
- package/dist/modules/cloud/services/cloud-npm.service.js.map +1 -1
- package/dist/modules/cloud/services/project-cleanup.service.d.ts +24 -0
- package/dist/modules/cloud/services/project-cleanup.service.d.ts.map +1 -0
- package/dist/modules/cloud/services/project-cleanup.service.js +141 -0
- package/dist/modules/cloud/services/project-cleanup.service.js.map +1 -0
- package/dist/modules/cloud/services/user-provider.service.d.ts +1 -1
- package/dist/modules/cloud/services/user-provider.service.d.ts.map +1 -1
- package/dist/modules/cloud/services/user-provider.service.js +3 -3
- package/dist/modules/cloud/services/user-provider.service.js.map +1 -1
- package/dist/modules/configure/configure.command.js +6 -4
- package/dist/modules/configure/configure.command.js.map +1 -1
- package/dist/modules/deploy/commands/build.command.d.ts.map +1 -1
- package/dist/modules/deploy/commands/build.command.js +23 -12
- package/dist/modules/deploy/commands/build.command.js.map +1 -1
- package/dist/modules/deploy/commands/configure-docker.command.js +6 -6
- package/dist/modules/deploy/commands/configure-docker.command.js.map +1 -1
- package/dist/modules/deploy/config/docker-config.js +1 -1
- package/dist/modules/deploy/config/docker-config.js.map +1 -1
- package/dist/modules/deploy/index.js +1 -1
- package/dist/modules/deploy/index.js.map +1 -1
- package/dist/modules/deploy/services/docker.service.js +1 -1
- package/dist/modules/deploy/services/docker.service.js.map +1 -1
- package/dist/modules/dockerfile/services/project-docker.service.d.ts +9 -0
- package/dist/modules/dockerfile/services/project-docker.service.d.ts.map +1 -0
- package/dist/modules/dockerfile/services/project-docker.service.js +122 -0
- package/dist/modules/dockerfile/services/project-docker.service.js.map +1 -0
- package/dist/modules/jenkins/commands/create-deployment.command.js +4 -4
- package/dist/modules/jenkins/commands/create-deployment.command.js.map +1 -1
- package/dist/modules/jenkins/index.js +1 -1
- package/dist/modules/jenkins/index.js.map +1 -1
- package/dist/modules/mobile/commands/mobile-environment.command.js +1 -1
- package/dist/modules/mobile/commands/mobile-environment.command.js.map +1 -1
- package/dist/modules/mobile/commands/mobile-prebuild.command.js +1 -1
- package/dist/modules/mobile/commands/mobile-prebuild.command.js.map +1 -1
- package/dist/modules/mobile/commands/ota.command.js +3 -3
- package/dist/modules/mobile/commands/ota.command.js.map +1 -1
- package/dist/modules/mobile/index.d.ts.map +1 -1
- package/dist/modules/mobile/index.js +8 -7
- package/dist/modules/mobile/index.js.map +1 -1
- package/dist/modules/mobile/services/mobile-project-directory.d.ts +3 -0
- package/dist/modules/mobile/services/mobile-project-directory.d.ts.map +1 -0
- package/dist/modules/mobile/services/mobile-project-directory.js +31 -0
- package/dist/modules/mobile/services/mobile-project-directory.js.map +1 -0
- package/dist/modules/mobile/services/ota-setup.service.d.ts.map +1 -1
- package/dist/modules/mobile/services/ota-setup.service.js +5 -3
- package/dist/modules/mobile/services/ota-setup.service.js.map +1 -1
- package/dist/modules/prebuild/commands/prebuild.command.d.ts +4 -0
- package/dist/modules/prebuild/commands/prebuild.command.d.ts.map +1 -1
- package/dist/modules/prebuild/commands/prebuild.command.js +155 -100
- package/dist/modules/prebuild/commands/prebuild.command.js.map +1 -1
- package/dist/modules/prebuild/index.js +2 -2
- package/dist/modules/prebuild/index.js.map +1 -1
- package/dist/modules/prebuild/setup-plan.d.ts +11 -0
- package/dist/modules/prebuild/setup-plan.d.ts.map +1 -0
- package/dist/modules/prebuild/setup-plan.js +58 -0
- package/dist/modules/prebuild/setup-plan.js.map +1 -0
- package/dist/modules/proxy/services/npm-api.service.d.ts +1 -0
- package/dist/modules/proxy/services/npm-api.service.d.ts.map +1 -1
- package/dist/modules/proxy/services/npm-api.service.js +1 -0
- package/dist/modules/proxy/services/npm-api.service.js.map +1 -1
- package/dist/modules/scaffold/commands/init.command.d.ts.map +1 -1
- package/dist/modules/scaffold/commands/init.command.js +33 -18
- package/dist/modules/scaffold/commands/init.command.js.map +1 -1
- package/dist/modules/scaffold/types.d.ts +3 -1
- package/dist/modules/scaffold/types.d.ts.map +1 -1
- package/dist/modules/scopes/commands/scope.command.d.ts +3 -1
- package/dist/modules/scopes/commands/scope.command.d.ts.map +1 -1
- package/dist/modules/scopes/commands/scope.command.js +15 -8
- package/dist/modules/scopes/commands/scope.command.js.map +1 -1
- package/dist/modules/scopes/index.js +1 -1
- package/dist/modules/scopes/index.js.map +1 -1
- package/dist/modules/scopes/services/scope-native.service.d.ts.map +1 -1
- package/dist/modules/scopes/services/scope-native.service.js +16 -5
- package/dist/modules/scopes/services/scope-native.service.js.map +1 -1
- package/dist/modules/setup/commands/setup.command.d.ts.map +1 -1
- package/dist/modules/setup/commands/setup.command.js +41 -24
- package/dist/modules/setup/commands/setup.command.js.map +1 -1
- package/dist/modules/users/commands/user.command.d.ts.map +1 -1
- package/dist/modules/users/commands/user.command.js +10 -2
- package/dist/modules/users/commands/user.command.js.map +1 -1
- package/dist/modules/users/providers/jenkins-user.provider.js +95 -95
- package/dist/modules/users/providers/npm-user.provider.d.ts.map +1 -1
- package/dist/modules/users/providers/npm-user.provider.js +31 -2
- package/dist/modules/users/providers/npm-user.provider.js.map +1 -1
- package/dist/shared/config/config-files.js +7 -7
- package/dist/shared/jenkins/role-strategy-groovy.js +84 -84
- package/dist/shared/process/run-npx.d.ts +4 -0
- package/dist/shared/process/run-npx.d.ts.map +1 -0
- package/dist/shared/process/run-npx.js +31 -0
- package/dist/shared/process/run-npx.js.map +1 -0
- package/docs/ARCHITECTURE.md +7 -7
- package/docs/CREATE-DEPLOYMENT-reference.groovy +8 -8
- package/docs/README_v2.6.0_DETAILED.md +1021 -0
- package/package.json +12 -5
- package/templates/jenkins/CREATE-DEPLOYMENT.groovy +8 -8
- package/templates/jenkins/Jenkinsfile-Mobile-App +759 -759
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# IndraQ CLI v2.5.0 Release Checks
|
|
2
|
+
|
|
3
|
+
## Functional regression suite
|
|
4
|
+
|
|
5
|
+
`npm test` passed from the v2.5.0 working tree.
|
|
6
|
+
|
|
7
|
+
Coverage retained from earlier releases includes:
|
|
8
|
+
|
|
9
|
+
- Cloud endpoint and persistent sessions
|
|
10
|
+
- user lifecycle and provider-scope security
|
|
11
|
+
- AWS/Route53
|
|
12
|
+
- Nginx Proxy Manager
|
|
13
|
+
- Jenkins crumbs/ports/live logs/parameters
|
|
14
|
+
- Docker build context
|
|
15
|
+
- project lifecycle/access
|
|
16
|
+
- public/internal environment addressing
|
|
17
|
+
- multi-component projects
|
|
18
|
+
- multi-environment build-once deployment
|
|
19
|
+
- mobile environments/builds
|
|
20
|
+
- OTA registration, targeting, promotion, rollback and metrics
|
|
21
|
+
|
|
22
|
+
v2.5-specific tests cover:
|
|
23
|
+
|
|
24
|
+
- one setup checklist
|
|
25
|
+
- literal selection (Route53/NPM do not silently add Jenkins/GitHub Packages)
|
|
26
|
+
- automatic Dockerfile generation paths
|
|
27
|
+
- GitHub Packages screen name and `github-packages` alias
|
|
28
|
+
- creation vs mutation audit-reason behavior
|
|
29
|
+
- NPM email-first credentials and provisioning rollback
|
|
30
|
+
- Jenkins lost-response recovery without duplicate POST
|
|
31
|
+
- simplified README/help
|
|
32
|
+
|
|
33
|
+
## Jenkins runtime recovery test
|
|
34
|
+
|
|
35
|
+
A dedicated runtime regression simulates:
|
|
36
|
+
|
|
37
|
+
1. Jenkins pre-trigger snapshot reports next build 42.
|
|
38
|
+
2. The build POST reaches the simulated Jenkins/proxy path but returns HTTP 502.
|
|
39
|
+
3. IndraQ does not submit a second POST.
|
|
40
|
+
4. Build 42 appears and IndraQ attaches to it.
|
|
41
|
+
5. Jenkins console/build state completes successfully.
|
|
42
|
+
|
|
43
|
+
A second case verifies that when no safe pre-trigger snapshot exists, IndraQ refuses to attach to an arbitrary old build and does not submit another POST.
|
|
44
|
+
|
|
45
|
+
## TypeScript validation
|
|
46
|
+
|
|
47
|
+
Both projects passed strict TypeScript compilation in the sandbox:
|
|
48
|
+
|
|
49
|
+
- root CLI: `strict`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `NodeNext`
|
|
50
|
+
- Cloud API: strict TypeScript compilation
|
|
51
|
+
|
|
52
|
+
The npm registry was unavailable from the sandbox (`EAI_AGAIN`/timeout), so unavailable third-party package typings were represented by temporary compile-only declarations. Those declarations are NOT included in the release package.
|
|
53
|
+
|
|
54
|
+
Because of that network limitation, the final dependency-backed build gate must still be run on the publishing machine:
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
npm install
|
|
58
|
+
npm run build
|
|
59
|
+
npm test
|
|
60
|
+
npm publish --dry-run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Cloud API separately:
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
cd cloud-api
|
|
67
|
+
npm install
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Package safety
|
|
72
|
+
|
|
73
|
+
Before packaging, temporary validation `node_modules` and shim files are removed.
|
|
74
|
+
|
|
75
|
+
The final package audit checks for:
|
|
76
|
+
|
|
77
|
+
- no `node_modules`
|
|
78
|
+
- no real `.env`
|
|
79
|
+
- no `.npmrc`
|
|
80
|
+
- no private `.pem`, `.key`, `.p12`, `.pfx`
|
|
81
|
+
- no validation shim files
|
|
82
|
+
|
|
83
|
+
## Clean npm payload audit
|
|
84
|
+
|
|
85
|
+
`npm pack --dry-run --ignore-scripts --json` on the clean release tree:
|
|
86
|
+
|
|
87
|
+
- package: `indraq_cli@2.5.0`
|
|
88
|
+
- files: 410
|
|
89
|
+
- tarball size: 541,317 bytes
|
|
90
|
+
- unpacked size: 2,254,425 bytes
|
|
91
|
+
- forbidden files found: 0
|
|
92
|
+
- README/changelog/release checks/test results included
|
|
93
|
+
- `cloud-api/.env.example` included
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
IndraQ CLI v2.5.0 test summary
|
|
2
|
+
================================
|
|
3
|
+
|
|
4
|
+
FULL REGRESSION SUITE: PASS
|
|
5
|
+
|
|
6
|
+
PASS built-in IndraQ Cloud endpoint regression
|
|
7
|
+
PASS user-scoped cloud credential + shared environment regression
|
|
8
|
+
PASS infrastructure init/DNS/proxy/GitHub Packages hardening regression
|
|
9
|
+
PASS platform role/AWS/GHCR/DNS/NPM/init hardening regression
|
|
10
|
+
PASS project membership + resource access regression
|
|
11
|
+
PASS non-destructive existing-folder project create regression
|
|
12
|
+
PASS Jenkins crumb + session-cookie regression
|
|
13
|
+
PASS Jenkins aggressive port-check regression
|
|
14
|
+
PASS prebuild cloud reconciliation regression
|
|
15
|
+
PASS full Docker build-context + baked environment-file regression
|
|
16
|
+
PASS identity/password/list-select/AWS-key-rotation regression
|
|
17
|
+
PASS hard-delete / role-sync / generic-Jenkins-pipeline regression
|
|
18
|
+
PASS v2 durable lifecycle + Jenkins compatibility regression
|
|
19
|
+
PASS v2.2 retained scope architecture regression
|
|
20
|
+
PASS v2.2 scope security + deploy lifecycle regression
|
|
21
|
+
PASS v2.2.1 environment/scope-selection regression
|
|
22
|
+
PASS v2.2.2 persistent-session regression
|
|
23
|
+
PASS v2.2.2 persistent-session runtime regression
|
|
24
|
+
PASS v2.2.3 logical fixes regression
|
|
25
|
+
PASS v2.2.3 normal-user Route53 least-privilege regression
|
|
26
|
+
PASS v2.2.3 Jenkins build/runtime diagnostics regression
|
|
27
|
+
PASS v2.2.4 Jenkins parameter semantics + live console regression
|
|
28
|
+
PASS v2.2.5 public/internal environment addressing regression
|
|
29
|
+
PASS v2.3.0 compatible help/version fast-path regression
|
|
30
|
+
PASS v2.3.0 component/multi-environment/performance/setup regression
|
|
31
|
+
PASS v2.3.0 build-once multi-environment deploy runtime regression
|
|
32
|
+
PASS v2.4 mobile + OTA regression
|
|
33
|
+
PASS v2.5.0 setup/reliability/NPM/Docker/UX regression
|
|
34
|
+
PASS v2.5.0 Jenkins lost-response recovery runtime regression
|
|
35
|
+
|
|
36
|
+
STRICT TYPESCRIPT VALIDATION: PASS
|
|
37
|
+
- Root CLI strict TypeScript: PASS
|
|
38
|
+
- Cloud API strict TypeScript: PASS
|
|
39
|
+
|
|
40
|
+
Version fast path:
|
|
41
|
+
- node dist/index.js -V -> 2.5.0
|
|
42
|
+
|
|
43
|
+
Sandbox limitation:
|
|
44
|
+
The npm registry was unavailable, so a fresh real dependency install could not be completed in the sandbox.
|
|
45
|
+
Temporary compile-only declarations were used only to validate the project source under strict TypeScript and were removed before packaging.
|
|
46
|
+
Run the real dependency-backed build/publish dry-run on the publishing Windows machine before npm publish.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
IndraQ CLI v2.6.0 — local validation (November 19, 2026)
|
|
2
|
+
|
|
3
|
+
PASS — npm test (all scripted regression suites, including v2.6.0)
|
|
4
|
+
PASS — v2.6.0 selective cleanup mock-provider tests (DNS, NPM, Jenkins, GHCR)
|
|
5
|
+
PASS — shared resource and shared Jenkins pipeline protection tests
|
|
6
|
+
PASS — Windows npx argument-preservation regression (mocked Windows child process)
|
|
7
|
+
PASS — 98 TypeScript source files parsed without syntax errors
|
|
8
|
+
PASS — 98 TypeScript JavaScript output files generated using global TypeScript transpileModule
|
|
9
|
+
PASS — node --check for all generated CLI and Cloud API JavaScript files
|
|
10
|
+
|
|
11
|
+
NOT RUN — dependency-backed tsc build; npm registry unavailable in build environment.
|
|
12
|
+
NOT RUN — live Windows Expo codesigning, live AWS/GitHub/Jenkins/NPM deletions, Cloud API/PostgreSQL integration.
|
|
13
|
+
|
|
14
|
+
Before production: install dependencies and run npm run build && npm test
|
|
15
|
+
in the CLI root; npm install && npm run build in cloud-api; deploy Cloud API
|
|
16
|
+
v1.2.0 before CLI v2.6.0 and test against disposable provider resources.
|
package/cloud-api/.dockerignore
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
npm-debug.log*
|
|
3
|
-
yarn-debug.log*
|
|
4
|
-
yarn-error.log*
|
|
5
|
-
pnpm-debug.log*
|
|
6
|
-
*.log
|
|
7
|
-
.git
|
|
8
|
-
.gitignore
|
|
9
|
-
.indraq
|
|
10
|
-
dist
|
|
11
|
-
build
|
|
12
|
-
.next
|
|
13
|
-
coverage
|
|
14
|
-
.cache
|
|
15
|
-
.vite
|
|
16
|
-
.turbo
|
|
17
|
-
.DS_Store
|
|
18
|
-
Thumbs.db
|
|
1
|
+
node_modules
|
|
2
|
+
npm-debug.log*
|
|
3
|
+
yarn-debug.log*
|
|
4
|
+
yarn-error.log*
|
|
5
|
+
pnpm-debug.log*
|
|
6
|
+
*.log
|
|
7
|
+
.git
|
|
8
|
+
.gitignore
|
|
9
|
+
.indraq
|
|
10
|
+
dist
|
|
11
|
+
build
|
|
12
|
+
.next
|
|
13
|
+
coverage
|
|
14
|
+
.cache
|
|
15
|
+
.vite
|
|
16
|
+
.turbo
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
package/cloud-api/.env.example
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
PORT=4010
|
|
2
|
-
DATABASE_URL=postgresql://indraq:change-me@127.0.0.1:5432/indraq_cloud
|
|
3
|
-
JWT_SECRET=replace-with-64-random-characters
|
|
4
|
-
MASTER_KEY=replace-with-64-hex-characters
|
|
5
|
-
BOOTSTRAP_ADMIN_EMAIL=admin@example.com
|
|
6
|
-
BOOTSTRAP_ADMIN_PASSWORD=change-this-immediately
|
|
7
|
-
|
|
8
|
-
# Password-reset email (required for `indraq password reset`)
|
|
9
|
-
SMTP_HOST=smtp.example.com
|
|
10
|
-
SMTP_PORT=587
|
|
11
|
-
SMTP_SECURE=false
|
|
12
|
-
SMTP_USER=
|
|
13
|
-
SMTP_PASS=
|
|
14
|
-
SMTP_FROM=IndraQ <no-reply@example.com>
|
|
1
|
+
PORT=4010
|
|
2
|
+
DATABASE_URL=postgresql://indraq:change-me@127.0.0.1:5432/indraq_cloud
|
|
3
|
+
JWT_SECRET=replace-with-64-random-characters
|
|
4
|
+
MASTER_KEY=replace-with-64-hex-characters
|
|
5
|
+
BOOTSTRAP_ADMIN_EMAIL=admin@example.com
|
|
6
|
+
BOOTSTRAP_ADMIN_PASSWORD=change-this-immediately
|
|
7
|
+
|
|
8
|
+
# Password-reset email (required for `indraq password reset`)
|
|
9
|
+
SMTP_HOST=smtp.example.com
|
|
10
|
+
SMTP_PORT=587
|
|
11
|
+
SMTP_SECURE=false
|
|
12
|
+
SMTP_USER=
|
|
13
|
+
SMTP_PASS=
|
|
14
|
+
SMTP_FROM=IndraQ <no-reply@example.com>
|
|
15
15
|
|
|
16
16
|
# Mobile OTA / MinIO
|
|
17
17
|
MINIO_ENDPOINT=127.0.0.1
|
package/cloud-api/Dockerfile
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
FROM node:22-alpine AS build
|
|
2
|
-
WORKDIR /myapp
|
|
3
|
-
# Copy the complete project context. .dockerignore controls all exclusions.
|
|
4
|
-
COPY . .
|
|
5
|
-
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
6
|
-
RUN npm run build
|
|
7
|
-
RUN npm prune --omit=dev
|
|
8
|
-
|
|
9
|
-
FROM node:22-alpine AS runtime
|
|
10
|
-
WORKDIR /myapp
|
|
11
|
-
RUN apk add --no-cache curl
|
|
12
|
-
ENV NODE_ENV=production PORT=4010
|
|
13
|
-
# Copy the complete filtered project from the build stage, including generated
|
|
14
|
-
# build output and production node_modules. No project filenames are guessed.
|
|
15
|
-
COPY --from=build --chown=node:node /myapp ./
|
|
16
|
-
USER node
|
|
17
|
-
EXPOSE 4010
|
|
18
|
-
HEALTHCHECK --interval=30s --timeout=3s CMD curl -fsS http://127.0.0.1:4010/health >/dev/null || exit 1
|
|
19
|
-
CMD ["npm", "start"]
|
|
1
|
+
FROM node:22-alpine AS build
|
|
2
|
+
WORKDIR /myapp
|
|
3
|
+
# Copy the complete project context. .dockerignore controls all exclusions.
|
|
4
|
+
COPY . .
|
|
5
|
+
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
6
|
+
RUN npm run build
|
|
7
|
+
RUN npm prune --omit=dev
|
|
8
|
+
|
|
9
|
+
FROM node:22-alpine AS runtime
|
|
10
|
+
WORKDIR /myapp
|
|
11
|
+
RUN apk add --no-cache curl
|
|
12
|
+
ENV NODE_ENV=production PORT=4010
|
|
13
|
+
# Copy the complete filtered project from the build stage, including generated
|
|
14
|
+
# build output and production node_modules. No project filenames are guessed.
|
|
15
|
+
COPY --from=build --chown=node:node /myapp ./
|
|
16
|
+
USER node
|
|
17
|
+
EXPOSE 4010
|
|
18
|
+
HEALTHCHECK --interval=30s --timeout=3s CMD curl -fsS http://127.0.0.1:4010/health >/dev/null || exit 1
|
|
19
|
+
CMD ["npm", "start"]
|
package/cloud-api/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# IndraQ Cloud API
|
|
2
2
|
|
|
3
|
-
Control plane for IndraQ CLI v2.
|
|
3
|
+
Control plane for IndraQ CLI v2.6.0 / Cloud API v1.2.0. The public CLI and OTA endpoint is `https://cli.indraq.com`.
|
|
4
4
|
|
|
5
5
|
## Responsibilities
|
|
6
6
|
|
|
7
7
|
- persistent CLI authentication sessions and organization RBAC (`user`, `manager`, `admin`)
|
|
8
|
-
- provider scopes for AWS/NPM/Jenkins/
|
|
8
|
+
- provider scopes for AWS/NPM/Jenkins/GitHub Packages
|
|
9
9
|
- scope USE/MANAGE membership and audited delegation
|
|
10
10
|
- encrypted provider scope secrets
|
|
11
11
|
- per-user scope defaults
|
|
@@ -86,7 +86,7 @@ Mobile OTA uses the same Cloud API and public domain as the CLI. `expo-updates`
|
|
|
86
86
|
|
|
87
87
|
A successful Jenkins native mobile build records the authoritative native fingerprint for its Cloud mobile environment. OTA release creation is rejected if the publishing source fingerprint does not match that baseline. Runtime changes clear the baseline until another native build succeeds.
|
|
88
88
|
|
|
89
|
-
The v2.
|
|
89
|
+
The v2.5.0 source distribution intentionally does not ship the old v0.9.0 `package-lock.json`, because it predates the MinIO dependency. `Dockerfile` falls back to `npm install` when no lockfile exists. Generate a fresh lockfile after `npm install` if deterministic `npm ci` deployment is desired.
|
|
90
90
|
|
|
91
91
|
## Authorization model
|
|
92
92
|
|
package/cloud-api/dist/index.js
CHANGED
|
@@ -1228,6 +1228,47 @@ app.put('/projects/:id/deployment-topology', auth, async (req, res) => {
|
|
|
1228
1228
|
await audit(req.auth.id, 'project.deployment.update', 'project', id, reason, { mode, environments: names });
|
|
1229
1229
|
res.json({ ...result.rows[0], effective_access: 'write' });
|
|
1230
1230
|
});
|
|
1231
|
+
// Inventory of exact project-owned provider resources before destructive project deletion.
|
|
1232
|
+
// The CLI uses this authoritative list, not guesses based on project names or DNS.
|
|
1233
|
+
app.get('/projects/:id/cleanup-inventory', ...allow('manager', 'admin'), async (req, res) => {
|
|
1234
|
+
const id = ensureUuid(routeParam(req.params.id), 'Project ID');
|
|
1235
|
+
if ((await projectAccessLevel(id, req.auth, true)) !== 'write') {
|
|
1236
|
+
res.status(403).json({ error: 'WRITE access to the project is required.' });
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
const rows = await pool.query(`SELECT id,environment,resource_type,provider,external_id,config
|
|
1240
|
+
FROM project_resources WHERE project_id=$1 ORDER BY provider,environment,resource_type`, [id]);
|
|
1241
|
+
const response = [];
|
|
1242
|
+
for (const row of rows.rows) {
|
|
1243
|
+
// A provider identifier alone is not enough when scopes may point to different accounts.
|
|
1244
|
+
// Treat same provider + resource identity anywhere in another project as shared; this
|
|
1245
|
+
// intentionally errs on the side of refusing destructive cleanup.
|
|
1246
|
+
const config = row.config || {};
|
|
1247
|
+
let shared = false;
|
|
1248
|
+
if (row.provider === 'ghcr' && typeof config.fullImage === 'string') {
|
|
1249
|
+
const result = await pool.query(`SELECT 1 FROM project_resources
|
|
1250
|
+
WHERE project_id<>$1 AND provider='ghcr' AND lower(config->>'fullImage')=lower($2) LIMIT 1`, [id, config.fullImage]);
|
|
1251
|
+
shared = !!result.rowCount;
|
|
1252
|
+
}
|
|
1253
|
+
else if (row.provider === 'aws' && config.zoneId && config.domain) {
|
|
1254
|
+
const result = await pool.query(`SELECT 1 FROM project_resources
|
|
1255
|
+
WHERE project_id<>$1 AND provider='aws' AND config->>'zoneId'=$2 AND lower(trim(trailing '.' from config->>'domain'))=lower(trim(trailing '.' from $3::text)) LIMIT 1`, [id, String(config.zoneId), String(config.domain)]);
|
|
1256
|
+
shared = !!result.rowCount;
|
|
1257
|
+
}
|
|
1258
|
+
else if (row.provider === 'npm' && config.proxyHostId) {
|
|
1259
|
+
const result = await pool.query(`SELECT 1 FROM project_resources
|
|
1260
|
+
WHERE project_id<>$1 AND provider='npm' AND config->>'proxyHostId'=$2 LIMIT 1`, [id, String(config.proxyHostId)]);
|
|
1261
|
+
shared = !!result.rowCount;
|
|
1262
|
+
}
|
|
1263
|
+
else if (String(row.provider).startsWith('jenkins-') && (config.jobName || row.external_id)) {
|
|
1264
|
+
const result = await pool.query(`SELECT 1 FROM project_resources
|
|
1265
|
+
WHERE project_id<>$1 AND provider=$2 AND coalesce(config->>'jobName',external_id)=$3 LIMIT 1`, [id, row.provider, String(config.jobName || row.external_id)]);
|
|
1266
|
+
shared = !!result.rowCount;
|
|
1267
|
+
}
|
|
1268
|
+
response.push({ ...row, shared_elsewhere: shared });
|
|
1269
|
+
}
|
|
1270
|
+
res.json(response);
|
|
1271
|
+
});
|
|
1231
1272
|
app.delete('/projects/:id', ...allow('manager', 'admin'), async (req, res) => {
|
|
1232
1273
|
const reason = requireReason(req, res);
|
|
1233
1274
|
if (!reason)
|
|
@@ -1752,7 +1793,11 @@ app.post('/me/scopes/:provider/resolve', auth, async (req, res) => {
|
|
|
1752
1793
|
}
|
|
1753
1794
|
const projectId = req.body?.projectId ? ensureUuid(String(req.body.projectId), 'Project ID') : '';
|
|
1754
1795
|
const environment = req.body?.environment ? environmentName(req.body.environment) : '';
|
|
1755
|
-
|
|
1796
|
+
const mayCleanupArchived = req.body?.forCleanup === true && ['manager', 'admin'].includes(req.auth.role);
|
|
1797
|
+
const allowedProject = projectId && (mayCleanupArchived
|
|
1798
|
+
? (await projectAccessLevel(projectId, req.auth, true)) === 'write'
|
|
1799
|
+
: await hasProjectAccess(projectId, req.auth));
|
|
1800
|
+
if (projectId && !allowedProject) {
|
|
1756
1801
|
res.status(404).json({ error: 'Project not found or access denied' });
|
|
1757
1802
|
return;
|
|
1758
1803
|
}
|
|
@@ -1796,13 +1841,15 @@ app.post('/me/scopes/:provider/resolve', auth, async (req, res) => {
|
|
|
1796
1841
|
credentialSource = 'user-native';
|
|
1797
1842
|
}
|
|
1798
1843
|
else if (req.auth.role !== 'admin' && ['npm', 'jenkins-dev', 'jenkins-prod'].includes(provider)) {
|
|
1799
|
-
const own = await pool.query('SELECT external_username,encrypted_secret FROM scope_external_accounts WHERE scope_id=$1 AND cloud_user_id=$2', [scopeId, req.auth.id]);
|
|
1844
|
+
const own = await pool.query('SELECT external_username,external_email,encrypted_secret FROM scope_external_accounts WHERE scope_id=$1 AND cloud_user_id=$2', [scopeId, req.auth.id]);
|
|
1800
1845
|
if (!own.rowCount || !own.rows[0].encrypted_secret) {
|
|
1801
1846
|
res.status(404).json({ error: `No ${provider} credential is provisioned for you in this scope. Rotate your provider password or ask a scope manager to reprovision you.` });
|
|
1802
1847
|
return;
|
|
1803
1848
|
}
|
|
1849
|
+
// Nginx Proxy Manager authenticates managed users by their login identity/email.
|
|
1850
|
+
// Older IndraQ rows may not have external_email, so keep username as a fallback.
|
|
1804
1851
|
secret = provider === 'npm'
|
|
1805
|
-
? { identity: own.rows[0].external_username, secret: decrypt(own.rows[0].encrypted_secret) }
|
|
1852
|
+
? { identity: own.rows[0].external_email || own.rows[0].external_username, secret: decrypt(own.rows[0].encrypted_secret) }
|
|
1806
1853
|
: { username: own.rows[0].external_username, secret: decrypt(own.rows[0].encrypted_secret) };
|
|
1807
1854
|
credentialSource = 'user-native';
|
|
1808
1855
|
}
|
|
@@ -2158,7 +2205,7 @@ app.post('/me/scopes/:scopeId/external-account/rotate', auth, async (req, res) =
|
|
|
2158
2205
|
res.status(400).json({ error: 'Password must be at least 10 characters.' });
|
|
2159
2206
|
return;
|
|
2160
2207
|
}
|
|
2161
|
-
const account = await pool.query('SELECT provider,external_username FROM scope_external_accounts WHERE scope_id=$1 AND cloud_user_id=$2', [scopeId, req.auth.id]);
|
|
2208
|
+
const account = await pool.query('SELECT provider,external_username,external_email FROM scope_external_accounts WHERE scope_id=$1 AND cloud_user_id=$2', [scopeId, req.auth.id]);
|
|
2162
2209
|
if (!account.rowCount) {
|
|
2163
2210
|
res.status(404).json({ error: 'No NPM/Jenkins account is stored for you in this scope.' });
|
|
2164
2211
|
return;
|
|
@@ -2171,6 +2218,7 @@ app.post('/me/scopes/:scopeId/external-account/rotate', auth, async (req, res) =
|
|
|
2171
2218
|
const provider = String(account.rows[0].provider);
|
|
2172
2219
|
const management = JSON.parse(decrypt(scope.rows[0].encrypted_secret));
|
|
2173
2220
|
const username = String(account.rows[0].external_username);
|
|
2221
|
+
const externalEmail = String(account.rows[0].external_email || '');
|
|
2174
2222
|
if (provider === 'npm') {
|
|
2175
2223
|
const base = String(scope.rows[0].config?.url || '').replace(/\/+$/, '');
|
|
2176
2224
|
const tokenResponse = await fetch(`${base}/api/tokens`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ identity: management.identity, secret: management.secret }) });
|
|
@@ -2191,7 +2239,8 @@ app.post('/me/scopes/:scopeId/external-account/rotate', auth, async (req, res) =
|
|
|
2191
2239
|
}
|
|
2192
2240
|
const users = await usersResponse.json();
|
|
2193
2241
|
const wanted = username.toLowerCase();
|
|
2194
|
-
const
|
|
2242
|
+
const wantedEmail = externalEmail.toLowerCase();
|
|
2243
|
+
const target = users.find((u) => (wantedEmail && String(u.email || '').toLowerCase() === wantedEmail) || String(u.email || '').toLowerCase() === wanted || String(u.nickname || '').toLowerCase() === wanted || String(u.name || '').toLowerCase() === wanted);
|
|
2195
2244
|
if (!target) {
|
|
2196
2245
|
res.status(404).json({ error: `NPM user ${username} was not found.` });
|
|
2197
2246
|
return;
|
|
@@ -3053,8 +3102,8 @@ app.post('/projects/:projectId/mobile/register', auth, async (req, res) => {
|
|
|
3053
3102
|
return;
|
|
3054
3103
|
}
|
|
3055
3104
|
const project = (await pool.query('SELECT id,kind FROM projects WHERE id=$1', [projectId])).rows[0];
|
|
3056
|
-
if (!project ||
|
|
3057
|
-
res.status(400).json({ error: 'OTA registration
|
|
3105
|
+
if (!project || !['mobile', 'backend-mobile'].includes(project.kind)) {
|
|
3106
|
+
res.status(400).json({ error: 'OTA registration requires a mobile or backend-mobile project.' });
|
|
3058
3107
|
return;
|
|
3059
3108
|
}
|
|
3060
3109
|
const appName = textValue(req.body?.appName, 'App name', 100);
|
|
@@ -3571,3 +3620,4 @@ if (process.env.MINIO_ENDPOINT && process.env.MINIO_ACCESS_KEY && process.env.MI
|
|
|
3571
3620
|
console.log(`OTA MinIO bucket ready: ${minioBucket}`);
|
|
3572
3621
|
}
|
|
3573
3622
|
app.listen(Number(process.env.PORT || 4010), () => console.log(`IndraQ Cloud API listening on ${process.env.PORT || 4010}`));
|
|
3623
|
+
//# sourceMappingURL=index.js.map
|