From 13c368109e733984cc110120f2cd0b09791c1229 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 8 Apr 2021 17:39:46 +0100 Subject: [PATCH] Some changes after trying system for first time. --- hosting/docker-compose.yaml | 1 + hosting/envoy.dev.yaml.hbs | 4 ++++ packages/server/scripts/dev/manage.js | 3 --- packages/server/src/app.js | 3 ++- packages/worker/scripts/dev/manage.js | 4 +--- packages/worker/src/index.js | 3 ++- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 49f8cddccd..5e21cc9efd 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -35,6 +35,7 @@ services: environment: SELF_HOSTED: 1 PORT: 4003 + JWT_SECRET: ${JWT_SECRET} MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} MINIO_URL: http://minio-service:9000 diff --git a/hosting/envoy.dev.yaml.hbs b/hosting/envoy.dev.yaml.hbs index c2795fdb5f..40cfc551ef 100644 --- a/hosting/envoy.dev.yaml.hbs +++ b/hosting/envoy.dev.yaml.hbs @@ -46,6 +46,10 @@ static_resources: route: cluster: builder-dev prefix_rewrite: "/builder/" + + # special case in dev to redirect no path to builder + - match: { path: "/" } + redirect: { path_redirect: "/builder/" } # minio is on the default route because this works # best, minio + AWS SDK doesn't handle path proxy diff --git a/packages/server/scripts/dev/manage.js b/packages/server/scripts/dev/manage.js index 7a318ff6ff..20037c7e3c 100644 --- a/packages/server/scripts/dev/manage.js +++ b/packages/server/scripts/dev/manage.js @@ -33,9 +33,6 @@ async function init() { fs.writeFileSync(envoyOutputPath, processStringSync(contents, config)) const envFilePath = path.join(process.cwd(), ".env") - if (fs.existsSync(envFilePath)) { - return - } const envFileJson = { PORT: 4001, MINIO_URL: "http://localhost:10000/", diff --git a/packages/server/src/app.js b/packages/server/src/app.js index e5e9b77084..88776fadac 100644 --- a/packages/server/src/app.js +++ b/packages/server/src/app.js @@ -1,3 +1,5 @@ +// need to load environment first +const env = require("./environment") const Koa = require("koa") const destroyable = require("server-destroy") const electron = require("electron") @@ -5,7 +7,6 @@ const koaBody = require("koa-body") const logger = require("koa-pino-logger") const http = require("http") const api = require("./api") -const env = require("./environment") const eventEmitter = require("./events") const automations = require("./automations/index") const Sentry = require("@sentry/node") diff --git a/packages/worker/scripts/dev/manage.js b/packages/worker/scripts/dev/manage.js index b7e92f6d15..f363bd05ac 100644 --- a/packages/worker/scripts/dev/manage.js +++ b/packages/worker/scripts/dev/manage.js @@ -4,12 +4,10 @@ const fs = require("fs") async function init() { const envFilePath = path.join(process.cwd(), ".env") - if (fs.existsSync(envFilePath)) { - return - } const envFileJson = { SELF_HOSTED: 1, PORT: 4002, + JWT_SECRET: "testsecret", MINIO_ACCESS_KEY: "budibase", MINIO_SECRET_KEY: "budibase", COUCH_DB_USER: "budibase", diff --git a/packages/worker/src/index.js b/packages/worker/src/index.js index 2e031b9f64..55f2705ed1 100644 --- a/packages/worker/src/index.js +++ b/packages/worker/src/index.js @@ -1,3 +1,5 @@ +// need to load environment first +const env = require("./environment") const Koa = require("koa") const destroyable = require("server-destroy") const koaBody = require("koa-body") @@ -5,7 +7,6 @@ const { passport } = require("@budibase/auth") const logger = require("koa-pino-logger") const http = require("http") const api = require("./api") -const env = require("./environment") const app = new Koa()