Skip to content

Commit 70dd5b7

Browse files
committed
Cleanup client ID generation
1 parent 220aea1 commit 70dd5b7

File tree

3 files changed

+24
-51
lines changed

3 files changed

+24
-51
lines changed

agent-server/nodejs/init-client.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

agent-server/nodejs/src/client-manager.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class ClientManager {
1616
}
1717

1818
this.loadAllClients();
19+
20+
// Auto-generate default client if no clients exist (for AUTOMATED_MODE)
21+
if (this.clients.size === 0) {
22+
this.autoGenerateDefaultClient();
23+
}
1924
}
2025

2126
/**
@@ -150,6 +155,25 @@ class ClientManager {
150155
return { clientId, yamlPath };
151156
}
152157

158+
/**
159+
* Auto-generate a default client configuration (for AUTOMATED_MODE)
160+
*/
161+
autoGenerateDefaultClient() {
162+
logger.info('No client configurations found. Auto-generating default client for AUTOMATED_MODE...');
163+
164+
const clientId = uuidv4();
165+
const clientName = 'DevTools Client';
166+
167+
try {
168+
const result = this.createClientWithId(clientId, clientName, null);
169+
logger.info(`✅ Auto-generated client configuration: ${clientId}`);
170+
return result;
171+
} catch (error) {
172+
logger.error('Failed to auto-generate default client:', error);
173+
throw error;
174+
}
175+
}
176+
153177
/**
154178
* Reload a specific client's configuration
155179
*/

docker/Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ COPY --from=builder /workspace/devtools/devtools-frontend/out/Default/gen/front_
8383
# Copy agent-server from builder stage
8484
COPY --from=agent-server-builder /workspace/agent-server /opt/agent-server
8585

86-
# Copy client initialization script
87-
COPY agent-server/nodejs/init-client.sh /opt/agent-server/init-client.sh
88-
RUN chmod +x /opt/agent-server/init-client.sh
89-
9086
# Copy nginx config
9187
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
9288

@@ -95,10 +91,6 @@ RUN cat > /usr/local/bin/start-services.sh <<'EOFSCRIPT'
9591
#!/bin/bash
9692
set -e
9793

98-
# Initialize client configuration if needed
99-
echo "Initializing client configuration..."
100-
/opt/agent-server/init-client.sh
101-
10294
# Start nginx in background
10395
echo "Starting nginx..."
10496
nginx -g "daemon off;" &

0 commit comments

Comments
 (0)