@aifabrix/builder 2.1.4 → 2.1.6
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/lib/commands/app.js +43 -0
- package/lib/secrets.js +127 -49
- package/lib/templates.js +4 -1
- package/lib/utils/compose-generator.js +18 -2
- package/lib/utils/env-template.js +70 -0
- package/lib/utils/local-secrets.js +98 -0
- package/lib/utils/secrets-path.js +114 -0
- package/package.json +1 -1
- package/templates/applications/keycloak/Dockerfile +5 -4
- package/templates/applications/keycloak/env.template +5 -0
- package/templates/applications/keycloak/variables.yaml +3 -3
- package/templates/applications/miso-controller/Dockerfile +3 -0
- package/templates/applications/miso-controller/env.template +3 -3
- package/templates/python/docker-compose.hbs +10 -8
- package/templates/typescript/docker-compose.hbs +10 -8
- package/test-output.txt +5431 -0
|
@@ -25,9 +25,9 @@ requires:
|
|
|
25
25
|
|
|
26
26
|
# Health Check
|
|
27
27
|
healthCheck:
|
|
28
|
-
path: /health
|
|
28
|
+
path: /health/ready
|
|
29
29
|
interval: 30
|
|
30
|
-
probePath: /health
|
|
30
|
+
probePath: /health/ready
|
|
31
31
|
probeRequestType: GET
|
|
32
32
|
probeProtocol: Https
|
|
33
33
|
probeIntervalInSeconds: 120
|
|
@@ -49,4 +49,4 @@ build:
|
|
|
49
49
|
# Docker Compose
|
|
50
50
|
compose:
|
|
51
51
|
file: docker-compose.yaml
|
|
52
|
-
service: keycloak
|
|
52
|
+
service: keycloak
|
|
@@ -62,6 +62,9 @@ RUN pnpm exec tsc -p tsconfig.docker.json || true
|
|
|
62
62
|
# Copy sensitive-fields.config.json to dist folder
|
|
63
63
|
RUN mkdir -p dist/src/services/logging && \
|
|
64
64
|
cp src/services/logging/sensitive-fields.config.json dist/src/services/logging/ || true
|
|
65
|
+
# Copy generated Prisma logs client to dist folder (needed at runtime)
|
|
66
|
+
RUN mkdir -p dist/database/generated && \
|
|
67
|
+
cp -r src/database/generated/logs-client dist/database/generated/ || true
|
|
65
68
|
|
|
66
69
|
# Return to root to prune correctly (needed to keep workspace dependencies)
|
|
67
70
|
WORKDIR /app
|
|
@@ -121,14 +121,14 @@ MISO_CONTROLLER_URL=kv://miso-controller-url
|
|
|
121
121
|
|
|
122
122
|
# Web Server URL (for OpenAPI documentation server URLs)
|
|
123
123
|
# Used to generate correct server URLs in OpenAPI spec
|
|
124
|
-
WEB_SERVER_URL=kv://miso-web-server-url
|
|
124
|
+
WEB_SERVER_URL=kv://miso-controller-web-server-url
|
|
125
125
|
|
|
126
126
|
# MISO Environment Configuration (miso, dev, tst, pro)
|
|
127
127
|
MISO_ENVIRONMENT=miso
|
|
128
128
|
|
|
129
129
|
# MISO Application Client Credentials (per application)
|
|
130
|
-
MISO_CLIENTID=kv://miso-client-idKeyVault
|
|
131
|
-
MISO_CLIENTSECRET=kv://miso-client-secretKeyVault
|
|
130
|
+
MISO_CLIENTID=kv://miso-controller-client-idKeyVault
|
|
131
|
+
MISO_CLIENTSECRET=kv://miso-controller-client-secretKeyVault
|
|
132
132
|
|
|
133
133
|
# =============================================================================
|
|
134
134
|
# MORI SERVICE CONFIGURATION
|
|
@@ -70,18 +70,20 @@ services:
|
|
|
70
70
|
{{#each databases}}
|
|
71
71
|
echo 'Creating {{name}} database and user...' &&
|
|
72
72
|
(psql -d postgres -c \"CREATE DATABASE \\\"{{name}}\\\";\" || true) &&
|
|
73
|
-
(psql -d postgres -c \"
|
|
74
|
-
psql -d postgres -c \"
|
|
75
|
-
psql -d
|
|
76
|
-
psql -d {{name}} -c \"
|
|
73
|
+
(psql -d postgres -c \"DROP USER IF EXISTS {{pgUserOld name}};\" || true) &&
|
|
74
|
+
(psql -d postgres -c \"CREATE USER {{pgUser name}} WITH PASSWORD '${DB_{{@index}}_PASSWORD}';\" || true) &&
|
|
75
|
+
psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE \\\"{{name}}\\\" TO {{pgUser name}};\" || true &&
|
|
76
|
+
psql -d {{name}} -c \"ALTER SCHEMA public OWNER TO {{pgUser name}};\" || true &&
|
|
77
|
+
psql -d {{name}} -c \"GRANT ALL ON SCHEMA public TO {{pgUser name}};\" || true &&
|
|
77
78
|
{{/each}}
|
|
78
79
|
{{else}}
|
|
79
80
|
echo 'Creating {{app.key}} database and user...' &&
|
|
80
81
|
(psql -d postgres -c \"CREATE DATABASE \\\"{{app.key}}\\\";\" || true) &&
|
|
81
|
-
(psql -d postgres -c \"
|
|
82
|
-
psql -d postgres -c \"
|
|
83
|
-
psql -d
|
|
84
|
-
psql -d {{app.key}} -c \"
|
|
82
|
+
(psql -d postgres -c \"DROP USER IF EXISTS {{pgUserOld app.key}};\" || true) &&
|
|
83
|
+
(psql -d postgres -c \"CREATE USER {{pgUser app.key}} WITH PASSWORD '${DB_0_PASSWORD:-${DB_PASSWORD}}';\" || true) &&
|
|
84
|
+
psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE \\\"{{app.key}}\\\" TO {{pgUser app.key}};\" || true &&
|
|
85
|
+
psql -d {{app.key}} -c \"ALTER SCHEMA public OWNER TO {{pgUser app.key}};\" || true &&
|
|
86
|
+
psql -d {{app.key}} -c \"GRANT ALL ON SCHEMA public TO {{pgUser app.key}};\" || true &&
|
|
85
87
|
{{/if}}
|
|
86
88
|
echo 'Database initialization complete!'
|
|
87
89
|
"
|
|
@@ -70,18 +70,20 @@ services:
|
|
|
70
70
|
{{#each databases}}
|
|
71
71
|
echo 'Creating {{name}} database and user...' &&
|
|
72
72
|
(psql -d postgres -c \"CREATE DATABASE \\\"{{name}}\\\";\" || true) &&
|
|
73
|
-
(psql -d postgres -c \"
|
|
74
|
-
psql -d postgres -c \"
|
|
75
|
-
psql -d
|
|
76
|
-
psql -d {{name}} -c \"
|
|
73
|
+
(psql -d postgres -c \"DROP USER IF EXISTS {{pgUserOld name}};\" || true) &&
|
|
74
|
+
(psql -d postgres -c \"CREATE USER {{pgUser name}} WITH PASSWORD '${DB_{{@index}}_PASSWORD}';\" || true) &&
|
|
75
|
+
psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE \\\"{{name}}\\\" TO {{pgUser name}};\" || true &&
|
|
76
|
+
psql -d {{name}} -c \"ALTER SCHEMA public OWNER TO {{pgUser name}};\" || true &&
|
|
77
|
+
psql -d {{name}} -c \"GRANT ALL ON SCHEMA public TO {{pgUser name}};\" || true &&
|
|
77
78
|
{{/each}}
|
|
78
79
|
{{else}}
|
|
79
80
|
echo 'Creating {{app.key}} database and user...' &&
|
|
80
81
|
(psql -d postgres -c \"CREATE DATABASE \\\"{{app.key}}\\\";\" || true) &&
|
|
81
|
-
(psql -d postgres -c \"
|
|
82
|
-
psql -d postgres -c \"
|
|
83
|
-
psql -d
|
|
84
|
-
psql -d {{app.key}} -c \"
|
|
82
|
+
(psql -d postgres -c \"DROP USER IF EXISTS {{pgUserOld app.key}};\" || true) &&
|
|
83
|
+
(psql -d postgres -c \"CREATE USER {{pgUser app.key}} WITH PASSWORD '${DB_0_PASSWORD:-${DB_PASSWORD}}';\" || true) &&
|
|
84
|
+
psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE \\\"{{app.key}}\\\" TO {{pgUser app.key}};\" || true &&
|
|
85
|
+
psql -d {{app.key}} -c \"ALTER SCHEMA public OWNER TO {{pgUser app.key}};\" || true &&
|
|
86
|
+
psql -d {{app.key}} -c \"GRANT ALL ON SCHEMA public TO {{pgUser app.key}};\" || true &&
|
|
85
87
|
{{/if}}
|
|
86
88
|
echo 'Database initialization complete!'
|
|
87
89
|
"
|