From 1cd46327bf9249ea0e69dee5e6996903daa64331 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 22:18:59 +0000 Subject: [PATCH 1/6] v0.9.160 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 510f605b3f..9c1d1db679 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.159", + "version": "0.9.160", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5af97cb10a..9c81a03a1b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.159", + "version": "0.9.160", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index bba2722293..dfb0fcb75b 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.159", + "version": "0.9.160", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index f09c2e9c59..856168470d 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.159", + "version": "0.9.160", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.159", - "@budibase/client": "^0.9.159", + "@budibase/bbui": "^0.9.160", + "@budibase/client": "^0.9.160", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.159", + "@budibase/string-templates": "^0.9.160", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4024bf0906..5f35fb3984 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.159", + "version": "0.9.160", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 4b1e88b2fa..a5252dcfdf 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.159", + "version": "0.9.160", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.159", + "@budibase/bbui": "^0.9.160", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.159", + "@budibase/string-templates": "^0.9.160", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index f3fa66a595..6a9c127f67 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.159", + "version": "0.9.160", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.159", - "@budibase/client": "^0.9.159", - "@budibase/string-templates": "^0.9.159", + "@budibase/auth": "^0.9.160", + "@budibase/client": "^0.9.160", + "@budibase/string-templates": "^0.9.160", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index fa2e0ae8c0..1459cd1f4d 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.159", + "version": "0.9.160", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 30e7107fd3..b628591971 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.159", + "version": "0.9.160", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.159", - "@budibase/string-templates": "^0.9.159", + "@budibase/auth": "^0.9.160", + "@budibase/string-templates": "^0.9.160", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 22527970b237e0cbc64f579fec1eebe42dc1c778 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 22:32:31 +0000 Subject: [PATCH 2/6] v0.9.161 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 9c1d1db679..3b72b76b32 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.160", + "version": "0.9.161", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 9c81a03a1b..2bfc50a6a3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.160", + "version": "0.9.161", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index dfb0fcb75b..2afd4a5f30 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.160", + "version": "0.9.161", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 856168470d..09f6fbc1e2 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.160", + "version": "0.9.161", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.160", - "@budibase/client": "^0.9.160", + "@budibase/bbui": "^0.9.161", + "@budibase/client": "^0.9.161", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.160", + "@budibase/string-templates": "^0.9.161", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 5f35fb3984..8bbef74dd7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.160", + "version": "0.9.161", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index a5252dcfdf..c79e9d0c61 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.160", + "version": "0.9.161", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.160", + "@budibase/bbui": "^0.9.161", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.160", + "@budibase/string-templates": "^0.9.161", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 6a9c127f67..5c5637e229 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.160", + "version": "0.9.161", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.160", - "@budibase/client": "^0.9.160", - "@budibase/string-templates": "^0.9.160", + "@budibase/auth": "^0.9.161", + "@budibase/client": "^0.9.161", + "@budibase/string-templates": "^0.9.161", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 1459cd1f4d..a758d157cb 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.160", + "version": "0.9.161", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index b628591971..cd8b590f4d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.160", + "version": "0.9.161", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.160", - "@budibase/string-templates": "^0.9.160", + "@budibase/auth": "^0.9.161", + "@budibase/string-templates": "^0.9.161", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 7a26f3769d54a14a202d8f36964844df9d7fb401 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 8 Oct 2021 18:21:40 +0100 Subject: [PATCH 3/6] Fixing some issues with cloud export/import, removing the ability to export and import your users as this was dangerous and didn't really work with passwords/SSO. --- .../admin/_components/ImportAppsModal.svelte | 5 ++- .../src/pages/builder/admin/index.svelte | 10 ++++- packages/builder/src/stores/portal/admin.js | 13 ++++++ .../server/src/api/controllers/application.js | 1 + packages/server/src/api/controllers/cloud.js | 41 ++++++++++++++----- packages/server/src/api/routes/cloud.js | 1 + .../worker/src/middleware/cloudRestricted.js | 2 +- 7 files changed, 58 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/pages/builder/admin/_components/ImportAppsModal.svelte b/packages/builder/src/pages/builder/admin/_components/ImportAppsModal.svelte index 633147e910..de29e11301 100644 --- a/packages/builder/src/pages/builder/admin/_components/ImportAppsModal.svelte +++ b/packages/builder/src/pages/builder/admin/_components/ImportAppsModal.svelte @@ -1,6 +1,7 @@ @@ -73,7 +81,7 @@ > Change organisation - {:else if !cloud} + {:else if !cloud && !imported} { diff --git a/packages/builder/src/stores/portal/admin.js b/packages/builder/src/stores/portal/admin.js index ebe8294060..b9ed0f04b8 100644 --- a/packages/builder/src/stores/portal/admin.js +++ b/packages/builder/src/stores/portal/admin.js @@ -9,6 +9,7 @@ export function createAdminStore() { cloud: false, disableAccountPortal: false, accountPortalUrl: "", + importComplete: false, onboardingProgress: 0, checklist: { apps: { checked: false }, @@ -45,6 +46,17 @@ export function createAdminStore() { } } + async function checkImportComplete() { + const response = await api.get(`/api/cloud/import/complete`) + if (response.status === 200) { + const json = await response.json() + admin.update(store => { + store.importComplete = json ? json.imported : false + return store + }) + } + } + async function getEnvironment() { let multiTenancyEnabled = false let cloud = false @@ -79,6 +91,7 @@ export function createAdminStore() { return { subscribe: admin.subscribe, init, + checkImportComplete, unload, } } diff --git a/packages/server/src/api/controllers/application.js b/packages/server/src/api/controllers/application.js index 6608ba0cac..e3aac8bd63 100644 --- a/packages/server/src/api/controllers/application.js +++ b/packages/server/src/api/controllers/application.js @@ -86,6 +86,7 @@ async function getAppUrlIfNotInUse(ctx) { if ( url && deployedApps[url] != null && + ctx.params != null && deployedApps[url].appId !== ctx.params.appId ) { ctx.throw(400, "App name/URL is already in use.") diff --git a/packages/server/src/api/controllers/cloud.js b/packages/server/src/api/controllers/cloud.js index aac79bb9dd..a0057d68e4 100644 --- a/packages/server/src/api/controllers/cloud.js +++ b/packages/server/src/api/controllers/cloud.js @@ -28,15 +28,18 @@ exports.exportApps = async ctx => { ctx.throw(400, "Exporting only allowed in multi-tenant cloud environments.") } const apps = await getAllApps(CouchDB, { all: true }) - const globalDBString = await exportDB(getGlobalDBName()) + const globalDBString = await exportDB(getGlobalDBName(), { + filter: doc => !doc._id.startsWith(DocumentTypes.USER), + }) let allDBs = { global: globalDBString, } for (let app of apps) { + const appId = app.appId || app._id // only export the dev apps as they will be the latest, the user can republish the apps // in their self hosted environment - if (isDevAppID(app._id)) { - allDBs[app.name] = await exportDB(app._id) + if (isDevAppID(appId)) { + allDBs[app.name] = await exportDB(appId) } } const filename = `cloud-export-${new Date().getTime()}.txt` @@ -53,16 +56,26 @@ async function getAllDocType(db, docType) { return response.rows.map(row => row.doc) } +async function hasBeenImported() { + if (!env.SELF_HOSTED || env.MULTI_TENANCY) { + return true + } + const apps = await getAllApps(CouchDB, { all: true }) + return apps.length !== 0 +} + +exports.hasBeenImported = async ctx => { + ctx.body = { + imported: await hasBeenImported(), + } +} + exports.importApps = async ctx => { if (!env.SELF_HOSTED || env.MULTI_TENANCY) { ctx.throw(400, "Importing only allowed in self hosted environments.") } - const apps = await getAllApps(CouchDB, { all: true }) - if ( - apps.length !== 0 || - !ctx.request.files || - !ctx.request.files.importFile - ) { + const beenImported = await hasBeenImported() + if (beenImported || !ctx.request.files || !ctx.request.files.importFile) { ctx.throw( 400, "Import file is required and environment must be fresh to import apps." @@ -80,11 +93,17 @@ exports.importApps = async ctx => { for (let [appName, appImport] of Object.entries(dbs)) { await createApp(appName, appImport) } - // once apps are created clean up the global db + + // if there are any users make sure to remove them let users = await getAllDocType(globalDb, DocumentTypes.USER) + let userDeletionPromises = [] for (let user of users) { - delete user.tenantId + userDeletionPromises.push(globalDb.remove(user._id, user._rev)) } + if (userDeletionPromises.length > 0) { + await Promise.all(userDeletionPromises) + } + await globalDb.bulkDocs(users) ctx.body = { message: "Apps successfully imported.", diff --git a/packages/server/src/api/routes/cloud.js b/packages/server/src/api/routes/cloud.js index 214473f43f..02b501c399 100644 --- a/packages/server/src/api/routes/cloud.js +++ b/packages/server/src/api/routes/cloud.js @@ -9,5 +9,6 @@ router .get("/api/cloud/export", authorized(BUILDER), controller.exportApps) // has to be public, only run if apps don't exist .post("/api/cloud/import", controller.importApps) + .get("/api/cloud/import/complete", controller.hasBeenImported) module.exports = router diff --git a/packages/worker/src/middleware/cloudRestricted.js b/packages/worker/src/middleware/cloudRestricted.js index 10cdeaebd4..b29093f77e 100644 --- a/packages/worker/src/middleware/cloudRestricted.js +++ b/packages/worker/src/middleware/cloudRestricted.js @@ -6,7 +6,7 @@ const { Headers } = require("@budibase/auth").constants * Ensure that the correct API key has been supplied. */ module.exports = async (ctx, next) => { - if (!env.SELF_HOSTED) { + if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) { const apiKey = ctx.request.headers[Headers.API_KEY] if (apiKey !== env.INTERNAL_API_KEY) { ctx.throw(403, "Unauthorized") From 9f14471ab547424f5a9681415ab88e44c27b99d0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 11 Oct 2021 15:17:21 +0000 Subject: [PATCH 4/6] v0.9.162 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 3b72b76b32..4b3ac04296 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.161", + "version": "0.9.162", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 2bfc50a6a3..8f960007d3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.161", + "version": "0.9.162", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 2afd4a5f30..26ba439ab3 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.161", + "version": "0.9.162", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 09f6fbc1e2..5d47275ea1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.161", + "version": "0.9.162", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.161", - "@budibase/client": "^0.9.161", + "@budibase/bbui": "^0.9.162", + "@budibase/client": "^0.9.162", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.161", + "@budibase/string-templates": "^0.9.162", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8bbef74dd7..6cf4e06f5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.161", + "version": "0.9.162", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index c79e9d0c61..55e833091a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.161", + "version": "0.9.162", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.161", + "@budibase/bbui": "^0.9.162", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.161", + "@budibase/string-templates": "^0.9.162", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 5c5637e229..16c0ef0650 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.161", + "version": "0.9.162", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.161", - "@budibase/client": "^0.9.161", - "@budibase/string-templates": "^0.9.161", + "@budibase/auth": "^0.9.162", + "@budibase/client": "^0.9.162", + "@budibase/string-templates": "^0.9.162", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a758d157cb..445d2f9e87 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.161", + "version": "0.9.162", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index cd8b590f4d..02eee2ad5c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.161", + "version": "0.9.162", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.161", - "@budibase/string-templates": "^0.9.161", + "@budibase/auth": "^0.9.162", + "@budibase/string-templates": "^0.9.162", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 1e4799ce9c113fca07ea4e9f77f05c616cb39a68 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 11 Oct 2021 17:59:44 +0100 Subject: [PATCH 5/6] Fixing an issue with env variables becoming numbers if they started with one. --- packages/server/src/environment.js | 7 ++++--- packages/worker/src/environment.js | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index e7bc35b04b..4044bb3787 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -74,9 +74,10 @@ module.exports = { }, } -// convert any strings to numbers if required, like "0" would be true otherwise +// clean up any environment variable edge cases for (let [key, value] of Object.entries(module.exports)) { - if (typeof value === "string" && !isNaN(parseInt(value))) { - module.exports[key] = parseInt(value) + // handle the edge case of "0" to disable an environment variable + if (value === "0") { + module.exports[key] = 0 } } diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 74bd40314c..a1fab84112 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -52,3 +52,11 @@ module.exports = { return !isDev() }, } + +// clean up any environment variable edge cases +for (let [key, value] of Object.entries(module.exports)) { + // handle the edge case of "0" to disable an environment variable + if (value === "0") { + module.exports[key] = 0 + } +} From a71ea88855222a44e32fdcbab8ece22806f344ea Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 11 Oct 2021 17:22:28 +0000 Subject: [PATCH 6/6] v0.9.163 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 4b3ac04296..9d4d302f12 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.162", + "version": "0.9.163", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 8f960007d3..fbf9c98ddb 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.162", + "version": "0.9.163", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 26ba439ab3..362c4732e4 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.162", + "version": "0.9.163", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 5d47275ea1..a3d7488a27 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.162", + "version": "0.9.163", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.162", - "@budibase/client": "^0.9.162", + "@budibase/bbui": "^0.9.163", + "@budibase/client": "^0.9.163", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.162", + "@budibase/string-templates": "^0.9.163", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 6cf4e06f5c..e2cb7da75a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.162", + "version": "0.9.163", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 55e833091a..d445cae044 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.162", + "version": "0.9.163", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.162", + "@budibase/bbui": "^0.9.163", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.162", + "@budibase/string-templates": "^0.9.163", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 16c0ef0650..ca054202ea 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.162", + "version": "0.9.163", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.162", - "@budibase/client": "^0.9.162", - "@budibase/string-templates": "^0.9.162", + "@budibase/auth": "^0.9.163", + "@budibase/client": "^0.9.163", + "@budibase/string-templates": "^0.9.163", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 445d2f9e87..883ebdc6bd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.162", + "version": "0.9.163", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 02eee2ad5c..93e0f271d9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.162", + "version": "0.9.163", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.162", - "@budibase/string-templates": "^0.9.162", + "@budibase/auth": "^0.9.163", + "@budibase/string-templates": "^0.9.163", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",