diff --git a/hosting/docker-compose.yaml b/hosting/docker-compose.yaml index 92765c29bf..9cdf2b2114 100644 --- a/hosting/docker-compose.yaml +++ b/hosting/docker-compose.yaml @@ -5,7 +5,7 @@ version: "3" services: app-service: restart: always - image: budibase/apps + image: budibase.docker.scarf.sh/budibase/apps container_name: bbapps ports: - "${APP_PORT}:4002" @@ -33,7 +33,7 @@ services: worker-service: restart: always - image: budibase/worker + image: budibase.docker.scarf.sh/budibase/worker container_name: bbworker ports: - "${WORKER_PORT}:4003" diff --git a/lerna.json b/lerna.json index 3db0c4b0d5..64dbb7dd9a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.99-alpha.4", + "version": "0.9.105-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 9d87ec93d1..49eff51e2b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.99-alpha.4", + "version": "0.9.105-alpha.3", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index 7d3a69ccd7..30ec701724 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -4,6 +4,8 @@ const { DEFAULT_TENANT_ID } = require("../constants") const env = require("../environment") const { StaticDatabases, SEPARATOR } = require("./constants") const { getTenantId } = require("../tenancy") +const fetch = require("node-fetch") +const { getCouch } = require("./index") const UNICODE_MAX = "\ufff0" @@ -156,6 +158,23 @@ exports.getDeployedAppID = appId => { return appId } +/** + * if in production this will use the CouchDB _all_dbs call to retrieve a list of databases. If testing + * when using Pouch it will use the pouchdb-all-dbs package. + */ +exports.getAllDbs = async () => { + // specifically for testing we use the pouch package for this + if (env.isTest()) { + return getCouch().allDbs() + } + const response = await fetch(`${env.COUCH_DB_URL}/_all_dbs`) + if (response.status === 200) { + return response.json() + } else { + throw "Cannot connect to CouchDB instance" + } +} + /** * Lots of different points in the system need to find the full list of apps, this will * enumerate the entire CouchDB cluster and get the list of databases (every app). @@ -163,13 +182,13 @@ exports.getDeployedAppID = appId => { * different users/companies apps as there is no security around it - all apps are returned. * @return {Promise} returns the app information document stored in each app database. */ -exports.getAllApps = async (CouchDB, { dev, all } = {}) => { +exports.getAllApps = async (CouchDB, { dev, all, idsOnly } = {}) => { let tenantId = getTenantId() if (!env.MULTI_TENANCY && !tenantId) { tenantId = DEFAULT_TENANT_ID } - let allDbs = await CouchDB.allDbs() - const appDbNames = allDbs.filter(dbName => { + let dbs = await exports.getAllDbs() + const appDbNames = dbs.filter(dbName => { const split = dbName.split(SEPARATOR) // it is an app, check the tenantId if (split[0] === DocumentTypes.APP) { @@ -183,6 +202,9 @@ exports.getAllApps = async (CouchDB, { dev, all } = {}) => { } return false }) + if (idsOnly) { + return appDbNames + } const appPromises = appDbNames.map(db => // skip setup otherwise databases could be re-created new CouchDB(db, { skip_setup: true }).get(DocumentTypes.APP_METADATA) diff --git a/packages/auth/src/middleware/passport/tests/utilities/db.js b/packages/auth/src/middleware/passport/tests/utilities/db.js index 3a792e3272..e83784471b 100644 --- a/packages/auth/src/middleware/passport/tests/utilities/db.js +++ b/packages/auth/src/middleware/passport/tests/utilities/db.js @@ -1,5 +1,4 @@ const PouchDB = require("pouchdb") -const allDbs = require("pouchdb-all-dbs") const env = require("../../../../environment") let POUCH_DB_DEFAULTS @@ -15,6 +14,4 @@ if (env.isTest()) { const Pouch = PouchDB.defaults(POUCH_DB_DEFAULTS) -allDbs(Pouch) - module.exports = Pouch diff --git a/packages/bbui/package.json b/packages/bbui/package.json index dc6c4f69e9..ace518d196 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.99-alpha.4", + "version": "0.9.105-alpha.3", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/bbui/src/Form/Checkbox.svelte b/packages/bbui/src/Form/Checkbox.svelte index 90a2cddda5..6aa88f6dee 100644 --- a/packages/bbui/src/Form/Checkbox.svelte +++ b/packages/bbui/src/Form/Checkbox.svelte @@ -9,6 +9,7 @@ export let text = null export let disabled = false export let error = null + export let size = "M" const dispatch = createEventDispatcher() const onChange = e => { @@ -18,5 +19,5 @@ - + diff --git a/packages/bbui/src/Form/Core/Checkbox.svelte b/packages/bbui/src/Form/Core/Checkbox.svelte index e9a6b56fd9..74745aa9a6 100644 --- a/packages/bbui/src/Form/Core/Checkbox.svelte +++ b/packages/bbui/src/Form/Core/Checkbox.svelte @@ -8,6 +8,7 @@ export let id = null export let text = null export let disabled = false + export let size = null const dispatch = createEventDispatcher() const onChange = event => { @@ -16,7 +17,7 @@