From 16106548acf5b2841d1a6021d1a94e1b94091ae1 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 10 Feb 2022 18:13:24 +0000 Subject: [PATCH 01/37] v1.0.58 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- 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, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 6602c97ea5..60a6d08176 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.58-alpha.0", + "version": "1.0.58", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index e20988bfa3..84d239e18c 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "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 1f529e5115..228b93ee22 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.58-alpha.0", + "version": "1.0.58", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index b373c60687..f1b5f1ef81 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.58-alpha.0", - "@budibase/client": "^1.0.58-alpha.0", - "@budibase/frontend-core": "^1.0.58-alpha.0", - "@budibase/string-templates": "^1.0.58-alpha.0", + "@budibase/bbui": "^1.0.58", + "@budibase/client": "^1.0.58", + "@budibase/frontend-core": "^1.0.58", + "@budibase/string-templates": "^1.0.58", "@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 2ff8dfeae6..47f20bd0ae 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "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 a584a82833..ed8ced31af 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "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.58-alpha.0", - "@budibase/frontend-core": "^1.0.58-alpha.0", - "@budibase/string-templates": "^1.0.58-alpha.0", + "@budibase/bbui": "^1.0.58", + "@budibase/frontend-core": "^1.0.58", + "@budibase/string-templates": "^1.0.58", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index ee91dd93e5..ca2742550a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "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.58-alpha.0", + "@budibase/bbui": "^1.0.58", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index fb271e360d..b06a939f59 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.58-alpha.0", + "version": "1.0.58", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.58-alpha.0", - "@budibase/client": "^1.0.58-alpha.0", - "@budibase/string-templates": "^1.0.58-alpha.0", + "@budibase/backend-core": "^1.0.58", + "@budibase/client": "^1.0.58", + "@budibase/string-templates": "^1.0.58", "@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 0e71f85e84..9fb3669b19 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.58-alpha.0", + "version": "1.0.58", "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 d58cdbc3a3..044ddc2a53 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.58-alpha.0", + "version": "1.0.58", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.58-alpha.0", - "@budibase/string-templates": "^1.0.58-alpha.0", + "@budibase/backend-core": "^1.0.58", + "@budibase/string-templates": "^1.0.58", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 580bb89fda65bf48a4f660652ecc2c2e798e900d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 10:59:06 +0100 Subject: [PATCH 02/37] Create envoy.yaml --- hosting/envoy.yaml | 152 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 hosting/envoy.yaml diff --git a/hosting/envoy.yaml b/hosting/envoy.yaml new file mode 100644 index 0000000000..d9f8384688 --- /dev/null +++ b/hosting/envoy.yaml @@ -0,0 +1,152 @@ +static_resources: + listeners: + - name: main_listener + address: + socket_address: { address: 0.0.0.0, port_value: 10000 } + filter_chains: + - filters: + - name: envoy.filters.network.http_connection_manager + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager + stat_prefix: ingress + codec_type: auto + route_config: + name: local_route + virtual_hosts: + - name: local_services + domains: ["*"] + routes: + - match: { prefix: "/app/" } + route: + cluster: app-service + prefix_rewrite: "/" + + - match: { path: "/v1/update" } + route: + cluster: watchtower-service + + - match: { prefix: "/builder/" } + route: + cluster: app-service + + - match: { prefix: "/builder" } + route: + cluster: app-service + + - match: { prefix: "/app_" } + route: + cluster: app-service + + # special cases for worker admin (deprecated), global and system API + - match: { prefix: "/api/global/" } + route: + cluster: worker-service + + - match: { prefix: "/api/admin/" } + route: + cluster: worker-service + + - match: { prefix: "/api/system/" } + route: + cluster: worker-service + + - match: { path: "/" } + route: + cluster: app-service + + # special case for when API requests are made, can just forward, not to minio + - match: { prefix: "/api/" } + route: + cluster: app-service + timeout: 120s + + - match: { prefix: "/worker/" } + route: + cluster: worker-service + prefix_rewrite: "/" + + - match: { prefix: "/db/" } + route: + cluster: couchdb-service + prefix_rewrite: "/" + + # minio is on the default route because this works + # best, minio + AWS SDK doesn't handle path proxy + - match: { prefix: "/" } + route: + cluster: minio-service + + http_filters: + - name: envoy.filters.http.router + + clusters: + - name: app-service + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + load_assignment: + cluster_name: app-service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: app-service + port_value: 4002 + + - name: minio-service + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + load_assignment: + cluster_name: minio-service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: minio-service + port_value: 9000 + + - name: worker-service + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + load_assignment: + cluster_name: worker-service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: worker-service + port_value: 4003 + + - name: couchdb-service + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + load_assignment: + cluster_name: couchdb-service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: couchdb-service + port_value: 5984 + + - name: watchtower-service + connect_timeout: 0.25s + type: strict_dns + lb_policy: round_robin + load_assignment: + cluster_name: watchtower-service + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: watchtower-service + port_value: 8080 + From 130021681232bbc08c86085a7aef869cc69ec8c4 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 13:21:03 +0100 Subject: [PATCH 03/37] fix path in /app for k8s --- hosting/kubernetes/nginx/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index 2bf512964b..7a84c0ee2e 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -45,7 +45,7 @@ http { add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { - proxy_pass http://app-service:4002; + proxy_pass http://app-service.budibase.svc.cluster.local:4002; rewrite ^/app/(.*)$ /$1 break; } From b2c4b60aff26aa615fff359c46f3138d169b79d2 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 13:22:14 +0100 Subject: [PATCH 04/37] fix for csp for images --- hosting/kubernetes/nginx/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index 7a84c0ee2e..688b72a4df 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -42,7 +42,7 @@ http { add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; add_header X-XSS-Protection "1; mode=block" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { proxy_pass http://app-service.budibase.svc.cluster.local:4002; From 8f668eac856d573ca32600e2d27f1792df4858a1 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 13:23:53 +0100 Subject: [PATCH 05/37] add csp update for nginx in self host --- hosting/proxy/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/proxy/nginx.conf b/hosting/proxy/nginx.conf index 7a8a44e2d8..06283d579b 100644 --- a/hosting/proxy/nginx.conf +++ b/hosting/proxy/nginx.conf @@ -46,7 +46,7 @@ http { add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; add_header X-XSS-Protection "1; mode=block" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { proxy_pass http://app-service:4002; From 0716df50981729d8820395bf9517150a4b862410 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 11 Feb 2022 12:32:57 +0000 Subject: [PATCH 06/37] Fixing issue with CLI not updating proxy images. --- packages/cli/src/hosting/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/hosting/index.js b/packages/cli/src/hosting/index.js index ecf3b710b2..2b147810b4 100644 --- a/packages/cli/src/hosting/index.js +++ b/packages/cli/src/hosting/index.js @@ -15,7 +15,7 @@ const makeEnv = require("./makeEnv") const axios = require("axios") const AnalyticsClient = require("../analytics/Client") -const BUDIBASE_SERVICES = ["app-service", "worker-service"] +const BUDIBASE_SERVICES = ["app-service", "worker-service", "proxy-service"] const ERROR_FILE = "docker-error.log" const FILE_URLS = [ "https://raw.githubusercontent.com/Budibase/budibase/master/hosting/docker-compose.yaml", From a78dd38a586926f68b649b0f1c94a9370ffb76e9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 11 Feb 2022 13:23:15 +0000 Subject: [PATCH 07/37] Fixing img-src for self host. --- hosting/proxy/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/proxy/nginx.conf b/hosting/proxy/nginx.conf index 06283d579b..4212a9e515 100644 --- a/hosting/proxy/nginx.conf +++ b/hosting/proxy/nginx.conf @@ -46,7 +46,7 @@ http { add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; add_header X-XSS-Protection "1; mode=block" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { proxy_pass http://app-service:4002; From f77b596a075fd2b3c6c484b6d8f63c982fe54807 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 11 Feb 2022 14:04:23 +0000 Subject: [PATCH 08/37] Fix for #4431 - converting SQL joins back to left joins, syntax specifying join type as string is old which doesn't work in latest versions of knex. --- .../api/controllers/row/ExternalRequest.ts | 2 +- packages/server/src/integrations/base/sql.ts | 68 ++++++++----------- 2 files changed, 29 insertions(+), 41 deletions(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 6aa51fb36b..c1181dd6d5 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -541,7 +541,7 @@ module External { if (!linkTable || !linkPrimary) { return } - const rows = related[key].rows || [] + const rows = related[key]?.rows || [] const found = rows.find( (row: { [key: string]: any }) => row[linkPrimary] === relationship.id || diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index a4220565cf..ce06624107 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -210,49 +210,37 @@ class InternalBuilder { const { toTable, throughTable } = JSON.parse(key) if (!throughTable) { // @ts-ignore - query = query.join( - toTable, - function () { - for (let relationship of relationships) { - const from = relationship.from, - to = relationship.to - // @ts-ignore - this.orOn(`${fromTable}.${from}`, "=", `${toTable}.${to}`) - } - }, - "left" - ) + query = query.leftJoin(toTable, function () { + for (let relationship of relationships) { + const from = relationship.from, + to = relationship.to + // @ts-ignore + this.orOn(`${fromTable}.${from}`, "=", `${toTable}.${to}`) + } + }) } else { query = query // @ts-ignore - .join( - throughTable, - function () { - for (let relationship of relationships) { - const fromPrimary = relationship.fromPrimary - const from = relationship.from - // @ts-ignore - this.orOn( - `${fromTable}.${fromPrimary}`, - "=", - `${throughTable}.${from}` - ) - } - }, - "left" - ) - .join( - toTable, - function () { - for (let relationship of relationships) { - const toPrimary = relationship.toPrimary - const to = relationship.to - // @ts-ignore - this.orOn(`${toTable}.${toPrimary}`, `${throughTable}.${to}`) - } - }, - "left" - ) + .leftJoin(throughTable, function () { + for (let relationship of relationships) { + const fromPrimary = relationship.fromPrimary + const from = relationship.from + // @ts-ignore + this.orOn( + `${fromTable}.${fromPrimary}`, + "=", + `${throughTable}.${from}` + ) + } + }) + .leftJoin(toTable, function () { + for (let relationship of relationships) { + const toPrimary = relationship.toPrimary + const to = relationship.to + // @ts-ignore + this.orOn(`${toTable}.${toPrimary}`, `${throughTable}.${to}`) + } + }) } } return query.limit(BASE_LIMIT) From 082be8ef67edc933152a0f476c419832d4f571f9 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 15:13:31 +0100 Subject: [PATCH 09/37] fix port redirection issue --- hosting/kubernetes/nginx/nginx.conf | 8 ++++++++ hosting/proxy/nginx.conf | 2 ++ 2 files changed, 10 insertions(+) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index 688b72a4df..1598bf9909 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -25,6 +25,7 @@ http { client_max_body_size 1k; ignore_invalid_headers off; proxy_buffering off; + port_in_redirect off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' @@ -36,6 +37,7 @@ http { server { listen 10000 default_server; + listen [::]:10000 default_server; server_name _; # Security Headers @@ -50,6 +52,12 @@ http { } location = / { + proxy_http_version 1.1; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://app-service.budibase.svc.cluster.local:4002; } diff --git a/hosting/proxy/nginx.conf b/hosting/proxy/nginx.conf index 06283d579b..b7ea9011c9 100644 --- a/hosting/proxy/nginx.conf +++ b/hosting/proxy/nginx.conf @@ -25,6 +25,7 @@ http { client_max_body_size 1k; ignore_invalid_headers off; proxy_buffering off; + port_in_redirect off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' @@ -37,6 +38,7 @@ http { server { listen 10000 default_server; + listen [::]:10000 default_server; server_name _; client_max_body_size 1000m; ignore_invalid_headers off; From e1f78a326b9816ed610f8438475a61e49f14b295 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 15:39:18 +0100 Subject: [PATCH 10/37] set correct port for worker --- hosting/kubernetes/nginx/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index 1598bf9909..d88831e1c8 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -76,11 +76,11 @@ http { } location ~ ^/api/(system|admin|global)/ { - proxy_pass http://worker-service.budibase.svc.cluster.local:4003; + proxy_pass http://worker-service.budibase.svc.cluster.local:4001; } location /worker/ { - proxy_pass http://worker-service.budibase.svc.cluster.local:4003; + proxy_pass http://worker-service.budibase.svc.cluster.local:4001; rewrite ^/worker/(.*)$ /$1 break; } From 27c0eafaf9e647393b2af5f3b7033dc2c0540735 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 16:05:35 +0100 Subject: [PATCH 11/37] CSP fixes --- hosting/kubernetes/nginx/nginx.conf | 4 ++-- hosting/proxy/nginx.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index d88831e1c8..14593b6648 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -22,7 +22,7 @@ http { # buffering client_body_buffer_size 1K; client_header_buffer_size 1k; - client_max_body_size 1k; + client_max_body_size 10M; ignore_invalid_headers off; proxy_buffering off; port_in_redirect off; @@ -44,7 +44,7 @@ http { add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; add_header X-XSS-Protection "1; mode=block" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { proxy_pass http://app-service.budibase.svc.cluster.local:4002; diff --git a/hosting/proxy/nginx.conf b/hosting/proxy/nginx.conf index db5b907395..d07e5b0d44 100644 --- a/hosting/proxy/nginx.conf +++ b/hosting/proxy/nginx.conf @@ -48,7 +48,7 @@ http { add_header X-Frame-Options SAMEORIGIN always; add_header X-Content-Type-Options nosniff always; add_header X-XSS-Protection "1; mode=block" always; - add_header Content-Security-Policy "default-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; + add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.budi.live https://js.intercomcdn.com https://widget.intercom.io; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me; object-src 'none'; base-uri 'self'; connect-src 'self' https://api-iam.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io; font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me; frame-src 'self'; img-src http: https: data:; manifest-src 'self'; media-src 'self'; worker-src 'none';" always; location /app { proxy_pass http://app-service:4002; From 57e554a98bc4f2eb31b921edc8e96afb38f378a1 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 19:04:27 +0100 Subject: [PATCH 12/37] fixes for k8s --- hosting/kubernetes/nginx/nginx.conf | 16 +++++++++++----- hosting/proxy/nginx.conf | 14 +++++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/hosting/kubernetes/nginx/nginx.conf b/hosting/kubernetes/nginx/nginx.conf index 14593b6648..9d03aaab18 100644 --- a/hosting/kubernetes/nginx/nginx.conf +++ b/hosting/kubernetes/nginx/nginx.conf @@ -25,7 +25,6 @@ http { client_max_body_size 10M; ignore_invalid_headers off; proxy_buffering off; - port_in_redirect off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' @@ -39,6 +38,7 @@ http { listen 10000 default_server; listen [::]:10000 default_server; server_name _; + port_in_redirect off; # Security Headers add_header X-Frame-Options SAMEORIGIN always; @@ -71,7 +71,13 @@ http { proxy_pass http://app-service.budibase.svc.cluster.local:4002; } - location ^/(builder|app_) { + location ~ ^/(builder|app_) { + proxy_http_version 1.1; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://app-service.budibase.svc.cluster.local:4002; } @@ -113,11 +119,11 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; + proxy_set_header Connection ""; + proxy_http_version 1.1; + chunked_transfer_encoding off; proxy_connect_timeout 300; - proxy_http_version 1.1; - proxy_set_header Connection ""; - chunked_transfer_encoding off; proxy_pass http://minio-service.budibase.svc.cluster.local:9000; } diff --git a/hosting/proxy/nginx.conf b/hosting/proxy/nginx.conf index d07e5b0d44..ff12e2f49e 100644 --- a/hosting/proxy/nginx.conf +++ b/hosting/proxy/nginx.conf @@ -24,8 +24,6 @@ http { client_header_buffer_size 1k; client_max_body_size 1k; ignore_invalid_headers off; - proxy_buffering off; - port_in_redirect off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' @@ -43,6 +41,7 @@ http { client_max_body_size 1000m; ignore_invalid_headers off; proxy_buffering off; + port_in_redirect off; # Security Headers add_header X-Frame-Options SAMEORIGIN always; @@ -56,6 +55,7 @@ http { } location = / { + port_in_redirect off; proxy_pass http://app-service:4002; } @@ -64,6 +64,7 @@ http { } location /builder/ { + port_in_redirect off; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade; @@ -73,7 +74,14 @@ http { proxy_pass http://app-service:4002; } - location ^/(builder|app_) { + location ~ ^/(builder|app_) { + port_in_redirect off; + proxy_http_version 1.1; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://app-service:4002; } From 93336bf798021589215320026c2e9aa682dcb21b Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 11 Feb 2022 18:25:35 +0000 Subject: [PATCH 13/37] v1.0.59 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- 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, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 60a6d08176..74caf62230 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.58", + "version": "1.0.59", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 84d239e18c..934ca1466a 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.58", + "version": "1.0.59", "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 228b93ee22..7ee39039b6 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.58", + "version": "1.0.59", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index f1b5f1ef81..7fbb49267f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.58", + "version": "1.0.59", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.58", - "@budibase/client": "^1.0.58", - "@budibase/frontend-core": "^1.0.58", - "@budibase/string-templates": "^1.0.58", + "@budibase/bbui": "^1.0.59", + "@budibase/client": "^1.0.59", + "@budibase/frontend-core": "^1.0.59", + "@budibase/string-templates": "^1.0.59", "@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 47f20bd0ae..5321235569 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.58", + "version": "1.0.59", "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 ed8ced31af..a5e03eef6e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.58", + "version": "1.0.59", "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.58", - "@budibase/frontend-core": "^1.0.58", - "@budibase/string-templates": "^1.0.58", + "@budibase/bbui": "^1.0.59", + "@budibase/frontend-core": "^1.0.59", + "@budibase/string-templates": "^1.0.59", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index ca2742550a..9b231d0c66 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.58", + "version": "1.0.59", "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.58", + "@budibase/bbui": "^1.0.59", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index b06a939f59..a9dd5ed280 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.58", + "version": "1.0.59", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.58", - "@budibase/client": "^1.0.58", - "@budibase/string-templates": "^1.0.58", + "@budibase/backend-core": "^1.0.59", + "@budibase/client": "^1.0.59", + "@budibase/string-templates": "^1.0.59", "@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 9fb3669b19..2c1d8fff13 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.58", + "version": "1.0.59", "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 044ddc2a53..d060c04460 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.58", + "version": "1.0.59", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.58", - "@budibase/string-templates": "^1.0.58", + "@budibase/backend-core": "^1.0.59", + "@budibase/string-templates": "^1.0.59", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From 1cc7109551bba0fe1a88337617a380716b03f666 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 11 Feb 2022 19:40:28 +0100 Subject: [PATCH 14/37] Update release-selfhost.yml --- .github/workflows/release-selfhost.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index e842da9d7c..f76ae530c2 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -29,10 +29,12 @@ jobs: # Tag apps and worker images docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG + docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG # Push images docker push budibase/apps:$SELFHOST_TAG docker push budibase/worker:$SELFHOST_TAG + docker push budibase/proxy:$SELFHOST_TAG env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} @@ -73,4 +75,4 @@ jobs: files: | packages/cli/build/cli-win.exe packages/cli/build/cli-linux - packages/cli/build/cli-macos \ No newline at end of file + packages/cli/build/cli-macos From c27a552d8805eea76640619c73bb9d87741b2aec Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 11 Feb 2022 18:47:34 +0000 Subject: [PATCH 15/37] v1.0.60 --- lerna.json | 2 +- packages/backend-core/package.json | 2 +- packages/bbui/package.json | 2 +- 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, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 74caf62230..3e18ded921 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.59", + "version": "1.0.60", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 934ca1466a..c8322eb6f7 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.59", + "version": "1.0.60", "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 7ee39039b6..2e29022247 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.59", + "version": "1.0.60", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 7fbb49267f..5e04ac75dd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.59", + "version": "1.0.60", "license": "GPL-3.0", "private": true, "scripts": { @@ -64,10 +64,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.59", - "@budibase/client": "^1.0.59", - "@budibase/frontend-core": "^1.0.59", - "@budibase/string-templates": "^1.0.59", + "@budibase/bbui": "^1.0.60", + "@budibase/client": "^1.0.60", + "@budibase/frontend-core": "^1.0.60", + "@budibase/string-templates": "^1.0.60", "@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 5321235569..7da657a4d2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.59", + "version": "1.0.60", "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 a5e03eef6e..dc15ef081a 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.59", + "version": "1.0.60", "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.59", - "@budibase/frontend-core": "^1.0.59", - "@budibase/string-templates": "^1.0.59", + "@budibase/bbui": "^1.0.60", + "@budibase/frontend-core": "^1.0.60", + "@budibase/string-templates": "^1.0.60", "regexparam": "^1.3.0", "rollup-plugin-polyfill-node": "^0.8.0", "shortid": "^2.2.15", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 9b231d0c66..014679f2e8 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.59", + "version": "1.0.60", "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.59", + "@budibase/bbui": "^1.0.60", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index a9dd5ed280..8861a9920f 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.59", + "version": "1.0.60", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -70,9 +70,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.59", - "@budibase/client": "^1.0.59", - "@budibase/string-templates": "^1.0.59", + "@budibase/backend-core": "^1.0.60", + "@budibase/client": "^1.0.60", + "@budibase/string-templates": "^1.0.60", "@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 2c1d8fff13..6d354b9b6f 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.59", + "version": "1.0.60", "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 d060c04460..bccbd992b1 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.59", + "version": "1.0.60", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -34,8 +34,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.59", - "@budibase/string-templates": "^1.0.59", + "@budibase/backend-core": "^1.0.60", + "@budibase/string-templates": "^1.0.60", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From f86222a98d06ba76ebd3a45d11a5d7c6148da14c Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 10 Feb 2022 09:25:13 +0100 Subject: [PATCH 16/37] Fix validation for query preview endpoint --- packages/server/src/api/controllers/query/validation.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/api/controllers/query/validation.js b/packages/server/src/api/controllers/query/validation.js index 4958433849..4486ff2307 100644 --- a/packages/server/src/api/controllers/query/validation.js +++ b/packages/server/src/api/controllers/query/validation.js @@ -33,6 +33,9 @@ exports.generateQueryPreviewValidation = () => { return joiValidator.body(Joi.object({ fields: Joi.object().required(), queryVerb: Joi.string().allow().required(), + name: Joi.string().required(), + flags: Joi.object().optional(), + schema: Joi.object().optional(), extra: Joi.object().optional(), datasourceId: Joi.string().required(), transformer: Joi.string().optional(), From 88383eabf144b23541edaf4a7498b58c20cdc87a Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 10 Feb 2022 10:22:57 +0100 Subject: [PATCH 17/37] add properties which are present when previewing an existing query --- packages/server/src/api/controllers/query/validation.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/api/controllers/query/validation.js b/packages/server/src/api/controllers/query/validation.js index 4486ff2307..515c7b591e 100644 --- a/packages/server/src/api/controllers/query/validation.js +++ b/packages/server/src/api/controllers/query/validation.js @@ -31,6 +31,9 @@ exports.generateQueryValidation = () => { exports.generateQueryPreviewValidation = () => { // prettier-ignore return joiValidator.body(Joi.object({ + _id: Joi.string().optional(), + _rev: Joi.string().optional(), + readable: Joi.boolean().optional(), fields: Joi.object().required(), queryVerb: Joi.string().allow().required(), name: Joi.string().required(), From 8ca38cf1358a8996a2986e3300f5ed2ade64130e Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Fri, 11 Feb 2022 17:28:19 +0100 Subject: [PATCH 18/37] fix tests --- .../server/src/api/routes/tests/query.spec.js | 17 +++++++++++++---- .../src/tests/utilities/TestConfiguration.js | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/server/src/api/routes/tests/query.spec.js b/packages/server/src/api/routes/tests/query.spec.js index dac576836e..48e3181d10 100644 --- a/packages/server/src/api/routes/tests/query.spec.js +++ b/packages/server/src/api/routes/tests/query.spec.js @@ -169,6 +169,7 @@ describe("/queries", () => { parameters: {}, fields: {}, queryVerb: "read", + name: datasource.name, }) .set(config.defaultHeaders()) .expect("Content-Type", /json/) @@ -261,9 +262,13 @@ describe("/queries", () => { }) it("check that it automatically retries on fail with cached dynamics", async () => { - const { datasource, query: base } = await config.dynamicVariableDatasource() + const { datasource, query: base } = + await config.dynamicVariableDatasource() // preview once to cache - await preview(datasource, { path: "www.google.com", queryString: "test={{ variable3 }}" }) + await preview(datasource, { + path: "www.google.com", + queryString: "test={{ variable3 }}", + }) // check its in cache const contents = await checkCacheForDynamicVariable(base._id, "variable3") expect(contents.rows.length).toEqual(1) @@ -276,9 +281,13 @@ describe("/queries", () => { }) it("deletes variables when linked query is deleted", async () => { - const { datasource, query: base } = await config.dynamicVariableDatasource() + const { datasource, query: base } = + await config.dynamicVariableDatasource() // preview once to cache - await preview(datasource, { path: "www.google.com", queryString: "test={{ variable3 }}" }) + await preview(datasource, { + path: "www.google.com", + queryString: "test={{ variable3 }}", + }) // check its in cache let contents = await checkCacheForDynamicVariable(base._id, "variable3") expect(contents.rows.length).toEqual(1) diff --git a/packages/server/src/tests/utilities/TestConfiguration.js b/packages/server/src/tests/utilities/TestConfiguration.js index 6c2b7d4f98..1b3a91ceab 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.js +++ b/packages/server/src/tests/utilities/TestConfiguration.js @@ -393,6 +393,7 @@ class TestConfiguration { parameters: {}, fields, queryVerb: "read", + name: datasource.name, }) .set(config.defaultHeaders()) .expect("Content-Type", /json/) From 126499f38390a99081acc51e21b34adc225e0ad2 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Sat, 12 Feb 2022 10:35:10 +0000 Subject: [PATCH 19/37] Fix for #4440, fixing validation of API endpoints. --- packages/bbui/src/ButtonGroup/ButtonGroup.svelte | 11 +++++++++++ .../components/integration/QueryViewer.svelte | 4 ++-- .../src/api/controllers/query/validation.js | 16 +++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/bbui/src/ButtonGroup/ButtonGroup.svelte b/packages/bbui/src/ButtonGroup/ButtonGroup.svelte index b845a770e1..50d0073a25 100644 --- a/packages/bbui/src/ButtonGroup/ButtonGroup.svelte +++ b/packages/bbui/src/ButtonGroup/ButtonGroup.svelte @@ -1,6 +1,16 @@ -
- - {#if showTooltip && tooltip} -
-
- -
{/if} -
+ {#if showTooltip && tooltip} +
+ +
+ {/if} +