@aifabrix/builder 2.39.1 → 2.39.2
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/app/readme.js +50 -8
- package/lib/commands/up-common.js +4 -0
- package/lib/external-system/generator.js +14 -3
- package/lib/schema/external-datasource.schema.json +1593 -1594
- package/lib/schema/external-system.schema.json +420 -420
- package/package.json +1 -1
- package/templates/applications/README.md.hbs +8 -8
- package/templates/applications/dataplane/env.template +3 -1
- package/templates/applications/dataplane/variables.yaml +1 -1
- package/templates/applications/keycloak/variables.yaml +1 -1
- package/templates/applications/miso-controller/env.template +14 -0
- package/templates/applications/miso-controller/variables.yaml +1 -1
- package/templates/external-system/external-system.json.hbs +20 -7
- package/templates/applications/dataplane/README.md +0 -219
- package/templates/applications/keycloak/README.md +0 -203
- package/templates/applications/miso-controller/README.md +0 -367
- package/templates/external-system/deploy.ps1.hbs +0 -34
- package/templates/external-system/deploy.sh.hbs +0 -34
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ npm install -g @aifabrix/builder
|
|
|
19
19
|
aifabrix doctor
|
|
20
20
|
|
|
21
21
|
# Login to controller (offline tokens are default; sets controller and environment in config)
|
|
22
|
-
aifabrix login --
|
|
22
|
+
aifabrix login --controller http://localhost:3000
|
|
23
23
|
|
|
24
24
|
# Register your application (gets you credentials; uses controller and environment from config)
|
|
25
25
|
aifabrix app register {{appName}}
|
|
@@ -42,13 +42,13 @@ aifabrix run {{appName}}
|
|
|
42
42
|
|
|
43
43
|
**View logs:**
|
|
44
44
|
```bash
|
|
45
|
-
|
|
45
|
+
aifabrix logs {{appName}}
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
**Stop:**
|
|
49
49
|
```bash
|
|
50
|
-
aifabrix down-
|
|
51
|
-
# aifabrix down-
|
|
50
|
+
aifabrix down-app {{appName}}
|
|
51
|
+
# aifabrix down-app {{appName}} --volumes # also remove data volume
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
### 4. Deploy to Azure
|
|
@@ -61,7 +61,7 @@ aifabrix build {{appName}} --tag v1.0.0
|
|
|
61
61
|
aifabrix push {{appName}} --registry {{registry}} --tag "v1.0.0,latest"
|
|
62
62
|
|
|
63
63
|
# Deploy (controller and environment from config; set via aifabrix login or aifabrix auth config)
|
|
64
|
-
aifabrix deploy {{appName}}
|
|
64
|
+
aifabrix deploy {{appName}} --deployment local
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
---
|
|
@@ -87,7 +87,7 @@ aifabrix app rotate-secret {{appName}}
|
|
|
87
87
|
# Development
|
|
88
88
|
aifabrix build {{appName}} # Build app
|
|
89
89
|
aifabrix run {{appName}} # Run locally
|
|
90
|
-
aifabrix down-
|
|
90
|
+
aifabrix down-app {{appName}} [--volumes] # Stop app (optionally remove volume)
|
|
91
91
|
aifabrix dockerfile {{appName}} --force # Generate Dockerfile
|
|
92
92
|
aifabrix resolve {{appName}} # Generate .env file
|
|
93
93
|
|
|
@@ -118,7 +118,7 @@ aifabrix build {{appName}} --language typescript # Override language detection
|
|
|
118
118
|
### Run Options
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
aifabrix run {{appName}} --port {{localPort}}
|
|
121
|
+
aifabrix run {{appName}} --port {{localPort}} # Override local port
|
|
122
122
|
aifabrix run {{appName}} --debug # Debug output
|
|
123
123
|
```
|
|
124
124
|
|
|
@@ -132,7 +132,7 @@ aifabrix push {{appName}} --registry {{registry}} --tag "v1.0.0,latest,stable"
|
|
|
132
132
|
### Deploy Options
|
|
133
133
|
|
|
134
134
|
```bash
|
|
135
|
-
aifabrix deploy {{appName}}
|
|
135
|
+
aifabrix deploy {{appName}} --deployment local # Uses controller and environment from config
|
|
136
136
|
aifabrix deploy {{appName}} --no-poll # Deploy without polling for status
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -16,7 +16,9 @@ DEBUG=false
|
|
|
16
16
|
LOG_LEVEL=INFO
|
|
17
17
|
# Log format: json or text
|
|
18
18
|
LOG_FORMAT=json
|
|
19
|
-
# Path for log file output
|
|
19
|
+
# Path for log file output.
|
|
20
|
+
# Docker default (no volume): use LOG_FILE_PATH=/app/logs/app.log (directory created in image).
|
|
21
|
+
# Production with persistent logs: use /mnt/data/logs/app.log and mount a volume at /mnt/data.
|
|
20
22
|
LOG_FILE_PATH=/mnt/data/logs/app.log
|
|
21
23
|
# If true, run without Redis/Celery (single process)
|
|
22
24
|
LOCAL_MODE=false
|
|
@@ -10,7 +10,7 @@ app:
|
|
|
10
10
|
image:
|
|
11
11
|
name: aifabrix/keycloak
|
|
12
12
|
tag: 'latest'
|
|
13
|
-
registry:
|
|
13
|
+
registry: aifabrixdevacr.azurecr.io
|
|
14
14
|
registryMode: acr
|
|
15
15
|
|
|
16
16
|
# Port Configuration (base for host; host port = 8082 + developer_id*100 from ~/.aifabrix/config.yaml)
|
|
@@ -6,11 +6,25 @@
|
|
|
6
6
|
# =============================================================================
|
|
7
7
|
# FIRST-TIME ONBOARDING CONFIGURATION
|
|
8
8
|
# =============================================================================
|
|
9
|
+
#
|
|
10
|
+
# Onboarding runs automatically when the database has no controller row (empty DB).
|
|
11
|
+
# It creates: controller, Keycloak realm/client, admin user in aifabrix realm, groups, roles.
|
|
12
|
+
# After "pnpm db:reset", ensure the controller uses the same DATABASE_URL as the DB you
|
|
13
|
+
# reset (e.g. same .env or secrets), then start the controller so it sees the empty DB
|
|
14
|
+
# and runs onboarding (and creates the admin user for login).
|
|
15
|
+
#
|
|
16
|
+
# =============================================================================
|
|
9
17
|
|
|
10
18
|
# Skip automatic first-time onboarding (default: false)
|
|
11
19
|
# Set to true to disable automatic onboarding on first startup
|
|
12
20
|
SKIP_FIRST_TIME_SETUP=false
|
|
13
21
|
|
|
22
|
+
# Force onboarding to run even when a controller row already exists (default: unset/false).
|
|
23
|
+
# Use only when the DB already had a controller so onboarding was skipped and the admin
|
|
24
|
+
# user was never created in the aifabrix realm. Set to true, restart controller once,
|
|
25
|
+
# then set back to false so onboarding does not re-run on every start.
|
|
26
|
+
# FORCE_ONBOARDING=true
|
|
27
|
+
|
|
14
28
|
# Optional custom controller key for onboarding (default: miso-controller)
|
|
15
29
|
ONBOARDING_CONTROLLER_KEY=miso-controller
|
|
16
30
|
|
|
@@ -9,7 +9,7 @@ app:
|
|
|
9
9
|
# Image Configuration
|
|
10
10
|
image:
|
|
11
11
|
name: aifabrix/miso-controller
|
|
12
|
-
registry:
|
|
12
|
+
registry: aifabrixdevacr.azurecr.io
|
|
13
13
|
registryMode: acr
|
|
14
14
|
|
|
15
15
|
# Port Configuration (container port; host port = 3000 + developer_id*100 from ~/.aifabrix/config.yaml)
|
|
@@ -4,11 +4,8 @@
|
|
|
4
4
|
"description": "{{systemDescription}}",
|
|
5
5
|
"type": "{{systemType}}",
|
|
6
6
|
"enabled": true,
|
|
7
|
-
"environment": {
|
|
8
|
-
"baseUrl": "https://api.example.com"
|
|
9
|
-
},
|
|
10
7
|
"authentication": {
|
|
11
|
-
"
|
|
8
|
+
"type": "{{authType}}"{{#if (eq authType "oauth2")}},
|
|
12
9
|
"oauth2": {
|
|
13
10
|
"tokenUrl": "https://api.example.com/oauth/token",
|
|
14
11
|
"clientId": "kv://{{systemKey}}-oauth2-client-id",
|
|
@@ -32,14 +29,30 @@
|
|
|
32
29
|
"serverUrl": "https://mcp.example.com",
|
|
33
30
|
"toolPrefix": "{{systemKey}}"
|
|
34
31
|
}{{/if}},
|
|
35
|
-
"tags": []
|
|
32
|
+
"tags": [],
|
|
33
|
+
"configuration": [
|
|
34
|
+
{
|
|
35
|
+
"name": "BASE_URL",
|
|
36
|
+
"value": "{{#if baseUrl}}{{baseUrl}}{{else}}https://api.example.com{{/if}}",
|
|
37
|
+
"location": "variable",
|
|
38
|
+
"required": true,
|
|
39
|
+
"portalInput": {
|
|
40
|
+
"field": "text",
|
|
41
|
+
"label": "Base URL",
|
|
42
|
+
"placeholder": "https://api.example.com",
|
|
43
|
+
"validation": {
|
|
44
|
+
"required": true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]{{#if roles}},
|
|
36
49
|
"roles": [
|
|
37
50
|
{{#each roles}}
|
|
38
51
|
{
|
|
39
52
|
"name": "{{name}}",
|
|
40
53
|
"value": "{{value}}",
|
|
41
|
-
"description": "{{description}}"{{#if
|
|
42
|
-
"groups": [{{#each
|
|
54
|
+
"description": "{{description}}"{{#if groups}},
|
|
55
|
+
"groups": [{{#each groups}}"{{this}}"{{#unless @last}}, {{/unless}}{{/each}}]{{/if}}
|
|
43
56
|
}{{#unless @last}},{{/unless}}
|
|
44
57
|
{{/each}}
|
|
45
58
|
]{{/if}}{{#if permissions}},
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
# Dataplane Builder
|
|
2
|
-
|
|
3
|
-
Build, run, and deploy Dataplane using `@aifabrix/builder`.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
### 1. Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g @aifabrix/builder
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 2. First Time Setup
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Check your environment
|
|
19
|
-
aifabrix doctor
|
|
20
|
-
|
|
21
|
-
# Login to controller (debug mode -c http://localhost:3010 - change your own port)
|
|
22
|
-
aifabrix login
|
|
23
|
-
|
|
24
|
-
# Register your application (gets you credentials automatically)
|
|
25
|
-
aifabrix app register dataplane
|
|
26
|
-
|
|
27
|
-
# Rotate credentials if needed:
|
|
28
|
-
aifabrix app rotate-secret dataplane
|
|
29
|
-
|
|
30
|
-
# Run locally
|
|
31
|
-
aifabrix run dataplane
|
|
32
|
-
|
|
33
|
-
# Deploy to miso-controller
|
|
34
|
-
aifabrix deploy dataplane
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### 3. Build & Run Locally
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Build the Docker image (latest)
|
|
42
|
-
aifabrix build dataplane
|
|
43
|
-
|
|
44
|
-
# Run locally
|
|
45
|
-
aifabrix run dataplane
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Access your app:** <http://localhost:3111> (host port from `build.localPort`; container uses 3001)
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Testing dataplane (use DATAPLANE_TEST_GUIDE)
|
|
53
|
-
|
|
54
|
-
**Use the builder’s Dataplane Test Guide** for auth, health, wizard, external systems, and pipeline checks:
|
|
55
|
-
|
|
56
|
-
- **In aifabrix-builder:** `integration/hubspot/DATAPLANE_TEST_GUIDE.md`
|
|
57
|
-
- **Dataplane base URL:** `http://localhost:3111`
|
|
58
|
-
- **Controller:** `http://localhost:3110` (login, token)
|
|
59
|
-
|
|
60
|
-
The guide defines: token setup, `/health`, wizard API, external systems API, pipeline API, and quick checks.
|
|
61
|
-
Keep `build.localPort` in `variables.yaml` at **3111** so it matches that guide.
|
|
62
|
-
|
|
63
|
-
**View logs:**
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
docker logs aifabrix-dev06-dataplane -f
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**Stop:**
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
docker stop aifabrix-dev06-dataplane
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 4. Deploy to Azure
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
# Build with version tag
|
|
79
|
-
aifabrix build dataplane --tag v1.0.0
|
|
80
|
-
|
|
81
|
-
# Push to registry
|
|
82
|
-
aifabrix push dataplane --registry myacr.azurecr.io --tag "v1.0.0,latest"
|
|
83
|
-
|
|
84
|
-
# Deploy to miso-controller
|
|
85
|
-
aifabrix deploy dataplane
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Using miso-client
|
|
92
|
-
|
|
93
|
-
> [miso-client](https://github.com/esystemsdev/aifabrix-miso-client)
|
|
94
|
-
|
|
95
|
-
After registering your app, you automatically get credentials in your secret file. Use miso-client for login, RBAC, audit logs, etc.
|
|
96
|
-
|
|
97
|
-
**Rotate credentials if needed:**
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
aifabrix app rotate-secret dataplane
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Reference
|
|
106
|
-
|
|
107
|
-
### Common Commands
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
# Development
|
|
111
|
-
aifabrix build dataplane # Build app
|
|
112
|
-
aifabrix run dataplane # Run locally
|
|
113
|
-
aifabrix dockerfile dataplane --force # Generate Dockerfile
|
|
114
|
-
aifabrix resolve dataplane # Generate .env file
|
|
115
|
-
|
|
116
|
-
# Deployment
|
|
117
|
-
aifabrix json dataplane # Preview deployment JSON
|
|
118
|
-
aifabrix genkey dataplane # Generate deployment key
|
|
119
|
-
aifabrix push dataplane --registry myacr.azurecr.io # Push to ACR
|
|
120
|
-
aifabrix deploy dataplane --controller <url> # Deploy to Azure
|
|
121
|
-
|
|
122
|
-
# Management
|
|
123
|
-
aifabrix app register dataplane
|
|
124
|
-
aifabrix app list
|
|
125
|
-
aifabrix app rotate-secret dataplane
|
|
126
|
-
|
|
127
|
-
# Utilities
|
|
128
|
-
aifabrix doctor # Check environment
|
|
129
|
-
aifabrix login --method device # Login
|
|
130
|
-
aifabrix --help # Get help
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Build Options
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
aifabrix build dataplane --tag v1.0.0 # Custom tag
|
|
137
|
-
aifabrix build dataplane --force-template # Force template regeneration
|
|
138
|
-
aifabrix build dataplane --language typescript # Override language detection
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Run Options
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
aifabrix run dataplane --port 3000 # Custom port
|
|
145
|
-
aifabrix run dataplane --debug # Debug output
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Push Options
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
aifabrix push dataplane --registry myacr.azurecr.io --tag v1.0.0
|
|
152
|
-
aifabrix push dataplane --registry myacr.azurecr.io --tag "v1.0.0,latest,stable"
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Deploy Options
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
aifabrix deploy dataplane
|
|
159
|
-
aifabrix deploy dataplane --no-poll
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Login Methods
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Device code flow
|
|
166
|
-
aifabrix login --method device --environment dev
|
|
167
|
-
|
|
168
|
-
# Credentials (reads from secrets.local.yaml)
|
|
169
|
-
aifabrix login --method credentials --app dataplane --environment dev
|
|
170
|
-
|
|
171
|
-
# Explicit credentials
|
|
172
|
-
aifabrix login --method credentials --app dataplane --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --environment dev
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Environment Variables
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
export AIFABRIX_HOME=/custom/path
|
|
179
|
-
export AIFABRIX_SECRETS=/path/to/secrets.yaml
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Default OAuth callback URL:** Set `DATAPLANE_WEB_SERVER_URL` (e.g. in `env.template` as `http://localhost:${PORT}`) so the dataplane can build the default OAuth2 callback URL when `redirectUri` is omitted. The callback URL is `{DATAPLANE_WEB_SERVER_URL}/auth/callback`. When you change the domain (e.g. from localhost to a production URL), update this single variable and register the same callback URL in your OAuth app (e.g. HubSpot).
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Troubleshooting
|
|
187
|
-
|
|
188
|
-
- **"Docker not running"** → Start Docker Desktop
|
|
189
|
-
- **"Not logged in"** → Run `aifabrix login` first
|
|
190
|
-
- **"Port already in use"** → Use `--port` flag or change `build.localPort` in `variables.yaml` (default: 3111, must match DATAPLANE_TEST_GUIDE)
|
|
191
|
-
- **"Authentication failed"** → Run `aifabrix login` again
|
|
192
|
-
- **"Build fails"** → Check Docker is running and `variables.yaml` → `build.secrets` path is correct
|
|
193
|
-
- **"Can't connect"** → Verify infrastructure is running and PostgreSQL is accessible
|
|
194
|
-
- **Wizard / API 401 after `rotate-secret`** → The wizard may write `.env` to a different path (e.g. `../../.env`). Ensure the **project root** `.env` has the new `MISO_CLIENTID` and `MISO_CLIENTSECRET` (copy from the rotate-secret output or run `make resolve`), then **restart the backend** (`make dev` or restart the process) so it loads the new credentials.
|
|
195
|
-
|
|
196
|
-
**Regenerate files:**
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
aifabrix resolve dataplane --force
|
|
200
|
-
aifabrix json dataplane
|
|
201
|
-
aifabrix genkey dataplane
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## Prerequisites
|
|
207
|
-
|
|
208
|
-
- `@aifabrix/builder` installed globally
|
|
209
|
-
- Docker Desktop running
|
|
210
|
-
- Azure CLI installed (for push command)
|
|
211
|
-
- Authenticated with controller (for deploy command)
|
|
212
|
-
- PostgreSQL database (ensure infrastructure is running)
|
|
213
|
-
- Redis (ensure infrastructure is running)
|
|
214
|
-
- File storage configured
|
|
215
|
-
- Authentication/RBAC configured
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
**Application**: dataplane | **Port**: 3111 (local) / 3001 (container) | **Registry**: myacr.azurecr.io | **Image**: aifabrix/dataplane:latest
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
# Keycloak Builder
|
|
2
|
-
|
|
3
|
-
Build, run, and deploy Keycloak using `@aifabrix/builder`.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Quick Start
|
|
8
|
-
|
|
9
|
-
### 1. Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
pnpm install -g @aifabrix/builder
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 2. First Time Setup
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Check your environment
|
|
19
|
-
aifabrix doctor
|
|
20
|
-
|
|
21
|
-
# Login to controller
|
|
22
|
-
aifabrix login --method device --environment dev --controller http://localhost:3100 --offline
|
|
23
|
-
|
|
24
|
-
# Register your application (gets you credentials automatically)
|
|
25
|
-
aifabrix app register keycloak --environment dev
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### 3. Build & Run Locally
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# Build the Docker image
|
|
32
|
-
aifabrix build keycloak
|
|
33
|
-
|
|
34
|
-
# Generate environment variables
|
|
35
|
-
aifabrix resolve keycloak
|
|
36
|
-
|
|
37
|
-
# Run locally
|
|
38
|
-
aifabrix run keycloak
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Access your app:** <http://dev.aifabrix:8082>
|
|
42
|
-
|
|
43
|
-
**Token issuer (Docker + refresh):** Keycloak is configured with `KC_HOSTNAME=localhost` and `KC_HOSTNAME_PORT=${KEYCLOAK_PUBLIC_PORT}` so tokens always have issuer `http://localhost:<port>/realms/aifabrix`. This lets refresh work when users log in via localhost and the controller (in Docker) calls Keycloak at `http://keycloak:8080`.
|
|
44
|
-
|
|
45
|
-
**If you get "Invalid token issuer. Expected 'http://keycloak:8080/realms/aifabrix'" on refresh:**
|
|
46
|
-
|
|
47
|
-
1. Set `KEYCLOAK_PUBLIC_PORT` to the port you use for Keycloak (e.g. if your token issuer shows `http://localhost:8682/realms/aifabrix`, use `8682`). In `.env` (in the directory where you run `aifabrix resolve keycloak`) add or set: `KEYCLOAK_PUBLIC_PORT=8682`.
|
|
48
|
-
2. Regenerate Keycloak env and restart Keycloak:
|
|
49
|
-
```bash
|
|
50
|
-
aifabrix resolve keycloak
|
|
51
|
-
docker restart $(docker ps -q -f name=keycloak)
|
|
52
|
-
```
|
|
53
|
-
3. Re-run `pnpm validate:config -- --test-refresh` from the repo root.
|
|
54
|
-
|
|
55
|
-
**View logs:**
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
docker logs aifabrix-keycloak -f
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Stop:**
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
docker stop aifabrix-keycloak
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 4. Deploy to Azure
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
# Build with version tag
|
|
71
|
-
aifabrix build keycloak --tag v1.0.0
|
|
72
|
-
|
|
73
|
-
# Push to registry
|
|
74
|
-
aifabrix push keycloak --registry myacr.azurecr.io --tag "v1.0.0,latest"
|
|
75
|
-
|
|
76
|
-
# Deploy to miso-controller
|
|
77
|
-
aifabrix deploy keycloak --controller https://controller.aifabrix.ai --environment dev
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Using miso-client
|
|
83
|
-
|
|
84
|
-
> [miso-client](https://github.com/esystemsdev/aifabrix-miso-client)
|
|
85
|
-
|
|
86
|
-
After registering your app, you automatically get credentials in your secret file. Use miso-client for login, RBAC, audit logs, etc.
|
|
87
|
-
|
|
88
|
-
**Rotate credentials if needed:**
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
aifabrix app rotate-secret keycloak --environment dev
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Reference
|
|
97
|
-
|
|
98
|
-
### Common Commands
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Development
|
|
102
|
-
aifabrix build keycloak # Build app
|
|
103
|
-
aifabrix run keycloak # Run locally
|
|
104
|
-
aifabrix dockerfile keycloak --force # Generate Dockerfile
|
|
105
|
-
aifabrix resolve keycloak # Generate .env file
|
|
106
|
-
|
|
107
|
-
# Deployment
|
|
108
|
-
aifabrix json keycloak # Generate deployment manifest
|
|
109
|
-
aifabrix push keycloak --registry myacr.azurecr.io # Push to ACR
|
|
110
|
-
aifabrix deploy keycloak --controller <url> # Deploy to Azure
|
|
111
|
-
|
|
112
|
-
# Management
|
|
113
|
-
aifabrix app register keycloak --environment dev
|
|
114
|
-
aifabrix app list --environment dev
|
|
115
|
-
aifabrix app rotate-secret keycloak --environment dev
|
|
116
|
-
|
|
117
|
-
# Utilities
|
|
118
|
-
aifabrix doctor # Check environment
|
|
119
|
-
aifabrix login --method device --environment dev # Login
|
|
120
|
-
aifabrix --help # Get help
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Build Options
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
aifabrix build keycloak --tag v1.0.0 # Custom tag
|
|
127
|
-
aifabrix build keycloak --force-template # Force template regeneration
|
|
128
|
-
aifabrix build keycloak --language typescript # Override language detection
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Run Options
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
aifabrix run keycloak --port 8082 # Custom port
|
|
135
|
-
aifabrix run keycloak --debug # Debug output
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Push Options
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
aifabrix push keycloak --registry myacr.azurecr.io --tag v1.0.0
|
|
142
|
-
aifabrix push keycloak --registry myacr.azurecr.io --tag "v1.0.0,latest"
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Deploy Options
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
aifabrix deploy keycloak --controller <url> --environment dev
|
|
149
|
-
aifabrix deploy keycloak --controller <url> --environment dev --no-poll
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Login Methods
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
# Device code flow
|
|
156
|
-
aifabrix login --method device --environment dev
|
|
157
|
-
|
|
158
|
-
# Credentials (reads from secrets.local.yaml)
|
|
159
|
-
aifabrix login --method credentials --app keycloak --environment dev
|
|
160
|
-
|
|
161
|
-
# Explicit credentials
|
|
162
|
-
aifabrix login --method credentials --app keycloak --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --environment dev
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Environment Variables
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
export AIFABRIX_HOME=/custom/path
|
|
169
|
-
export AIFABRIX_SECRETS=/path/to/secrets.yaml
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
## Troubleshooting
|
|
175
|
-
|
|
176
|
-
- **"Docker not running"** → Start Docker Desktop
|
|
177
|
-
- **"Not logged in"** → Run `aifabrix login` first
|
|
178
|
-
- **"Port already in use"** → Use `--port` flag or change `build.localPort` in `variables.yaml` (default: 8082)
|
|
179
|
-
- **"Authentication failed"** → Run `aifabrix login` again
|
|
180
|
-
- **"Build fails"** → Check Docker is running and `variables.yaml` → `build.secrets` path is correct
|
|
181
|
-
- **"Can't connect"** → Verify infrastructure is running and PostgreSQL is accessible
|
|
182
|
-
|
|
183
|
-
**Regenerate files:**
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
aifabrix resolve keycloak --force
|
|
187
|
-
aifabrix json keycloak
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## Prerequisites
|
|
193
|
-
|
|
194
|
-
- `@aifabrix/builder` installed globally
|
|
195
|
-
- Docker Desktop running
|
|
196
|
-
- Azure CLI installed (for push command)
|
|
197
|
-
- Authenticated with controller (for deploy command)
|
|
198
|
-
- PostgreSQL database (ensure infrastructure is running)
|
|
199
|
-
- Authentication/RBAC configured
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
**Application**: keycloak | **Port**: 8082 | **Registry**: myacr.azurecr.io | **Image**: aifabrix/keycloak:latest
|