deckide 3.5.11 → 3.5.12
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/bin/deckide.js +4 -3
- package/dist/websocket.js +5 -2
- package/package.json +1 -1
package/bin/deckide.js
CHANGED
|
@@ -317,8 +317,8 @@ if (command === 'auth') {
|
|
|
317
317
|
const genUser = user || 'admin';
|
|
318
318
|
const genPassword = password || crypto.randomBytes(16).toString('base64url');
|
|
319
319
|
|
|
320
|
-
if (password && password.length <
|
|
321
|
-
console.error('Error: password must be at least
|
|
320
|
+
if (password && password.length < 12) {
|
|
321
|
+
console.error('Error: password must be at least 12 characters.');
|
|
322
322
|
process.exit(1);
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -370,13 +370,14 @@ if (command === 'logs') {
|
|
|
370
370
|
if (follow) {
|
|
371
371
|
const tail = spawn('tail', ['-f', logFile], { stdio: 'inherit' });
|
|
372
372
|
tail.on('exit', () => process.exit(0));
|
|
373
|
+
await new Promise(() => {}); // Block until tail exits
|
|
373
374
|
} else {
|
|
374
375
|
const lines = fs.readFileSync(logFile, 'utf-8');
|
|
375
376
|
// Show last 50 lines
|
|
376
377
|
const arr = lines.split('\n');
|
|
377
378
|
console.log(arr.slice(-51).join('\n'));
|
|
379
|
+
process.exit(0);
|
|
378
380
|
}
|
|
379
|
-
if (!args.includes('-f') && !args.includes('--follow')) process.exit(0);
|
|
380
381
|
}
|
|
381
382
|
|
|
382
383
|
// ── deckide stop ──
|
package/dist/websocket.js
CHANGED
|
@@ -88,9 +88,12 @@ export function setupWebSocketServer(server, terminals) {
|
|
|
88
88
|
const wss = new WebSocketServer({ server });
|
|
89
89
|
const WS_ALLOWED_ORIGINS = new Set([
|
|
90
90
|
`http://localhost:${PORT}`,
|
|
91
|
-
'http://localhost:5173',
|
|
92
|
-
'http://localhost:3000',
|
|
93
91
|
]);
|
|
92
|
+
// Add dev origins only in development mode
|
|
93
|
+
if (NODE_ENV !== 'production') {
|
|
94
|
+
WS_ALLOWED_ORIGINS.add('http://localhost:5173');
|
|
95
|
+
WS_ALLOWED_ORIGINS.add('http://localhost:3000');
|
|
96
|
+
}
|
|
94
97
|
// Allow configured CORS origin for WebSocket too
|
|
95
98
|
if (CORS_ORIGIN && CORS_ORIGIN !== '*') {
|
|
96
99
|
WS_ALLOWED_ORIGINS.add(CORS_ORIGIN);
|