mlgym-deploy 2.9.0 → 2.10.0
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/index.js +10 -12
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import crypto from 'crypto';
|
|
|
17
17
|
const execAsync = promisify(exec);
|
|
18
18
|
|
|
19
19
|
// Current version of this MCP server - INCREMENT FOR WORKFLOW FIXES
|
|
20
|
-
const CURRENT_VERSION = '2.
|
|
20
|
+
const CURRENT_VERSION = '2.10.0'; // Fixed SSH key handling: generate and include in user creation request
|
|
21
21
|
const PACKAGE_NAME = 'mlgym-deploy';
|
|
22
22
|
|
|
23
23
|
// Version check state
|
|
@@ -275,10 +275,16 @@ async function authenticate(args) {
|
|
|
275
275
|
|
|
276
276
|
// Try to create account
|
|
277
277
|
try {
|
|
278
|
+
// Generate SSH key BEFORE creating user
|
|
279
|
+
console.error('Generating SSH key for new user...');
|
|
280
|
+
const { publicKey, privateKeyPath } = await generateSSHKeyPair(email);
|
|
281
|
+
|
|
282
|
+
// Create user with SSH key included
|
|
278
283
|
const createResult = await apiRequest('POST', '/api/v1/users', {
|
|
279
284
|
email,
|
|
280
285
|
name: full_name,
|
|
281
|
-
password
|
|
286
|
+
password,
|
|
287
|
+
ssh_key: publicKey // Include SSH key in user creation
|
|
282
288
|
}, false);
|
|
283
289
|
|
|
284
290
|
if (createResult.success) {
|
|
@@ -291,16 +297,6 @@ async function authenticate(args) {
|
|
|
291
297
|
if (loginResult.success && loginResult.data.token) {
|
|
292
298
|
await saveAuth(email, loginResult.data.token);
|
|
293
299
|
|
|
294
|
-
// Generate and add SSH key for new user
|
|
295
|
-
console.error('Generating SSH key for new user...');
|
|
296
|
-
const { publicKey, privateKeyPath } = await generateSSHKeyPair(email);
|
|
297
|
-
|
|
298
|
-
const keyTitle = `mlgym-${new Date().toISOString().split('T')[0]}`;
|
|
299
|
-
await apiRequest('POST', '/api/v1/keys', {
|
|
300
|
-
title: keyTitle,
|
|
301
|
-
key: publicKey
|
|
302
|
-
}, true);
|
|
303
|
-
|
|
304
300
|
return {
|
|
305
301
|
content: [{
|
|
306
302
|
type: 'text',
|
|
@@ -311,9 +307,11 @@ async function authenticate(args) {
|
|
|
311
307
|
user_id: loginResult.data.user?.user_id,
|
|
312
308
|
gitlab_username: loginResult.data.user?.gitlab_username,
|
|
313
309
|
ssh_key_path: privateKeyPath,
|
|
310
|
+
ssh_key_status: createResult.data.ssh_key_status || 'SSH key configured',
|
|
314
311
|
next_steps: [
|
|
315
312
|
'New account created',
|
|
316
313
|
`SSH key generated at: ${privateKeyPath}`,
|
|
314
|
+
'SSH key automatically uploaded to GitLab',
|
|
317
315
|
'You can now create projects and deploy'
|
|
318
316
|
]
|
|
319
317
|
}, null, 2)
|