indraq_cli 1.5.8 → 1.9.1

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 (274) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1517 -1686
  3. package/cloud-api/.dockerignore +18 -0
  4. package/cloud-api/.env.example +14 -0
  5. package/cloud-api/Dockerfile +19 -0
  6. package/cloud-api/README.md +141 -0
  7. package/cloud-api/package-lock.json +2250 -0
  8. package/cloud-api/package.json +29 -0
  9. package/cloud-api/sql/001_init.sql +8 -0
  10. package/cloud-api/sql/002_user_providers_and_project_resources.sql +40 -0
  11. package/cloud-api/sql/003_environment_infrastructure.sql +19 -0
  12. package/cloud-api/sql/004_managed_aws_credentials.sql +20 -0
  13. package/cloud-api/sql/005_project_members_and_resource_grants.sql +22 -0
  14. package/cloud-api/sql/006_catalog_identity_password_security.sql +96 -0
  15. package/cloud-api/sql/007_aws_access_key_rotation.sql +16 -0
  16. package/cloud-api/src/index.ts +1254 -0
  17. package/cloud-api/tsconfig.json +18 -0
  18. package/dist/cli/create-program.d.ts.map +1 -1
  19. package/dist/cli/create-program.js +21 -3
  20. package/dist/cli/create-program.js.map +1 -1
  21. package/dist/cli/doctor.command.d.ts +1 -1
  22. package/dist/cli/doctor.command.d.ts.map +1 -1
  23. package/dist/cli/doctor.command.js +70 -12
  24. package/dist/cli/doctor.command.js.map +1 -1
  25. package/dist/cli/help-content.d.ts +1 -1
  26. package/dist/cli/help-content.d.ts.map +1 -1
  27. package/dist/cli/help-content.js +256 -177
  28. package/dist/cli/help-content.js.map +1 -1
  29. package/dist/modules/access/commands/access.command.d.ts +3 -0
  30. package/dist/modules/access/commands/access.command.d.ts.map +1 -0
  31. package/dist/modules/access/commands/access.command.js +226 -0
  32. package/dist/modules/access/commands/access.command.js.map +1 -0
  33. package/dist/modules/access/index.d.ts +3 -0
  34. package/dist/modules/access/index.d.ts.map +1 -0
  35. package/dist/modules/access/index.js +11 -0
  36. package/dist/modules/access/index.js.map +1 -0
  37. package/dist/modules/aws/commands/configure-aws.command.d.ts +2 -0
  38. package/dist/modules/aws/commands/configure-aws.command.d.ts.map +1 -0
  39. package/dist/modules/aws/commands/configure-aws.command.js +7 -0
  40. package/dist/modules/aws/commands/configure-aws.command.js.map +1 -0
  41. package/dist/modules/aws/commands/dns.command.d.ts +22 -0
  42. package/dist/modules/aws/commands/dns.command.d.ts.map +1 -0
  43. package/dist/modules/aws/commands/dns.command.js +229 -0
  44. package/dist/modules/aws/commands/dns.command.js.map +1 -0
  45. package/dist/modules/aws/commands/healthcheck.command.d.ts +22 -0
  46. package/dist/modules/aws/commands/healthcheck.command.d.ts.map +1 -0
  47. package/dist/modules/aws/commands/healthcheck.command.js +125 -0
  48. package/dist/modules/aws/commands/healthcheck.command.js.map +1 -0
  49. package/dist/modules/aws/commands/iam.command.d.ts +24 -0
  50. package/dist/modules/aws/commands/iam.command.d.ts.map +1 -0
  51. package/dist/modules/aws/commands/iam.command.js +219 -0
  52. package/dist/modules/aws/commands/iam.command.js.map +1 -0
  53. package/dist/modules/aws/config/aws-config.d.ts +23 -0
  54. package/dist/modules/aws/config/aws-config.d.ts.map +1 -0
  55. package/dist/modules/aws/config/aws-config.js +72 -0
  56. package/dist/modules/aws/config/aws-config.js.map +1 -0
  57. package/dist/modules/aws/index.d.ts +3 -0
  58. package/dist/modules/aws/index.d.ts.map +1 -0
  59. package/dist/modules/aws/index.js +54 -0
  60. package/dist/modules/aws/index.js.map +1 -0
  61. package/dist/modules/aws/services/aws-clients.d.ts +9 -0
  62. package/dist/modules/aws/services/aws-clients.d.ts.map +1 -0
  63. package/dist/modules/aws/services/aws-clients.js +43 -0
  64. package/dist/modules/aws/services/aws-clients.js.map +1 -0
  65. package/dist/modules/aws/services/route53-lookup.service.d.ts +9 -0
  66. package/dist/modules/aws/services/route53-lookup.service.d.ts.map +1 -0
  67. package/dist/modules/aws/services/route53-lookup.service.js +57 -0
  68. package/dist/modules/aws/services/route53-lookup.service.js.map +1 -0
  69. package/dist/modules/cloud/commands/cloud.command.d.ts +38 -0
  70. package/dist/modules/cloud/commands/cloud.command.d.ts.map +1 -0
  71. package/dist/modules/cloud/commands/cloud.command.js +443 -0
  72. package/dist/modules/cloud/commands/cloud.command.js.map +1 -0
  73. package/dist/modules/cloud/commands/credentials.command.d.ts +5 -0
  74. package/dist/modules/cloud/commands/credentials.command.d.ts.map +1 -0
  75. package/dist/modules/cloud/commands/credentials.command.js +25 -0
  76. package/dist/modules/cloud/commands/credentials.command.js.map +1 -0
  77. package/dist/modules/cloud/commands/environment.command.d.ts +6 -0
  78. package/dist/modules/cloud/commands/environment.command.d.ts.map +1 -0
  79. package/dist/modules/cloud/commands/environment.command.js +75 -0
  80. package/dist/modules/cloud/commands/environment.command.js.map +1 -0
  81. package/dist/modules/cloud/commands/provider.command.d.ts +3 -0
  82. package/dist/modules/cloud/commands/provider.command.d.ts.map +1 -0
  83. package/dist/modules/cloud/commands/provider.command.js +193 -0
  84. package/dist/modules/cloud/commands/provider.command.js.map +1 -0
  85. package/dist/modules/cloud/config/cloud-config.d.ts +19 -0
  86. package/dist/modules/cloud/config/cloud-config.d.ts.map +1 -0
  87. package/dist/modules/cloud/config/cloud-config.js +53 -0
  88. package/dist/modules/cloud/config/cloud-config.js.map +1 -0
  89. package/dist/modules/cloud/index.d.ts +3 -0
  90. package/dist/modules/cloud/index.d.ts.map +1 -0
  91. package/dist/modules/cloud/index.js +62 -0
  92. package/dist/modules/cloud/index.js.map +1 -0
  93. package/dist/modules/cloud/services/cloud-api.service.d.ts +17 -0
  94. package/dist/modules/cloud/services/cloud-api.service.d.ts.map +1 -0
  95. package/dist/modules/cloud/services/cloud-api.service.js +61 -0
  96. package/dist/modules/cloud/services/cloud-api.service.js.map +1 -0
  97. package/dist/modules/cloud/services/cloud-aws.service.d.ts +23 -0
  98. package/dist/modules/cloud/services/cloud-aws.service.d.ts.map +1 -0
  99. package/dist/modules/cloud/services/cloud-aws.service.js +26 -0
  100. package/dist/modules/cloud/services/cloud-aws.service.js.map +1 -0
  101. package/dist/modules/cloud/services/cloud-ghcr.service.d.ts +12 -0
  102. package/dist/modules/cloud/services/cloud-ghcr.service.d.ts.map +1 -0
  103. package/dist/modules/cloud/services/cloud-ghcr.service.js +31 -0
  104. package/dist/modules/cloud/services/cloud-ghcr.service.js.map +1 -0
  105. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts +29 -0
  106. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts.map +1 -0
  107. package/dist/modules/cloud/services/cloud-jenkins.service.js +236 -0
  108. package/dist/modules/cloud/services/cloud-jenkins.service.js.map +1 -0
  109. package/dist/modules/cloud/services/cloud-npm.service.d.ts +3 -0
  110. package/dist/modules/cloud/services/cloud-npm.service.d.ts.map +1 -0
  111. package/dist/modules/cloud/services/cloud-npm.service.js +13 -0
  112. package/dist/modules/cloud/services/cloud-npm.service.js.map +1 -0
  113. package/dist/modules/cloud/services/environment.service.d.ts +25 -0
  114. package/dist/modules/cloud/services/environment.service.d.ts.map +1 -0
  115. package/dist/modules/cloud/services/environment.service.js +21 -0
  116. package/dist/modules/cloud/services/environment.service.js.map +1 -0
  117. package/dist/modules/cloud/services/managed-aws-credential.service.d.ts +36 -0
  118. package/dist/modules/cloud/services/managed-aws-credential.service.d.ts.map +1 -0
  119. package/dist/modules/cloud/services/managed-aws-credential.service.js +35 -0
  120. package/dist/modules/cloud/services/managed-aws-credential.service.js.map +1 -0
  121. package/dist/modules/cloud/services/project-cloud.service.d.ts +28 -0
  122. package/dist/modules/cloud/services/project-cloud.service.d.ts.map +1 -0
  123. package/dist/modules/cloud/services/project-cloud.service.js +50 -0
  124. package/dist/modules/cloud/services/project-cloud.service.js.map +1 -0
  125. package/dist/modules/cloud/services/user-provider.service.d.ts +17 -0
  126. package/dist/modules/cloud/services/user-provider.service.d.ts.map +1 -0
  127. package/dist/modules/cloud/services/user-provider.service.js +25 -0
  128. package/dist/modules/cloud/services/user-provider.service.js.map +1 -0
  129. package/dist/modules/configure/configure.command.d.ts.map +1 -1
  130. package/dist/modules/configure/configure.command.js +17 -94
  131. package/dist/modules/configure/configure.command.js.map +1 -1
  132. package/dist/modules/deploy/commands/build.command.d.ts +1 -2
  133. package/dist/modules/deploy/commands/build.command.d.ts.map +1 -1
  134. package/dist/modules/deploy/commands/build.command.js +82 -124
  135. package/dist/modules/deploy/commands/build.command.js.map +1 -1
  136. package/dist/modules/deploy/index.d.ts.map +1 -1
  137. package/dist/modules/deploy/index.js +10 -30
  138. package/dist/modules/deploy/index.js.map +1 -1
  139. package/dist/modules/deploy/services/docker.service.d.ts +6 -3
  140. package/dist/modules/deploy/services/docker.service.d.ts.map +1 -1
  141. package/dist/modules/deploy/services/docker.service.js +8 -11
  142. package/dist/modules/deploy/services/docker.service.js.map +1 -1
  143. package/dist/modules/dockerfile/commands/create-dockerfile.command.d.ts +13 -0
  144. package/dist/modules/dockerfile/commands/create-dockerfile.command.d.ts.map +1 -0
  145. package/dist/modules/dockerfile/commands/create-dockerfile.command.js +39 -0
  146. package/dist/modules/dockerfile/commands/create-dockerfile.command.js.map +1 -0
  147. package/dist/modules/dockerfile/index.d.ts +3 -0
  148. package/dist/modules/dockerfile/index.d.ts.map +1 -0
  149. package/dist/modules/dockerfile/index.js +7 -0
  150. package/dist/modules/dockerfile/index.js.map +1 -0
  151. package/dist/modules/jenkins/commands/admin.command.d.ts +22 -0
  152. package/dist/modules/jenkins/commands/admin.command.d.ts.map +1 -0
  153. package/dist/modules/jenkins/commands/admin.command.js +128 -0
  154. package/dist/modules/jenkins/commands/admin.command.js.map +1 -0
  155. package/dist/modules/jenkins/commands/create-deployment.command.d.ts +13 -0
  156. package/dist/modules/jenkins/commands/create-deployment.command.d.ts.map +1 -0
  157. package/dist/modules/jenkins/commands/create-deployment.command.js +115 -0
  158. package/dist/modules/jenkins/commands/create-deployment.command.js.map +1 -0
  159. package/dist/modules/jenkins/index.d.ts +3 -0
  160. package/dist/modules/jenkins/index.d.ts.map +1 -0
  161. package/dist/modules/jenkins/index.js +28 -0
  162. package/dist/modules/jenkins/index.js.map +1 -0
  163. package/dist/modules/mobile/commands/build-mobile.command.d.ts.map +1 -1
  164. package/dist/modules/mobile/commands/build-mobile.command.js +4 -22
  165. package/dist/modules/mobile/commands/build-mobile.command.js.map +1 -1
  166. package/dist/modules/mobile/commands/configure-mobile.command.d.ts +1 -1
  167. package/dist/modules/mobile/commands/configure-mobile.command.d.ts.map +1 -1
  168. package/dist/modules/mobile/commands/configure-mobile.command.js +11 -9
  169. package/dist/modules/mobile/commands/configure-mobile.command.js.map +1 -1
  170. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts +2 -2
  171. package/dist/modules/mobile/services/jenkins-mobile.service.d.ts.map +1 -1
  172. package/dist/modules/mobile/services/jenkins-mobile.service.js +1 -2
  173. package/dist/modules/mobile/services/jenkins-mobile.service.js.map +1 -1
  174. package/dist/modules/mobile/services/project.service.d.ts +2 -2
  175. package/dist/modules/mobile/services/project.service.d.ts.map +1 -1
  176. package/dist/modules/prebuild/commands/prebuild.command.d.ts +13 -0
  177. package/dist/modules/prebuild/commands/prebuild.command.d.ts.map +1 -0
  178. package/dist/modules/prebuild/commands/prebuild.command.js +507 -0
  179. package/dist/modules/prebuild/commands/prebuild.command.js.map +1 -0
  180. package/dist/modules/prebuild/index.d.ts +3 -0
  181. package/dist/modules/prebuild/index.d.ts.map +1 -0
  182. package/dist/modules/prebuild/index.js +19 -0
  183. package/dist/modules/prebuild/index.js.map +1 -0
  184. package/dist/modules/proxy/commands/configure-proxy.command.d.ts +2 -0
  185. package/dist/modules/proxy/commands/configure-proxy.command.d.ts.map +1 -0
  186. package/dist/modules/proxy/commands/configure-proxy.command.js +7 -0
  187. package/dist/modules/proxy/commands/configure-proxy.command.js.map +1 -0
  188. package/dist/modules/proxy/commands/npm-user.command.d.ts +28 -0
  189. package/dist/modules/proxy/commands/npm-user.command.d.ts.map +1 -0
  190. package/dist/modules/proxy/commands/npm-user.command.js +77 -0
  191. package/dist/modules/proxy/commands/npm-user.command.js.map +1 -0
  192. package/dist/modules/proxy/commands/proxy.command.d.ts +22 -0
  193. package/dist/modules/proxy/commands/proxy.command.d.ts.map +1 -0
  194. package/dist/modules/proxy/commands/proxy.command.js +173 -0
  195. package/dist/modules/proxy/commands/proxy.command.js.map +1 -0
  196. package/dist/modules/proxy/config/npm-config.d.ts +17 -0
  197. package/dist/modules/proxy/config/npm-config.d.ts.map +1 -0
  198. package/dist/modules/proxy/config/npm-config.js +50 -0
  199. package/dist/modules/proxy/config/npm-config.js.map +1 -0
  200. package/dist/modules/proxy/index.d.ts +3 -0
  201. package/dist/modules/proxy/index.d.ts.map +1 -0
  202. package/dist/modules/proxy/index.js +21 -0
  203. package/dist/modules/proxy/index.js.map +1 -0
  204. package/dist/modules/proxy/services/npm-api.service.d.ts +76 -0
  205. package/dist/modules/proxy/services/npm-api.service.d.ts.map +1 -0
  206. package/dist/modules/proxy/services/npm-api.service.js +82 -0
  207. package/dist/modules/proxy/services/npm-api.service.js.map +1 -0
  208. package/dist/modules/scaffold/commands/init.command.d.ts +6 -0
  209. package/dist/modules/scaffold/commands/init.command.d.ts.map +1 -0
  210. package/dist/modules/scaffold/commands/init.command.js +193 -0
  211. package/dist/modules/scaffold/commands/init.command.js.map +1 -0
  212. package/dist/modules/scaffold/config/project-metadata.d.ts +9 -0
  213. package/dist/modules/scaffold/config/project-metadata.d.ts.map +1 -0
  214. package/dist/modules/scaffold/config/project-metadata.js +75 -0
  215. package/dist/modules/scaffold/config/project-metadata.js.map +1 -0
  216. package/dist/modules/scaffold/index.d.ts +3 -0
  217. package/dist/modules/scaffold/index.d.ts.map +1 -0
  218. package/dist/modules/scaffold/index.js +7 -0
  219. package/dist/modules/scaffold/index.js.map +1 -0
  220. package/dist/modules/scaffold/services/docker-template.service.d.ts +3 -0
  221. package/dist/modules/scaffold/services/docker-template.service.d.ts.map +1 -0
  222. package/dist/modules/scaffold/services/docker-template.service.js +131 -0
  223. package/dist/modules/scaffold/services/docker-template.service.js.map +1 -0
  224. package/dist/modules/scaffold/services/filesystem.service.d.ts +7 -0
  225. package/dist/modules/scaffold/services/filesystem.service.d.ts.map +1 -0
  226. package/dist/modules/scaffold/services/filesystem.service.js +97 -0
  227. package/dist/modules/scaffold/services/filesystem.service.js.map +1 -0
  228. package/dist/modules/scaffold/services/project-template.service.d.ts +4 -0
  229. package/dist/modules/scaffold/services/project-template.service.d.ts.map +1 -0
  230. package/dist/modules/scaffold/services/project-template.service.js +82 -0
  231. package/dist/modules/scaffold/services/project-template.service.js.map +1 -0
  232. package/dist/modules/scaffold/types.d.ts +65 -0
  233. package/dist/modules/scaffold/types.d.ts.map +1 -0
  234. package/dist/modules/scaffold/types.js +3 -0
  235. package/dist/modules/scaffold/types.js.map +1 -0
  236. package/dist/modules/users/commands/user.command.d.ts +22 -0
  237. package/dist/modules/users/commands/user.command.d.ts.map +1 -0
  238. package/dist/modules/users/commands/user.command.js +350 -0
  239. package/dist/modules/users/commands/user.command.js.map +1 -0
  240. package/dist/modules/users/index.d.ts +3 -0
  241. package/dist/modules/users/index.d.ts.map +1 -0
  242. package/dist/modules/users/index.js +34 -0
  243. package/dist/modules/users/index.js.map +1 -0
  244. package/dist/modules/users/providers/aws-user.provider.d.ts +11 -0
  245. package/dist/modules/users/providers/aws-user.provider.d.ts.map +1 -0
  246. package/dist/modules/users/providers/aws-user.provider.js +129 -0
  247. package/dist/modules/users/providers/aws-user.provider.js.map +1 -0
  248. package/dist/modules/users/providers/jenkins-user.provider.d.ts +6 -0
  249. package/dist/modules/users/providers/jenkins-user.provider.d.ts.map +1 -0
  250. package/dist/modules/users/providers/jenkins-user.provider.js +97 -0
  251. package/dist/modules/users/providers/jenkins-user.provider.js.map +1 -0
  252. package/dist/modules/users/providers/npm-user.provider.d.ts +4 -0
  253. package/dist/modules/users/providers/npm-user.provider.d.ts.map +1 -0
  254. package/dist/modules/users/providers/npm-user.provider.js +47 -0
  255. package/dist/modules/users/providers/npm-user.provider.js.map +1 -0
  256. package/dist/shared/config/config-files.d.ts.map +1 -1
  257. package/dist/shared/config/config-files.js +14 -10
  258. package/dist/shared/config/config-files.js.map +1 -1
  259. package/dist/shared/github/github-api.service.d.ts.map +1 -1
  260. package/dist/shared/github/github-api.service.js +25 -37
  261. package/dist/shared/github/github-api.service.js.map +1 -1
  262. package/dist/shared/jenkins/jenkins.service.d.ts +2 -0
  263. package/dist/shared/jenkins/jenkins.service.d.ts.map +1 -1
  264. package/dist/shared/jenkins/jenkins.service.js +30 -1
  265. package/dist/shared/jenkins/jenkins.service.js.map +1 -1
  266. package/dist/shared/listing.d.ts +9 -0
  267. package/dist/shared/listing.d.ts.map +1 -0
  268. package/dist/shared/listing.js +29 -0
  269. package/dist/shared/listing.js.map +1 -0
  270. package/docs/ARCHITECTURE.md +29 -0
  271. package/docs/CREATE-DEPLOYMENT-reference.groovy +1105 -0
  272. package/package.json +76 -59
  273. package/templates/jenkins/CREATE-DEPLOYMENT.groovy +1105 -0
  274. package/templates/jenkins/Jenkinsfile-Mobile-App +759 -759
