From f9c82e5059ea541e6dfae41c88bbf117af141ac0 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Fri, 17 Sep 2021 11:43:27 +0200 Subject: [PATCH 01/26] re-use sanitizeUrl utils method, add / if it's not added already --- .../design/NavigationPanel/NewScreenModal.svelte | 3 ++- .../PropertiesPanel/ScreenSettingsSection.svelte | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index ed0c764956..78f5d74e62 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -5,6 +5,7 @@ import { Input, Select, ModalContent, Toggle } from "@budibase/bbui" import getTemplates from "builderStore/store/screenTemplates" import analytics from "analytics" + import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" const CONTAINER = "@budibase/standard-components/container" @@ -84,7 +85,7 @@ if (!event.detail.startsWith("/")) { route = "/" + event.detail } - route = route.replace(/ +/g, "-") + route = sanitizeUrl(route) } diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index d782d1cd44..97e1e8a2b5 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -7,13 +7,17 @@ import RoleSelect from "./PropertyControls/RoleSelect.svelte" import { currentAsset, store } from "builderStore" import { FrontendTypes } from "constants" + import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" export let componentInstance export let bindings function setAssetProps(name, value, parser) { if (parser && typeof parser === "function") { + console.log("before", value) value = parser(value) + console.log("after", value) + console.log("deepGet", deepGet($currentAsset, name)) } const selectedAsset = get(currentAsset) @@ -37,7 +41,12 @@ key: "routing.route", label: "Route", control: Input, - parser: val => val.replace(/ +/g, "-"), + parser: val => { + if (!val.startsWith("/")) { + val = "/" + val + } + return sanitizeUrl(val) + }, }, { key: "routing.roleId", label: "Access", control: RoleSelect }, { key: "layoutId", label: "Layout", control: LayoutSelect }, From cd4765664dfc22c22f81969bcffeca99bb22ed75 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 22 Sep 2021 08:49:33 +0200 Subject: [PATCH 02/26] remove console.log --- .../design/PropertiesPanel/ScreenSettingsSection.svelte | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index 97e1e8a2b5..efe51ebdac 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -14,10 +14,7 @@ function setAssetProps(name, value, parser) { if (parser && typeof parser === "function") { - console.log("before", value) value = parser(value) - console.log("after", value) - console.log("deepGet", deepGet($currentAsset, name)) } const selectedAsset = get(currentAsset) From e75610b78044f5e6d0ab9db1f3e10e757666544d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 1 Oct 2021 09:13:03 +0000 Subject: [PATCH 03/26] v0.9.148 --- 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 99d86d0380..07435f204d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.148-alpha.2", + "version": "0.9.148", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index d628624531..3a392a0d57 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.148-alpha.2", + "version": "0.9.148", "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 1704b6e024..7cf6ce0a83 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.148-alpha.2", + "version": "0.9.148", "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 cb12e509ab..edb59cedb7 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.148-alpha.2", + "version": "0.9.148", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.148-alpha.2", - "@budibase/client": "^0.9.148-alpha.2", + "@budibase/bbui": "^0.9.148", + "@budibase/client": "^0.9.148", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.148-alpha.2", + "@budibase/string-templates": "^0.9.148", "@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 994f14b4ca..df1baa74c9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.148-alpha.2", + "version": "0.9.148", "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 8848220b6b..b86d72f48b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.148-alpha.2", + "version": "0.9.148", "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.148-alpha.2", + "@budibase/bbui": "^0.9.148", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.148-alpha.2", + "@budibase/string-templates": "^0.9.148", "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 5c33a8aeb8..e220141772 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.148-alpha.2", + "version": "0.9.148", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.2", - "@budibase/client": "^0.9.148-alpha.2", - "@budibase/string-templates": "^0.9.148-alpha.2", + "@budibase/auth": "^0.9.148", + "@budibase/client": "^0.9.148", + "@budibase/string-templates": "^0.9.148", "@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 4fb15bd62d..01844cc0ee 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.148-alpha.2", + "version": "0.9.148", "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 6e16f86854..18487c0af3 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.148-alpha.2", + "version": "0.9.148", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.2", - "@budibase/string-templates": "^0.9.148-alpha.2", + "@budibase/auth": "^0.9.148", + "@budibase/string-templates": "^0.9.148", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 81e63373c4a7edabc2068363b918b6344466db70 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 1 Oct 2021 12:51:33 +0100 Subject: [PATCH 04/26] update envoy config for k8s --- hosting/kubernetes/envoy/envoy.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosting/kubernetes/envoy/envoy.yaml b/hosting/kubernetes/envoy/envoy.yaml index 4bf751b3a3..25a774dc7e 100644 --- a/hosting/kubernetes/envoy/envoy.yaml +++ b/hosting/kubernetes/envoy/envoy.yaml @@ -50,6 +50,11 @@ static_resources: route: cluster: app-service + - match: { path: "/api/deploy" } + route: + timeout: 60s + cluster: app-service + # special case for when API requests are made, can just forward, not to minio - match: { prefix: "/api/" } route: From be09410cae656abf893b5f89510fa839720a7c4c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 1 Oct 2021 13:29:08 +0100 Subject: [PATCH 05/26] Quick fix for worker, API key was not considered good enough to access worker, updated this and added better error to smtp action. --- packages/server/src/utilities/workerRequests.js | 3 ++- packages/worker/src/api/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utilities/workerRequests.js b/packages/server/src/utilities/workerRequests.js index 2ace265ca0..88771ef006 100644 --- a/packages/server/src/utilities/workerRequests.js +++ b/packages/server/src/utilities/workerRequests.js @@ -52,7 +52,8 @@ exports.sendSmtpEmail = async (to, from, subject, contents, automation) => { ) if (response.status !== 200) { - throw "Unable to send email." + const error = await response.text() + throw `Unable to send email - ${error}` } return response.json() } diff --git a/packages/worker/src/api/index.js b/packages/worker/src/api/index.js index e3cc6efbc4..3ed6a96ac1 100644 --- a/packages/worker/src/api/index.js +++ b/packages/worker/src/api/index.js @@ -87,7 +87,7 @@ router if (ctx.publicEndpoint) { return next() } - if (!ctx.isAuthenticated || !ctx.user.budibaseAccess) { + if ((!ctx.isAuthenticated || !ctx.user.budibaseAccess) && !ctx.internal) { ctx.throw(403, "Unauthorized - no public worker access") } return next() From aad4fe9f8e55715ab58764587d033e062e96a6fb Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 13:52:11 +0000 Subject: [PATCH 06/26] v0.9.148-alpha.8 --- 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 0a0da9c300..bffae8fb35 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index b5acd8c467..49fc6d3333 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "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 5d1c98dd0c..701da3394a 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.148-alpha.7", + "version": "0.9.148-alpha.8", "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 deca819917..02b6ee80c9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.148-alpha.7", - "@budibase/client": "^0.9.148-alpha.7", + "@budibase/bbui": "^0.9.148-alpha.8", + "@budibase/client": "^0.9.148-alpha.8", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.148-alpha.7", + "@budibase/string-templates": "^0.9.148-alpha.8", "@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 36a4e1647c..cd85460d36 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "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 7b56eaedf7..ab5ab5e9d3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "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.148-alpha.7", + "@budibase/bbui": "^0.9.148-alpha.8", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.148-alpha.7", + "@budibase/string-templates": "^0.9.148-alpha.8", "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 eaf710d30b..cc384a81a2 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.148-alpha.7", + "version": "0.9.148-alpha.8", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.7", - "@budibase/client": "^0.9.148-alpha.7", - "@budibase/string-templates": "^0.9.148-alpha.7", + "@budibase/auth": "^0.9.148-alpha.8", + "@budibase/client": "^0.9.148-alpha.8", + "@budibase/string-templates": "^0.9.148-alpha.8", "@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 e66ab2314f..bb6fba2c53 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.148-alpha.7", + "version": "0.9.148-alpha.8", "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 13e5bb615a..5f3275c96c 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.148-alpha.7", + "version": "0.9.148-alpha.8", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.7", - "@budibase/string-templates": "^0.9.148-alpha.7", + "@budibase/auth": "^0.9.148-alpha.8", + "@budibase/string-templates": "^0.9.148-alpha.8", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 8decbc20d5034b4d6604525e8a0d93efaa4fff98 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 1 Oct 2021 15:00:11 +0100 Subject: [PATCH 07/26] Fixing issue with created by/updated by on public forms, also fixing a small issue with analytics ping generating a 404. --- packages/server/src/api/controllers/analytics.js | 11 ++++++++--- packages/server/src/api/routes/analytics.js | 5 +++-- packages/server/src/utilities/rowProcessor/index.js | 10 ++++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/server/src/api/controllers/analytics.js b/packages/server/src/api/controllers/analytics.js index ef410aace5..e6e5d6a748 100644 --- a/packages/server/src/api/controllers/analytics.js +++ b/packages/server/src/api/controllers/analytics.js @@ -7,14 +7,19 @@ if (env.POSTHOG_TOKEN && env.ENABLE_ANALYTICS && !env.SELF_HOSTED) { posthogClient = new PostHog(env.POSTHOG_TOKEN) } -exports.isEnabled = async function (ctx) { +exports.isEnabled = async ctx => { ctx.body = { enabled: !env.SELF_HOSTED && env.ENABLE_ANALYTICS === "true", } } -exports.endUserPing = async (ctx, next) => { - if (!posthogClient) return next() +exports.endUserPing = async ctx => { + if (!posthogClient) { + ctx.body = { + ping: false, + } + return + } posthogClient.capture("budibase:end_user_ping", { userId: ctx.user && ctx.user._id, diff --git a/packages/server/src/api/routes/analytics.js b/packages/server/src/api/routes/analytics.js index 632e99d031..be27e7d19b 100644 --- a/packages/server/src/api/routes/analytics.js +++ b/packages/server/src/api/routes/analytics.js @@ -3,7 +3,8 @@ const controller = require("../controllers/analytics") const router = Router() -router.get("/api/analytics", controller.isEnabled) -router.post("/api/analytics/ping", controller.endUserPing) +router + .get("/api/analytics", controller.isEnabled) + .post("/api/analytics/ping", controller.endUserPing) module.exports = router diff --git a/packages/server/src/utilities/rowProcessor/index.js b/packages/server/src/utilities/rowProcessor/index.js index 07549dd8a8..55af87bc13 100644 --- a/packages/server/src/utilities/rowProcessor/index.js +++ b/packages/server/src/utilities/rowProcessor/index.js @@ -99,6 +99,7 @@ function processAutoColumn( row, opts = { reprocessing: false, noAutoRelationships: false } ) { + let noUser = !user || !user.userId let now = new Date().toISOString() // if a row doesn't have a revision then it doesn't exist yet const creating = !row._rev @@ -108,7 +109,12 @@ function processAutoColumn( } switch (schema.subtype) { case AutoFieldSubTypes.CREATED_BY: - if (creating && !opts.reprocessing && !opts.noAutoRelationships) { + if ( + creating && + !opts.reprocessing && + !opts.noAutoRelationships && + !noUser + ) { row[key] = [user.userId] } break @@ -118,7 +124,7 @@ function processAutoColumn( } break case AutoFieldSubTypes.UPDATED_BY: - if (!opts.reprocessing && !opts.noAutoRelationships) { + if (!opts.reprocessing && !opts.noAutoRelationships && !noUser) { row[key] = [user.userId] } break From f04baeaa7ed1cbf24ca4c861a1353b1306979b19 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 14:10:48 +0000 Subject: [PATCH 08/26] v0.9.148-alpha.9 --- 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 bffae8fb35..b020206a51 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 49fc6d3333..7139265d75 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "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 701da3394a..6adeccd2ab 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.148-alpha.8", + "version": "0.9.148-alpha.9", "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 02b6ee80c9..10b6765713 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.148-alpha.8", - "@budibase/client": "^0.9.148-alpha.8", + "@budibase/bbui": "^0.9.148-alpha.9", + "@budibase/client": "^0.9.148-alpha.9", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.148-alpha.8", + "@budibase/string-templates": "^0.9.148-alpha.9", "@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 cd85460d36..85a538abdc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "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 ab5ab5e9d3..df9ba10451 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "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.148-alpha.8", + "@budibase/bbui": "^0.9.148-alpha.9", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.148-alpha.8", + "@budibase/string-templates": "^0.9.148-alpha.9", "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 cc384a81a2..e0507bbbb3 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.148-alpha.8", + "version": "0.9.148-alpha.9", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.8", - "@budibase/client": "^0.9.148-alpha.8", - "@budibase/string-templates": "^0.9.148-alpha.8", + "@budibase/auth": "^0.9.148-alpha.9", + "@budibase/client": "^0.9.148-alpha.9", + "@budibase/string-templates": "^0.9.148-alpha.9", "@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 bb6fba2c53..c5bcf6c799 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.148-alpha.8", + "version": "0.9.148-alpha.9", "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 5f3275c96c..854ad85485 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.148-alpha.8", + "version": "0.9.148-alpha.9", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148-alpha.8", - "@budibase/string-templates": "^0.9.148-alpha.8", + "@budibase/auth": "^0.9.148-alpha.9", + "@budibase/string-templates": "^0.9.148-alpha.9", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From b4999f3f13cb93265447510838b8e9dca7085a63 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 1 Oct 2021 15:26:41 +0100 Subject: [PATCH 09/26] updating copy on self host flow --- .../builder/src/components/upgrade/UpgradeModal.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/upgrade/UpgradeModal.svelte b/packages/builder/src/components/upgrade/UpgradeModal.svelte index 570dcc06a1..a8702ee3eb 100644 --- a/packages/builder/src/components/upgrade/UpgradeModal.svelte +++ b/packages/builder/src/components/upgrade/UpgradeModal.svelte @@ -21,12 +21,12 @@ Upgrade to Budibase self-hosting for free, and get SSO, unlimited apps, - and more - and it only takes a few minutes!Self-host budibase for free, and get SSO, unlimited apps, and more - and + it only takes a few minutes! From 67a664e6ba4407f8cb351b0aec33a1b4a3172173 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 14:28:01 +0000 Subject: [PATCH 10/26] v0.9.149-alpha.0 --- 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 07435f204d..c76d2d90a0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.148", + "version": "0.9.149-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 3a392a0d57..316b1cea48 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.148", + "version": "0.9.149-alpha.0", "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 7cf6ce0a83..02326edbfd 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.148", + "version": "0.9.149-alpha.0", "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 edb59cedb7..88b27db26a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.148", + "version": "0.9.149-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.148", - "@budibase/client": "^0.9.148", + "@budibase/bbui": "^0.9.149-alpha.0", + "@budibase/client": "^0.9.149-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.148", + "@budibase/string-templates": "^0.9.149-alpha.0", "@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 df1baa74c9..5675a749b4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.148", + "version": "0.9.149-alpha.0", "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 b86d72f48b..c0cc0cb4f5 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.148", + "version": "0.9.149-alpha.0", "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.148", + "@budibase/bbui": "^0.9.149-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.148", + "@budibase/string-templates": "^0.9.149-alpha.0", "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 e220141772..2b2afab22f 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.148", + "version": "0.9.149-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148", - "@budibase/client": "^0.9.148", - "@budibase/string-templates": "^0.9.148", + "@budibase/auth": "^0.9.149-alpha.0", + "@budibase/client": "^0.9.149-alpha.0", + "@budibase/string-templates": "^0.9.149-alpha.0", "@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 01844cc0ee..1f9cb20760 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.148", + "version": "0.9.149-alpha.0", "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 18487c0af3..09f48f6dcb 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.148", + "version": "0.9.149-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.148", - "@budibase/string-templates": "^0.9.148", + "@budibase/auth": "^0.9.149-alpha.0", + "@budibase/string-templates": "^0.9.149-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From ff610d6516e0374bbbac78f8c8636bcbbf313729 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 1 Oct 2021 15:36:33 +0100 Subject: [PATCH 11/26] adding debug log for deployments --- .../server/src/api/controllers/deploy/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/server/src/api/controllers/deploy/index.js b/packages/server/src/api/controllers/deploy/index.js index 08f9072138..d68b2064d7 100644 --- a/packages/server/src/api/controllers/deploy/index.js +++ b/packages/server/src/api/controllers/deploy/index.js @@ -64,6 +64,7 @@ async function storeDeploymentHistory(deployment) { async function initDeployedApp(prodAppId) { const db = new CouchDB(prodAppId) + console.log("Reading automation docs") const automations = ( await db.allDocs( getAutomationParams(null, { @@ -71,12 +72,17 @@ async function initDeployedApp(prodAppId) { }) ) ).rows.map(row => row.doc) + console.log("You have " + automations.length + " automations") const promises = [] + console.log("Disabling prod crons..") await disableAllCrons(prodAppId) + console.log("Prod Cron triggers disabled..") + console.log("Enabling cron triggers for deployed app..") for (let automation of automations) { promises.push(enableCronTrigger(prodAppId, automation)) } await Promise.all(promises) + console.log("Enabled cron triggers for deployed app..") } async function deployApp(deployment) { @@ -88,13 +94,18 @@ async function deployApp(deployment) { target: productionAppId, }) + console.log("Replication object created") + await replication.replicate() + console.log("replication complete.. replacing app meta doc") const db = new CouchDB(productionAppId) const appDoc = await db.get(DocumentTypes.APP_METADATA) appDoc.appId = productionAppId appDoc.instance._id = productionAppId await db.put(appDoc) + console.log("New app doc written successfully.") + console.log("Setting up live repl between dev and prod") // Set up live sync between the live and dev instances const liveReplication = new Replication({ source: productionAppId, @@ -105,8 +116,11 @@ async function deployApp(deployment) { return doc._id !== DocumentTypes.APP_METADATA }, }) + console.log("Set up live repl between dev and prod") + console.log("Initialising deployed app") await initDeployedApp(productionAppId) + console.log("Init complete, setting deployment to successful") deployment.setStatus(DeploymentStatus.SUCCESS) await storeDeploymentHistory(deployment) } catch (err) { @@ -153,9 +167,13 @@ exports.deploymentProgress = async function (ctx) { exports.deployApp = async function (ctx) { let deployment = new Deployment(ctx.appId) + console.log("Deployment object created") deployment.setStatus(DeploymentStatus.PENDING) + console.log("Deployment object set to pending") deployment = await storeDeploymentHistory(deployment) + console.log("Stored deployment history") + console.log("Deploying app...") await deployApp(deployment) ctx.body = deployment From 3c02b6a1c5e57fa1914cd2d1d5f5eda28e24e7fa Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 14:53:11 +0000 Subject: [PATCH 12/26] v0.9.149-alpha.1 --- 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 c76d2d90a0..24d8b5e55d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 316b1cea48..1115a94af6 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "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 02326edbfd..6b128f47b5 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.149-alpha.0", + "version": "0.9.149-alpha.1", "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 88b27db26a..99767c9edb 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.149-alpha.0", - "@budibase/client": "^0.9.149-alpha.0", + "@budibase/bbui": "^0.9.149-alpha.1", + "@budibase/client": "^0.9.149-alpha.1", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.149-alpha.0", + "@budibase/string-templates": "^0.9.149-alpha.1", "@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 5675a749b4..7e4630ed91 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "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 c0cc0cb4f5..7af2395686 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "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.149-alpha.0", + "@budibase/bbui": "^0.9.149-alpha.1", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.149-alpha.0", + "@budibase/string-templates": "^0.9.149-alpha.1", "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 2b2afab22f..077190f0d1 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.149-alpha.0", + "version": "0.9.149-alpha.1", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.0", - "@budibase/client": "^0.9.149-alpha.0", - "@budibase/string-templates": "^0.9.149-alpha.0", + "@budibase/auth": "^0.9.149-alpha.1", + "@budibase/client": "^0.9.149-alpha.1", + "@budibase/string-templates": "^0.9.149-alpha.1", "@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 1f9cb20760..da80896ef8 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.149-alpha.0", + "version": "0.9.149-alpha.1", "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 09f48f6dcb..ee8ebe7999 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.149-alpha.0", + "version": "0.9.149-alpha.1", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.0", - "@budibase/string-templates": "^0.9.149-alpha.0", + "@budibase/auth": "^0.9.149-alpha.1", + "@budibase/string-templates": "^0.9.149-alpha.1", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 3bef997168f6b677967f0eba23926ef12500ec07 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 1 Oct 2021 15:55:57 +0100 Subject: [PATCH 13/26] Support for tenancy subdomain locally + improvements --- package.json | 2 ++ .../builder/src/pages/builder/_layout.svelte | 32 +++++++++++++------ packages/worker/package.json | 4 ++- packages/worker/scripts/localdomain.js | 22 +++++++++++++ 4 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 packages/worker/scripts/localdomain.js diff --git a/package.json b/package.json index 3df577ca58..3596ec7800 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,8 @@ "multi:disable": "lerna run multi:disable", "selfhost:enable": "lerna run selfhost:enable", "selfhost:disable": "lerna run selfhost:disable", + "localdomain:enable": "lerna run localdomain:enable", + "localdomain:disable": "lerna run localdomain:disable", "postinstall": "husky install" } } diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte index 6cb78aa9da..625071c07e 100644 --- a/packages/builder/src/pages/builder/_layout.svelte +++ b/packages/builder/src/pages/builder/_layout.svelte @@ -14,16 +14,30 @@ $: useAccountPortal = cloud && !$admin.disableAccountPortal const validateTenantId = async () => { - // set the tenant from the url in the cloud - const tenantId = window.location.host.split(".")[0] + const host = window.location.host + if (host.includes("localhost:")) { + // ignore local dev + return + } - if (!tenantId.includes("localhost:")) { - // user doesn't have permission to access this tenant - kick them out - if (user && user.tenantId !== tenantId) { - await auth.logout() - await auth.setOrganisation(null) + if (user && user.tenantId) { + let urlTenantId + const hostParts = host.split(".") + + // only run validation when we know we are in a tenant url + // not when we visit the root budibase.app domain + // e.g. ['tenant', 'budibase', 'app'] vs ['budibase', 'app'] + if (hostParts.length > 2) { + urlTenantId = hostParts[0] } else { - await auth.setOrganisation(tenantId) + // no tenant in the url - send to account portal to fix this + window.location.href = $admin.accountPortalUrl + return + } + + if (user.tenantId !== urlTenantId) { + // user should not be here - play it safe and log them out + await auth.logout() } } } @@ -32,7 +46,7 @@ await auth.checkAuth() await admin.init() - if (cloud && multiTenancyEnabled) { + if (useAccountPortal && multiTenancyEnabled) { await validateTenantId() } diff --git a/packages/worker/package.json b/packages/worker/package.json index 09f48f6dcb..6b7a5cc307 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -20,7 +20,9 @@ "multi:enable": "node scripts/multiTenancy.js enable", "multi:disable": "node scripts/multiTenancy.js disable", "selfhost:enable": "node scripts/selfhost.js enable", - "selfhost:disable": "node scripts/selfhost.js disable" + "selfhost:disable": "node scripts/selfhost.js disable", + "localdomain:enable": "node scripts/localdomain.js enable", + "localdomain:disable": "node scripts/localdomain.js disable" }, "author": "Budibase", "license": "AGPL-3.0-or-later", diff --git a/packages/worker/scripts/localdomain.js b/packages/worker/scripts/localdomain.js new file mode 100644 index 0000000000..92f229f058 --- /dev/null +++ b/packages/worker/scripts/localdomain.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node +const updateDotEnv = require("update-dotenv") + +const arg = process.argv.slice(2)[0] + +/** + * For testing multi tenancy sub domains locally. + * + * Relies on an entry in /etc/hosts e.g: + * + * 127.0.0.1 local.com + * + * and an entry for each tenant you wish to test locally e.g: + * + * 127.0.0.1 t1.local.com + * 127.0.0.1 t2.local.com + */ +updateDotEnv({ + ACCOUNT_PORTAL_URL: + arg === "enable" ? "http://local.com:10001" : "http://localhost:10001", + COOKIE_DOMAIN: arg === "enable" ? ".local.com" : "", +}).then(() => console.log("Updated worker!")) From 8729fa27ac5333c19603f2f9126cac94cf993859 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 1 Oct 2021 16:05:48 +0100 Subject: [PATCH 14/26] Hide upgrade button / modal from non-root account holders --- .../builder/src/pages/builder/app/[application]/_layout.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index ae21a9dbb9..aaf948883d 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -92,7 +92,7 @@
- {#if $admin.cloud} + {#if $admin.cloud && $auth.user.account} {/if} From 4ada3e12be94fb1314fa8ef82c90f1281976a9c4 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 15:10:31 +0000 Subject: [PATCH 15/26] v0.9.149-alpha.2 --- 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 24d8b5e55d..e3077ceba8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 1115a94af6..a69c6e58b5 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "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 6b128f47b5..80a88c1afc 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.149-alpha.1", + "version": "0.9.149-alpha.2", "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 99767c9edb..1fd1267f44 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.149-alpha.1", - "@budibase/client": "^0.9.149-alpha.1", + "@budibase/bbui": "^0.9.149-alpha.2", + "@budibase/client": "^0.9.149-alpha.2", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.149-alpha.1", + "@budibase/string-templates": "^0.9.149-alpha.2", "@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 7e4630ed91..88e9737da9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "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 7af2395686..b5521391e0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "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.149-alpha.1", + "@budibase/bbui": "^0.9.149-alpha.2", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.149-alpha.1", + "@budibase/string-templates": "^0.9.149-alpha.2", "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 077190f0d1..116b0f91f6 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.149-alpha.1", + "version": "0.9.149-alpha.2", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.1", - "@budibase/client": "^0.9.149-alpha.1", - "@budibase/string-templates": "^0.9.149-alpha.1", + "@budibase/auth": "^0.9.149-alpha.2", + "@budibase/client": "^0.9.149-alpha.2", + "@budibase/string-templates": "^0.9.149-alpha.2", "@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 da80896ef8..6d58142344 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.149-alpha.1", + "version": "0.9.149-alpha.2", "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 ee8ebe7999..78c8299b39 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.149-alpha.1", + "version": "0.9.149-alpha.2", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -25,8 +25,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.1", - "@budibase/string-templates": "^0.9.149-alpha.1", + "@budibase/auth": "^0.9.149-alpha.2", + "@budibase/string-templates": "^0.9.149-alpha.2", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 47b80b7f2ad58cc073fb9becf6b169de4cbab98d Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 1 Oct 2021 16:12:07 +0100 Subject: [PATCH 16/26] Load account portal url from environment --- packages/builder/src/components/upgrade/UpgradeModal.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/upgrade/UpgradeModal.svelte b/packages/builder/src/components/upgrade/UpgradeModal.svelte index 570dcc06a1..f78b7abdea 100644 --- a/packages/builder/src/components/upgrade/UpgradeModal.svelte +++ b/packages/builder/src/components/upgrade/UpgradeModal.svelte @@ -1,10 +1,11 @@ From be265bf78743d55ac0954233456a4b7034f6f656 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 15:25:11 +0000 Subject: [PATCH 17/26] v0.9.149-alpha.3 --- 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 e3077ceba8..370edc641d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index a69c6e58b5..0a5cfdc4d2 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "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 80a88c1afc..53f3896a3c 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.149-alpha.2", + "version": "0.9.149-alpha.3", "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 1fd1267f44..1e255b5454 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.149-alpha.2", - "@budibase/client": "^0.9.149-alpha.2", + "@budibase/bbui": "^0.9.149-alpha.3", + "@budibase/client": "^0.9.149-alpha.3", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.149-alpha.2", + "@budibase/string-templates": "^0.9.149-alpha.3", "@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 88e9737da9..c5a9177c72 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "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 b5521391e0..51281424db 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "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.149-alpha.2", + "@budibase/bbui": "^0.9.149-alpha.3", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.149-alpha.2", + "@budibase/string-templates": "^0.9.149-alpha.3", "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 116b0f91f6..b2244d4d51 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.149-alpha.2", + "version": "0.9.149-alpha.3", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.2", - "@budibase/client": "^0.9.149-alpha.2", - "@budibase/string-templates": "^0.9.149-alpha.2", + "@budibase/auth": "^0.9.149-alpha.3", + "@budibase/client": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149-alpha.3", "@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 6d58142344..7c1b6627dc 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.149-alpha.2", + "version": "0.9.149-alpha.3", "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 2c20a09e25..f4cd707c3c 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.149-alpha.2", + "version": "0.9.149-alpha.3", "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.149-alpha.2", - "@budibase/string-templates": "^0.9.149-alpha.2", + "@budibase/auth": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149-alpha.3", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 7602985d25d111ef3526788f7395cb8c38709d70 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 1 Oct 2021 15:40:26 +0000 Subject: [PATCH 18/26] v0.9.149 --- 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 370edc641d..be05dd10ee 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.149-alpha.3", + "version": "0.9.149", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 0a5cfdc4d2..511e281fd1 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.149-alpha.3", + "version": "0.9.149", "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 53f3896a3c..57448a00f5 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.149-alpha.3", + "version": "0.9.149", "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 1e255b5454..df85bc1c91 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.149-alpha.3", + "version": "0.9.149", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.149-alpha.3", - "@budibase/client": "^0.9.149-alpha.3", + "@budibase/bbui": "^0.9.149", + "@budibase/client": "^0.9.149", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149", "@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 c5a9177c72..ddd1c18bc7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.149-alpha.3", + "version": "0.9.149", "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 51281424db..b6ea8d2413 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.149-alpha.3", + "version": "0.9.149", "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.149-alpha.3", + "@budibase/bbui": "^0.9.149", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149", "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 b2244d4d51..c194646311 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.149-alpha.3", + "version": "0.9.149", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.3", - "@budibase/client": "^0.9.149-alpha.3", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/auth": "^0.9.149", + "@budibase/client": "^0.9.149", + "@budibase/string-templates": "^0.9.149", "@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 7c1b6627dc..0f0dde1de7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.149-alpha.3", + "version": "0.9.149", "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 f4cd707c3c..8d4e99dd7e 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.149-alpha.3", + "version": "0.9.149", "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.149-alpha.3", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/auth": "^0.9.149", + "@budibase/string-templates": "^0.9.149", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From be7d3438689c55b323b92cd205845ad979d14fe7 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 1 Oct 2021 15:41:08 +0000 Subject: [PATCH 19/26] v0.9.149-alpha.4 --- 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 370edc641d..a6ede1d70f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 0a5cfdc4d2..c61d4b54f2 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "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 53f3896a3c..61e82d8706 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.149-alpha.3", + "version": "0.9.149-alpha.4", "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 1e255b5454..859d041080 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.149-alpha.3", - "@budibase/client": "^0.9.149-alpha.3", + "@budibase/bbui": "^0.9.149-alpha.4", + "@budibase/client": "^0.9.149-alpha.4", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149-alpha.4", "@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 c5a9177c72..25eeb3f8a0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "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 51281424db..348ad6d5e2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "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.149-alpha.3", + "@budibase/bbui": "^0.9.149-alpha.4", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/string-templates": "^0.9.149-alpha.4", "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 b2244d4d51..2b67d869e4 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.149-alpha.3", + "version": "0.9.149-alpha.4", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -64,9 +64,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.149-alpha.3", - "@budibase/client": "^0.9.149-alpha.3", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/auth": "^0.9.149-alpha.4", + "@budibase/client": "^0.9.149-alpha.4", + "@budibase/string-templates": "^0.9.149-alpha.4", "@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 7c1b6627dc..6721370381 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.149-alpha.3", + "version": "0.9.149-alpha.4", "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 f4cd707c3c..09fc3c2d85 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.149-alpha.3", + "version": "0.9.149-alpha.4", "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.149-alpha.3", - "@budibase/string-templates": "^0.9.149-alpha.3", + "@budibase/auth": "^0.9.149-alpha.4", + "@budibase/string-templates": "^0.9.149-alpha.4", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 80e767144492889bb1a334eda0a1f9326f77cf12 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 1 Oct 2021 17:16:43 +0100 Subject: [PATCH 20/26] Fix for many to many relationships where the union table has arbituarily named foreign key constraint columns, an example has been provided in the scripts directory. --- .../CreateEditRelationship.svelte | 18 ++++++++ .../customer-categories/docker-compose.yml | 28 +++++++++++++ .../integrations/customer-categories/init.sql | 41 +++++++++++++++++++ .../integrations/customer-categories/reset.sh | 3 ++ .../api/controllers/row/ExternalRequest.ts | 16 ++++---- packages/server/src/definitions/common.ts | 2 + packages/server/src/definitions/datasource.ts | 2 + packages/server/src/integrations/base/sql.ts | 6 ++- 8 files changed, 107 insertions(+), 9 deletions(-) create mode 100644 packages/server/scripts/integrations/customer-categories/docker-compose.yml create mode 100644 packages/server/scripts/integrations/customer-categories/init.sql create mode 100755 packages/server/scripts/integrations/customer-categories/reset.sh diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte index fbc2b401ef..583ca5e887 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/CreateEditRelationship/CreateEditRelationship.svelte @@ -156,6 +156,8 @@ ...relateTo, through: through._id, fieldName: fromTable.primary[0], + throughFrom: relateFrom.throughTo, + throughTo: relateFrom.throughFrom, } } else { // the relateFrom.fieldName should remain the same, as it is the foreignKey in the other @@ -251,6 +253,22 @@ bind:error={errors.through} bind:value={fromRelationship.through} /> + {#if fromTable && toTable && through} + ($touched.toForeign = true)} + bind:error={errors.toForeign} + bind:value={fromRelationship.throughFrom} + /> + {/if} {:else if fromRelationship?.relationshipType && toTable}