From 3b819892509b10a5eef13a7bff020363b2042985 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 21 May 2021 14:38:46 +0100 Subject: [PATCH] Making sure the email sends out the write port if no platform URL is set. --- hosting/docker-compose.yaml | 1 + packages/worker/scripts/dev/manage.js | 1 + packages/worker/src/environment.js | 1 + packages/worker/src/utilities/templates.js | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index b609f5d962..37657ce009 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -35,6 +35,7 @@ services: environment: SELF_HOSTED: 1 PORT: 4003 + CLUSTER_PORT: ${MAIN_PORT} JWT_SECRET: ${JWT_SECRET} MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} diff --git a/packages/worker/scripts/dev/manage.js b/packages/worker/scripts/dev/manage.js index f7216befb5..b9d28b6278 100644 --- a/packages/worker/scripts/dev/manage.js +++ b/packages/worker/scripts/dev/manage.js @@ -7,6 +7,7 @@ async function init() { const envFileJson = { SELF_HOSTED: 1, PORT: 4002, + CLUSTER_PORT: 10000, JWT_SECRET: "testsecret", INTERNAL_API_KEY: "budibase", MINIO_ACCESS_KEY: "budibase", diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 11eed33982..384230b9b3 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -19,6 +19,7 @@ if (!LOADED && isDev() && !isTest()) { module.exports = { SELF_HOSTED: process.env.SELF_HOSTED, PORT: process.env.PORT, + CLUSTER_PORT: process.env.CLUSTER_PORT, MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY, MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY, MINIO_URL: process.env.MINIO_URL, diff --git a/packages/worker/src/utilities/templates.js b/packages/worker/src/utilities/templates.js index 86436a2f29..3ac897c10f 100644 --- a/packages/worker/src/utilities/templates.js +++ b/packages/worker/src/utilities/templates.js @@ -7,8 +7,9 @@ const { EmailTemplatePurpose, } = require("../constants") const { checkSlashesInUrl } = require("./index") +const env = require("../environment") -const LOCAL_URL = `http://localhost:10000` +const LOCAL_URL = `http://localhost:${env.CLUSTER_PORT || 10000}` const BASE_COMPANY = "Budibase" exports.getSettingsTemplateContext = async (purpose, code = null) => {