1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00

Merge branch 'master' of github.com:Budibase/budibase into fix/form-block

This commit is contained in:
Andrew Kingston 2022-11-15 12:45:24 +00:00
commit 17ebbc6c53
25 changed files with 142 additions and 81 deletions

View file

@ -66,6 +66,15 @@ http {
proxy_set_header Connection "";
}
location /api/backups/ {
proxy_read_timeout 1800s;
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_pass http://app-service;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /api/ {
proxy_read_timeout 120s;
proxy_connect_timeout 120s;

View file

@ -116,6 +116,24 @@ http {
rewrite ^/worker/(.*)$ /$1 break;
}
location /api/backups/ {
# calls to export apps are limited
limit_req zone=ratelimit burst=20 nodelay;
# 1800s timeout for app export requests
proxy_read_timeout 1800s;
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://$apps:4002;
}
location /api/ {
# calls to the API are rate limited with bursting
limit_req zone=ratelimit burst=20 nodelay;

View file

@ -43,6 +43,24 @@ server {
rewrite ^/worker/(.*)$ /$1 break;
}
location /api/backups/ {
# calls to export apps are limited
limit_req zone=ratelimit burst=20 nodelay;
# 1800s timeout for app export requests
proxy_read_timeout 1800s;
proxy_connect_timeout 1800s;
proxy_send_timeout 1800s;
proxy_http_version 1.1;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:4001;
}
location /api/ {
# calls to the API are rate limited with bursting
limit_req zone=ratelimit burst=20 nodelay;

View file

@ -27,12 +27,14 @@ if [[ "${TARGETBUILD}" = "aas" ]]; then
else
DATA_DIR=${DATA_DIR:-/data}
fi
mkdir -p ${DATA_DIR}
# Mount NFS or GCP Filestore if env vars exist for it
if [[ -z ${FILESHARE_IP} && -z ${FILESHARE_NAME} ]]; then
if [[ ! -z ${FILESHARE_IP} && ! -z ${FILESHARE_NAME} ]]; then
echo "Mounting NFS share"
apt update && apt install -y nfs-common nfs-kernel-server
echo "Mount file share ${FILESHARE_IP}:/${FILESHARE_NAME} to ${DATA_DIR}"
mount -o nolock ${FILESHARE_IP}:/${FILESHARE_NAME} ${DATA_DIR}
echo "Mounting completed."
echo "Mounting result: $?"
fi
if [ -f "${DATA_DIR}/.env" ]; then
@ -74,9 +76,9 @@ mkdir -p ${DATA_DIR}/couch/{dbs,views}
mkdir -p ${DATA_DIR}/minio
mkdir -p ${DATA_DIR}/search
chown -R couchdb:couchdb ${DATA_DIR}/couch
redis-server --requirepass $REDIS_PASSWORD &
/opt/clouseau/bin/clouseau &
/minio/minio server ${DATA_DIR}/minio &
redis-server --requirepass $REDIS_PASSWORD > /dev/stdout 2>&1 &
/opt/clouseau/bin/clouseau > /dev/stdout 2>&1 &
/minio/minio server ${DATA_DIR}/minio > /dev/stdout 2>&1 &
/docker-entrypoint.sh /opt/couchdb/bin/couchdb &
/etc/init.d/nginx restart
if [[ ! -z "${CUSTOM_DOMAIN}" ]]; then
@ -85,16 +87,18 @@ if [[ ! -z "${CUSTOM_DOMAIN}" ]]; then
chmod +x /etc/cron.d/certificate-renew
# Request the certbot certificate
/app/letsencrypt/certificate-request.sh ${CUSTOM_DOMAIN}
/etc/init.d/nginx restart
fi
/etc/init.d/nginx restart
pushd app
pm2 start --name app "yarn run:docker"
pm2 start -l /dev/stdout --name app "yarn run:docker"
popd
pushd worker
pm2 start --name worker "yarn run:docker"
pm2 start -l /dev/stdout --name worker "yarn run:docker"
popd
sleep 10
echo "curl to couchdb endpoints"
curl -X PUT ${COUCH_DB_URL}/_users
curl -X PUT ${COUCH_DB_URL}/_replicator
echo "end of runner.sh, sleeping ..."
sleep infinity

View file

@ -1,5 +1,5 @@
{
"version": "2.1.21",
"version": "2.1.26",
"npmClient": "yarn",
"packages": [
"packages/*"

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/types": "^2.1.26",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",

View file

@ -51,6 +51,7 @@ function validateDatasource(schema) {
const queryValidator = joi
.object({
type: joi.string().allow(...Object.values(QueryType)),
readable: joi.boolean(),
fields: joi.object().pattern(joi.string(), fieldValidator),
})
.required()

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/string-templates": "^2.1.26",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",
@ -85,5 +85,8 @@
"svelte-flatpickr": "^3.2.3",
"svelte-portal": "^1.0.0"
},
"resolutions": {
"loader-utils": "1.4.1"
},
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc"
}

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "2.1.21",
"version": "2.1.26",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -71,10 +71,10 @@
}
},
"dependencies": {
"@budibase/bbui": "^2.1.21",
"@budibase/client": "^2.1.21",
"@budibase/frontend-core": "^2.1.21",
"@budibase/string-templates": "^2.1.21",
"@budibase/bbui": "^2.1.26",
"@budibase/client": "^2.1.26",
"@budibase/frontend-core": "^2.1.26",
"@budibase/string-templates": "^2.1.26",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View file

@ -304,6 +304,8 @@
const newError = {}
if (!external && fieldInfo.name?.startsWith("_")) {
newError.name = `Column name cannot start with an underscore.`
} else if (fieldInfo.name && !fieldInfo.name.match(/^[a-zA-Z0-9\s]*$/g)) {
newError.name = `Illegal character; must be alpha-numeric.`
} else if (PROHIBITED_COLUMN_NAMES.some(name => fieldInfo.name === name)) {
newError.name = `${PROHIBITED_COLUMN_NAMES.join(
", "

View file

@ -97,7 +97,7 @@
}
function fieldOptions(field) {
return schema[field]?.type === "options"
return schema[field]?.type === "options" || schema[field]?.type === "array"
? schema[field]?.constraints.inclusion
: [true, false]
}

View file

@ -155,9 +155,9 @@ export function createAuthStore() {
await actions.getSelf()
},
logout: async () => {
setUser(null)
setPostLogout()
await API.logOut()
setPostLogout()
setUser(null)
await setInitInfo({})
},
updateSelf: async fields => {

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/string-templates": "^2.1.21",
"@budibase/types": "^2.1.21",
"@budibase/backend-core": "^2.1.26",
"@budibase/string-templates": "^2.1.26",
"@budibase/types": "^2.1.26",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/frontend-core": "^2.1.21",
"@budibase/string-templates": "^2.1.21",
"@budibase/bbui": "^2.1.26",
"@budibase/frontend-core": "^2.1.26",
"@budibase/string-templates": "^2.1.26",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",
@ -59,5 +59,8 @@
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.5.4"
},
"resolutions": {
"loader-utils": "1.4.1"
},
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc"
}

View file

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/bbui": "^2.1.26",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
"version": "2.1.21",
"version": "2.1.26",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/client": "^2.1.21",
"@budibase/pro": "2.1.21",
"@budibase/string-templates": "^2.1.21",
"@budibase/types": "^2.1.21",
"@budibase/backend-core": "^2.1.26",
"@budibase/client": "^2.1.26",
"@budibase/pro": "2.1.26",
"@budibase/string-templates": "^2.1.26",
"@budibase/types": "^2.1.26",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View file

@ -142,15 +142,15 @@ export async function destroy(ctx: any) {
const tableToDelete = await db.get(ctx.params.tableId)
// Delete all rows for that table
const rows = await db.allDocs(
const rowsData = await db.allDocs(
getRowParams(ctx.params.tableId, null, {
include_docs: true,
})
)
await db.bulkDocs(
rows.rows.map((row: any) => ({ ...row.doc, _deleted: true }))
rowsData.rows.map((row: any) => ({ ...row.doc, _deleted: true }))
)
await quotas.removeRows(rows.rows.length, {
await quotas.removeRows(rowsData.rows.length, {
tableId: ctx.params.tableId,
})
@ -179,7 +179,9 @@ export async function destroy(ctx: any) {
oldTable: null,
deletion: true,
})
await cleanupAttachments(tableToDelete, { rows })
await cleanupAttachments(tableToDelete, {
rows: rowsData.rows.map((row: any) => row.doc),
})
return tableToDelete
}

View file

@ -58,6 +58,7 @@ const SCHEMA: Integration = {
},
aggregate: {
type: QueryType.JSON,
readable: true,
steps: [
{
key: "$addFields",

View file

@ -100,7 +100,7 @@ async function updateAutomations(prodAppId: string, db: PouchDB.Database) {
const oldDevAppId = automation.appId,
oldProdAppId = dbCore.getProdAppID(automation.appId)
if (
automation.definition.trigger.stepId === AutomationTriggerStepId.WEBHOOK
automation.definition.trigger?.stepId === AutomationTriggerStepId.WEBHOOK
) {
const old = automation.definition.trigger.inputs
automation.definition.trigger.inputs = {

View file

@ -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.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.21.tgz#6e473385dd6329229e54a3299a261b44568721ee"
integrity sha512-ktfXBNzRuRUeAhmZ0EnEyTNteHcMGsY6AK8+j+nEJzdc6zP/6DMSISXJcGG8SkXT77fWQkem69ao21/XN5r+ZQ==
"@budibase/backend-core@2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.26.tgz#e663ccb83e027c46b4a0a58e701ed75d2ef79ce8"
integrity sha512-ZXzeX+ifI0I3PVjyQCPJhn0RRXZptzfluziaSDrfAZQ85pvH6lluWcbUTPd1dx9WdSCS4N0rxvPsfL9FHb/TtA==
dependencies:
"@budibase/types" "^2.1.21"
"@budibase/types" "^2.1.26"
"@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.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.21.tgz#f5a73c47f2e8eebdf0b86bcfe9d1bf30c7be5f6b"
integrity sha512-nNouTv7RwRc0XtxNWimrkaoYyqFO+9ZIgJsEaFhzDv/p4D6i0tggyMkAC3TDSZNuPPzxMq/3pThjrdt7LBW/DQ==
"@budibase/pro@2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.26.tgz#335ca9343ae3f84c7a99224c6863ecf09573221f"
integrity sha512-1bdpQO+v//vbhQa1/+Ic1tB2PlU3hCAwgYNm4C+MhNicMc9InpOE4bMNn22s6eoOI5XcuHiSZld+Au8J9/xuRA==
dependencies:
"@budibase/backend-core" "2.1.21"
"@budibase/types" "2.1.21"
"@budibase/backend-core" "2.1.26"
"@budibase/types" "2.1.26"
"@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.21", "@budibase/types@^2.1.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.21.tgz#ff607f0979e710f68469b0a586b3dc835ceaf236"
integrity sha512-KSvvUj2DQECVsZ2xbh0jsPz6u/WfoIQbkzsJa7wdRcC9goQ5fDdjLtHZrLDKKBRV9ceSVh0021BxFQ705+CaEA==
"@budibase/types@2.1.26", "@budibase/types@^2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.26.tgz#15422f49fc096a7b0419b4104a86df97198ebfde"
integrity sha512-gykmR8jSLVNAvbg7/senimW0HGs/lC3W1TlfoAVvkhzS2AAiuyH3CVbEYmgdd0SnZbY2Hpaas+Eqdp4fkqFu8A==
"@bull-board/api@3.7.0":
version "3.7.0"

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "2.1.21",
"version": "2.1.26",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.1.21",
"version": "2.1.26",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "2.1.21",
"version": "2.1.26",
"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.21",
"@budibase/pro": "2.1.21",
"@budibase/string-templates": "^2.1.21",
"@budibase/types": "^2.1.21",
"@budibase/backend-core": "^2.1.26",
"@budibase/pro": "2.1.26",
"@budibase/string-templates": "^2.1.26",
"@budibase/types": "^2.1.26",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View file

@ -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.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.21.tgz#6e473385dd6329229e54a3299a261b44568721ee"
integrity sha512-ktfXBNzRuRUeAhmZ0EnEyTNteHcMGsY6AK8+j+nEJzdc6zP/6DMSISXJcGG8SkXT77fWQkem69ao21/XN5r+ZQ==
"@budibase/backend-core@2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.26.tgz#e663ccb83e027c46b4a0a58e701ed75d2ef79ce8"
integrity sha512-ZXzeX+ifI0I3PVjyQCPJhn0RRXZptzfluziaSDrfAZQ85pvH6lluWcbUTPd1dx9WdSCS4N0rxvPsfL9FHb/TtA==
dependencies:
"@budibase/types" "^2.1.21"
"@budibase/types" "^2.1.26"
"@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.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.21.tgz#f5a73c47f2e8eebdf0b86bcfe9d1bf30c7be5f6b"
integrity sha512-nNouTv7RwRc0XtxNWimrkaoYyqFO+9ZIgJsEaFhzDv/p4D6i0tggyMkAC3TDSZNuPPzxMq/3pThjrdt7LBW/DQ==
"@budibase/pro@2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.26.tgz#335ca9343ae3f84c7a99224c6863ecf09573221f"
integrity sha512-1bdpQO+v//vbhQa1/+Ic1tB2PlU3hCAwgYNm4C+MhNicMc9InpOE4bMNn22s6eoOI5XcuHiSZld+Au8J9/xuRA==
dependencies:
"@budibase/backend-core" "2.1.21"
"@budibase/types" "2.1.21"
"@budibase/backend-core" "2.1.26"
"@budibase/types" "2.1.26"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
node-fetch "^2.6.1"
"@budibase/types@2.1.21", "@budibase/types@^2.1.21":
version "2.1.21"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.21.tgz#ff607f0979e710f68469b0a586b3dc835ceaf236"
integrity sha512-KSvvUj2DQECVsZ2xbh0jsPz6u/WfoIQbkzsJa7wdRcC9goQ5fDdjLtHZrLDKKBRV9ceSVh0021BxFQ705+CaEA==
"@budibase/types@2.1.26", "@budibase/types@^2.1.26":
version "2.1.26"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.26.tgz#15422f49fc096a7b0419b4104a86df97198ebfde"
integrity sha512-gykmR8jSLVNAvbg7/senimW0HGs/lC3W1TlfoAVvkhzS2AAiuyH3CVbEYmgdd0SnZbY2Hpaas+Eqdp4fkqFu8A==
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"