diff --git a/gbot.cmd b/gbot.cmd index 2acfb338..3d335405 100644 --- a/gbot.cmd +++ b/gbot.cmd @@ -9,7 +9,7 @@ CALL npm install --silent :COMPILE IF EXIST dist goto ALLSET ECHO Compiling... -CALL tsc +CALL node_modules\.bin\tsc :ALLSET node boot.js diff --git a/package-lock.json b/package-lock.json index 6b82d3cf..79316c08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.0", + "version": "1.3.10", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2652,6 +2652,25 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, + "fetch-ponyfill": { + "version": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", + "from": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", + "requires": { + "fetch-cookie": "~0.6.0", + "node-fetch": "~1.7.1" + }, + "dependencies": { + "fetch-cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.6.0.tgz", + "integrity": "sha1-T+xOQIzAAH9sBOVTYYr0s97jf2k=", + "requires": { + "es6-denodeify": "^0.1.1", + "tough-cookie": "^2.3.1" + } + } + } + }, "har-validator": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", @@ -2682,7 +2701,6 @@ "@types/node-fetch": "^1.6.7", "@types/uuid": "^3.4.3", "fetch-cookie": "^0.7.0", - "fetch-ponyfill": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", "form-data": "^2.3.2", "is-buffer": "^2.0.0", "is-stream": "^1.1.0", @@ -2934,6 +2952,25 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, + "fetch-ponyfill": { + "version": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", + "from": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", + "requires": { + "fetch-cookie": "~0.6.0", + "node-fetch": "~1.7.1" + }, + "dependencies": { + "fetch-cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.6.0.tgz", + "integrity": "sha1-T+xOQIzAAH9sBOVTYYr0s97jf2k=", + "requires": { + "es6-denodeify": "^0.1.1", + "tough-cookie": "^2.3.1" + } + } + } + }, "har-validator": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", @@ -2964,7 +3001,6 @@ "@types/node-fetch": "^1.6.7", "@types/uuid": "^3.4.3", "fetch-cookie": "^0.7.0", - "fetch-ponyfill": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", "form-data": "^2.3.2", "is-buffer": "^2.0.0", "is-stream": "^1.1.0", @@ -6131,25 +6167,6 @@ "tough-cookie": "^2.3.1" } }, - "fetch-ponyfill": { - "version": "github:amarzavery/fetch-ponyfill#136e6f8192bdb2aa0b7983f0b3b4361c357be9db", - "from": "github:amarzavery/fetch-ponyfill#master", - "requires": { - "fetch-cookie": "~0.6.0", - "node-fetch": "~1.7.1" - }, - "dependencies": { - "fetch-cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.6.0.tgz", - "integrity": "sha1-T+xOQIzAAH9sBOVTYYr0s97jf2k=", - "requires": { - "es6-denodeify": "^0.1.1", - "tough-cookie": "^2.3.1" - } - } - } - }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", diff --git a/packages/core.gbapp/services/GBCoreService.ts b/packages/core.gbapp/services/GBCoreService.ts index c7b9454a..593da49a 100644 --- a/packages/core.gbapp/services/GBCoreService.ts +++ b/packages/core.gbapp/services/GBCoreService.ts @@ -303,7 +303,8 @@ STORAGE_SYNC=true try { instances = await core.loadInstances(); const instance = instances[0]; - if (process.env.NODE_ENV === 'development') { + if (process.env.NODE_ENV === 'development' && + GBConfigService.get('REVERSE_PROXY') === undefined) { GBLog.info(`Updating bot endpoint to local reverse proxy (ngrok)...`); try { await installationDeployer.updateBotProxy( diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 578cea90..ebeab376 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -137,7 +137,7 @@ export class GBDeployer { WaitUntil() .interval(1000) - .times(10) + .times(5) .condition(cb => { GBLog.info(`Waiting for app package deployment...`); cb(appPackagesProcessed === gbappPackages.length); @@ -432,7 +432,7 @@ export class GBDeployer { GBLog.info(`Compiling ${e}...`); try { - child_process.execSync(Path.join(e, 'node_modules/.bin/tsc'), { cwd: e }); + child_process.execSync(Path.join(process.env.PWD, 'node_modules/.bin/tsc'), { cwd: e }); import(e) .then(m => { const p = new m.Package(); diff --git a/src/app.ts b/src/app.ts index d5543eb8..e5f5df1a 100644 --- a/src/app.ts +++ b/src/app.ts @@ -97,10 +97,16 @@ export class GBServer { const conversationalService: GBConversationalService = new GBConversationalService(core); if (process.env.NODE_ENV === 'development') { - // Ensure that local development proxy is setup. + const proxy = GBConfigService.get('REVERSE_PROXY'); + if (proxy !== undefined) { + GBServer.globals.publicAddress = proxy; + } + else { + // Ensure that local development proxy is setup. - GBLog.info(`Establishing a development local proxy (ngrok)...`); - GBServer.globals.publicAddress = await core.ensureProxy(port); + GBLog.info(`Establishing a development local proxy (ngrok)...`); + GBServer.globals.publicAddress = await core.ensureProxy(port); + } } else { const serverAddress = `https://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`; GBLog.info(`Defining server address at ${serverAddress}...`);