From 296a327ee9ac1f0438e5cce1a2dd1b496bd76ab8 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 18 May 2022 21:00:42 +0100 Subject: [PATCH 01/45] use platform url env --- .../src/middleware/passport/datasource/google.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/src/middleware/passport/datasource/google.js b/packages/backend-core/src/middleware/passport/datasource/google.js index 9b8019575c..49cb1a8fea 100644 --- a/packages/backend-core/src/middleware/passport/datasource/google.js +++ b/packages/backend-core/src/middleware/passport/datasource/google.js @@ -22,7 +22,11 @@ async function fetchGoogleCreds() { } async function getPlatformUrl() { - let platformUrl = environment.PLATFORM_URL || "http://localhost:10000" + if (environment.PLATFORM_URL) { + return environment.PLATFORM_URL + } + + let platformUrl = "http://localhost:10000" const db = getGlobalDB() const settings = await getScopedConfig(db, { From 8cba28e9db8edd056085517880215b2bd9946c8b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 18 May 2022 20:09:31 +0000 Subject: [PATCH 02/45] v1.0.167 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index bcd5516ea6..ac3d08ad3e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.166", + "version": "1.0.167", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 0c7cc8e87f..c0265f110a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.166", + "version": "1.0.167", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 595417948a..6db9d78df7 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": "1.0.166", + "version": "1.0.167", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.166", + "@budibase/string-templates": "^1.0.167", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 7951263e2c..e81912422e 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.166", + "version": "1.0.167", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.166", - "@budibase/client": "^1.0.166", - "@budibase/frontend-core": "^1.0.166", - "@budibase/string-templates": "^1.0.166", + "@budibase/bbui": "^1.0.167", + "@budibase/client": "^1.0.167", + "@budibase/frontend-core": "^1.0.167", + "@budibase/string-templates": "^1.0.167", "@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 662891e213..249b7db3cf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.166", + "version": "1.0.167", "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 234db5c37a..cb2e4e7904 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.166", + "version": "1.0.167", "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": "^1.0.166", - "@budibase/frontend-core": "^1.0.166", - "@budibase/string-templates": "^1.0.166", + "@budibase/bbui": "^1.0.167", + "@budibase/frontend-core": "^1.0.167", + "@budibase/string-templates": "^1.0.167", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 26a10a180b..a6c27a04ce 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.166", + "version": "1.0.167", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.166", + "@budibase/bbui": "^1.0.167", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index be7e02933d..882af29152 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.166", + "version": "1.0.167", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.166", - "@budibase/client": "^1.0.166", + "@budibase/backend-core": "^1.0.167", + "@budibase/client": "^1.0.167", "@budibase/pro": "1.0.166", - "@budibase/string-templates": "^1.0.166", + "@budibase/string-templates": "^1.0.167", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 4172411d42..3463935569 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.166", + "version": "1.0.167", "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 c4e1c4571b..eabed378c8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.166", + "version": "1.0.167", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.166", + "@budibase/backend-core": "^1.0.167", "@budibase/pro": "1.0.166", - "@budibase/string-templates": "^1.0.166", + "@budibase/string-templates": "^1.0.167", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 617650bf80df935102bf3002a6280e39a140391f Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 18 May 2022 20:10:51 +0000 Subject: [PATCH 03/45] Update pro version to 1.0.167 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 882af29152..9b4689c106 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.167", "@budibase/client": "^1.0.167", - "@budibase/pro": "1.0.166", + "@budibase/pro": "1.0.167", "@budibase/string-templates": "^1.0.167", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index eabed378c8..eae280f42d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.167", - "@budibase/pro": "1.0.166", + "@budibase/pro": "1.0.167", "@budibase/string-templates": "^1.0.167", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 50445f6990e2bbe7d4917d4c78a33b1352fb26a1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 20 May 2022 17:41:27 +0100 Subject: [PATCH 04/45] Fix for Postgres connections, seemed to be some issues with out of order, connections not opening in time. --- packages/server/src/integrations/postgres.ts | 48 ++++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index 430a3f3461..a3e49687b6 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -136,7 +136,7 @@ module PostgresModule { : undefined, } this.client = new Client(newConfig) - this.setSchema() + this.open = false } getBindingIdentifier(): string { @@ -147,7 +147,34 @@ module PostgresModule { return parts.join(" || ") } + async openConnection() { + await this.client.connect() + if (!this.config.schema) { + this.config.schema = "public" + } + this.client.query(`SET search_path TO ${this.config.schema}`) + this.COLUMNS_SQL = `select * from information_schema.columns where table_schema = '${this.config.schema}'` + this.open = true + } + + closeConnection() { + const pg = this + return new Promise((resolve, reject) => { + this.client.end((err: any) => { + pg.open = false + if (err) { + reject(err) + } else { + resolve() + } + }) + }) + } + async internalQuery(query: SqlQuery, close: boolean = true) { + if (!this.open) { + await this.openConnection() + } const client = this.client this.index = 1 // need to handle a specific issue with json data types in postgres, @@ -164,23 +191,16 @@ module PostgresModule { try { return await client.query(query.sql, query.bindings || []) } catch (err) { - await this.client.end() + await this.closeConnection() // @ts-ignore throw new Error(err) } finally { - if (close) await this.client.end() + if (close) { + await this.closeConnection() + } } } - async setSchema() { - await this.client.connect() - if (!this.config.schema) { - this.config.schema = "public" - } - this.client.query(`SET search_path TO ${this.config.schema}`) - this.COLUMNS_SQL = `select * from information_schema.columns where table_schema = '${this.config.schema}'` - } - /** * Fetches the tables from the postgres table and assigns them to the datasource. * @param {*} datasourceId - datasourceId to fetch @@ -251,7 +271,7 @@ module PostgresModule { // @ts-ignore throw new Error(err) } finally { - await this.client.end() + await this.closeConnection() } } @@ -283,7 +303,7 @@ module PostgresModule { for (let query of input) { responses.push(await this.internalQuery(query, false)) } - await this.client.end() + await this.closeConnection() return responses } else { const response = await this.internalQuery(input) From 152f0bb0affe3e936c079e4742d6083931e1af47 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 20 May 2022 17:43:47 +0100 Subject: [PATCH 05/45] Opening connection for building schema. --- packages/server/src/integrations/postgres.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/integrations/postgres.ts b/packages/server/src/integrations/postgres.ts index a3e49687b6..220f35dae5 100644 --- a/packages/server/src/integrations/postgres.ts +++ b/packages/server/src/integrations/postgres.ts @@ -208,6 +208,7 @@ module PostgresModule { */ async buildSchema(datasourceId: string, entities: Record) { let tableKeys: { [key: string]: string[] } = {} + await this.openConnection() try { const primaryKeysResponse = await this.client.query( this.PRIMARY_KEYS_SQL From f0211a0ce81263a50d3db07452eab30e4522b669 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 20 May 2022 18:08:48 +0100 Subject: [PATCH 06/45] Fixing mock. --- packages/server/__mocks__/pg.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/__mocks__/pg.ts b/packages/server/__mocks__/pg.ts index 44aeabcb38..110933ad52 100644 --- a/packages/server/__mocks__/pg.ts +++ b/packages/server/__mocks__/pg.ts @@ -14,7 +14,9 @@ module PgMock { function Client() {} Client.prototype.query = query - Client.prototype.end = jest.fn() + Client.prototype.end = jest.fn(cb => { + if (cb) cb() + }) Client.prototype.connect = jest.fn() Client.prototype.release = jest.fn() From 1b86041c68b4d1004288927f220d43d1794ab6d8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 20 May 2022 18:29:37 +0100 Subject: [PATCH 07/45] Removing the use of pouchdb-all-dbs from testing environment, it was causing more harm than good and was entirely avoidable. --- packages/backend-core/package.json | 3 +-- packages/backend-core/src/db/index.js | 12 +++++++++--- packages/backend-core/src/db/pouch.js | 8 +------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c0265f110a..bbd7a1af6b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -41,8 +41,7 @@ "devDependencies": { "ioredis-mock": "^5.5.5", "jest": "^26.6.3", - "pouchdb-adapter-memory": "^7.2.2", - "pouchdb-all-dbs": "^1.0.2" + "pouchdb-adapter-memory": "^7.2.2" }, "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc" } diff --git a/packages/backend-core/src/db/index.js b/packages/backend-core/src/db/index.js index 7d54b881b1..d179186988 100644 --- a/packages/backend-core/src/db/index.js +++ b/packages/backend-core/src/db/index.js @@ -3,13 +3,13 @@ const env = require("../environment") let PouchDB let initialised = false +const dbList = new Set() const put = dbPut => async (doc, options = {}) => { - const response = await dbPut(doc, options) // TODO: add created / updated - return response + return await dbPut(doc, options) } const checkInitialised = () => { @@ -28,6 +28,9 @@ exports.init = opts => { // in situations that using the function doWithDB does not work exports.dangerousGetDB = (dbName, opts) => { checkInitialised() + if (env.isTest()) { + dbList.add(dbName) + } const db = new PouchDB(dbName, opts) const dbPut = db.put db.put = put(dbPut) @@ -63,6 +66,9 @@ exports.doWithDB = async (dbName, cb, opts) => { } exports.allDbs = () => { + if (!env.isTest()) { + throw new Error("Cannot be used outside test environment.") + } checkInitialised() - return PouchDB.allDbs() + return [...dbList] } diff --git a/packages/backend-core/src/db/pouch.js b/packages/backend-core/src/db/pouch.js index 9c1ada8d76..76390ac644 100644 --- a/packages/backend-core/src/db/pouch.js +++ b/packages/backend-core/src/db/pouch.js @@ -92,11 +92,5 @@ exports.getPouch = (opts = {}) => { PouchDB.plugin(find) } - const Pouch = PouchDB.defaults(POUCH_DB_DEFAULTS) - if (opts.allDbs) { - const allDbs = require("pouchdb-all-dbs") - allDbs(Pouch) - } - - return Pouch + return PouchDB.defaults(POUCH_DB_DEFAULTS) } From f3d66ea3c711d804d62dfcf4c11de42d322c8da4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 20 May 2022 18:38:11 +0100 Subject: [PATCH 08/45] Updating yarn locks. --- packages/server/yarn.lock | 18 +++++++++--------- packages/worker/yarn.lock | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 690f4ba0ef..e8a1186adf 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.164.tgz#08c111dcebf5c74159a3c18218c7b3a0716de4f6" - integrity sha512-lpMudezndUD1hHBLfT9LDNKCunj8rQNlaJb30/xggdIUvp718u/jVP54hXF26NYxXOTMZ0EvMwCsIS4AucJ1Mg== +"@budibase/backend-core@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" + integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.164.tgz#780ae38893d0609c87bf51fe96cc2c35bbdb431a" - integrity sha512-PgF7q2vADPPYzet4Wdma+THWuQPrEnN1+TfRly4l0oS9SUxutog3hYn0TlPmPS0AHgrqG/1v65TcEdC4ucX8TA== +"@budibase/pro@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" + integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== dependencies: - "@budibase/backend-core" "1.0.164" + "@budibase/backend-core" "1.0.167" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 6ec47f0e09..e52f6e6d9d 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.164.tgz#08c111dcebf5c74159a3c18218c7b3a0716de4f6" - integrity sha512-lpMudezndUD1hHBLfT9LDNKCunj8rQNlaJb30/xggdIUvp718u/jVP54hXF26NYxXOTMZ0EvMwCsIS4AucJ1Mg== +"@budibase/backend-core@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" + integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.164.tgz#780ae38893d0609c87bf51fe96cc2c35bbdb431a" - integrity sha512-PgF7q2vADPPYzet4Wdma+THWuQPrEnN1+TfRly4l0oS9SUxutog3hYn0TlPmPS0AHgrqG/1v65TcEdC4ucX8TA== +"@budibase/pro@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" + integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== dependencies: - "@budibase/backend-core" "1.0.164" + "@budibase/backend-core" "1.0.167" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": From 82ecaec405d1233c1b804583b0c9363b2baa921a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Sun, 22 May 2022 16:39:34 +0100 Subject: [PATCH 09/45] lint --- packages/worker/src/api/controllers/global/configs.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 2562dd4e2e..658789e90a 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -1,7 +1,6 @@ const { generateConfigID, getConfigParams, - getGlobalUserParams, getScopedFullConfig, getAllApps, } = require("@budibase/backend-core/db") @@ -271,13 +270,6 @@ exports.configChecklist = async function (ctx) { const oidcConfig = await getScopedFullConfig(db, { type: Configs.OIDC, }) - // They have set up an global user - const users = await db.allDocs( - getGlobalUserParams(null, { - include_docs: true, - }) - ) - const adminUser = users.rows.some(row => row.doc.admin) ctx.body = { apps: { @@ -291,7 +283,7 @@ exports.configChecklist = async function (ctx) { link: "/builder/portal/manage/email", }, adminUser: { - checked: adminUser, + checked: true, label: "Create your first user", link: "/builder/portal/manage/users", }, From b55635c7ab67a39837ae09ae3195d7aae57d19cc Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Sun, 22 May 2022 17:11:05 +0100 Subject: [PATCH 10/45] disable prod app sync --- packages/server/src/api/controllers/application.ts | 9 +++++++++ packages/server/src/environment.js | 1 + 2 files changed, 10 insertions(+) diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index aa76dd403c..fbc2250b6b 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -439,6 +439,15 @@ export const destroy = async (ctx: any) => { } export const sync = async (ctx: any, next: any) => { + if (env.DISABLE_AUTO_PROD_APP_SYNC) { + ctx.status = 200 + ctx.body = { + message: + "App sync disabled. You can reenable with the DISABLE_AUTO_PROD_APP_SYNC environment variable.", + } + return next() + } + const appId = ctx.params.appId if (!isDevAppID(appId)) { ctx.throw(400, "This action cannot be performed for production apps") diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index ff1061dbaf..96f395f153 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -57,6 +57,7 @@ module.exports = { JEST_WORKER_ID: process.env.JEST_WORKER_ID, BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT, DISABLE_ACCOUNT_PORTAL: process.env.DISABLE_ACCOUNT_PORTAL, + DISABLE_AUTO_PROD_APP_SYNC: process.env.DISABLE_AUTO_PROD_APP_SYNC, // minor SALT_ROUNDS: process.env.SALT_ROUNDS, LOGGER: process.env.LOGGER, From 513d901ab416d33e1fbbf5889585a93560074f23 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Sun, 22 May 2022 17:14:24 +0100 Subject: [PATCH 11/45] Adding user load testing script. --- packages/server/scripts/load/users.js | 83 +++++++++++++++++++++++++++ packages/server/yarn.lock | 18 +++--- packages/worker/yarn.lock | 18 +++--- 3 files changed, 101 insertions(+), 18 deletions(-) create mode 100644 packages/server/scripts/load/users.js diff --git a/packages/server/scripts/load/users.js b/packages/server/scripts/load/users.js new file mode 100644 index 0000000000..7c3964b6e7 --- /dev/null +++ b/packages/server/scripts/load/users.js @@ -0,0 +1,83 @@ +const fetch = require("node-fetch") +const { getProdAppID } = require("@budibase/backend-core/db") + +const USER_LOAD_NUMBER = 10000 +const BATCH_SIZE = 25 +const SERVER_URL = "http://localhost:4001" +const PASSWORD = "test" + +const APP_ID = process.argv[2] +const API_KEY = process.argv[3] + +const words = [ + "test", + "testing", + "budi", + "mail", + "age", + "risk", + "load", + "uno", + "arm", + "leg", + "pen", + "glass", + "box", + "chicken", + "bottle", +] + +if (!APP_ID) { + console.error("Must supply app ID as first CLI option!") + process.exit(-1) +} +if (!API_KEY) { + console.error("Must supply API key as second CLI option!") + process.exit(-1) +} + +const WORD_1 = words[Math.floor(Math.random() * words.length)] +const WORD_2 = words[Math.floor(Math.random() * words.length)] + +function generateUser(count) { + return { + password: PASSWORD, + email: `${WORD_1}${count}@${WORD_2}.com`, + roles: { + [getProdAppID(APP_ID)]: "BASIC", + }, + status: "active", + forceResetPassword: false, + firstName: "John", + lastName: "Smith", + } +} + +async function run() { + for (let i = 0; i < USER_LOAD_NUMBER; i += BATCH_SIZE) { + let promises = [] + for (let j = 0; j < BATCH_SIZE; j++) { + promises.push( + fetch(`${SERVER_URL}/api/public/v1/users`, { + method: "POST", + body: JSON.stringify(generateUser(i + j)), + headers: { + "x-budibase-api-key": API_KEY, + "Content-Type": "application/json", + }, + }) + ) + } + await Promise.all(promises) + console.log(`${i + BATCH_SIZE} users have been created.`) + } +} + +run() + .then(() => { + console.log(`Generated ${USER_LOAD_NUMBER} users!`) + }) + .catch(err => { + console.error("Failed for reason: ", err) + process.exit(-1) + }) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 690f4ba0ef..e8a1186adf 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.164.tgz#08c111dcebf5c74159a3c18218c7b3a0716de4f6" - integrity sha512-lpMudezndUD1hHBLfT9LDNKCunj8rQNlaJb30/xggdIUvp718u/jVP54hXF26NYxXOTMZ0EvMwCsIS4AucJ1Mg== +"@budibase/backend-core@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" + integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.164.tgz#780ae38893d0609c87bf51fe96cc2c35bbdb431a" - integrity sha512-PgF7q2vADPPYzet4Wdma+THWuQPrEnN1+TfRly4l0oS9SUxutog3hYn0TlPmPS0AHgrqG/1v65TcEdC4ucX8TA== +"@budibase/pro@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" + integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== dependencies: - "@budibase/backend-core" "1.0.164" + "@budibase/backend-core" "1.0.167" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 6ec47f0e09..e52f6e6d9d 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.164.tgz#08c111dcebf5c74159a3c18218c7b3a0716de4f6" - integrity sha512-lpMudezndUD1hHBLfT9LDNKCunj8rQNlaJb30/xggdIUvp718u/jVP54hXF26NYxXOTMZ0EvMwCsIS4AucJ1Mg== +"@budibase/backend-core@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" + integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.164": - version "1.0.164" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.164.tgz#780ae38893d0609c87bf51fe96cc2c35bbdb431a" - integrity sha512-PgF7q2vADPPYzet4Wdma+THWuQPrEnN1+TfRly4l0oS9SUxutog3hYn0TlPmPS0AHgrqG/1v65TcEdC4ucX8TA== +"@budibase/pro@1.0.167": + version "1.0.167" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" + integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== dependencies: - "@budibase/backend-core" "1.0.164" + "@budibase/backend-core" "1.0.167" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": From aede23d44e46a51823ec8914bed8c39a6a3bae32 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Sun, 22 May 2022 18:29:02 +0100 Subject: [PATCH 12/45] Improving performance of load script, can generate thousands of users a second. --- packages/backend-core/src/utils.js | 41 +++++++++--- packages/server/scripts/load/users.js | 62 ++++++++++++------- .../src/api/controllers/public/users.ts | 27 +------- packages/server/src/environment.js | 6 +- packages/server/src/utilities/users.js | 21 +++++++ packages/worker/src/environment.js | 6 +- 6 files changed, 106 insertions(+), 57 deletions(-) diff --git a/packages/backend-core/src/utils.js b/packages/backend-core/src/utils.js index 5c922c42ad..e764f35803 100644 --- a/packages/backend-core/src/utils.js +++ b/packages/backend-core/src/utils.js @@ -197,11 +197,16 @@ exports.getBuildersCount = async () => { return builders.length } -exports.saveUser = async ( +const DEFAULT_SAVE_USER = { + hashPassword: true, + requirePassword: true, + bulkCreate: false, +} + +exports.internalSaveUser = async ( user, tenantId, - hashPassword = true, - requirePassword = true + { hashPassword, requirePassword, bulkCreate } = DEFAULT_SAVE_USER ) => { if (!tenantId) { throw "No tenancy specified." @@ -213,7 +218,10 @@ exports.saveUser = async ( let { email, password, _id } = user // make sure another user isn't using the same email let dbUser - if (email) { + // user can't exist in bulk creation + if (bulkCreate) { + dbUser = null + } else if (email) { // check budibase users inside the tenant dbUser = await exports.getGlobalUserByEmail(email) if (dbUser != null && (dbUser._id !== _id || Array.isArray(dbUser))) { @@ -267,11 +275,17 @@ exports.saveUser = async ( user.status = UserStatus.ACTIVE } try { - const response = await db.put({ + const putOpts = { password: hashedPassword, ...user, - }) - await tryAddTenant(tenantId, _id, email) + } + if (bulkCreate) { + return putOpts + } + const response = await db.put(putOpts) + if (env.MULTI_TENANCY) { + await tryAddTenant(tenantId, _id, email) + } await userCache.invalidateUser(response.id) return { _id: response.id, @@ -288,6 +302,19 @@ exports.saveUser = async ( }) } +// maintained for api compat, don't want to change function signature +exports.saveUser = async ( + user, + tenantId, + hashPassword = true, + requirePassword = true +) => { + return exports.internalSaveUser(user, tenantId, { + hashPassword, + requirePassword, + }) +} + /** * Logs a user out from budibase. Re-used across account portal and builder. */ diff --git a/packages/server/scripts/load/users.js b/packages/server/scripts/load/users.js index 7c3964b6e7..3bc8056986 100644 --- a/packages/server/scripts/load/users.js +++ b/packages/server/scripts/load/users.js @@ -1,13 +1,21 @@ -const fetch = require("node-fetch") -const { getProdAppID } = require("@budibase/backend-core/db") +// get the JWT secret etc +require("../../src/environment") +require("@budibase/backend-core").init() +const { + getProdAppID, + generateGlobalUserID, +} = require("@budibase/backend-core/db") +const { doInTenant, getGlobalDB } = require("@budibase/backend-core/tenancy") +const { internalSaveUser } = require("@budibase/backend-core/utils") +const { publicApiUserFix } = require("../../src/utilities/users") +const { hash } = require("@budibase/backend-core/utils") const USER_LOAD_NUMBER = 10000 -const BATCH_SIZE = 25 -const SERVER_URL = "http://localhost:4001" +const BATCH_SIZE = 200 const PASSWORD = "test" +const TENANT_ID = "default" const APP_ID = process.argv[2] -const API_KEY = process.argv[3] const words = [ "test", @@ -31,17 +39,15 @@ if (!APP_ID) { console.error("Must supply app ID as first CLI option!") process.exit(-1) } -if (!API_KEY) { - console.error("Must supply API key as second CLI option!") - process.exit(-1) -} const WORD_1 = words[Math.floor(Math.random() * words.length)] const WORD_2 = words[Math.floor(Math.random() * words.length)] +let HASHED_PASSWORD function generateUser(count) { return { - password: PASSWORD, + _id: generateGlobalUserID(), + password: HASHED_PASSWORD, email: `${WORD_1}${count}@${WORD_2}.com`, roles: { [getProdAppID(APP_ID)]: "BASIC", @@ -54,23 +60,31 @@ function generateUser(count) { } async function run() { - for (let i = 0; i < USER_LOAD_NUMBER; i += BATCH_SIZE) { - let promises = [] - for (let j = 0; j < BATCH_SIZE; j++) { - promises.push( - fetch(`${SERVER_URL}/api/public/v1/users`, { - method: "POST", - body: JSON.stringify(generateUser(i + j)), - headers: { - "x-budibase-api-key": API_KEY, - "Content-Type": "application/json", + HASHED_PASSWORD = await hash(PASSWORD) + return doInTenant(TENANT_ID, async () => { + const db = getGlobalDB() + for (let i = 0; i < USER_LOAD_NUMBER; i += BATCH_SIZE) { + let userSavePromises = [] + for (let j = 0; j < BATCH_SIZE; j++) { + // like the public API + const ctx = publicApiUserFix({ + request: { + body: generateUser(i + j), }, }) - ) + userSavePromises.push( + internalSaveUser(ctx.request.body, TENANT_ID, { + hashPassword: false, + requirePassword: true, + bulkCreate: true, + }) + ) + } + const users = await Promise.all(userSavePromises) + await db.bulkDocs(users) + console.log(`${i + BATCH_SIZE} users have been created.`) } - await Promise.all(promises) - console.log(`${i + BATCH_SIZE} users have been created.`) - } + }) } run() diff --git a/packages/server/src/api/controllers/public/users.ts b/packages/server/src/api/controllers/public/users.ts index f199dcb761..129d2c883f 100644 --- a/packages/server/src/api/controllers/public/users.ts +++ b/packages/server/src/api/controllers/public/users.ts @@ -4,30 +4,9 @@ import { readGlobalUser, saveGlobalUser, } from "../../../utilities/workerRequests" +import { publicApiUserFix } from "../../../utilities/users" import { search as stringSearch } from "./utils" -const { getProdAppID } = require("@budibase/backend-core/db") - -function fixUser(ctx: any) { - if (!ctx.request.body) { - return ctx - } - if (!ctx.request.body._id && ctx.params.userId) { - ctx.request.body._id = ctx.params.userId - } - if (!ctx.request.body.roles) { - ctx.request.body.roles = {} - } else { - const newRoles: { [key: string]: string } = {} - for (let [appId, role] of Object.entries(ctx.request.body.roles)) { - // @ts-ignore - newRoles[getProdAppID(appId)] = role - } - ctx.request.body.roles = newRoles - } - return ctx -} - function getUser(ctx: any, userId?: string) { if (userId) { ctx.params = { userId } @@ -45,7 +24,7 @@ export async function search(ctx: any, next: any) { } export async function create(ctx: any, next: any) { - const response = await saveGlobalUser(fixUser(ctx)) + const response = await saveGlobalUser(publicApiUserFix(ctx)) ctx.body = await getUser(ctx, response._id) await next() } @@ -61,7 +40,7 @@ export async function update(ctx: any, next: any) { ...ctx.request.body, _rev: user._rev, } - const response = await saveGlobalUser(fixUser(ctx)) + const response = await saveGlobalUser(publicApiUserFix(ctx)) ctx.body = await getUser(ctx, response._id) await next() } diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index 96f395f153..9fa8692298 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -1,3 +1,5 @@ +const { join } = require("path") + function isTest() { return ( process.env.NODE_ENV === "jest" || @@ -20,7 +22,9 @@ function isCypress() { let LOADED = false if (!LOADED && isDev() && !isTest()) { - require("dotenv").config() + require("dotenv").config({ + path: join(__dirname, "..", ".env"), + }) LOADED = true } diff --git a/packages/server/src/utilities/users.js b/packages/server/src/utilities/users.js index b3601986d8..e769441322 100644 --- a/packages/server/src/utilities/users.js +++ b/packages/server/src/utilities/users.js @@ -1,6 +1,7 @@ const { InternalTables } = require("../db/utils") const { getGlobalUser } = require("../utilities/global") const { getAppDB } = require("@budibase/backend-core/context") +const { getProdAppID } = require("@budibase/backend-core/db") exports.getFullUser = async (ctx, userId) => { const global = await getGlobalUser(userId) @@ -22,3 +23,23 @@ exports.getFullUser = async (ctx, userId) => { _id: userId, } } + +exports.publicApiUserFix = ctx => { + if (!ctx.request.body) { + return ctx + } + if (!ctx.request.body._id && ctx.params.userId) { + ctx.request.body._id = ctx.params.userId + } + if (!ctx.request.body.roles) { + ctx.request.body.roles = {} + } else { + const newRoles = {} + for (let [appId, role] of Object.entries(ctx.request.body.roles)) { + // @ts-ignore + newRoles[getProdAppID(appId)] = role + } + ctx.request.body.roles = newRoles + } + return ctx +} diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index c965863a54..8ef12e3877 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -1,3 +1,5 @@ +const { join } = require("path") + function isDev() { return process.env.NODE_ENV !== "production" } @@ -12,7 +14,9 @@ function isTest() { let LOADED = false if (!LOADED && isDev() && !isTest()) { - require("dotenv").config() + require("dotenv").config({ + path: join(__dirname, "..", ".env"), + }) LOADED = true } From e61e118b251313ccad7cdc779f7000fea69151c7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Sun, 22 May 2022 18:51:13 +0100 Subject: [PATCH 13/45] query optimisation on checklist endpoint --- packages/worker/src/api/controllers/global/configs.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 658789e90a..3799337bd5 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -1,6 +1,7 @@ const { generateConfigID, getConfigParams, + getGlobalUserParams, getScopedFullConfig, getAllApps, } = require("@budibase/backend-core/db") @@ -271,6 +272,14 @@ exports.configChecklist = async function (ctx) { type: Configs.OIDC, }) + // They have set up an global user + const users = await db.allDocs( + getGlobalUserParams(null, { + include_docs: true, + limit: 1, + }) + ) + ctx.body = { apps: { checked: apps.length > 0, @@ -283,7 +292,7 @@ exports.configChecklist = async function (ctx) { link: "/builder/portal/manage/email", }, adminUser: { - checked: true, + checked: users && users.rows.length >= 1, label: "Create your first user", link: "/builder/portal/manage/users", }, From 62aa399396ac454779752624b8a2702455017eb0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Sun, 22 May 2022 18:30:22 +0000 Subject: [PATCH 14/45] v1.0.168 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index ac3d08ad3e..7965e17b8c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.167", + "version": "1.0.168", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c0265f110a..bbd754f450 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.167", + "version": "1.0.168", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6db9d78df7..8718d51e7e 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": "1.0.167", + "version": "1.0.168", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.167", + "@budibase/string-templates": "^1.0.168", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index e81912422e..a6ff592ea4 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.167", + "version": "1.0.168", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.167", - "@budibase/client": "^1.0.167", - "@budibase/frontend-core": "^1.0.167", - "@budibase/string-templates": "^1.0.167", + "@budibase/bbui": "^1.0.168", + "@budibase/client": "^1.0.168", + "@budibase/frontend-core": "^1.0.168", + "@budibase/string-templates": "^1.0.168", "@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 249b7db3cf..a1f992c1cd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.167", + "version": "1.0.168", "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 cb2e4e7904..449880c2ab 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.167", + "version": "1.0.168", "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": "^1.0.167", - "@budibase/frontend-core": "^1.0.167", - "@budibase/string-templates": "^1.0.167", + "@budibase/bbui": "^1.0.168", + "@budibase/frontend-core": "^1.0.168", + "@budibase/string-templates": "^1.0.168", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index a6c27a04ce..89f5b1f110 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.167", + "version": "1.0.168", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.167", + "@budibase/bbui": "^1.0.168", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 9b4689c106..381ff370b4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.167", + "version": "1.0.168", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.167", - "@budibase/client": "^1.0.167", + "@budibase/backend-core": "^1.0.168", + "@budibase/client": "^1.0.168", "@budibase/pro": "1.0.167", - "@budibase/string-templates": "^1.0.167", + "@budibase/string-templates": "^1.0.168", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 3463935569..6ab4f8630d 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.167", + "version": "1.0.168", "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 eae280f42d..ecfc4d7f79 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.167", + "version": "1.0.168", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.167", + "@budibase/backend-core": "^1.0.168", "@budibase/pro": "1.0.167", - "@budibase/string-templates": "^1.0.167", + "@budibase/string-templates": "^1.0.168", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From ea5d8e9d56937d259bf9509b5c26378400b6e83b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Sun, 22 May 2022 18:31:42 +0000 Subject: [PATCH 15/45] Update pro version to 1.0.168 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 381ff370b4..0bfcad9a1c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.168", "@budibase/client": "^1.0.168", - "@budibase/pro": "1.0.167", + "@budibase/pro": "1.0.168", "@budibase/string-templates": "^1.0.168", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index ecfc4d7f79..3f8ab856eb 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.168", - "@budibase/pro": "1.0.167", + "@budibase/pro": "1.0.168", "@budibase/string-templates": "^1.0.168", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 6d3aa6a80617a80c4a7d54d292d10e6168e2f774 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 00:09:03 +0100 Subject: [PATCH 16/45] withCache wrapper for working with redis --- packages/backend-core/src/redis/utils.js | 1 + .../src/api/controllers/global/configs.js | 100 ++++++++++-------- packages/worker/src/utilities/redis.js | 24 ++++- 3 files changed, 77 insertions(+), 48 deletions(-) diff --git a/packages/backend-core/src/redis/utils.js b/packages/backend-core/src/redis/utils.js index 77f64f6593..c2bb59813b 100644 --- a/packages/backend-core/src/redis/utils.js +++ b/packages/backend-core/src/redis/utils.js @@ -18,6 +18,7 @@ exports.Databases = { APP_METADATA: "appMetadata", QUERY_VARS: "queryVars", LICENSES: "license", + DATA_CACHE: "data_cache", } exports.SEPARATOR = SEPARATOR diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 3799337bd5..571e102e4c 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -14,6 +14,7 @@ const { const { getGlobalDB, getTenantId } = require("@budibase/backend-core/tenancy") const env = require("../../../environment") const { googleCallbackUrl, oidcCallbackUrl } = require("./auth") +const { withCache } = require("../../../utilities/redis") const BB_TENANT_CDN = "https://tenants.cdn.budi.live" @@ -249,59 +250,64 @@ exports.configChecklist = async function (ctx) { const tenantId = getTenantId() try { - // TODO: Watch get started video + const ONE_MINUTE = 600 - let apps = [] - if (!env.MULTI_TENANCY || tenantId) { - // Apps exist - apps = await getAllApps({ idsOnly: true, efficient: true }) - } + ctx.body = await withCache( + `checklist:${tenantId}`, + ONE_MINUTE, + async () => { + let apps = [] + if (!env.MULTI_TENANCY || tenantId) { + // Apps exist + apps = await getAllApps({ idsOnly: true, efficient: true }) + } - // They have set up SMTP - const smtpConfig = await getScopedFullConfig(db, { - type: Configs.SMTP, - }) + // They have set up SMTP + const smtpConfig = await getScopedFullConfig(db, { + type: Configs.SMTP, + }) - // They have set up Google Auth - const googleConfig = await getScopedFullConfig(db, { - type: Configs.GOOGLE, - }) + // They have set up Google Auth + const googleConfig = await getScopedFullConfig(db, { + type: Configs.GOOGLE, + }) - // They have set up OIDC - const oidcConfig = await getScopedFullConfig(db, { - type: Configs.OIDC, - }) + // They have set up OIDC + const oidcConfig = await getScopedFullConfig(db, { + type: Configs.OIDC, + }) - // They have set up an global user - const users = await db.allDocs( - getGlobalUserParams(null, { - include_docs: true, - limit: 1, - }) + // They have set up an global user + const users = await db.allDocs( + getGlobalUserParams(null, { + include_docs: true, + limit: 1, + }) + ) + return { + apps: { + checked: apps.length > 0, + label: "Create your first app", + link: "/builder/portal/apps", + }, + smtp: { + checked: !!smtpConfig, + label: "Set up email", + link: "/builder/portal/manage/email", + }, + adminUser: { + checked: users && users.rows.length >= 1, + label: "Create your first user", + link: "/builder/portal/manage/users", + }, + sso: { + checked: !!googleConfig || !!oidcConfig, + label: "Set up single sign-on", + link: "/builder/portal/manage/auth", + }, + } + } ) - - ctx.body = { - apps: { - checked: apps.length > 0, - label: "Create your first app", - link: "/builder/portal/apps", - }, - smtp: { - checked: !!smtpConfig, - label: "Set up email", - link: "/builder/portal/manage/email", - }, - adminUser: { - checked: users && users.rows.length >= 1, - label: "Create your first user", - link: "/builder/portal/manage/users", - }, - sso: { - checked: !!googleConfig || !!oidcConfig, - label: "Set up single sign-on", - link: "/builder/portal/manage/auth", - }, - } } catch (err) { ctx.throw(err.status, err) } diff --git a/packages/worker/src/utilities/redis.js b/packages/worker/src/utilities/redis.js index cfed97cd18..70a16a3be8 100644 --- a/packages/worker/src/utilities/redis.js +++ b/packages/worker/src/utilities/redis.js @@ -12,7 +12,7 @@ function getExpirySecondsForDB(db) { } } -let pwResetClient, invitationClient +let pwResetClient, invitationClient, cachingClient function getClient(db) { switch (db) { @@ -20,6 +20,8 @@ function getClient(db) { return pwResetClient case utils.Databases.INVITATIONS: return invitationClient + case utils.Databases.DATA_CACHE: + return cachingClient } } @@ -45,8 +47,10 @@ async function getACode(db, code, deleteCode = true) { exports.init = async () => { pwResetClient = new Client(utils.Databases.PW_RESETS) invitationClient = new Client(utils.Databases.INVITATIONS) + cachingClient = new Client(utils.Databases.DATA_CACHE) await pwResetClient.init() await invitationClient.init() + await cachingClient.init() } /** @@ -104,3 +108,21 @@ exports.checkInviteCode = async (inviteCode, deleteCode = true) => { throw "Invitation is not valid or has expired, please request a new one." } } + +// TODO: move into backend-core +exports.withCache = async (key, ttl, fetchFn) => { + const cachedValue = await cachingClient.get(key) + if (cachedValue) { + return cachedValue + } + + try { + const fetchedValue = await fetchFn() + + await cachingClient.store(key, fetchedValue, ttl) + return fetchedValue + } catch (err) { + console.error("Error calling fetch function", err) + throw err + } +} From 1ce66bd860c36dc3723959fffccff72105f10e07 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 00:29:45 +0100 Subject: [PATCH 17/45] turn off withCache for tests --- packages/worker/src/utilities/redis.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/worker/src/utilities/redis.js b/packages/worker/src/utilities/redis.js index 70a16a3be8..f43c2d6bdc 100644 --- a/packages/worker/src/utilities/redis.js +++ b/packages/worker/src/utilities/redis.js @@ -1,5 +1,6 @@ const { Client, utils } = require("@budibase/backend-core/redis") const { newid } = require("@budibase/backend-core/utils") +const env = require("../environment") function getExpirySecondsForDB(db) { switch (db) { @@ -119,7 +120,9 @@ exports.withCache = async (key, ttl, fetchFn) => { try { const fetchedValue = await fetchFn() - await cachingClient.store(key, fetchedValue, ttl) + if (!env.isTest()) { + await cachingClient.store(key, fetchedValue, ttl) + } return fetchedValue } catch (err) { console.error("Error calling fetch function", err) From 2754241eea8fe42c621831d155be80f31e2ac824 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 00:06:28 +0000 Subject: [PATCH 18/45] v1.0.169 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 7965e17b8c..9d786a0ac5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.168", + "version": "1.0.169", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index bbd754f450..3fde825095 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.168", + "version": "1.0.169", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 8718d51e7e..4844c4ed31 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": "1.0.168", + "version": "1.0.169", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.168", + "@budibase/string-templates": "^1.0.169", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index a6ff592ea4..1a157bfbc5 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.168", + "version": "1.0.169", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.168", - "@budibase/client": "^1.0.168", - "@budibase/frontend-core": "^1.0.168", - "@budibase/string-templates": "^1.0.168", + "@budibase/bbui": "^1.0.169", + "@budibase/client": "^1.0.169", + "@budibase/frontend-core": "^1.0.169", + "@budibase/string-templates": "^1.0.169", "@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 a1f992c1cd..8abade78ea 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.168", + "version": "1.0.169", "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 449880c2ab..18e9f54979 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.168", + "version": "1.0.169", "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": "^1.0.168", - "@budibase/frontend-core": "^1.0.168", - "@budibase/string-templates": "^1.0.168", + "@budibase/bbui": "^1.0.169", + "@budibase/frontend-core": "^1.0.169", + "@budibase/string-templates": "^1.0.169", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 89f5b1f110..18a7baeac8 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.168", + "version": "1.0.169", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.168", + "@budibase/bbui": "^1.0.169", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 0bfcad9a1c..45c4a2a161 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.168", + "version": "1.0.169", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.168", - "@budibase/client": "^1.0.168", + "@budibase/backend-core": "^1.0.169", + "@budibase/client": "^1.0.169", "@budibase/pro": "1.0.168", - "@budibase/string-templates": "^1.0.168", + "@budibase/string-templates": "^1.0.169", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6ab4f8630d..aa9468ca79 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.168", + "version": "1.0.169", "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 3f8ab856eb..4edfbb2f19 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.168", + "version": "1.0.169", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.168", + "@budibase/backend-core": "^1.0.169", "@budibase/pro": "1.0.168", - "@budibase/string-templates": "^1.0.168", + "@budibase/string-templates": "^1.0.169", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 8d0040a0b2271a39b031688762fd691ceff26e0e Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 00:07:47 +0000 Subject: [PATCH 19/45] Update pro version to 1.0.169 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 45c4a2a161..b3808e1409 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.169", "@budibase/client": "^1.0.169", - "@budibase/pro": "1.0.168", + "@budibase/pro": "1.0.169", "@budibase/string-templates": "^1.0.169", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 4edfbb2f19..5895b9ff64 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.169", - "@budibase/pro": "1.0.168", + "@budibase/pro": "1.0.169", "@budibase/string-templates": "^1.0.169", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From aa12ae78af93dc1112cc0cc1777f3f0afb09a722 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 07:51:22 +0000 Subject: [PATCH 20/45] v1.0.170 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 9d786a0ac5..4f1967e92b 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.169", + "version": "1.0.170", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 7d929445e6..c07eb48777 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.169", + "version": "1.0.170", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 4844c4ed31..38d6faed2f 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": "1.0.169", + "version": "1.0.170", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.169", + "@budibase/string-templates": "^1.0.170", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 1a157bfbc5..ef14641e7c 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.169", + "version": "1.0.170", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.169", - "@budibase/client": "^1.0.169", - "@budibase/frontend-core": "^1.0.169", - "@budibase/string-templates": "^1.0.169", + "@budibase/bbui": "^1.0.170", + "@budibase/client": "^1.0.170", + "@budibase/frontend-core": "^1.0.170", + "@budibase/string-templates": "^1.0.170", "@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 8abade78ea..964f08f891 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.169", + "version": "1.0.170", "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 18e9f54979..bf744e51c3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.169", + "version": "1.0.170", "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": "^1.0.169", - "@budibase/frontend-core": "^1.0.169", - "@budibase/string-templates": "^1.0.169", + "@budibase/bbui": "^1.0.170", + "@budibase/frontend-core": "^1.0.170", + "@budibase/string-templates": "^1.0.170", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 18a7baeac8..c9cd9bcf92 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.169", + "version": "1.0.170", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.169", + "@budibase/bbui": "^1.0.170", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index b3808e1409..0b28c90914 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.169", + "version": "1.0.170", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.169", - "@budibase/client": "^1.0.169", + "@budibase/backend-core": "^1.0.170", + "@budibase/client": "^1.0.170", "@budibase/pro": "1.0.169", - "@budibase/string-templates": "^1.0.169", + "@budibase/string-templates": "^1.0.170", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index aa9468ca79..ba8f15896a 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.169", + "version": "1.0.170", "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 5895b9ff64..c34be06e0c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.169", + "version": "1.0.170", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.169", + "@budibase/backend-core": "^1.0.170", "@budibase/pro": "1.0.169", - "@budibase/string-templates": "^1.0.169", + "@budibase/string-templates": "^1.0.170", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 4935cff4ac78d3a7d201fd9aab2ffe198ea903c6 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 07:52:51 +0000 Subject: [PATCH 21/45] Update pro version to 1.0.170 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 0b28c90914..8c4eba448f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.170", "@budibase/client": "^1.0.170", - "@budibase/pro": "1.0.169", + "@budibase/pro": "1.0.170", "@budibase/string-templates": "^1.0.170", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index c34be06e0c..598f152f2a 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.170", - "@budibase/pro": "1.0.169", + "@budibase/pro": "1.0.170", "@budibase/string-templates": "^1.0.170", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 0b53d9ab6b221bb1e267d36be46c1b6fabfaab93 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 12:50:42 +0100 Subject: [PATCH 22/45] simple login validation to prevent login without entering anything --- packages/builder/src/pages/builder/auth/login.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index d9151b4342..84af5b6338 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -80,7 +80,9 @@ /> - + $goto("./forgot")}> Forgot password? From 664d41ab99c4ad3baa3dd1b3ae24896a662118d9 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 12:01:23 +0000 Subject: [PATCH 23/45] v1.0.171 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 4f1967e92b..5b9bb453c3 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.170", + "version": "1.0.171", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index c07eb48777..d0501d780e 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.170", + "version": "1.0.171", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 38d6faed2f..ab785cb768 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": "1.0.170", + "version": "1.0.171", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.170", + "@budibase/string-templates": "^1.0.171", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index ef14641e7c..84770c25c4 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.170", + "version": "1.0.171", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.170", - "@budibase/client": "^1.0.170", - "@budibase/frontend-core": "^1.0.170", - "@budibase/string-templates": "^1.0.170", + "@budibase/bbui": "^1.0.171", + "@budibase/client": "^1.0.171", + "@budibase/frontend-core": "^1.0.171", + "@budibase/string-templates": "^1.0.171", "@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 964f08f891..a9943e643f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.170", + "version": "1.0.171", "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 bf744e51c3..fdb023f607 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.170", + "version": "1.0.171", "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": "^1.0.170", - "@budibase/frontend-core": "^1.0.170", - "@budibase/string-templates": "^1.0.170", + "@budibase/bbui": "^1.0.171", + "@budibase/frontend-core": "^1.0.171", + "@budibase/string-templates": "^1.0.171", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index c9cd9bcf92..e6e41f1545 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.170", + "version": "1.0.171", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.170", + "@budibase/bbui": "^1.0.171", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 8c4eba448f..1dda432080 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.170", + "version": "1.0.171", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.170", - "@budibase/client": "^1.0.170", + "@budibase/backend-core": "^1.0.171", + "@budibase/client": "^1.0.171", "@budibase/pro": "1.0.170", - "@budibase/string-templates": "^1.0.170", + "@budibase/string-templates": "^1.0.171", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ba8f15896a..698f7e0cc5 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.170", + "version": "1.0.171", "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 598f152f2a..bc0c7a6c63 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.170", + "version": "1.0.171", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.170", + "@budibase/backend-core": "^1.0.171", "@budibase/pro": "1.0.170", - "@budibase/string-templates": "^1.0.170", + "@budibase/string-templates": "^1.0.171", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From b33d8ba588c8d7562a96ea41b7e146cfe7736824 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 12:03:00 +0000 Subject: [PATCH 24/45] Update pro version to 1.0.171 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 1dda432080..f428ad5328 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.171", "@budibase/client": "^1.0.171", - "@budibase/pro": "1.0.170", + "@budibase/pro": "1.0.171", "@budibase/string-templates": "^1.0.171", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index bc0c7a6c63..885f55003e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.171", - "@budibase/pro": "1.0.170", + "@budibase/pro": "1.0.171", "@budibase/string-templates": "^1.0.171", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 76f19def2665f20a3fbcc1816d79da2190f481c0 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 23 May 2022 15:03:52 +0100 Subject: [PATCH 25/45] Moving the withCache function to backend-core so that it can be shared, as well as adding a cache busting function which can be used when one of the checklist configs changes. --- packages/backend-core/cache.js | 3 + packages/backend-core/src/cache/generic.js | 47 +++++ packages/backend-core/src/redis/authRedis.js | 10 +- packages/backend-core/src/redis/utils.js | 2 +- packages/backend-core/yarn.lock | 169 +----------------- .../server/src/api/controllers/application.ts | 2 + packages/server/yarn.lock | 18 +- .../src/api/controllers/global/configs.js | 14 +- .../src/api/controllers/global/users.ts | 18 +- packages/worker/src/utilities/redis.js | 3 +- packages/worker/yarn.lock | 18 +- 11 files changed, 109 insertions(+), 195 deletions(-) create mode 100644 packages/backend-core/src/cache/generic.js diff --git a/packages/backend-core/cache.js b/packages/backend-core/cache.js index 02344586a9..932fd7b901 100644 --- a/packages/backend-core/cache.js +++ b/packages/backend-core/cache.js @@ -1,4 +1,7 @@ +const generic = require("./src/cache/generic") + module.exports = { user: require("./src/cache/user"), app: require("./src/cache/appMetadata"), + ...generic, } diff --git a/packages/backend-core/src/cache/generic.js b/packages/backend-core/src/cache/generic.js new file mode 100644 index 0000000000..e5446a1424 --- /dev/null +++ b/packages/backend-core/src/cache/generic.js @@ -0,0 +1,47 @@ +const redis = require("../redis/authRedis") +const env = require("../environment") +const { getTenantId } = require("../context") + +exports.CacheKeys = { + CHECKLIST: "checklist", +} + +exports.TTL = { + ONE_MINUTE: 600, +} + +function generateTenantKey(key) { + const tenantId = getTenantId() + return `${key}:${tenantId}` +} + +exports.withCache = async (key, ttl, fetchFn) => { + key = generateTenantKey(key) + const client = await redis.getCacheClient() + const cachedValue = await client.get(key) + if (cachedValue) { + return cachedValue + } + + try { + const fetchedValue = await fetchFn() + + if (!env.isTest()) { + await client.store(key, fetchedValue, ttl) + } + return fetchedValue + } catch (err) { + console.error("Error fetching before cache - ", err) + throw err + } +} + +exports.bustCache = async key => { + const client = await redis.getCacheClient() + try { + await client.delete(generateTenantKey(key)) + } catch (err) { + console.error("Error busting cache - ", err) + throw err + } +} diff --git a/packages/backend-core/src/redis/authRedis.js b/packages/backend-core/src/redis/authRedis.js index ca5c9bae37..b9f6d8d0b0 100644 --- a/packages/backend-core/src/redis/authRedis.js +++ b/packages/backend-core/src/redis/authRedis.js @@ -1,18 +1,20 @@ const Client = require("./index") const utils = require("./utils") -let userClient, sessionClient, appClient +let userClient, sessionClient, appClient, cacheClient async function init() { userClient = await new Client(utils.Databases.USER_CACHE).init() sessionClient = await new Client(utils.Databases.SESSIONS).init() appClient = await new Client(utils.Databases.APP_METADATA).init() + cacheClient = await new Client(utils.Databases.GENERIC_CACHE).init() } process.on("exit", async () => { if (userClient) await userClient.finish() if (sessionClient) await sessionClient.finish() if (appClient) await appClient.finish() + if (cacheClient) await cacheClient.finish() }) module.exports = { @@ -34,4 +36,10 @@ module.exports = { } return appClient }, + getCacheClient: async () => { + if (!cacheClient) { + await init() + } + return cacheClient + }, } diff --git a/packages/backend-core/src/redis/utils.js b/packages/backend-core/src/redis/utils.js index c2bb59813b..90ea5c33f9 100644 --- a/packages/backend-core/src/redis/utils.js +++ b/packages/backend-core/src/redis/utils.js @@ -18,7 +18,7 @@ exports.Databases = { APP_METADATA: "appMetadata", QUERY_VARS: "queryVars", LICENSES: "license", - DATA_CACHE: "data_cache", + GENERIC_CACHE: "data_cache", } exports.SEPARATOR = SEPARATOR diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index 7dfa64810e..95bda45504 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -661,11 +661,6 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn@^5.2.1: - version "5.7.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" - integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== - acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" @@ -701,11 +696,6 @@ ajv@^6.12.3: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= - ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -800,11 +790,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@0.9.6: - version "0.9.6" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" - integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= - async@~2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" @@ -938,11 +923,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base62@^1.1.0: - version "1.2.8" - resolved "https://registry.yarnpkg.com/base62/-/base62-1.2.8.tgz#1264cb0fb848d875792877479dbe8bae6bae3428" - integrity sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA== - base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -1259,26 +1239,6 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.5.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commoner@^0.10.1: - version "0.10.8" - resolved "https://registry.yarnpkg.com/commoner/-/commoner-0.10.8.tgz#34fc3672cd24393e8bb47e70caa0293811f4f2c5" - integrity sha1-NPw2cs0kOT6LtH5wyqApOBH08sU= - dependencies: - commander "^2.5.0" - detective "^4.3.1" - glob "^5.0.15" - graceful-fs "^4.1.2" - iconv-lite "^0.4.5" - mkdirp "^0.5.0" - private "^0.1.6" - q "^1.1.2" - recast "^0.11.17" - component-emitter@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -1445,11 +1405,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1465,14 +1420,6 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== -detective@^4.3.1: - version "4.7.1" - resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" - integrity sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig== - dependencies: - acorn "^5.2.1" - defined "^1.0.0" - diff-sequences@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" @@ -1572,15 +1519,6 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es3ify@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/es3ify/-/es3ify-0.2.2.tgz#5dae3e650e5be3684b88066513d528d092629862" - integrity sha1-Xa4+ZQ5b42hLiAZlE9Uo0JJimGI= - dependencies: - esprima "^2.7.1" - jstransform "~11.0.0" - through "~2.3.4" - escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1608,26 +1546,11 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -esprima-fb@^15001.1.0-dev-harmony-fb: - version "15001.1.0-dev-harmony-fb" - resolved "https://registry.yarnpkg.com/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz#30a947303c6b8d5e955bee2b99b1d233206a6901" - integrity sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE= - -esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esprima@~3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - estraverse@^5.2.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -1945,17 +1868,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" @@ -1999,7 +1911,7 @@ googleapis@^16.0.0: google-auth-library "~0.10.0" string-template "~1.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.2.4: +graceful-fs@^4.2.4: version "4.2.8" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== @@ -2165,7 +2077,7 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -iconv-lite@0.4.24, iconv-lite@^0.4.5: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -2988,17 +2900,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" -jstransform@~11.0.0: - version "11.0.3" - resolved "https://registry.yarnpkg.com/jstransform/-/jstransform-11.0.3.tgz#09a78993e0ae4d4ef4487f6155a91f6190cb4223" - integrity sha1-CaeJk+CuTU70SH9hVakfYZDLQiM= - dependencies: - base62 "^1.1.0" - commoner "^0.10.1" - esprima-fb "^15001.1.0-dev-harmony-fb" - object-assign "^2.0.0" - source-map "^0.4.2" - jwa@^1.1.4: version "1.1.5" resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.1.5.tgz#a0552ce0220742cd52e153774a32905c30e756e5" @@ -3387,7 +3288,7 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -"minimatch@2 || 3", minimatch@^3.0.4: +minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -3412,13 +3313,6 @@ mkdirp-classic@^0.5.2: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@^0.5.0: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -3581,11 +3475,6 @@ oauth@0.9.x, oauth@^0.9.15: resolved "https://registry.yarnpkg.com/oauth/-/oauth-0.9.15.tgz#bd1fefaf686c96b75475aed5196412ff60cfb9c1" integrity sha1-vR/vr2hslrdUda7VGWQS/2DPucE= -object-assign@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" - integrity sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo= - object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" @@ -3918,17 +3807,6 @@ pouchdb-adapter-utils@7.2.2: pouchdb-merge "7.2.2" pouchdb-utils "7.2.2" -pouchdb-all-dbs@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pouchdb-all-dbs/-/pouchdb-all-dbs-1.1.1.tgz#85f04a39cafda52497ec49abf1c93bb5e72813f6" - integrity sha512-UUnsdmcnRSQ8MAOYSJjfTwKkQNb/6fvOfd/f7dNNivWZ2YDYVuMfgw1WQdL634yEtcXTxAENZ/EyLRdzPCB41A== - dependencies: - argsarray "0.0.1" - es3ify "^0.2.2" - inherits "~2.0.1" - pouchdb-promise "6.4.3" - tiny-queue "^0.2.0" - pouchdb-binary-utils@7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-7.2.2.tgz#0690b348052c543b1e67f032f47092ca82bcb10e" @@ -4005,7 +3883,7 @@ pouchdb-merge@7.2.2: resolved "https://registry.yarnpkg.com/pouchdb-merge/-/pouchdb-merge-7.2.2.tgz#940d85a2b532d6a93a6cab4b250f5648511bcc16" integrity sha512-6yzKJfjIchBaS7Tusuk8280WJdESzFfQ0sb4jeMUNnrqs4Cx3b0DIEOYTRRD9EJDM+je7D3AZZ4AT0tFw8gb4A== -pouchdb-promise@6.4.3, pouchdb-promise@^6.0.4: +pouchdb-promise@^6.0.4: version "6.4.3" resolved "https://registry.yarnpkg.com/pouchdb-promise/-/pouchdb-promise-6.4.3.tgz#74516f4acf74957b54debd0fb2c0e5b5a68ca7b3" integrity sha512-ruJaSFXwzsxRHQfwNHjQfsj58LBOY1RzGzde4PM5CWINZwFjCQAhZwfMrch2o/0oZT6d+Xtt0HTWhq35p3b0qw== @@ -4088,11 +3966,6 @@ pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -private@^0.1.6, private@~0.1.5: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -4139,11 +4012,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -q@^1.1.2: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" @@ -4225,16 +4093,6 @@ readline-sync@^1.4.9: resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== -recast@^0.11.17: - version "0.11.23" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" - integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= - dependencies: - ast-types "0.9.6" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" - redis-commands@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/redis-commands/-/redis-commands-1.7.0.tgz#15a6fea2d58281e27b1cd1acfb4b293e278c3a89" @@ -4592,14 +4450,7 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== -source-map@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - integrity sha1-66T12pwNyZneaAMti092FzZSA2s= - dependencies: - amdefine ">=0.0.4" - -source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.0: +source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -4879,16 +4730,6 @@ through2@^2.0.0, through2@^2.0.2, through2@^2.0.3: readable-stream "~2.3.6" xtend "~4.0.1" -through@~2.3.4: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tiny-queue@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tiny-queue/-/tiny-queue-0.2.1.tgz#25a67f2c6e253b2ca941977b5ef7442ef97a6046" - integrity sha1-JaZ/LG4lOyypQZd7XvdELvl6YEY= - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts index fbc2250b6b..2ca3c230c7 100644 --- a/packages/server/src/api/controllers/application.ts +++ b/packages/server/src/api/controllers/application.ts @@ -25,6 +25,7 @@ const { import { BASE_LAYOUTS } from "../../constants/layouts" import { cloneDeep } from "lodash/fp" const { processObject } = require("@budibase/string-templates") +const { CacheKeys, bustCache } = require("@budibase/backend-core/cache") const { getAllApps, isDevAppID, @@ -316,6 +317,7 @@ const appPostCreate = async (ctx: any, appId: string) => { export const create = async (ctx: any) => { const newApplication = await quotas.addApp(() => performAppCreate(ctx)) await appPostCreate(ctx, newApplication.appId) + await bustCache(CacheKeys.CHECKLIST) ctx.body = newApplication ctx.status = 200 } diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e8a1186adf..219b5add75 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.167": - version "1.0.167" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" - integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== +"@budibase/backend-core@1.0.171": + version "1.0.171" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.171.tgz#39fb68fc1a6e233589cf65e8354ff5e5098b4b4e" + integrity sha512-au7nP2x4Oj/5PCU7qd538FDrz/Dhq9nSX6AjR+3+hoU658Gv3xes4RKXgFjf5qE0tdSKTSe1pMntMhwQxshUBQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.167": - version "1.0.167" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" - integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== +"@budibase/pro@1.0.171": + version "1.0.171" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.171.tgz#b64de1e3b80407bd004d4cf6e2b247f0b7855c02" + integrity sha512-iTu63sm/DA6AJbVNOnASZ03mPR6GFJf5rLRE672XMF2ftQ2WcjDx9QIuwKF4aPWQqB7LuzX8/isNugNYzgNuVw== dependencies: - "@budibase/backend-core" "1.0.167" + "@budibase/backend-core" "1.0.171" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 571e102e4c..4dfef1f8f5 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -14,7 +14,12 @@ const { const { getGlobalDB, getTenantId } = require("@budibase/backend-core/tenancy") const env = require("../../../environment") const { googleCallbackUrl, oidcCallbackUrl } = require("./auth") -const { withCache } = require("../../../utilities/redis") +const { + withCache, + CacheKeys, + TTL, + bustCache, +} = require("@budibase/backend-core/cache") const BB_TENANT_CDN = "https://tenants.cdn.budi.live" @@ -44,6 +49,7 @@ exports.save = async function (ctx) { try { const response = await db.put(ctx.request.body) + await bustCache(CacheKeys.CHECKLIST) ctx.body = { type, _id: response.id, @@ -250,11 +256,9 @@ exports.configChecklist = async function (ctx) { const tenantId = getTenantId() try { - const ONE_MINUTE = 600 - ctx.body = await withCache( - `checklist:${tenantId}`, - ONE_MINUTE, + CacheKeys.CHECKLIST, + TTL.ONE_MINUTE, async () => { let apps = [] if (!env.MULTI_TENANCY || tenantId) { diff --git a/packages/worker/src/api/controllers/global/users.ts b/packages/worker/src/api/controllers/global/users.ts index 441a1f15ab..11cf03d0cc 100644 --- a/packages/worker/src/api/controllers/global/users.ts +++ b/packages/worker/src/api/controllers/global/users.ts @@ -3,9 +3,6 @@ const { StaticDatabases, } = require("@budibase/backend-core/db") const { getGlobalUserByEmail } = require("@budibase/backend-core/utils") -import { EmailTemplatePurpose } from "../../../constants" -import { checkInviteCode } from "../../../utilities/redis" -import { sendEmail } from "../../../utilities/email" const { user: userCache } = require("@budibase/backend-core/cache") const { invalidateSessions } = require("@budibase/backend-core/sessions") const accounts = require("@budibase/backend-core/accounts") @@ -17,11 +14,15 @@ const { doesTenantExist, } = require("@budibase/backend-core/tenancy") const { removeUserFromInfoDB } = require("@budibase/backend-core/deprovision") +const { errors } = require("@budibase/backend-core") +const { CacheKeys, bustCache } = require("@budibase/backend-core/cache") import env from "../../../environment" import { syncUserInApps } from "../../../utilities/appService" import { quotas, users } from "@budibase/pro" -const { errors } = require("@budibase/backend-core") import { allUsers, getUser } from "../../utilities" +import { EmailTemplatePurpose } from "../../../constants" +import { checkInviteCode } from "../../../utilities/redis" +import { sendEmail } from "../../../utilities/email" export const save = async (ctx: any) => { try { @@ -93,7 +94,14 @@ export const adminUser = async (ctx: any) => { tenantId, } try { - ctx.body = await users.save(user, tenantId, hashPassword, requirePassword) + const finalUser = await users.save( + user, + tenantId, + hashPassword, + requirePassword + ) + await bustCache(CacheKeys.CHECKLIST) + ctx.body = finalUser } catch (err: any) { ctx.throw(err.status || 400, err) } diff --git a/packages/worker/src/utilities/redis.js b/packages/worker/src/utilities/redis.js index f43c2d6bdc..73b10a62d5 100644 --- a/packages/worker/src/utilities/redis.js +++ b/packages/worker/src/utilities/redis.js @@ -21,7 +21,7 @@ function getClient(db) { return pwResetClient case utils.Databases.INVITATIONS: return invitationClient - case utils.Databases.DATA_CACHE: + case utils.Databases.GENERIC_CACHE: return cachingClient } } @@ -66,6 +66,7 @@ exports.shutdown = async () => { * Given a user ID this will store a code (that is returned) for an hour in redis. * The user can then return this code for resetting their password (through their reset link). * @param {string} userId the ID of the user which is to be reset. + * @param {object} info Info about the user/the reset process. * @return {Promise} returns the code that was stored to redis. */ exports.getResetPasswordCode = async (userId, info) => { diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e52f6e6d9d..832422f224 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.167": - version "1.0.167" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.167.tgz#6ea4b90f8b8b8ec3cbbe05e39853d44d40938879" - integrity sha512-IG9GZUdjFiqOKbgpZiwGotyT3BttFlChXs7mT8GaOkX7XvlyxxrG/nSI1duglBd6X2iafGESKQU8e6tKKQsxuw== +"@budibase/backend-core@1.0.171": + version "1.0.171" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.171.tgz#39fb68fc1a6e233589cf65e8354ff5e5098b4b4e" + integrity sha512-au7nP2x4Oj/5PCU7qd538FDrz/Dhq9nSX6AjR+3+hoU658Gv3xes4RKXgFjf5qE0tdSKTSe1pMntMhwQxshUBQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.167": - version "1.0.167" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.167.tgz#62fe54b58206eb04151a786a5516351137bd2f84" - integrity sha512-AdWWOub58LMxZoZzXm3jy1ZSVOR1teSH+lwLisdGWLnoVAUV8e46pD7iOyJDM1SKuSyNWeQ1lXj8tcLHVK1+OA== +"@budibase/pro@1.0.171": + version "1.0.171" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.171.tgz#b64de1e3b80407bd004d4cf6e2b247f0b7855c02" + integrity sha512-iTu63sm/DA6AJbVNOnASZ03mPR6GFJf5rLRE672XMF2ftQ2WcjDx9QIuwKF4aPWQqB7LuzX8/isNugNYzgNuVw== dependencies: - "@budibase/backend-core" "1.0.167" + "@budibase/backend-core" "1.0.171" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": From ee345af60d2ae20018973b2a6ca7caad59799b5c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 23 May 2022 15:07:58 +0100 Subject: [PATCH 26/45] Removing old caching code. --- packages/worker/src/utilities/redis.js | 27 +------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/packages/worker/src/utilities/redis.js b/packages/worker/src/utilities/redis.js index 73b10a62d5..97adafa195 100644 --- a/packages/worker/src/utilities/redis.js +++ b/packages/worker/src/utilities/redis.js @@ -1,6 +1,5 @@ const { Client, utils } = require("@budibase/backend-core/redis") const { newid } = require("@budibase/backend-core/utils") -const env = require("../environment") function getExpirySecondsForDB(db) { switch (db) { @@ -13,7 +12,7 @@ function getExpirySecondsForDB(db) { } } -let pwResetClient, invitationClient, cachingClient +let pwResetClient, invitationClient function getClient(db) { switch (db) { @@ -21,8 +20,6 @@ function getClient(db) { return pwResetClient case utils.Databases.INVITATIONS: return invitationClient - case utils.Databases.GENERIC_CACHE: - return cachingClient } } @@ -48,10 +45,8 @@ async function getACode(db, code, deleteCode = true) { exports.init = async () => { pwResetClient = new Client(utils.Databases.PW_RESETS) invitationClient = new Client(utils.Databases.INVITATIONS) - cachingClient = new Client(utils.Databases.DATA_CACHE) await pwResetClient.init() await invitationClient.init() - await cachingClient.init() } /** @@ -110,23 +105,3 @@ exports.checkInviteCode = async (inviteCode, deleteCode = true) => { throw "Invitation is not valid or has expired, please request a new one." } } - -// TODO: move into backend-core -exports.withCache = async (key, ttl, fetchFn) => { - const cachedValue = await cachingClient.get(key) - if (cachedValue) { - return cachedValue - } - - try { - const fetchedValue = await fetchFn() - - if (!env.isTest()) { - await cachingClient.store(key, fetchedValue, ttl) - } - return fetchedValue - } catch (err) { - console.error("Error calling fetch function", err) - throw err - } -} From 8fbbba16eebd526950bc4ea190d90b6b6f432459 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 23 May 2022 16:06:47 +0100 Subject: [PATCH 27/45] Updating cache to 1 hour. --- packages/backend-core/src/cache/generic.js | 2 + .../src/api/controllers/global/configs.js | 106 +++++++++--------- 2 files changed, 53 insertions(+), 55 deletions(-) diff --git a/packages/backend-core/src/cache/generic.js b/packages/backend-core/src/cache/generic.js index e5446a1424..b23568f8b9 100644 --- a/packages/backend-core/src/cache/generic.js +++ b/packages/backend-core/src/cache/generic.js @@ -8,6 +8,8 @@ exports.CacheKeys = { exports.TTL = { ONE_MINUTE: 600, + ONE_HOUR: 3600, + ONE_DAY: 86400, } function generateTenantKey(key) { diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 4dfef1f8f5..147c5296ce 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -256,62 +256,58 @@ exports.configChecklist = async function (ctx) { const tenantId = getTenantId() try { - ctx.body = await withCache( - CacheKeys.CHECKLIST, - TTL.ONE_MINUTE, - async () => { - let apps = [] - if (!env.MULTI_TENANCY || tenantId) { - // Apps exist - apps = await getAllApps({ idsOnly: true, efficient: true }) - } - - // They have set up SMTP - const smtpConfig = await getScopedFullConfig(db, { - type: Configs.SMTP, - }) - - // They have set up Google Auth - const googleConfig = await getScopedFullConfig(db, { - type: Configs.GOOGLE, - }) - - // They have set up OIDC - const oidcConfig = await getScopedFullConfig(db, { - type: Configs.OIDC, - }) - - // They have set up an global user - const users = await db.allDocs( - getGlobalUserParams(null, { - include_docs: true, - limit: 1, - }) - ) - return { - apps: { - checked: apps.length > 0, - label: "Create your first app", - link: "/builder/portal/apps", - }, - smtp: { - checked: !!smtpConfig, - label: "Set up email", - link: "/builder/portal/manage/email", - }, - adminUser: { - checked: users && users.rows.length >= 1, - label: "Create your first user", - link: "/builder/portal/manage/users", - }, - sso: { - checked: !!googleConfig || !!oidcConfig, - label: "Set up single sign-on", - link: "/builder/portal/manage/auth", - }, - } + ctx.body = await withCache(CacheKeys.CHECKLIST, TTL.ONE_HOUR, async () => { + let apps = [] + if (!env.MULTI_TENANCY || tenantId) { + // Apps exist + apps = await getAllApps({ idsOnly: true, efficient: true }) } - ) + + // They have set up SMTP + const smtpConfig = await getScopedFullConfig(db, { + type: Configs.SMTP, + }) + + // They have set up Google Auth + const googleConfig = await getScopedFullConfig(db, { + type: Configs.GOOGLE, + }) + + // They have set up OIDC + const oidcConfig = await getScopedFullConfig(db, { + type: Configs.OIDC, + }) + + // They have set up an global user + const users = await db.allDocs( + getGlobalUserParams(null, { + include_docs: true, + limit: 1, + }) + ) + return { + apps: { + checked: apps.length > 0, + label: "Create your first app", + link: "/builder/portal/apps", + }, + smtp: { + checked: !!smtpConfig, + label: "Set up email", + link: "/builder/portal/manage/email", + }, + adminUser: { + checked: users && users.rows.length >= 1, + label: "Create your first user", + link: "/builder/portal/manage/users", + }, + sso: { + checked: !!googleConfig || !!oidcConfig, + label: "Set up single sign-on", + link: "/builder/portal/manage/auth", + }, + } + }) } catch (err) { ctx.throw(err.status, err) } From 9d813292de00b6c08c3d293accf17b110448f7ea Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 16:24:29 +0100 Subject: [PATCH 28/45] enable clustering on server and worker services, better log output on user not found errors --- packages/backend-core/src/auth.js | 2 +- packages/backend-core/src/middleware/passport/local.js | 2 +- packages/builder/src/pages/builder/auth/login.svelte | 2 +- packages/server/Dockerfile | 4 +++- packages/server/docker_run.sh | 5 +++++ packages/server/package.json | 1 + packages/server/pm2.js | 9 +++++++++ packages/worker/Dockerfile | 4 +++- packages/worker/docker_run.sh | 5 +++++ packages/worker/package.json | 1 + packages/worker/pm2.js | 9 +++++++++ packages/worker/src/api/controllers/global/configs.js | 4 +--- packages/worker/src/environment.js | 7 +++++++ 13 files changed, 47 insertions(+), 8 deletions(-) create mode 100755 packages/server/docker_run.sh create mode 100644 packages/server/pm2.js create mode 100755 packages/worker/docker_run.sh create mode 100644 packages/worker/pm2.js diff --git a/packages/backend-core/src/auth.js b/packages/backend-core/src/auth.js index f6d53522d5..b13cd932c6 100644 --- a/packages/backend-core/src/auth.js +++ b/packages/backend-core/src/auth.js @@ -29,7 +29,7 @@ passport.deserializeUser(async (user, done) => { const user = await db.get(user._id) return done(null, user) } catch (err) { - console.error("User not found", err) + console.error(`User not found`, err) return done(null, false, { message: "User not found" }) } }) diff --git a/packages/backend-core/src/middleware/passport/local.js b/packages/backend-core/src/middleware/passport/local.js index 2149bd3e18..716ebc1755 100644 --- a/packages/backend-core/src/middleware/passport/local.js +++ b/packages/backend-core/src/middleware/passport/local.js @@ -30,7 +30,7 @@ exports.authenticate = async function (ctx, email, password, done) { const dbUser = await getGlobalUserByEmail(email) if (dbUser == null) { - return authError(done, "User not found") + return authError(done, `User not found: [${email}]`) } // check that the user is currently inactive, if this is the case throw invalid diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index 84af5b6338..c2ec547e38 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -28,7 +28,7 @@ async function login() { try { await auth.login({ - username, + username: username.trim(), password, }) if ($auth?.user?.forceResetPassword) { diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 0ef0fe4244..e5063a88ed 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -16,6 +16,7 @@ ENV BUDIBASE_ENVIRONMENT=PRODUCTION # copy files and install dependencies COPY . ./ RUN yarn +RUN yarn global add pm2 RUN yarn build # Install client for oracle datasource @@ -28,4 +29,5 @@ EXPOSE 4001 # due to this causing yarn to stop installing dev dependencies # which are actually needed to get this environment up and running ENV NODE_ENV=production -CMD ["yarn", "run:docker"] +ENV CLUSTER_MODE=${CLUSTER_MODE} +CMD ["./docker_run.sh"] diff --git a/packages/server/docker_run.sh b/packages/server/docker_run.sh new file mode 100755 index 0000000000..0045fe0c44 --- /dev/null +++ b/packages/server/docker_run.sh @@ -0,0 +1,5 @@ +if [ -z $CLUSTER_MODE ]; then + yarn run:docker +else + yarn run:docker:cluster +fi diff --git a/packages/server/package.json b/packages/server/package.json index f428ad5328..8ebad9923b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -18,6 +18,7 @@ "build:docker": "yarn run predocker && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION", "build:docs": "node ./scripts/docs/generate.js open", "run:docker": "node dist/index.js", + "run:docker:cluster": "pm2-runtime start pm2.js", "dev:stack:up": "node scripts/dev/manage.js up", "dev:stack:down": "node scripts/dev/manage.js down", "dev:stack:nuke": "node scripts/dev/manage.js nuke", diff --git a/packages/server/pm2.js b/packages/server/pm2.js new file mode 100644 index 0000000000..33829f327c --- /dev/null +++ b/packages/server/pm2.js @@ -0,0 +1,9 @@ +module.exports = { + apps: [ + { + script: "dist/index.js", + instances: "max", + exec_mode: "cluster", + }, + ], +} diff --git a/packages/worker/Dockerfile b/packages/worker/Dockerfile index 614a724ab6..b73efcc4a1 100644 --- a/packages/worker/Dockerfile +++ b/packages/worker/Dockerfile @@ -10,6 +10,7 @@ WORKDIR /app # copy files and install dependencies COPY . ./ RUN yarn +RUN yarn global add pm2 EXPOSE 4001 @@ -17,4 +18,5 @@ EXPOSE 4001 # due to this causing yarn to stop installing dev dependencies # which are actually needed to get this environment up and running ENV NODE_ENV=production -CMD ["yarn", "run:docker"] +ENV CLUSTER_MODE=${CLUSTER_MODE} +CMD ["./docker_run.sh"] diff --git a/packages/worker/docker_run.sh b/packages/worker/docker_run.sh new file mode 100755 index 0000000000..20694e5df0 --- /dev/null +++ b/packages/worker/docker_run.sh @@ -0,0 +1,5 @@ +if [[ -z $CLUSTER_MODE ]]; then + yarn run:docker +else + yarn run:docker:cluster +fi diff --git a/packages/worker/package.json b/packages/worker/package.json index 885f55003e..32b7610d8c 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -15,6 +15,7 @@ "build": "rimraf dist/ && tsc", "postbuild": "copyfiles -u 1 src/**/*.hbs dist/", "run:docker": "node dist/index.js", + "run:docker:cluster": "pm2-runtime start pm2.js", "build:docker": "docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION", "dev:stack:init": "node ./scripts/dev/manage.js init", "dev:builder": "npm run dev:stack:init && nodemon", diff --git a/packages/worker/pm2.js b/packages/worker/pm2.js new file mode 100644 index 0000000000..33829f327c --- /dev/null +++ b/packages/worker/pm2.js @@ -0,0 +1,9 @@ +module.exports = { + apps: [ + { + script: "dist/index.js", + instances: "max", + exec_mode: "cluster", + }, + ], +} diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 571e102e4c..0301ec354f 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -250,11 +250,9 @@ exports.configChecklist = async function (ctx) { const tenantId = getTenantId() try { - const ONE_MINUTE = 600 - ctx.body = await withCache( `checklist:${tenantId}`, - ONE_MINUTE, + env.CHECKLIST_CACHE_TTL, async () => { let apps = [] if (!env.MULTI_TENANCY || tenantId) { diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 8ef12e3877..790448d7e8 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -20,6 +20,12 @@ if (!LOADED && isDev() && !isTest()) { LOADED = true } +function parseIntSafe(number) { + if (number) { + return parseInt(number) + } +} + module.exports = { NODE_ENV: process.env.NODE_ENV, SELF_HOSTED: !!parseInt(process.env.SELF_HOSTED), @@ -46,6 +52,7 @@ module.exports = { SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, PLATFORM_URL: process.env.PLATFORM_URL, COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, + CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 600, APPS_URL: process.env.APPS_URL, _set(key, value) { process.env[key] = value From 858204d5f90909b43ba28a8d2d52db1941c16e91 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 15:48:30 +0000 Subject: [PATCH 29/45] v1.0.172 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 5b9bb453c3..39916bf0ba 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.171", + "version": "1.0.172", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index d0501d780e..0158525844 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.171", + "version": "1.0.172", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ab785cb768..61d3a5af20 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": "1.0.171", + "version": "1.0.172", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.171", + "@budibase/string-templates": "^1.0.172", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 84770c25c4..119e0b9b55 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.171", + "version": "1.0.172", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.171", - "@budibase/client": "^1.0.171", - "@budibase/frontend-core": "^1.0.171", - "@budibase/string-templates": "^1.0.171", + "@budibase/bbui": "^1.0.172", + "@budibase/client": "^1.0.172", + "@budibase/frontend-core": "^1.0.172", + "@budibase/string-templates": "^1.0.172", "@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 a9943e643f..423b854d1b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.171", + "version": "1.0.172", "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 fdb023f607..bed4ccdd44 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.171", + "version": "1.0.172", "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": "^1.0.171", - "@budibase/frontend-core": "^1.0.171", - "@budibase/string-templates": "^1.0.171", + "@budibase/bbui": "^1.0.172", + "@budibase/frontend-core": "^1.0.172", + "@budibase/string-templates": "^1.0.172", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index e6e41f1545..772746ed9a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.171", + "version": "1.0.172", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.171", + "@budibase/bbui": "^1.0.172", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index f428ad5328..76d936bc38 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.171", + "version": "1.0.172", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.171", - "@budibase/client": "^1.0.171", + "@budibase/backend-core": "^1.0.172", + "@budibase/client": "^1.0.172", "@budibase/pro": "1.0.171", - "@budibase/string-templates": "^1.0.171", + "@budibase/string-templates": "^1.0.172", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 698f7e0cc5..04c37ead25 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.171", + "version": "1.0.172", "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 885f55003e..98831e0d58 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.171", + "version": "1.0.172", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.171", + "@budibase/backend-core": "^1.0.172", "@budibase/pro": "1.0.171", - "@budibase/string-templates": "^1.0.171", + "@budibase/string-templates": "^1.0.172", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 8101b6ea063e7b4ab284e11f9c7eae694ca78c13 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 15:49:57 +0000 Subject: [PATCH 30/45] Update pro version to 1.0.172 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 76d936bc38..1f5ef7f8cf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.172", "@budibase/client": "^1.0.172", - "@budibase/pro": "1.0.171", + "@budibase/pro": "1.0.172", "@budibase/string-templates": "^1.0.172", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 98831e0d58..46b2dc935d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.172", - "@budibase/pro": "1.0.171", + "@budibase/pro": "1.0.172", "@budibase/string-templates": "^1.0.172", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From e1bacb7cca9338c763f411d46f41bb5abe71fc8c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 16:57:15 +0100 Subject: [PATCH 31/45] making checklist cache length controllable through env var --- .../src/api/controllers/global/configs.js | 103 +++++++++--------- packages/worker/src/environment.js | 4 +- 2 files changed, 56 insertions(+), 51 deletions(-) diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 147c5296ce..df3326ef26 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -17,7 +17,6 @@ const { googleCallbackUrl, oidcCallbackUrl } = require("./auth") const { withCache, CacheKeys, - TTL, bustCache, } = require("@budibase/backend-core/cache") @@ -256,58 +255,62 @@ exports.configChecklist = async function (ctx) { const tenantId = getTenantId() try { - ctx.body = await withCache(CacheKeys.CHECKLIST, TTL.ONE_HOUR, async () => { - let apps = [] - if (!env.MULTI_TENANCY || tenantId) { - // Apps exist - apps = await getAllApps({ idsOnly: true, efficient: true }) - } + ctx.body = await withCache( + CacheKeys.CHECKLIST, + env.CHECKLIST_CACHE_TTL, + async () => { + let apps = [] + if (!env.MULTI_TENANCY || tenantId) { + // Apps exist + apps = await getAllApps({ idsOnly: true, efficient: true }) + } - // They have set up SMTP - const smtpConfig = await getScopedFullConfig(db, { - type: Configs.SMTP, - }) - - // They have set up Google Auth - const googleConfig = await getScopedFullConfig(db, { - type: Configs.GOOGLE, - }) - - // They have set up OIDC - const oidcConfig = await getScopedFullConfig(db, { - type: Configs.OIDC, - }) - - // They have set up an global user - const users = await db.allDocs( - getGlobalUserParams(null, { - include_docs: true, - limit: 1, + // They have set up SMTP + const smtpConfig = await getScopedFullConfig(db, { + type: Configs.SMTP, }) - ) - return { - apps: { - checked: apps.length > 0, - label: "Create your first app", - link: "/builder/portal/apps", - }, - smtp: { - checked: !!smtpConfig, - label: "Set up email", - link: "/builder/portal/manage/email", - }, - adminUser: { - checked: users && users.rows.length >= 1, - label: "Create your first user", - link: "/builder/portal/manage/users", - }, - sso: { - checked: !!googleConfig || !!oidcConfig, - label: "Set up single sign-on", - link: "/builder/portal/manage/auth", - }, + + // They have set up Google Auth + const googleConfig = await getScopedFullConfig(db, { + type: Configs.GOOGLE, + }) + + // They have set up OIDC + const oidcConfig = await getScopedFullConfig(db, { + type: Configs.OIDC, + }) + + // They have set up an global user + const users = await db.allDocs( + getGlobalUserParams(null, { + include_docs: true, + limit: 1, + }) + ) + return { + apps: { + checked: apps.length > 0, + label: "Create your first app", + link: "/builder/portal/apps", + }, + smtp: { + checked: !!smtpConfig, + label: "Set up email", + link: "/builder/portal/manage/email", + }, + adminUser: { + checked: users && users.rows.length >= 1, + label: "Create your first user", + link: "/builder/portal/manage/users", + }, + sso: { + checked: !!googleConfig || !!oidcConfig, + label: "Set up single sign-on", + link: "/builder/portal/manage/auth", + }, + } } - }) + ) } catch (err) { ctx.throw(err.status, err) } diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 790448d7e8..a6a60c0a88 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -1,4 +1,5 @@ const { join } = require("path") +const { TTL } = require("@budibase/backend-core/cache") function isDev() { return process.env.NODE_ENV !== "production" @@ -52,7 +53,8 @@ module.exports = { SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, PLATFORM_URL: process.env.PLATFORM_URL, COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, - CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 600, + CHECKLIST_CACHE_TTL: + parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || TTL.ONE_HOUR, APPS_URL: process.env.APPS_URL, _set(key, value) { process.env[key] = value From f838a43e51a29554a90ab8d48567e0a4aba66433 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 23 May 2022 16:13:12 +0000 Subject: [PATCH 32/45] v1.0.173-alpha.0 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 39916bf0ba..f58bac059d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.172", + "version": "1.0.173-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 59152abd28..0e1251fbc1 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.172", + "version": "1.0.173-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 61d3a5af20..60995d2cfd 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": "1.0.172", + "version": "1.0.173-alpha.0", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173-alpha.0", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index c5ca1304ac..07c530043f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.172", + "version": "1.0.173-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.172", - "@budibase/client": "^1.0.172", - "@budibase/frontend-core": "^1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/bbui": "^1.0.173-alpha.0", + "@budibase/client": "^1.0.173-alpha.0", + "@budibase/frontend-core": "^1.0.173-alpha.0", + "@budibase/string-templates": "^1.0.173-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 423b854d1b..eaaad65ec5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.172", + "version": "1.0.173-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 bed4ccdd44..5d62184f80 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.172", + "version": "1.0.173-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": "^1.0.172", - "@budibase/frontend-core": "^1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/bbui": "^1.0.173-alpha.0", + "@budibase/frontend-core": "^1.0.173-alpha.0", + "@budibase/string-templates": "^1.0.173-alpha.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 772746ed9a..43f89937af 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.172", + "version": "1.0.173-alpha.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.172", + "@budibase/bbui": "^1.0.173-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 1f5ef7f8cf..ee1905fc08 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.172", + "version": "1.0.173-alpha.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,10 +69,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.172", - "@budibase/client": "^1.0.172", + "@budibase/backend-core": "^1.0.173-alpha.0", + "@budibase/client": "^1.0.173-alpha.0", "@budibase/pro": "1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173-alpha.0", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 04c37ead25..b9bc56833f 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.172", + "version": "1.0.173-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 46b2dc935d..7c3fbbe0aa 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.172", + "version": "1.0.173-alpha.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.172", + "@budibase/backend-core": "^1.0.173-alpha.0", "@budibase/pro": "1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173-alpha.0", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From 3310b03173c27e5f1dfe7a90d9900e599679358e Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 23 May 2022 16:14:33 +0000 Subject: [PATCH 33/45] Update pro version to 1.0.173-alpha.0 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index ee1905fc08..9fa8671563 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -71,7 +71,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.173-alpha.0", "@budibase/client": "^1.0.173-alpha.0", - "@budibase/pro": "1.0.172", + "@budibase/pro": "1.0.173-alpha.0", "@budibase/string-templates": "^1.0.173-alpha.0", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 7c3fbbe0aa..6b8a68dc26 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -32,7 +32,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.173-alpha.0", - "@budibase/pro": "1.0.172", + "@budibase/pro": "1.0.173-alpha.0", "@budibase/string-templates": "^1.0.173-alpha.0", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From d18de6c4c938b3e92b674d674fddc4fc96a0e2b7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 17:38:02 +0100 Subject: [PATCH 34/45] prevent issue with TTL dependency import --- packages/server/yarn.lock | 18 +++++++++--------- packages/worker/src/environment.js | 4 +--- packages/worker/yarn.lock | 18 +++++++++--------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 219b5add75..277fda70ca 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.171": - version "1.0.171" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.171.tgz#39fb68fc1a6e233589cf65e8354ff5e5098b4b4e" - integrity sha512-au7nP2x4Oj/5PCU7qd538FDrz/Dhq9nSX6AjR+3+hoU658Gv3xes4RKXgFjf5qE0tdSKTSe1pMntMhwQxshUBQ== +"@budibase/backend-core@1.0.172": + version "1.0.172" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.172.tgz#81f825d5e141fbcbad085202509e1f97dfed0dfc" + integrity sha512-JDyR646dhDmQMWqeJxkdD70wyFv26hfNgRl768sgCgN4fG9B8829QsKeNjOquZf+U2diaKbDmKX+f/7gqoA5FQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.171": - version "1.0.171" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.171.tgz#b64de1e3b80407bd004d4cf6e2b247f0b7855c02" - integrity sha512-iTu63sm/DA6AJbVNOnASZ03mPR6GFJf5rLRE672XMF2ftQ2WcjDx9QIuwKF4aPWQqB7LuzX8/isNugNYzgNuVw== +"@budibase/pro@1.0.172": + version "1.0.172" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.172.tgz#c6fe078098c72b8d163cfcf62d5389a9ca937b20" + integrity sha512-hHNobwr+8G99ofi9zp0cGB13iIC0StEV3JdF2a2HXwB4NzMz4b0vJ6VfcB1J+nVJPEe42DWmJViwJkuSX0jGhw== dependencies: - "@budibase/backend-core" "1.0.171" + "@budibase/backend-core" "1.0.172" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index a6a60c0a88..4d65d5d834 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -1,5 +1,4 @@ const { join } = require("path") -const { TTL } = require("@budibase/backend-core/cache") function isDev() { return process.env.NODE_ENV !== "production" @@ -53,8 +52,7 @@ module.exports = { SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, PLATFORM_URL: process.env.PLATFORM_URL, COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, - CHECKLIST_CACHE_TTL: - parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || TTL.ONE_HOUR, + CHECKLIST_CACHE_TTL: parseIntSafe(process.env.CHECKLIST_CACHE_TTL) || 3600, APPS_URL: process.env.APPS_URL, _set(key, value) { process.env[key] = value diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 832422f224..57cf9f09af 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.171": - version "1.0.171" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.171.tgz#39fb68fc1a6e233589cf65e8354ff5e5098b4b4e" - integrity sha512-au7nP2x4Oj/5PCU7qd538FDrz/Dhq9nSX6AjR+3+hoU658Gv3xes4RKXgFjf5qE0tdSKTSe1pMntMhwQxshUBQ== +"@budibase/backend-core@1.0.172": + version "1.0.172" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.172.tgz#81f825d5e141fbcbad085202509e1f97dfed0dfc" + integrity sha512-JDyR646dhDmQMWqeJxkdD70wyFv26hfNgRl768sgCgN4fG9B8829QsKeNjOquZf+U2diaKbDmKX+f/7gqoA5FQ== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.171": - version "1.0.171" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.171.tgz#b64de1e3b80407bd004d4cf6e2b247f0b7855c02" - integrity sha512-iTu63sm/DA6AJbVNOnASZ03mPR6GFJf5rLRE672XMF2ftQ2WcjDx9QIuwKF4aPWQqB7LuzX8/isNugNYzgNuVw== +"@budibase/pro@1.0.172": + version "1.0.172" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.172.tgz#c6fe078098c72b8d163cfcf62d5389a9ca937b20" + integrity sha512-hHNobwr+8G99ofi9zp0cGB13iIC0StEV3JdF2a2HXwB4NzMz4b0vJ6VfcB1J+nVJPEe42DWmJViwJkuSX0jGhw== dependencies: - "@budibase/backend-core" "1.0.171" + "@budibase/backend-core" "1.0.172" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0": From 4c8dceb5cffd54bf1370e46d619020aada5031b7 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 17:14:13 +0000 Subject: [PATCH 35/45] v1.0.173 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 39916bf0ba..f1aac195e4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.172", + "version": "1.0.173", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 0158525844..f0d42a006d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.172", + "version": "1.0.173", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 61d3a5af20..626e8beeb3 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": "1.0.172", + "version": "1.0.173", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 119e0b9b55..7474c2b123 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.172", + "version": "1.0.173", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.172", - "@budibase/client": "^1.0.172", - "@budibase/frontend-core": "^1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/bbui": "^1.0.173", + "@budibase/client": "^1.0.173", + "@budibase/frontend-core": "^1.0.173", + "@budibase/string-templates": "^1.0.173", "@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 423b854d1b..361b030de9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.172", + "version": "1.0.173", "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 bed4ccdd44..1a07441d86 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.172", + "version": "1.0.173", "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": "^1.0.172", - "@budibase/frontend-core": "^1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/bbui": "^1.0.173", + "@budibase/frontend-core": "^1.0.173", + "@budibase/string-templates": "^1.0.173", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 772746ed9a..33122df856 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.172", + "version": "1.0.173", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.172", + "@budibase/bbui": "^1.0.173", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index cd04beef2b..e849fa1162 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.172", + "version": "1.0.173", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,10 +70,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.172", - "@budibase/client": "^1.0.172", + "@budibase/backend-core": "^1.0.173", + "@budibase/client": "^1.0.173", "@budibase/pro": "1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 04c37ead25..d1e1661096 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.172", + "version": "1.0.173", "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 f94dd15c73..d72c86e9c9 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.172", + "version": "1.0.173", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -32,9 +32,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.172", + "@budibase/backend-core": "^1.0.173", "@budibase/pro": "1.0.172", - "@budibase/string-templates": "^1.0.172", + "@budibase/string-templates": "^1.0.173", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From aa6380a85675216d42be6e3c0ccd0dfadc3d69f5 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 17:15:41 +0000 Subject: [PATCH 36/45] Update pro version to 1.0.173 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index e849fa1162..4b89a11bf2 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -72,7 +72,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.173", "@budibase/client": "^1.0.173", - "@budibase/pro": "1.0.172", + "@budibase/pro": "1.0.173", "@budibase/string-templates": "^1.0.173", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index d72c86e9c9..e8fc824080 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -33,7 +33,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.173", - "@budibase/pro": "1.0.172", + "@budibase/pro": "1.0.173", "@budibase/string-templates": "^1.0.173", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From fb1a10d50b0a55437a1d9867200b2a327ec6f299 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 19:13:02 +0100 Subject: [PATCH 37/45] updating pm2 config files to be named correctly so commands are picked up --- packages/server/package.json | 2 +- packages/server/{pm2.js => pm2.config.js} | 2 +- packages/worker/package.json | 2 +- packages/worker/{pm2.js => pm2.config.js} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename packages/server/{pm2.js => pm2.config.js} (81%) rename packages/worker/{pm2.js => pm2.config.js} (75%) diff --git a/packages/server/package.json b/packages/server/package.json index 4b89a11bf2..d052651b69 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -18,7 +18,7 @@ "build:docker": "yarn run predocker && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION", "build:docs": "node ./scripts/docs/generate.js open", "run:docker": "node dist/index.js", - "run:docker:cluster": "pm2-runtime start pm2.js", + "run:docker:cluster": "pm2-runtime start pm2.config.js", "dev:stack:up": "node scripts/dev/manage.js up", "dev:stack:down": "node scripts/dev/manage.js down", "dev:stack:nuke": "node scripts/dev/manage.js nuke", diff --git a/packages/server/pm2.js b/packages/server/pm2.config.js similarity index 81% rename from packages/server/pm2.js rename to packages/server/pm2.config.js index 33829f327c..31cbab5d6c 100644 --- a/packages/server/pm2.js +++ b/packages/server/pm2.config.js @@ -2,7 +2,7 @@ module.exports = { apps: [ { script: "dist/index.js", - instances: "max", + instances: "4", exec_mode: "cluster", }, ], diff --git a/packages/worker/package.json b/packages/worker/package.json index e8fc824080..238dd5b6e2 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -15,7 +15,7 @@ "build": "rimraf dist/ && tsc", "postbuild": "copyfiles -u 1 src/**/*.hbs dist/", "run:docker": "node dist/index.js", - "run:docker:cluster": "pm2-runtime start pm2.js", + "run:docker:cluster": "pm2-runtime start pm2.config.js", "build:docker": "docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION", "dev:stack:init": "node ./scripts/dev/manage.js init", "dev:builder": "npm run dev:stack:init && nodemon", diff --git a/packages/worker/pm2.js b/packages/worker/pm2.config.js similarity index 75% rename from packages/worker/pm2.js rename to packages/worker/pm2.config.js index 33829f327c..b5fb1880ef 100644 --- a/packages/worker/pm2.js +++ b/packages/worker/pm2.config.js @@ -1,7 +1,7 @@ module.exports = { apps: [ { - script: "dist/index.js", + script: "./dist/index.js", instances: "max", exec_mode: "cluster", }, From 4328f5926c08e4f1b801210b4d9d021a62461216 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 23 May 2022 19:16:11 +0100 Subject: [PATCH 38/45] Update pm2.config.js --- packages/server/pm2.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/pm2.config.js b/packages/server/pm2.config.js index 31cbab5d6c..33829f327c 100644 --- a/packages/server/pm2.config.js +++ b/packages/server/pm2.config.js @@ -2,7 +2,7 @@ module.exports = { apps: [ { script: "dist/index.js", - instances: "4", + instances: "max", exec_mode: "cluster", }, ], From b8737ef665c2f1d67d1092b909e8248f158b9567 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 18:24:18 +0000 Subject: [PATCH 39/45] v1.0.174 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index f1aac195e4..10717bc007 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.173", + "version": "1.0.174", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index f0d42a006d..30c3cfb937 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.173", + "version": "1.0.174", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 626e8beeb3..ee1e73c387 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": "1.0.173", + "version": "1.0.174", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.173", + "@budibase/string-templates": "^1.0.174", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 7474c2b123..e33f90f707 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.173", + "version": "1.0.174", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.173", - "@budibase/client": "^1.0.173", - "@budibase/frontend-core": "^1.0.173", - "@budibase/string-templates": "^1.0.173", + "@budibase/bbui": "^1.0.174", + "@budibase/client": "^1.0.174", + "@budibase/frontend-core": "^1.0.174", + "@budibase/string-templates": "^1.0.174", "@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 361b030de9..711437f8fc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.173", + "version": "1.0.174", "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 1a07441d86..2e3f9c1018 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.173", + "version": "1.0.174", "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": "^1.0.173", - "@budibase/frontend-core": "^1.0.173", - "@budibase/string-templates": "^1.0.173", + "@budibase/bbui": "^1.0.174", + "@budibase/frontend-core": "^1.0.174", + "@budibase/string-templates": "^1.0.174", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 33122df856..7827d4986e 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.173", + "version": "1.0.174", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.173", + "@budibase/bbui": "^1.0.174", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index d052651b69..854ca33bcd 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.173", + "version": "1.0.174", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,10 +70,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.173", - "@budibase/client": "^1.0.173", + "@budibase/backend-core": "^1.0.174", + "@budibase/client": "^1.0.174", "@budibase/pro": "1.0.173", - "@budibase/string-templates": "^1.0.173", + "@budibase/string-templates": "^1.0.174", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index d1e1661096..bd50bf1b99 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.173", + "version": "1.0.174", "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 238dd5b6e2..f46225793d 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.173", + "version": "1.0.174", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -32,9 +32,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.173", + "@budibase/backend-core": "^1.0.174", "@budibase/pro": "1.0.173", - "@budibase/string-templates": "^1.0.173", + "@budibase/string-templates": "^1.0.174", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From c6a8f5ec3a97a8fd20a5bedd1fb03a8f0a5bf99d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 18:25:37 +0000 Subject: [PATCH 40/45] Update pro version to 1.0.174 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 854ca33bcd..69efa55ccb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -72,7 +72,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.174", "@budibase/client": "^1.0.174", - "@budibase/pro": "1.0.173", + "@budibase/pro": "1.0.174", "@budibase/string-templates": "^1.0.174", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index f46225793d..800ede6a90 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -33,7 +33,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.174", - "@budibase/pro": "1.0.173", + "@budibase/pro": "1.0.174", "@budibase/string-templates": "^1.0.174", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From 484dbbb6051f52ac84f7afd988cb9b761ca8eaa8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 23 May 2022 23:23:49 +0100 Subject: [PATCH 41/45] Adding the ability to force a new context. --- packages/backend-core/src/context/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend-core/src/context/index.js b/packages/backend-core/src/context/index.js index 20e5e26693..3abbc84596 100644 --- a/packages/backend-core/src/context/index.js +++ b/packages/backend-core/src/context/index.js @@ -73,7 +73,7 @@ exports.isMultiTenant = () => { } // used for automations, API endpoints should always be in context already -exports.doInTenant = (tenantId, task) => { +exports.doInTenant = (tenantId, task, { forceNew } = {}) => { // the internal function is so that we can re-use an existing // context - don't want to close DB on a parent context async function internal(opts = { existing: false }) { @@ -98,7 +98,11 @@ exports.doInTenant = (tenantId, task) => { } } const using = cls.getFromContext(ContextKeys.IN_USE) - if (using && cls.getFromContext(ContextKeys.TENANT_ID) === tenantId) { + if ( + !forceNew && + using && + cls.getFromContext(ContextKeys.TENANT_ID) === tenantId + ) { cls.setOnContext(ContextKeys.IN_USE, using + 1) return internal({ existing: true }) } else { @@ -135,7 +139,7 @@ const setAppTenantId = appId => { exports.updateTenantId(appTenantId) } -exports.doInAppContext = (appId, task) => { +exports.doInAppContext = (appId, task, { forceNew } = {}) => { if (!appId) { throw new Error("appId is required") } @@ -162,7 +166,7 @@ exports.doInAppContext = (appId, task) => { } } const using = cls.getFromContext(ContextKeys.IN_USE) - if (using && cls.getFromContext(ContextKeys.APP_ID) === appId) { + if (!forceNew && using && cls.getFromContext(ContextKeys.APP_ID) === appId) { cls.setOnContext(ContextKeys.IN_USE, using + 1) return internal({ existing: true }) } else { From 15d3ecaa7b4b7b22aa38e5d602e39096c5bf8491 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 22:32:31 +0000 Subject: [PATCH 42/45] v1.0.175 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index 10717bc007..fd289506fa 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.174", + "version": "1.0.175", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 30c3cfb937..39a2fc186a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.174", + "version": "1.0.175", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ee1e73c387..e26a5dc113 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": "1.0.174", + "version": "1.0.175", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.174", + "@budibase/string-templates": "^1.0.175", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index e33f90f707..f39bc03740 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.174", + "version": "1.0.175", "license": "GPL-3.0", "private": true, "scripts": { @@ -67,10 +67,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.174", - "@budibase/client": "^1.0.174", - "@budibase/frontend-core": "^1.0.174", - "@budibase/string-templates": "^1.0.174", + "@budibase/bbui": "^1.0.175", + "@budibase/client": "^1.0.175", + "@budibase/frontend-core": "^1.0.175", + "@budibase/string-templates": "^1.0.175", "@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 711437f8fc..fb2e593c20 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.174", + "version": "1.0.175", "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 2e3f9c1018..6ea3f166c3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.174", + "version": "1.0.175", "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": "^1.0.174", - "@budibase/frontend-core": "^1.0.174", - "@budibase/string-templates": "^1.0.174", + "@budibase/bbui": "^1.0.175", + "@budibase/frontend-core": "^1.0.175", + "@budibase/string-templates": "^1.0.175", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 7827d4986e..e87e7f6e77 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.174", + "version": "1.0.175", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.174", + "@budibase/bbui": "^1.0.175", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index 69efa55ccb..b3f3ce48a6 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.174", + "version": "1.0.175", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,10 +70,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.174", - "@budibase/client": "^1.0.174", + "@budibase/backend-core": "^1.0.175", + "@budibase/client": "^1.0.175", "@budibase/pro": "1.0.174", - "@budibase/string-templates": "^1.0.174", + "@budibase/string-templates": "^1.0.175", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index bd50bf1b99..77916aca77 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.174", + "version": "1.0.175", "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 800ede6a90..815dfdda47 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.174", + "version": "1.0.175", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -32,9 +32,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.174", + "@budibase/backend-core": "^1.0.175", "@budibase/pro": "1.0.174", - "@budibase/string-templates": "^1.0.174", + "@budibase/string-templates": "^1.0.175", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From ed1099470ee559e25cade6373ee8c9144bbcf61b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 23 May 2022 22:33:53 +0000 Subject: [PATCH 43/45] Update pro version to 1.0.175 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index b3f3ce48a6..fd86e08780 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -72,7 +72,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.175", "@budibase/client": "^1.0.175", - "@budibase/pro": "1.0.174", + "@budibase/pro": "1.0.175", "@budibase/string-templates": "^1.0.175", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 815dfdda47..5e0cd96397 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -33,7 +33,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.175", - "@budibase/pro": "1.0.174", + "@budibase/pro": "1.0.175", "@budibase/string-templates": "^1.0.175", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", From fe44d5a321aa571098f8aaa432463755633ddc73 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 23 May 2022 22:51:48 +0000 Subject: [PATCH 44/45] v1.0.176-alpha.0 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lerna.json b/lerna.json index fd289506fa..7a2e88beda 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.175", + "version": "1.0.176-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 26a4809f85..f083320c6d 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.175", + "version": "1.0.176-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index e26a5dc113..cf304b0b48 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": "1.0.175", + "version": "1.0.176-alpha.0", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.175", + "@budibase/string-templates": "^1.0.176-alpha.0", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index e1404b7fa0..5a50f9b2f2 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.175", + "version": "1.0.176-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.175", - "@budibase/client": "^1.0.175", - "@budibase/frontend-core": "^1.0.175", - "@budibase/string-templates": "^1.0.175", + "@budibase/bbui": "^1.0.176-alpha.0", + "@budibase/client": "^1.0.176-alpha.0", + "@budibase/frontend-core": "^1.0.176-alpha.0", + "@budibase/string-templates": "^1.0.176-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 fb2e593c20..d4cb7cc4bd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.175", + "version": "1.0.176-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 6ea3f166c3..dfa8aba29c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.175", + "version": "1.0.176-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": "^1.0.175", - "@budibase/frontend-core": "^1.0.175", - "@budibase/string-templates": "^1.0.175", + "@budibase/bbui": "^1.0.176-alpha.0", + "@budibase/frontend-core": "^1.0.176-alpha.0", + "@budibase/string-templates": "^1.0.176-alpha.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index e87e7f6e77..16fbd60728 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.175", + "version": "1.0.176-alpha.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.175", + "@budibase/bbui": "^1.0.176-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index fd86e08780..2294029ade 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.175", + "version": "1.0.176-alpha.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,10 +70,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.175", - "@budibase/client": "^1.0.175", + "@budibase/backend-core": "^1.0.176-alpha.0", + "@budibase/client": "^1.0.176-alpha.0", "@budibase/pro": "1.0.175", - "@budibase/string-templates": "^1.0.175", + "@budibase/string-templates": "^1.0.176-alpha.0", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 77916aca77..09b84276c1 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.175", + "version": "1.0.176-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 5e0cd96397..1726003dbb 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.175", + "version": "1.0.176-alpha.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -32,9 +32,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.175", + "@budibase/backend-core": "^1.0.176-alpha.0", "@budibase/pro": "1.0.175", - "@budibase/string-templates": "^1.0.175", + "@budibase/string-templates": "^1.0.176-alpha.0", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", From dacefa4300a27fc3481e566622d1da73bbb2715b Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 23 May 2022 22:53:16 +0000 Subject: [PATCH 45/45] Update pro version to 1.0.176-alpha.0 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 2294029ade..f603e7616a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -72,7 +72,7 @@ "@apidevtools/swagger-parser": "^10.0.3", "@budibase/backend-core": "^1.0.176-alpha.0", "@budibase/client": "^1.0.176-alpha.0", - "@budibase/pro": "1.0.175", + "@budibase/pro": "1.0.176-alpha.0", "@budibase/string-templates": "^1.0.176-alpha.0", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 1726003dbb..5bf4897955 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -33,7 +33,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.0.176-alpha.0", - "@budibase/pro": "1.0.175", + "@budibase/pro": "1.0.176-alpha.0", "@budibase/string-templates": "^1.0.176-alpha.0", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7",