Skip to content

Commit d74dd07

Browse files
committed
chore: wip
1 parent 28b2b6a commit d74dd07

File tree

6 files changed

+27
-22
lines changed

6 files changed

+27
-22
lines changed

.stacks/core/buddy/src/commands/cloud.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export function cloud(buddy: CLI) {
194194
const startTime = await intro('buddy cloud:clean-up')
195195

196196
log.info('')
197-
log.info('ℹ️ Cleaning up your cloud resources will take a while to complete. Please be patient.')
197+
log.info(`ℹ️ ${italic('Cleaning up your cloud resources will take a while to complete. Please be patient.')}`)
198198
log.info('')
199199

200200
// sleep for 2 seconds to get the user to read the message

.stacks/core/cloud/src/cloud.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@ export class StacksCloud extends Stack {
531531
effect: iam.Effect.ALLOW,
532532
principals: [sesPrincipal],
533533
actions: ['s3:PutObject'],
534-
resources: [this.storage.emailBucket.arnForObjects('tmp/email_in/*')],
534+
resources: [
535+
// this.storage.emailBucket.arnForObjects('tmp/email_in/*'),
536+
this.storage.emailBucket.arnForObjects('*'),
537+
],
535538
conditions: {
536539
StringEquals: {
537540
'aws:Referer': this.account,
@@ -540,17 +543,6 @@ export class StacksCloud extends Stack {
540543
})
541544

542545
this.storage.emailBucket.addToResourcePolicy(bucketPolicyStatement)
543-
// Grant SES permission to write to the S3 bucket
544-
this.storage.emailBucket.addToResourcePolicy(new iam.PolicyStatement({
545-
principals: [sesPrincipal],
546-
actions: ['s3:PutObject'],
547-
resources: [this.storage.emailBucket.arnForObjects('*')],
548-
conditions: {
549-
StringEquals: {
550-
'aws:Referer': this.account,
551-
},
552-
},
553-
}))
554546

555547
const iamGroup = new iam.Group(this, 'IAMGroup', {
556548
groupName: `${this.appName}-${appEnv}-email-management-s3-group`,
@@ -672,7 +664,7 @@ export class StacksCloud extends Stack {
672664
},
673665
},
674666
],
675-
scanEnabled: config.email.server?.scan,
667+
scanEnabled: config.email.server?.scan || true,
676668
tlsPolicy: 'Require',
677669
},
678670
})
@@ -919,7 +911,7 @@ export class StacksCloud extends Stack {
919911
const existingBucketArn = `arn:aws:s3:::${existingBucketName}`
920912

921913
if (existingBucketName)
922-
return s3.Bucket.fromBucketArn(this, 'ExistingPublicBucket', existingBucketArn)
914+
return s3.Bucket.fromBucketArn(this, 'PublicBucket', existingBucketArn)
923915

924916
return new s3.Bucket(this, 'PublicBucket', {
925917
bucketName: `${bucketPrefix}${timestamp}`,
@@ -934,7 +926,7 @@ export class StacksCloud extends Stack {
934926
const existingBucketArn = `arn:aws:s3:::${existingBucketName}`
935927

936928
if (existingBucketName)
937-
return s3.Bucket.fromBucketArn(this, 'ExistingPrivateBucket', existingBucketArn)
929+
return s3.Bucket.fromBucketArn(this, 'PrivateBucket', existingBucketArn)
938930

939931
return new s3.Bucket(this, 'PrivateBucket', {
940932
bucketName: `${bucketPrefix}${timestamp}`,
@@ -949,7 +941,7 @@ export class StacksCloud extends Stack {
949941
const existingBucketArn = `arn:aws:s3:::${existingBucketName}`
950942

951943
if (existingBucketName)
952-
return s3.Bucket.fromBucketArn(this, 'ExistingEmailBucket', existingBucketArn)
944+
return s3.Bucket.fromBucketArn(this, 'EmailBucket', existingBucketArn)
953945

954946
return new s3.Bucket(this, 'EmailServerBucket', {
955947
bucketName: `${this.appName}-email-${appEnv}-${timestamp}`,
@@ -987,7 +979,6 @@ export async function getBucketWithPrefix(prefix: string): Promise<string | null
987979

988980
try {
989981
const response = await s3.send(new ListBucketsCommand({}))
990-
991982
const bucket = response.Buckets?.find(bucket => bucket.Name?.startsWith(prefix))
992983

993984
return bucket ? bucket.Name : null

.stacks/core/cloud/src/helpers.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { CountryCode } from '@aws-sdk/client-route-53-domains'
55
import { ContactType, Route53Domains } from '@aws-sdk/client-route-53-domains'
66
import { CloudFormation } from '@aws-sdk/client-cloudformation'
77
import { IAM } from '@aws-sdk/client-iam'
8-
import { S3 } from '@aws-sdk/client-s3'
8+
import { ListBucketsCommand, S3 } from '@aws-sdk/client-s3'
99
import { Lambda } from '@aws-sdk/client-lambda'
1010
import { DescribeFileSystemsCommand, EFSClient } from '@aws-sdk/client-efs'
1111
import type { DescribeLogGroupsCommandOutput } from '@aws-sdk/client-cloudwatch-logs'
@@ -300,6 +300,19 @@ export async function deleteCdkRemnants() {
300300
}
301301
}
302302

303+
export async function hasBeenDeployed() {
304+
const s3 = new S3({ region: 'us-east-1' })
305+
306+
try {
307+
const response = await s3.send(new ListBucketsCommand({}))
308+
return response.Buckets?.some(bucket => bucket.Name?.includes(config.app.name?.toLocaleLowerCase() || 'stacks')) || false
309+
}
310+
catch (error) {
311+
console.error('Error fetching buckets', error)
312+
return false
313+
}
314+
}
315+
303316
export async function getJumpBoxInstanceProfileName() {
304317
const iam = new IAM({ region: 'us-east-1' })
305318
const data = await iam.listInstanceProfiles({})

.stacks/ide/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ defaultcontent
6565
defu
6666
demi
6767
deps
68+
Descryption
6869
dessant
6970
destructurable
7071
devs

bun.lockb

0 Bytes
Binary file not shown.

config/docs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ const sidebar = {
7373
},
7474
{ text: 'Build a CLI', link: '/bootcamp/cli' },
7575
{ text: 'Build a Desktop App', link: '/bootcamp/desktop' },
76+
{ text: 'Extend the Dashboard', link: '/bootcamp/dashboard' },
7677
],
7778
},
78-
{ text: 'Hello World', link: '/bootcamp/hello-world' },
7979
{ text: 'Linting & Formatting', link: '/bootcamp/linting' },
8080
{ text: 'Semantic Commits', link: '/bootcamp/semantic-commits' },
81-
{ text: 'Extend the Dashboard', link: '/bootcamp/dashboard' },
8281
{ text: 'How to deploy?', link: '/bootcamp/deploy' },
8382
{ text: 'How to test?', link: '/bootcamp/test' },
8483
{ text: 'How to publish?', link: '/bootcamp/publish' },
@@ -109,7 +108,7 @@ const sidebar = {
109108
{ text: 'Composability', link: '/guide/libraries/composability' },
110109
],
111110
},
112-
{ text: 'Model-View-Actions', link: '/guide/model-view-actions' },
111+
{ text: 'Model-View-Action', link: '/guide/model-view-action' },
113112
{
114113
text: 'Packages',
115114
collapsible: true,
@@ -152,6 +151,7 @@ const sidebar = {
152151
{ text: 'ORM', link: '/guide/packages/orm' },
153152
{ text: 'Path', link: '/guide/packages/path' },
154153
{ text: 'Payments', link: '/guide/packages/payments' },
154+
{ text: 'Permissions', link: '/guide/packages/permissions' },
155155
{ text: 'Push', link: '/guide/packages/push' },
156156
{ text: 'Query Builder', link: '/guide/packages/query-builder' },
157157
{ text: 'Queue', link: '/guide/packages/queue' },

0 commit comments

Comments
 (0)