From c2ebbdf33ec5f243cfb7c48c79fc68233c0981d9 Mon Sep 17 00:00:00 2001 From: kevin olson Date: Sat, 24 Feb 2024 21:29:14 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20headless=20deployments=20need=20?= =?UTF-8?q?to=20stay=20public?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/deploy.ts | 3 +++ src/lib/deploytasks.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index f694ada..0fa74a4 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -283,6 +283,9 @@ export default class Deploy extends Command { 'dist', dp.deployment.s3.headless, 'SYNC_FILES', + '', + true, + true, ), }, { diff --git a/src/lib/deploytasks.ts b/src/lib/deploytasks.ts index af2db68..e6592b9 100644 --- a/src/lib/deploytasks.ts +++ b/src/lib/deploytasks.ts @@ -537,7 +537,7 @@ exports.handler = async (event, context) => { }) } - async sync(task: ListrTaskWrapper | null, folder: string, bucket: string, status: string, prefix = '', deleteRemoved = true) { + async sync(task: ListrTaskWrapper | null, folder: string, bucket: string, status: string, prefix = '', deleteRemoved = true, IsHeadless = false) { await this.deployment.update(status) const sts = await this.deployment.sts() const client = require('@auth0/s3').createClient({s3Client: new S3(sts)}) @@ -547,7 +547,7 @@ exports.handler = async (event, context) => { deleteRemoved: deleteRemoved, s3Params: { Bucket: bucket, - ACL: 'private', + ACL: IsHeadless ? 'publc-read' : 'private', Prefix: prefix, }, })