From 6e1fc6ed325a47c26aabe558f8590c774af9fd64 Mon Sep 17 00:00:00 2001 From: Jelle Siderius Date: Thu, 8 Aug 2024 10:11:52 +0200 Subject: [PATCH] Release 1.3.7 --- config/databases/production.json.sample | 6 ++++-- config/databases/staging.json.sample | 6 ++++-- dist/models/databasesModel.js | 9 ++++++++- dist/models/databasesModel.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- src/models/databasesModel.ts | 9 ++++++++- 7 files changed, 27 insertions(+), 9 deletions(-) diff --git a/config/databases/production.json.sample b/config/databases/production.json.sample index f43f370..8019511 100644 --- a/config/databases/production.json.sample +++ b/config/databases/production.json.sample @@ -12,7 +12,8 @@ "localProjectUrl": "example1.development", "wordpress": false, "commandsFolder": "commands/example-project", - "stagingUsername": "staging-username-1-placeholder" + "stagingUsername": "staging-username-1-placeholder", + "sshKeyName": "id_ed25519, will search in ~/ssh/" }, "production-username-2-placeholder": { "username": "example2", @@ -26,7 +27,8 @@ "localProjectUrl": "example2.development", "wordpress": false, "commandsFolder": "commands/example-project", - "stagingUsername": "staging-username-2-placeholder" + "stagingUsername": "staging-username-2-placeholder", + "sshKeyName": "id_ed25519, will search in ~/ssh/" } } } diff --git a/config/databases/staging.json.sample b/config/databases/staging.json.sample index fdc97d2..3991c54 100644 --- a/config/databases/staging.json.sample +++ b/config/databases/staging.json.sample @@ -11,7 +11,8 @@ "externalPhpPath": "", "localProjectUrl": "example1.development", "wordpress": false, - "commandsFolder": "commands/example-project" + "commandsFolder": "commands/example-project", + "sshKeyName": "id_ed25519, will search in ~/ssh/" }, "staging-username-2-placeholder": { "username": "example2", @@ -24,7 +25,8 @@ "externalPhpPath": "", "localProjectUrl": "example2.development", "wordpress": false, - "commandsFolder": "commands/example-project" + "commandsFolder": "commands/example-project", + "sshKeyName": "id_ed25519, will search in ~/ssh/" } } } diff --git a/dist/models/databasesModel.js b/dist/models/databasesModel.js index affdb13..7274f5c 100644 --- a/dist/models/databasesModel.js +++ b/dist/models/databasesModel.js @@ -7,6 +7,7 @@ const staging_json_1 = tslib_1.__importDefault(require("../../config/databases/s const production_json_1 = tslib_1.__importDefault(require("../../config/databases/production.json")); const path_1 = tslib_1.__importDefault(require("path")); const fs_1 = tslib_1.__importDefault(require("fs")); +const os_1 = tslib_1.__importDefault(require("os")); class DatabasesModel { constructor() { this.databasesList = []; @@ -23,7 +24,8 @@ class DatabasesModel { 'localProjectUrl': '', 'commandsFolder': '', 'stagingUsername': '', - 'externalElasticsearchPort': '' + 'externalElasticsearchPort': '', + 'sshKeyLocation': '' }; this.databaseDataSecond = { 'username': '', @@ -77,6 +79,11 @@ class DatabasesModel { databaseDataType.externalElasticsearchPort = database.externalElasticsearchPort; } // @ts-ignore + if (database.sshKeyName) { + // @ts-ignore + config.customConfig.sshKeyLocation = os_1.default.userInfo().homedir + '/.ssh/' + database.sshKeyName; + } + // @ts-ignore if (database.commandsFolder) { // @ts-ignore databaseDataType.commandsFolder = database.commandsFolder; diff --git a/dist/models/databasesModel.js.map b/dist/models/databasesModel.js.map index 65c454f..ca62a21 100644 --- a/dist/models/databasesModel.js.map +++ b/dist/models/databasesModel.js.map @@ -1 +1 @@ -{"version":3,"file":"databasesModel.js","sourceRoot":"","sources":["../../src/models/databasesModel.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,+FAAmE;AACnE,aAAa;AACb,qGAAyE;AACzE,wDAAwB;AACxB,oDAAoB;AAEpB,MAAM,cAAc;IAApB;QACQ,kBAAa,GAAyB,EAAE,CAAC;QACzC,iBAAY,GAAG;YACrB,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE,EAAE;YACV,oBAAoB,EAAE,EAAE;YACxB,uBAAuB,EAAE,EAAE;YAC3B,WAAW,EAAE,KAAK;YAClB,iBAAiB,EAAE,EAAE;YACrB,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,iBAAiB,EA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,CAAC,CAAA,CAAA;IACF,CAAC;CAAA;AAED,kBAAe,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"databasesModel.js","sourceRoot":"","sources":["../../src/models/databasesModel.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,+FAAmE;AACnE,aAAa;AACb,qGAAyE;AACzE,wDAAwB;AACxB,oDAAoB;AACpB,oDAAoB;AAEpB,MAAM,cAAc;IAApB;QACQ,kBAAa,GAAyB,EAAE,CAAC;QACzC,iBAAY,GAAG;YACrB,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE,EAAE;YACV,oBAAoB,EAAE,EAAE;YACxB,uBAAuB,EAAE,EAAE;YAC3B,WAAW,EAAE,KAAK;YAClB,iBAAiB,EAAE,EAAE;YACrB,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,iBAAiB,EAAE,EAAE;YACrB,2BAA2B,EAAE,EAAE;YAC/B,gBAAgB,EAAE,EAAE;SACpB,CAAC;QAEK,uBAAkB,GAAG;YAC3B,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE,EAAE;YACV,iBAAiB,EAAE,EAAE;YACrB,oBAAoB,EAAE,EAAE;YACxB,uBAAuB,EAAE,EAAE;YAC3B,WAAW,EAAE,KAAK;YAClB,iBAAiB,EAAE,EAAE;YACrB,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,2BAA2B,EAAE,EAAE;SAC/B,CAAC;QAEF,8CAA8C;QAC9C,wBAAmB,GAAG,CAAO,WAA0B,EAAE,YAA2B,EAAE,cAA8B,EAAE,MAAkB,EAAE,EAAE;YAC3I,aAAa;YACb,IAAI,SAAS,GAAG,sBAAgB,CAAC,SAAS,CAAC;YAC3C,aAAa;YACb,IA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Ae,GAAG,UAAU,CAAC;oCAC9C,CAAC;oCAED,IAAI,IAAI,IAAI,cAAc,EAAE,CAAC;wCAC5B,IAAI,IAAI,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;wCAC7C,IAAI,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wCAEtD,MAAM,CAAC,QAAQ,CAAC,eAAe,GAAG,UAAU,CAAC;oCAC9C,CAAC;gCACF,CAAC;4BACF,CAAC;wBACF,CAAC;oBACF,CAAC;oBAED,aAAa;oBACb,IAAI,QAAQ,CAAC,eAAe,EAAE,CAAC;wBAC9B,aAAa;wBACb,gBAAgB,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;wBAC5D,MAAM,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;oBAC1F,CAAC;gBACF,CAAC;qBAAM,CAAC;oBACP,uBAAuB;oBACvB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,YAAY,MAAM,QAAQ,CAAC,QAAQ,KAAK,GAAG,GAAG,CAAC,CAAC;gBACrF,CAAC;YACF,CAAC;QACF,CAAC,CAAA,CAAA;IACF,CAAC;CAAA;AAED,kBAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3f2e003..849f416 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "mage-db-sync", - "version": "1.3.6", + "version": "1.3.7", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 51c11ca..1905ac9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mage-db-sync", - "version": "1.3.6", + "version": "1.3.7", "description": "Database synchronizer for Magento, based on Magerun", "author": { "name": "Jelle Siderius" diff --git a/src/models/databasesModel.ts b/src/models/databasesModel.ts index bed4484..a582575 100644 --- a/src/models/databasesModel.ts +++ b/src/models/databasesModel.ts @@ -4,6 +4,7 @@ import stagingDatabases from "../../config/databases/staging.json"; import productionDatabases from "../../config/databases/production.json"; import path from "path"; import fs from "fs"; +import os from "os"; class DatabasesModel { public databasesList: { [k: string]: any } = []; @@ -20,7 +21,8 @@ class DatabasesModel { 'localProjectUrl': '', 'commandsFolder': '', 'stagingUsername': '', - 'externalElasticsearchPort': '' + 'externalElasticsearchPort': '', + 'sshKeyLocation': '' }; public databaseDataSecond = { @@ -78,6 +80,11 @@ class DatabasesModel { // @ts-ignore databaseDataType.externalElasticsearchPort = database.externalElasticsearchPort; } + // @ts-ignore + if (database.sshKeyName) { + // @ts-ignore + config.customConfig.sshKeyLocation = os.userInfo().homedir + '/.ssh/' + database.sshKeyName; + } // @ts-ignore if (database.commandsFolder) {