diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 492f244d79..bf1b672d37 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -158,6 +158,8 @@ spec: - name: ELASTIC_APM_SERVER_URL value: {{ .Values.globals.elasticApmServerUrl | quote }} {{ end }} + - name: CDN_URL + value: {{ .Values.globals.cdnUrl }} image: budibase/apps:{{ .Values.globals.appVersion }} imagePullPolicy: Always diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index c72398f825..df692a0723 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -147,6 +147,8 @@ spec: - name: ELASTIC_APM_SERVER_URL value: {{ .Values.globals.elasticApmServerUrl | quote }} {{ end }} + - name: CDN_URL + value: {{ .Values.globals.cdnUrl }} image: budibase/worker:{{ .Values.globals.appVersion }} imagePullPolicy: Always diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 5c4004cb57..a2a761aa86 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -98,6 +98,7 @@ globals: # if createSecrets is set to false, you can hard-code your secrets here internalApiKey: "" jwtSecret: "" + cdnUrl: "" smtp: enabled: false diff --git a/hosting/nginx.prod.conf.hbs b/hosting/nginx.prod.conf.hbs index 114a4575d0..b2a0f00320 100644 --- a/hosting/nginx.prod.conf.hbs +++ b/hosting/nginx.prod.conf.hbs @@ -51,11 +51,11 @@ http { proxy_buffering off; set $csp_default "default-src 'self'"; - set $csp_script "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io"; + set $csp_script "script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.budibase.net https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io"; set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com"; set $csp_object "object-src 'none'"; set $csp_base_uri "base-uri 'self'"; - set $csp_connect "connect-src 'self' https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.amazonaws.com https://*.s3.us-east-2.amazonaws.com https://*.s3.us-east-1.amazonaws.com https://*.s3.us-west-1.amazonaws.com https://*.s3.us-west-2.amazonaws.com https://*.s3.af-south-1.amazonaws.com https://*.s3.ap-east-1.amazonaws.com https://*.s3.ap-southeast-3.amazonaws.com https://*.s3.ap-south-1.amazonaws.com https://*.s3.ap-northeast-3.amazonaws.com https://*.s3.ap-northeast-2.amazonaws.com https://*.s3.ap-southeast-1.amazonaws.com https://*.s3.ap-southeast-2.amazonaws.com https://*.s3.ap-northeast-1.amazonaws.com https://*.s3.ca-central-1.amazonaws.com https://*.s3.cn-north-1.amazonaws.com https://*.s3.cn-northwest-1.amazonaws.com https://*.s3.eu-central-1.amazonaws.com https://*.s3.eu-west-1.amazonaws.com https://*.s3.eu-west-2.amazonaws.com https://*.s3.eu-south-1.amazonaws.com https://*.s3.eu-west-3.amazonaws.com https://*.s3.eu-north-1.amazonaws.com https://*.s3.sa-east-1.amazonaws.com https://*.s3.me-south-1.amazonaws.com https://*.s3.us-gov-east-1.amazonaws.com https://*.s3.us-gov-west-1.amazonaws.com"; + set $csp_connect "connect-src 'self' https://*.budibase.net https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.amazonaws.com https://*.s3.us-east-2.amazonaws.com https://*.s3.us-east-1.amazonaws.com https://*.s3.us-west-1.amazonaws.com https://*.s3.us-west-2.amazonaws.com https://*.s3.af-south-1.amazonaws.com https://*.s3.ap-east-1.amazonaws.com https://*.s3.ap-southeast-3.amazonaws.com https://*.s3.ap-south-1.amazonaws.com https://*.s3.ap-northeast-3.amazonaws.com https://*.s3.ap-northeast-2.amazonaws.com https://*.s3.ap-southeast-1.amazonaws.com https://*.s3.ap-southeast-2.amazonaws.com https://*.s3.ap-northeast-1.amazonaws.com https://*.s3.ca-central-1.amazonaws.com https://*.s3.cn-north-1.amazonaws.com https://*.s3.cn-northwest-1.amazonaws.com https://*.s3.eu-central-1.amazonaws.com https://*.s3.eu-west-1.amazonaws.com https://*.s3.eu-west-2.amazonaws.com https://*.s3.eu-south-1.amazonaws.com https://*.s3.eu-west-3.amazonaws.com https://*.s3.eu-north-1.amazonaws.com https://*.s3.sa-east-1.amazonaws.com https://*.s3.me-south-1.amazonaws.com https://*.s3.us-gov-east-1.amazonaws.com https://*.s3.us-gov-west-1.amazonaws.com"; set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com"; set $csp_frame "frame-src 'self' https:"; set $csp_img "img-src http: https: data: blob:"; diff --git a/lerna.json b/lerna.json index 99deed35ee..bee0ccd542 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 74f0125e7a..253a74c7f9 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "2.1.14-alpha.1", + "@budibase/types": "2.1.19-alpha.0", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index d684baae5a..23b7873f37 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": "2.1.14-alpha.1", + "version": "2.1.19-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": "2.1.14-alpha.1", + "@budibase/string-templates": "2.1.19-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/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js index f436f3ff39..f844402958 100644 --- a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -2,7 +2,7 @@ import filterTests from "../support/filterTests" const interact = require('../support/interact') filterTests(['all'], () => { - context("Add Multi-Option Datatype", () => { + xcontext("Add Multi-Option Datatype", () => { before(() => { cy.login() cy.createTestApp() diff --git a/packages/builder/cypress/integration/addRadioButtons.spec.js b/packages/builder/cypress/integration/addRadioButtons.spec.js index 91cfd0c7fa..3e344c3656 100644 --- a/packages/builder/cypress/integration/addRadioButtons.spec.js +++ b/packages/builder/cypress/integration/addRadioButtons.spec.js @@ -2,7 +2,7 @@ import filterTests from "../support/filterTests" const interact = require('../support/interact') filterTests(['all'], () => { - context("Add Radio Buttons", () => { + xcontext("Add Radio Buttons", () => { before(() => { cy.login() cy.createTestApp() diff --git a/packages/builder/package.json b/packages/builder/package.json index 093ed046fd..0ea8d1d6ff 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.1.14-alpha.1", - "@budibase/client": "2.1.14-alpha.1", - "@budibase/frontend-core": "2.1.14-alpha.1", - "@budibase/string-templates": "2.1.14-alpha.1", + "@budibase/bbui": "2.1.19-alpha.0", + "@budibase/client": "2.1.19-alpha.0", + "@budibase/frontend-core": "2.1.19-alpha.0", + "@budibase/string-templates": "2.1.19-alpha.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 562434eaf1..4ca67d83be 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -167,11 +167,13 @@ const autoCreateApp = async () => { try { // Auto name app if has same name - let appName = template.key + const templateKey = template.key.split("/")[1] + + let appName = templateKey.replace(/-/g, " ") const appsWithSameName = $apps.filter(app => app.name?.startsWith(appName) ) - appName = `${appName}-${appsWithSameName.length + 1}` + appName = `${appName} ${appsWithSameName.length + 1}` // Create form data to create app let data = new FormData() diff --git a/packages/cli/package.json b/packages/cli/package.json index 99676450ee..d4d865baee 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.1.14-alpha.1", - "@budibase/string-templates": "2.1.14-alpha.1", - "@budibase/types": "2.1.14-alpha.1", + "@budibase/backend-core": "2.1.19-alpha.0", + "@budibase/string-templates": "2.1.19-alpha.0", + "@budibase/types": "2.1.19-alpha.0", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index c88ed71817..5ea2e86db3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.1.14-alpha.1", + "version": "2.1.19-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": "2.1.14-alpha.1", - "@budibase/frontend-core": "2.1.14-alpha.1", - "@budibase/string-templates": "2.1.14-alpha.1", + "@budibase/bbui": "2.1.19-alpha.0", + "@budibase/frontend-core": "2.1.19-alpha.0", + "@budibase/string-templates": "2.1.19-alpha.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 0c512bbe0f..00bcf19548 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -131,7 +131,7 @@ const getDefault = (defaultValue, schema, type) => { // Remove any values not present in the field schema // Convert any values supplied to string - if (Array.isArray(defaultValue) && type == "array") { + if (Array.isArray(defaultValue) && type == "array" && schema) { return defaultValue.reduce((acc, entry) => { let processedOption = String(entry) let schemaOptions = schema.constraints.inclusion diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index aaa62f1598..ca6a20ef7d 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.1.14-alpha.1", + "version": "2.1.19-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": "2.1.14-alpha.1", + "@budibase/bbui": "2.1.19-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 2bde582675..a9d840cf0e 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 561d3427c1..662c94da8e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.1.14-alpha.1", - "@budibase/client": "2.1.14-alpha.1", - "@budibase/pro": "2.1.14-alpha.1", - "@budibase/string-templates": "2.1.14-alpha.1", - "@budibase/types": "2.1.14-alpha.1", + "@budibase/backend-core": "2.1.19-alpha.0", + "@budibase/client": "2.1.19-alpha.0", + "@budibase/pro": "2.1.19-alpha.0", + "@budibase/string-templates": "2.1.19-alpha.0", + "@budibase/types": "2.1.19-alpha.0", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/server/src/environment.js b/packages/server/src/environment.js index ef8e674a86..72baab9167 100644 --- a/packages/server/src/environment.js +++ b/packages/server/src/environment.js @@ -46,6 +46,7 @@ module.exports = { AWS_REGION: process.env.AWS_REGION, MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY, MINIO_SECRET_KEY: process.env.MINIO_SECRET_KEY, + CDN_URL: process.env.CDN_URL || "https://cdn.budi.live", REDIS_URL: process.env.REDIS_URL, REDIS_PASSWORD: process.env.REDIS_PASSWORD, INTERNAL_API_KEY: process.env.INTERNAL_API_KEY, diff --git a/packages/server/src/utilities/index.js b/packages/server/src/utilities/index.js index 38e15b5f58..9b51e0e628 100644 --- a/packages/server/src/utilities/index.js +++ b/packages/server/src/utilities/index.js @@ -5,8 +5,6 @@ const { generateMetadataID } = require("../db/utils") const Readable = require("stream").Readable const { getAppDB } = require("@budibase/backend-core/context") -const BB_CDN = "https://cdn.budi.live" - exports.wait = ms => new Promise(resolve => setTimeout(resolve, ms)) exports.isDev = env.isDev @@ -40,7 +38,7 @@ exports.objectStoreUrl = () => { // can use a relative url for this as all goes through the proxy (this is hosted in minio) return OBJ_STORE_DIRECTORY } else { - return BB_CDN + return env.CDN_URL } } diff --git a/packages/server/src/utilities/plugins.js b/packages/server/src/utilities/plugins.js index 202a349b16..139639e814 100644 --- a/packages/server/src/utilities/plugins.js +++ b/packages/server/src/utilities/plugins.js @@ -13,7 +13,7 @@ exports.enrichPluginURLs = plugins => { // In self host we need to prefix the path, as the bucket name is not part // of the bucket path. In cloud, it's already part of the bucket path. - let jsUrl = cloud ? "https://cdn.budi.live/" : `/${bucket}/` + let jsUrl = cloud ? `${env.CDN_URL}/` : `/${bucket}/` jsUrl += ProPlugins.getBucketPath(plugin.name) jsUrl += jsFileName return { ...plugin, jsUrl } diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index a1b23d572f..bdcc5c3095 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1094,12 +1094,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.14-alpha.1.tgz#88bc377fcafa4e93a7d31b9eb73ef7274f15e480" - integrity sha512-iDm5UB8Fbb14QcO/K7+58dTuqWiQd/ygKPc6g7VuKxov/8BAuXDKHpFnJZRGSu0Q2TEWSQSc6l95xoLoHR5tuA== +"@budibase/backend-core@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.19-alpha.0.tgz#ec30bd3bf9453631259bf121154515214d21a4b8" + integrity sha512-C49h4scGRNAFFZR3jaX7pX3WbZfSP07Rg1bYEPqI7MaivRh0SUNWv9r5rGz2eqy+LbwAtPEV5GDjsT2mAaaNNg== dependencies: - "@budibase/types" "2.1.14-alpha.1" + "@budibase/types" "2.1.19-alpha.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1181,13 +1181,13 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.14-alpha.1.tgz#cd7ccfc16166c720ad5576c8d8680fa529c753bd" - integrity sha512-JsobERP7rOEw8+SmC7ZvwG9U00Ugu/MJr00gzHnHZk46IljzUoZn/ay/e/GScRRayiRSUudlDnq8pS2LCSpw2A== +"@budibase/pro@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.19-alpha.0.tgz#3a7f6a900c1760a54d969a48cc7eed5ee105c5a4" + integrity sha512-gerMHUyRxpbKFhP6aAJCgd0I6Ntf5da8aOWogi9pPsRRF60qFojiIl3fFIDRi/esdOpGOa2i8Y28f1+vOzB4pg== dependencies: - "@budibase/backend-core" "2.1.14-alpha.1" - "@budibase/types" "2.1.14-alpha.1" + "@budibase/backend-core" "2.1.19-alpha.0" + "@budibase/types" "2.1.19-alpha.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1211,10 +1211,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.14-alpha.1.tgz#1cd57b5b5b5d7f4abe753bfe825be0095dc7c1b1" - integrity sha512-Oqwgt6JkRkBbzuescxMsfLGyi8yXC+NgK+fd7AUZXBCmTV+agWlpD9KRi7PpQIN/5J5c+DsMLN/rsFCnlNUdyQ== +"@budibase/types@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.19-alpha.0.tgz#1e4367feeccef10d3f64edd5ea6df7d0af362d98" + integrity sha512-iFb8GLT59nRGa5e2LWEat7dIIKzwi76ioJ6ng96NjW6VD5aGFU7X76TjdFg2Wb2OM9fahnDKV/O2BUCewMj3Pg== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index de9873eb86..f725466ec0 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 5101cee848..abbbd190ff 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index e6508d9d75..dda7146729 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.1.14-alpha.1", + "version": "2.1.19-alpha.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.1.14-alpha.1", - "@budibase/pro": "2.1.14-alpha.1", - "@budibase/string-templates": "2.1.14-alpha.1", - "@budibase/types": "2.1.14-alpha.1", + "@budibase/backend-core": "2.1.19-alpha.0", + "@budibase/pro": "2.1.19-alpha.0", + "@budibase/string-templates": "2.1.19-alpha.0", + "@budibase/types": "2.1.19-alpha.0", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", diff --git a/packages/worker/src/api/controllers/global/configs.js b/packages/worker/src/api/controllers/global/configs.js index 54de62a2aa..5be6141c3f 100644 --- a/packages/worker/src/api/controllers/global/configs.js +++ b/packages/worker/src/api/controllers/global/configs.js @@ -22,8 +22,6 @@ const { const { events } = require("@budibase/backend-core") const { checkAnyUserExists } = require("../../../utilities/users") -const BB_TENANT_CDN = "https://tenants.cdn.budi.live" - const getEventFns = async (db, config) => { const fns = [] const type = config.type @@ -350,7 +348,7 @@ exports.upload = async function (ctx) { if (env.SELF_HOSTED) { url = `/${bucket}/${key}` } else { - url = `${BB_TENANT_CDN}/${key}` + url = `${env.CDN_URL}/${key}` } cfgStructure.config[`${name}`] = url diff --git a/packages/worker/src/environment.ts b/packages/worker/src/environment.ts index 5b39ce6655..c9eabdfdb4 100644 --- a/packages/worker/src/environment.ts +++ b/packages/worker/src/environment.ts @@ -42,6 +42,7 @@ const env = { ACCOUNT_PORTAL_URL: process.env.ACCOUNT_PORTAL_URL, PLATFORM_URL: process.env.PLATFORM_URL, APPS_URL: process.env.APPS_URL, + CDN_URL: process.env.CDN_URL || "https://tenants.cdn.budi.live", // ports // prefer worker port to generic port PORT: process.env.WORKER_PORT || process.env.PORT, diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index c9794d7bd8..86ef85188d 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -291,12 +291,12 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.14-alpha.1.tgz#88bc377fcafa4e93a7d31b9eb73ef7274f15e480" - integrity sha512-iDm5UB8Fbb14QcO/K7+58dTuqWiQd/ygKPc6g7VuKxov/8BAuXDKHpFnJZRGSu0Q2TEWSQSc6l95xoLoHR5tuA== +"@budibase/backend-core@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.19-alpha.0.tgz#ec30bd3bf9453631259bf121154515214d21a4b8" + integrity sha512-C49h4scGRNAFFZR3jaX7pX3WbZfSP07Rg1bYEPqI7MaivRh0SUNWv9r5rGz2eqy+LbwAtPEV5GDjsT2mAaaNNg== dependencies: - "@budibase/types" "2.1.14-alpha.1" + "@budibase/types" "2.1.19-alpha.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -328,22 +328,22 @@ uuid "8.3.2" zlib "1.0.5" -"@budibase/pro@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.14-alpha.1.tgz#cd7ccfc16166c720ad5576c8d8680fa529c753bd" - integrity sha512-JsobERP7rOEw8+SmC7ZvwG9U00Ugu/MJr00gzHnHZk46IljzUoZn/ay/e/GScRRayiRSUudlDnq8pS2LCSpw2A== +"@budibase/pro@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.19-alpha.0.tgz#3a7f6a900c1760a54d969a48cc7eed5ee105c5a4" + integrity sha512-gerMHUyRxpbKFhP6aAJCgd0I6Ntf5da8aOWogi9pPsRRF60qFojiIl3fFIDRi/esdOpGOa2i8Y28f1+vOzB4pg== dependencies: - "@budibase/backend-core" "2.1.14-alpha.1" - "@budibase/types" "2.1.14-alpha.1" + "@budibase/backend-core" "2.1.19-alpha.0" + "@budibase/types" "2.1.19-alpha.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.1.14-alpha.1": - version "2.1.14-alpha.1" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.14-alpha.1.tgz#1cd57b5b5b5d7f4abe753bfe825be0095dc7c1b1" - integrity sha512-Oqwgt6JkRkBbzuescxMsfLGyi8yXC+NgK+fd7AUZXBCmTV+agWlpD9KRi7PpQIN/5J5c+DsMLN/rsFCnlNUdyQ== +"@budibase/types@2.1.19-alpha.0": + version "2.1.19-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.19-alpha.0.tgz#1e4367feeccef10d3f64edd5ea6df7d0af362d98" + integrity sha512-iFb8GLT59nRGa5e2LWEat7dIIKzwi76ioJ6ng96NjW6VD5aGFU7X76TjdFg2Wb2OM9fahnDKV/O2BUCewMj3Pg== "@cspotcode/source-map-consumer@0.8.0": version "0.8.0"