From 5444af9400fbbb652ab08c19dc8c937644322c6b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 18 Dec 2020 16:48:14 +0000 Subject: [PATCH] Quick fixes. --- hosting/hosting.properties | 2 +- packages/worker/src/api/controllers/deploy.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hosting/hosting.properties b/hosting/hosting.properties index 4afdcc044c..35df12f07b 100644 --- a/hosting/hosting.properties +++ b/hosting/hosting.properties @@ -4,7 +4,7 @@ COUCH_DB_PASSWORD=budibase COUCH_DB_USER=budibase WORKER_API_KEY=budibase BUDIBASE_ENVIRONMENT=PRODUCTION -HOSTING_URL="http://localhost" +HOSTING_URL=http://localhost LOGO_URL=https://logoipsum.com/logo/logo-15.svg APP_PORT=4002 WORKER_PORT=4003 diff --git a/packages/worker/src/api/controllers/deploy.js b/packages/worker/src/api/controllers/deploy.js index ad10cc2aae..8a2f8a3ea7 100644 --- a/packages/worker/src/api/controllers/deploy.js +++ b/packages/worker/src/api/controllers/deploy.js @@ -55,12 +55,6 @@ async function getMinioSession() { Bucket: APP_BUCKET, }) .promise() - await objClient - .putBucketPolicy({ - Bucket: APP_BUCKET, - Policy: JSON.stringify(PUBLIC_READ_POLICY), - }) - .promise() } catch (err) { // bucket doesn't exist create it if (err.statusCode === 404) { @@ -69,7 +63,15 @@ async function getMinioSession() { Bucket: APP_BUCKET, }) .promise() - } else { + } else if (err.statusCode === 403) { + await objClient + .putBucketPolicy({ + Bucket: APP_BUCKET, + Policy: JSON.stringify(PUBLIC_READ_POLICY), + }) + .promise() + } + else { throw err } }