From 05005d153db3ebb81ef183ca181b1658a1cb1598 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sat, 25 May 2019 18:31:19 +0000 Subject: [PATCH 1/4] chore(release): 1.3.1 [skip ci] ## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) ### Bug Fixes * **core.gbapp:** Azure deployment. ([f1b8eb2](https://github.com/pragmatismo-io/BotServer/commit/f1b8eb2)) * **core.gbapp:** Azure deployment. ([49e1743](https://github.com/pragmatismo-io/BotServer/commit/49e1743)) * **core.gbapp:** Azure Deployment. ([f8fab38](https://github.com/pragmatismo-io/BotServer/commit/f8fab38)) * **core.gbapp:** ESNext in tsconfig.json to match MSFT. ([01b8dd5](https://github.com/pragmatismo-io/BotServer/commit/01b8dd5)) * **core.gbapp:** Fixing loading of instances. ([bc9c588](https://github.com/pragmatismo-io/BotServer/commit/bc9c588)) * **core.gbapp:** Investigating BASIC broken. ([f0ec25e](https://github.com/pragmatismo-io/BotServer/commit/f0ec25e)) * **core.gbapp:** package.json artifacts sync. ([01d34a6](https://github.com/pragmatismo-io/BotServer/commit/01d34a6)) * **core.gbapp:** Publishing in Azure. ([4d6779e](https://github.com/pragmatismo-io/BotServer/commit/4d6779e)) * **core.gbapp:** Removing POC code. ([56f46f4](https://github.com/pragmatismo-io/BotServer/commit/56f46f4)) * **kb.gbapp:** Typo fix. ([ba26578](https://github.com/pragmatismo-io/BotServer/commit/ba26578)) * **whatsapp.gblib:** Enabling Whatsapp. ([4351b87](https://github.com/pragmatismo-io/BotServer/commit/4351b87)) * **whatsapp.gblib:** Enabling Whatsapp. ([74f5936](https://github.com/pragmatismo-io/BotServer/commit/74f5936)) * **whatsapp.lib:** Enabling Whatsapp. ([85249e5](https://github.com/pragmatismo-io/BotServer/commit/85249e5)) --- CHANGELOG.md | 19 +++++++++++++++++++ package.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7ea92f..a14a2b88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) + + +### Bug Fixes + +* **core.gbapp:** Azure deployment. ([f1b8eb2](https://github.com/pragmatismo-io/BotServer/commit/f1b8eb2)) +* **core.gbapp:** Azure deployment. ([49e1743](https://github.com/pragmatismo-io/BotServer/commit/49e1743)) +* **core.gbapp:** Azure Deployment. ([f8fab38](https://github.com/pragmatismo-io/BotServer/commit/f8fab38)) +* **core.gbapp:** ESNext in tsconfig.json to match MSFT. ([01b8dd5](https://github.com/pragmatismo-io/BotServer/commit/01b8dd5)) +* **core.gbapp:** Fixing loading of instances. ([bc9c588](https://github.com/pragmatismo-io/BotServer/commit/bc9c588)) +* **core.gbapp:** Investigating BASIC broken. ([f0ec25e](https://github.com/pragmatismo-io/BotServer/commit/f0ec25e)) +* **core.gbapp:** package.json artifacts sync. ([01d34a6](https://github.com/pragmatismo-io/BotServer/commit/01d34a6)) +* **core.gbapp:** Publishing in Azure. ([4d6779e](https://github.com/pragmatismo-io/BotServer/commit/4d6779e)) +* **core.gbapp:** Removing POC code. ([56f46f4](https://github.com/pragmatismo-io/BotServer/commit/56f46f4)) +* **kb.gbapp:** Typo fix. ([ba26578](https://github.com/pragmatismo-io/BotServer/commit/ba26578)) +* **whatsapp.gblib:** Enabling Whatsapp. ([4351b87](https://github.com/pragmatismo-io/BotServer/commit/4351b87)) +* **whatsapp.gblib:** Enabling Whatsapp. ([74f5936](https://github.com/pragmatismo-io/BotServer/commit/74f5936)) +* **whatsapp.lib:** Enabling Whatsapp. ([85249e5](https://github.com/pragmatismo-io/BotServer/commit/85249e5)) + # [1.3.0](https://github.com/pragmatismo-io/BotServer/compare/1.2.2...1.3.0) (2019-05-12) diff --git a/package.json b/package.json index 24b2dd19..6441563e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.0", + "version": "1.3.1", "description": "General Bot Community Edition open-core server.", "main": "./src/app.ts", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", -- 2.39.5 From 488de3895b5604fb93e35d2c7ccdd87811907904 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sun, 26 May 2019 23:41:29 +0000 Subject: [PATCH 2/4] chore(release): 1.3.2 [skip ci] ## [1.3.2](https://github.com/pragmatismo-io/BotServer/compare/1.3.1...1.3.2) (2019-05-26) ### Bug Fixes * **core.gbapp:** Self-replication on Azure. ([2ccae38](https://github.com/pragmatismo-io/BotServer/commit/2ccae38)) * **core.gbapp:** Self-replication on Azure. ([4b7d29d](https://github.com/pragmatismo-io/BotServer/commit/4b7d29d)) --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a14a2b88..1e7d6fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.3.2](https://github.com/pragmatismo-io/BotServer/compare/1.3.1...1.3.2) (2019-05-26) + + +### Bug Fixes + +* **core.gbapp:** Self-replication on Azure. ([2ccae38](https://github.com/pragmatismo-io/BotServer/commit/2ccae38)) +* **core.gbapp:** Self-replication on Azure. ([4b7d29d](https://github.com/pragmatismo-io/BotServer/commit/4b7d29d)) + ## [1.3.1](https://github.com/pragmatismo-io/BotServer/compare/1.3.0...1.3.1) (2019-05-25) diff --git a/package.json b/package.json index 6441563e..8a5fd116 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.1", + "version": "1.3.2", "description": "General Bot Community Edition open-core server.", "main": "./src/app.ts", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", -- 2.39.5 From e283a6d003148bb41826ca8ad09702fd66bb6bb6 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 27 May 2019 11:55:26 +0000 Subject: [PATCH 3/4] chore(release): 1.3.3 [skip ci] ## [1.3.3](https://github.com/pragmatismo-io/BotServer/compare/1.3.2...1.3.3) (2019-05-27) ### Bug Fixes * **core.gbapp:** Self-replication on Azure ([bf602c6](https://github.com/pragmatismo-io/BotServer/commit/bf602c6)) * **core.gbapp:** Self-replication on Azure ([3cca504](https://github.com/pragmatismo-io/BotServer/commit/3cca504)) * **core.gbapp:** Self-replication on Azure ([05edafd](https://github.com/pragmatismo-io/BotServer/commit/05edafd)) --- CHANGELOG.md | 9 +++++++++ package.json | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7d6fb2..ad5d9150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [1.3.3](https://github.com/pragmatismo-io/BotServer/compare/1.3.2...1.3.3) (2019-05-27) + + +### Bug Fixes + +* **core.gbapp:** Self-replication on Azure ([bf602c6](https://github.com/pragmatismo-io/BotServer/commit/bf602c6)) +* **core.gbapp:** Self-replication on Azure ([3cca504](https://github.com/pragmatismo-io/BotServer/commit/3cca504)) +* **core.gbapp:** Self-replication on Azure ([05edafd](https://github.com/pragmatismo-io/BotServer/commit/05edafd)) + ## [1.3.2](https://github.com/pragmatismo-io/BotServer/compare/1.3.1...1.3.2) (2019-05-26) diff --git a/package.json b/package.json index ce53f299..9ae831a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "botserver", - "version": "1.3.2", + "version": "1.3.3", "description": "General Bot Community Edition open-core server.", "main": "./boot.js", "bugs": "https://github.com/pragmatismo-io/BotServer/issues", @@ -245,4 +245,4 @@ "post-merge": [] } } -} \ No newline at end of file +} -- 2.39.5 From e82a813433123715de666447d7b590f265a752fa Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Mon, 27 May 2019 09:14:49 -0300 Subject: [PATCH 4/4] fix(core.gbapp): Self-replication on Azure --- packages/core.gbapp/services/GBDeployer.ts | 2 +- .../services/WhatsappDirectLine.ts | 2 +- src/app.ts | 20 ++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 1d0d7d96..0d113234 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -349,7 +349,7 @@ export class GBDeployer { botPackages.forEach(async (e) => { if (e !== 'packages\\boot.gbot') { GBLog.info(`Deploying bot: ${e}...`); - await _this.deployBot(e, GBServer.globals.proxyAddress); + await _this.deployBot(e, GBServer.globals.publicAddress); GBLog.info(`Bot: ${e} deployed...`); } }); diff --git a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts index bcf88d6f..fee48f3b 100644 --- a/packages/whatsapp.gblib/services/WhatsappDirectLine.ts +++ b/packages/whatsapp.gblib/services/WhatsappDirectLine.ts @@ -58,7 +58,7 @@ export class WhatsappDirectLine extends GBService { url: urlJoin(this.whatsappServiceUrl, 'webhook'), qs: { token: this.whatsappServiceKey, - webhookUrl: `${GBServer.globals.proxyAddress}/instances/${this.botId}/whatsapp`, + webhookUrl: `${GBServer.globals.publicAddress}/instances/${this.botId}/whatsapp`, set: true }, headers: { diff --git a/src/app.ts b/src/app.ts index 7367e727..2f826991 100644 --- a/src/app.ts +++ b/src/app.ts @@ -55,7 +55,7 @@ const appPackages: IGBPackage[] = []; * Global shared server data; */ export class RootData { - public proxyAddress: string; + public publicAddress: string; } /** @@ -93,10 +93,16 @@ export class GBServer { const adminService: GBAdminService = new GBAdminService(core); const conversationalService: GBConversationalService = new GBConversationalService(core); - // Ensure that local development proxy is setup. + if (process.env.NODE_ENV === 'development') { + // Ensure that local development proxy is setup. - GBLog.info(`Establishing a development local proxy (ngrok)...`); - GBServer.globals.proxyAddress = await core.ensureProxy(port); + GBLog.info(`Establishing a development local proxy (ngrok)...`); + GBServer.globals.publicAddress = await core.ensureProxy(port); + } else { + const serverAddress = `http://${process.env.WEBSITE_SITE_NAME}.azurewebsites.net`; + GBLog.info(`Defining server address at ${serverAddress}...`); + GBServer.globals.publicAddress = serverAddress; + } // Creates a boot instance or load it from storage. @@ -105,7 +111,7 @@ export class GBServer { await core.initStorage(); } catch (error) { GBLog.verbose(`Error initializing storage: ${error}`); - bootInstance = await core.createBootInstance(core, azureDeployer, GBServer.globals.proxyAddress); + bootInstance = await core.createBootInstance(core, azureDeployer, GBServer.globals.publicAddress); await core.initStorage(); } @@ -133,7 +139,7 @@ export class GBServer { const fullInstance = Object.assign(packageInstance, bootInstance); await core.saveInstance(fullInstance); let instances: IGBInstance[] = await core.loadAllInstances(core, azureDeployer, - GBServer.globals.proxyAddress); + GBServer.globals.publicAddress); instances = await core.ensureInstances(instances, bootInstance, core); if (bootInstance !== undefined) { bootInstance = instances[0]; @@ -143,7 +149,7 @@ export class GBServer { const minService: GBMinService = new GBMinService(core, conversationalService, adminService, deployer); await minService.buildMin(bootInstance, server, appPackages, instances, - deployer, GBServer.globals.proxyAddress); + deployer, GBServer.globals.publicAddress); // Deployment of local applications for the first time. -- 2.39.5