@@ -0,0 +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
@@ -0,0 +1,14 @@
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>
@@ -0,0 +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"]
@@ -0,0 +1,141 @@
1
+ # IndraQ Cloud API
2
+
3
+ IndraQ Cloud API is the control plane used by IndraQ CLI. It provides authentication, RBAC, projects, shared environments, encrypted user-scoped provider credentials, managed AWS IAM credential recovery/rotation, first-login password enforcement, email-OTP password reset, project infrastructure associations, automatic PostgreSQL migrations, and audit logs.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 22+
8
+ - PostgreSQL
9
+
10
+ ## Configure
11
+
12
+ ```powershell
13
+ npm install
14
+ Copy-Item .env.example .env
15
+ ```
16
+
17
+ Required environment values:
18
+
19
+ ```env
20
+ PORT=4010
21
+ DATABASE_URL=postgresql://indraq:change-me@127.0.0.1:5432/indraq_cloud
22
+ JWT_SECRET=replace-with-at-least-32-random-characters
23
+ MASTER_KEY=replace-with-exactly-64-hex-characters
24
+ BOOTSTRAP_ADMIN_EMAIL=admin@example.com
25
+ BOOTSTRAP_ADMIN_PASSWORD=use-a-strong-password
26
+
27
+ # Required for `indraq password reset`
28
+ SMTP_HOST=smtp.example.com
29
+ SMTP_PORT=587
30
+ SMTP_SECURE=false
31
+ SMTP_USER=
32
+ SMTP_PASS=
33
+ SMTP_FROM=IndraQ <no-reply@example.com>
34
+ ```
35
+
36
+ Rules:
37
+
38
+ - `JWT_SECRET` must be at least 32 characters.
39
+ - `MASTER_KEY` must be exactly 64 hexadecimal characters (32 bytes).
40
+ - `BOOTSTRAP_ADMIN_PASSWORD` must be at least 12 characters.
41
+
42
+ Generate a master key:
43
+
44
+ ```powershell
45
+ node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
46
+ ```
47
+
48
+ ## Start
49
+
50
+ Development:
51
+
52
+ ```powershell
53
+ npm run build
54
+ npm run dev
55
+ ```
56
+
57
+ Production:
58
+
59
+ ```powershell
60
+ npm run build
61
+ npm start
62
+ ```
63
+
64
+ Numbered migrations in `sql/` run automatically at startup.
65
+
66
+ ## Bootstrap admin
67
+
68
+ When no admin exists, `BOOTSTRAP_ADMIN_EMAIL` and `BOOTSTRAP_ADMIN_PASSWORD` create the first administrator.
69
+
70
+ Keep `MASTER_KEY` stable. Existing encrypted provider credentials cannot be resolved with a different key.
71
+
72
+ ## RBAC
73
+
74
+ Roles:
75
+
76
+ - `user`
77
+ - `manager`
78
+ - `admin`
79
+
80
+ Managers can create/manage normal users. Only admins can create managers/admins, change user roles, and manage shared environments. Managers/admins can view audit logs.
81
+
82
+ Authentication middleware rechecks the current database user state/role for protected requests rather than relying only on a stale role claim.
83
+
84
+ ## User-scoped provider credentials
85
+
86
+ Reusable provider credentials are stored in `user_integrations` and keyed by `(user_id, provider)`.
87
+
88
+ Supported provider profiles:
89
+
90
+ - AWS
91
+ - NPM
92
+ - Jenkins Development
93
+ - Jenkins Production
94
+ - GHCR
95
+
96
+ Secrets use AES-256-GCM because provider APIs need the original credential later. Account passwords use bcrypt.
97
+
98
+ Users cannot resolve another user's provider credentials through the normal API. Provider resolution is audited and responses use `Cache-Control: no-store`.
99
+
100
+ ## Managed AWS IAM credentials
101
+
102
+ When unified user creation generates an AWS access key, AWS returns the secret only at creation time. IndraQ can store that generated secret encrypted in `managed_aws_credentials` for the target Cloud user.
103
+
104
+ The target logged-in user can later resolve their own stored AWS credential. Users can rotate their own IndraQ-managed AWS key; managers/admins can rotate keys for users they are authorized to manage. Rotation creates the replacement key, stores it encrypted, updates the target provider credential, then deletes the previous managed key. Administrative creation/deletion/rotation and user resolution are audited.
105
+
106
+ ## Password lifecycle
107
+
108
+ Users created through the management API receive `must_change_password=true`. The first successful login must be followed by `/auth/first-login-password` before normal protected operations are allowed. Managed NPM/Jenkins identities created through the unified workflow can be rotated to the new password as part of that first-login change.
109
+
110
+ Self-service password recovery uses `/auth/password-reset/request` and `/auth/password-reset/verify`. OTP values are bcrypt-hashed in PostgreSQL, expire after 10 minutes, are rate-limited, and have an attempt limit. SMTP must be configured for delivery. AWS is not a password-reset target because IndraQ AWS users are CLI/API access-key users.
111
+
112
+ ## Shared environments
113
+
114
+ `environments` are admin-managed reusable server targets containing values such as:
115
+
116
+ - name
117
+ - description
118
+ - IPv4 address
119
+ - region
120
+
121
+ Environment names are arbitrary. Environments are reusable address targets only; Route53 health-check settings are chosen per DNS record. PRIMARY/SECONDARY roles are assigned by a project DNS routing configuration, not stored permanently on the environment.
122
+
123
+ ## Projects and project resources
124
+
125
+ Projects are stored separately from reusable user credentials.
126
+
127
+ `project_resources` stores project-specific associations such as:
128
+
129
+ - GHCR image
130
+ - Jenkins job
131
+ - Route53 record/health-check metadata
132
+ - NPM proxy
133
+ - environment association
134
+
135
+ `project_members` controls WRITE membership. Every authenticated organization user can discover/view the project catalog, while creators/members with WRITE (and managers/admins) may run infrastructure-changing workflows. Managers/admins can add or remove members with an audit reason.
136
+
137
+ `project_resource_grants` records service/resource-level access granted by managers/admins. IndraQ synchronizes native access where the provider supports safe granularity (for example exact Route53 record/health-check permissions and Jenkins item roles) while retaining IndraQ Cloud as the authoritative access inventory.
138
+
139
+ ## Audit logs
140
+
141
+ Administrative and sensitive actions are written to `audit_logs`. Audit log access is restricted to managers/admins.