wilfredwake 1.0.2 → 1.0.4
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/QUICKSTART.md +4 -4
- package/README.md +6 -6
- package/bin/cli.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/cli/commands/init.js +2 -2
- package/src/cli/config.js +1 -1
- package/src/orchestrator/server.js +4 -10
- package/tests/cli.test.js +1 -1
package/QUICKSTART.md
CHANGED
|
@@ -89,7 +89,7 @@ wilfredwake init
|
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Follow the prompts:
|
|
92
|
-
- **Orchestrator URL**: `
|
|
92
|
+
- **Orchestrator URL**: `https://wilfredwake.onrender.com` (or your server)
|
|
93
93
|
- **Environment**: `dev` (default)
|
|
94
94
|
- **API Token**: Optional
|
|
95
95
|
|
|
@@ -214,7 +214,7 @@ Edit service definitions in:
|
|
|
214
214
|
nano src/config/services.yaml
|
|
215
215
|
|
|
216
216
|
# After edit, reload:
|
|
217
|
-
curl -X POST
|
|
217
|
+
curl -X POST https://wilfredwake.onrender.com/api/reload
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
To add a new service, edit `services.yaml`:
|
|
@@ -243,7 +243,7 @@ wilfredwake wake my-service
|
|
|
243
243
|
|
|
244
244
|
1. **Check orchestrator is running:**
|
|
245
245
|
```bash
|
|
246
|
-
|
|
246
|
+
curl https://wilfredwake.onrender.com/health
|
|
247
247
|
```
|
|
248
248
|
|
|
249
249
|
2. **Check configuration:**
|
|
@@ -367,7 +367,7 @@ wilfredwake health payment-consumer
|
|
|
367
367
|
git pull
|
|
368
368
|
|
|
369
369
|
# Reload service registry
|
|
370
|
-
curl -X POST
|
|
370
|
+
curl -X POST https://wilfredwake.onrender.com/api/reload
|
|
371
371
|
|
|
372
372
|
# Wake any new services
|
|
373
373
|
wilfredwake wake all
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
# Run setup wizard
|
|
42
42
|
wilfredwake init
|
|
43
43
|
|
|
44
|
-
# Provide orchestrator URL (default:
|
|
44
|
+
# Provide orchestrator URL (default: https://wilfredwake.onrender.com)
|
|
45
45
|
# Select environment (dev, staging, prod)
|
|
46
46
|
# Optionally provide API token
|
|
47
47
|
```
|
|
@@ -185,7 +185,7 @@ This creates `~/.wilfredwake/config.json` with:
|
|
|
185
185
|
|
|
186
186
|
```json
|
|
187
187
|
{
|
|
188
|
-
"orchestratorUrl": "
|
|
188
|
+
"orchestratorUrl": "https://wilfredwake.onrender.com",
|
|
189
189
|
"token": "your-api-token",
|
|
190
190
|
"environment": "dev",
|
|
191
191
|
"preferences": {
|
|
@@ -203,7 +203,7 @@ This creates `~/.wilfredwake/config.json` with:
|
|
|
203
203
|
|
|
204
204
|
| Option | Type | Default | Description |
|
|
205
205
|
|--------|------|---------|-------------|
|
|
206
|
-
| `orchestratorUrl` | string | `
|
|
206
|
+
| `orchestratorUrl` | string | `https://wilfredwake.onrender.com` | Orchestrator backend URL |
|
|
207
207
|
| `token` | string | `null` | API token for authentication |
|
|
208
208
|
| `environment` | string | `dev` | Default environment (dev, staging, prod) |
|
|
209
209
|
| `preferences.outputFormat` | string | `table` | Output format (table or json) |
|
|
@@ -231,7 +231,7 @@ export REQUIRE_AUTH=true
|
|
|
231
231
|
Initialize wilfredwake configuration.
|
|
232
232
|
|
|
233
233
|
**Options:**
|
|
234
|
-
- `-o, --orchestrator <url>` - Orchestrator URL (default:
|
|
234
|
+
- `-o, --orchestrator <url>` - Orchestrator URL (default: https://wilfredwake.onrender.com)
|
|
235
235
|
- `-t, --token <token>` - Developer API token
|
|
236
236
|
|
|
237
237
|
**Example:**
|
|
@@ -490,7 +490,7 @@ services:
|
|
|
490
490
|
```bash
|
|
491
491
|
# Orchestrator reloads automatically (watch mode)
|
|
492
492
|
# Or manually:
|
|
493
|
-
curl -X POST
|
|
493
|
+
curl -X POST https://wilfredwake.onrender.com/api/reload
|
|
494
494
|
```
|
|
495
495
|
|
|
496
496
|
3. **Use immediately**
|
|
@@ -686,7 +686,7 @@ $ wilfredwake wake all --no-wait
|
|
|
686
686
|
**Problem:** CLI can't reach the orchestrator backend.
|
|
687
687
|
|
|
688
688
|
**Solution:**
|
|
689
|
-
1. Check orchestrator is running: `curl
|
|
689
|
+
1. Check orchestrator is running: `curl https://wilfredwake.onrender.com/health`
|
|
690
690
|
2. Verify orchestrator URL in config: `cat ~/.wilfredwake/config.json`
|
|
691
691
|
3. Check firewall/networking: Can you reach the URL?
|
|
692
692
|
|
package/bin/cli.js
CHANGED
|
@@ -47,7 +47,7 @@ program
|
|
|
47
47
|
.description(
|
|
48
48
|
chalk.magenta('Initialize wilfredwake configuration (first-time setup)')
|
|
49
49
|
)
|
|
50
|
-
.option('-o, --orchestrator <url>', 'Orchestrator URL', '
|
|
50
|
+
.option('-o, --orchestrator <url>', 'Orchestrator URL', 'https://wilfredwake.onrender.com')
|
|
51
51
|
.option('-t, --token <token>', 'Developer API token')
|
|
52
52
|
.action(initCommand);
|
|
53
53
|
|
package/index.js
CHANGED
package/package.json
CHANGED
package/src/cli/commands/init.js
CHANGED
|
@@ -143,9 +143,9 @@ async function _promptForConfig(options) {
|
|
|
143
143
|
console.log('');
|
|
144
144
|
|
|
145
145
|
orchestrator = await question(
|
|
146
|
-
`Orchestrator URL ${chalk.gray('(default:
|
|
146
|
+
`Orchestrator URL ${chalk.gray('(default: https://wilfredwake.onrender.com)')} `
|
|
147
147
|
);
|
|
148
|
-
orchestrator = orchestrator || '
|
|
148
|
+
orchestrator = orchestrator || 'https://wilfredwake.onrender.com';
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// Validate URL format
|
package/src/cli/config.js
CHANGED
|
@@ -71,17 +71,11 @@ app.use((req, res, next) => {
|
|
|
71
71
|
* Checks Authorization header if tokens are required
|
|
72
72
|
*/
|
|
73
73
|
const validateToken = (req, res, next) => {
|
|
74
|
+
// Authentication disabled by default.
|
|
75
|
+
// This middleware intentionally acts as a no-op so the orchestrator
|
|
76
|
+
// accepts unauthenticated requests. To enable authentication again,
|
|
77
|
+
// implement validation when `process.env.REQUIRE_AUTH` is set.
|
|
74
78
|
const token = req.headers.authorization?.replace('Bearer ', '');
|
|
75
|
-
|
|
76
|
-
// For now, we accept all requests
|
|
77
|
-
// In production, validate against registered tokens
|
|
78
|
-
if (process.env.REQUIRE_AUTH && !token) {
|
|
79
|
-
return res.status(401).json({
|
|
80
|
-
success: false,
|
|
81
|
-
error: 'Missing or invalid authentication token',
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
79
|
req.userId = token || 'anonymous';
|
|
86
80
|
next();
|
|
87
81
|
};
|
package/tests/cli.test.js
CHANGED
|
@@ -247,7 +247,7 @@ services:
|
|
|
247
247
|
test('Config - Validate URL format', async (t) => {
|
|
248
248
|
const { utils } = await import('../src/shared/logger.js');
|
|
249
249
|
|
|
250
|
-
assert.ok(utils.isValidUrl('
|
|
250
|
+
assert.ok(utils.isValidUrl('https://wilfredwake.onrender.com'), 'Valid URL');
|
|
251
251
|
assert.ok(utils.isValidUrl('https://example.com'), 'Valid HTTPS URL');
|
|
252
252
|
assert.ok(!utils.isValidUrl('not-a-url'), 'Invalid URL');
|
|
253
253
|
});
|