Skip to content

Commit a381883

Browse files
committed
chore: wip
1 parent b353d1b commit a381883

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

storage/framework/core/cloud/src/cloud/security.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class SecurityStack {
2828
cloudWatchMetricsEnabled: true,
2929
metricName: 'firewallMetric',
3030
},
31-
rules: this.getFirewallRules(),
31+
rules: this.getFirewallRules(scope),
3232
}
3333

3434
this.firewall = new wafv2.CfnWebACL(scope, 'StacksWebFirewall', options)
@@ -51,7 +51,7 @@ export class SecurityStack {
5151
})
5252
}
5353

54-
getFirewallRules() {
54+
getFirewallRules(scope: Construct): wafv2.CfnWebACL.RuleProperty[] {
5555
const rules: wafv2.CfnWebACL.RuleProperty[] = []
5656
const priorities = []
5757

@@ -61,9 +61,9 @@ export class SecurityStack {
6161
name: 'CountryRule',
6262
priority: priorities.length,
6363
statement: {
64-
geoMatchStatement: {
65-
countryCodes: config.security.firewall.countryCodes,
66-
},
64+
// geoMatchStatement: {
65+
// countryCodes: config.security.firewall.countryCodes,
66+
// },
6767
},
6868
action: {
6969
block: {},
@@ -77,7 +77,7 @@ export class SecurityStack {
7777
}
7878

7979
if (config.security.firewall?.ipAddresses?.length) {
80-
const ipSet = new wafv2.CfnIPSet(this, 'IpSet', {
80+
const ipSet = new wafv2.CfnIPSet(scope, 'IpSet', {
8181
name: 'IpSet',
8282
description: 'IP Set',
8383
scope: 'CLOUDFRONT',

storage/framework/core/config/src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AppConfig, CacheConfig, CdnConfig, ChatConfig, CliConfig, DatabaseConfig, DependenciesConfig, DnsConfig, EmailConfig, Events, GitConfig, HashingConfig, JobConfig, LibraryConfig, Model, NotificationConfig, PaymentConfig, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, SmsConfig, StacksConfig, StorageConfig, UiConfig } from '@stacksjs/types'
1+
import type { AppConfig, CacheConfig, CdnConfig, ChatConfig, CliConfig, DatabaseConfig, DependenciesConfig, DnsConfig, EmailConfig, Events, GitConfig, HashingConfig, JobConfig, LibraryConfig, Model, NotificationConfig, PaymentConfig, QueueConfig, SearchEngineConfig, SecurityConfig, ServicesConfig, StacksConfig, StorageConfig, UiConfig } from '@stacksjs/types'
22
import { createLocalTunnel } from '@stacksjs/tunnel'
33
import { config } from '.'
44

@@ -235,7 +235,7 @@ export function defineServices(config: ServicesConfig) {
235235
return config
236236
}
237237

238-
export function defineSms(config: SmsConfig) {
238+
export function defineSms(config: any) {
239239
return config
240240
}
241241

storage/framework/core/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export * as cloud from './cloud/src'
1414
export * as collections from './collections/src'
1515
export * as config from './config/src'
1616
export * from './database/src'
17-
export * from './datetime/src'
1817
export * from './desktop/src'
1918
export * from './development/src'
2019
export * from './dns/src'
@@ -44,7 +43,6 @@ export * from './scheduler/src'
4443
export * from './search-engine/src'
4544
export * from './security/src'
4645
export * from './server/src'
47-
export * from './signals/src'
4846
export * from './slug/src'
4947
export * from './sms/src'
5048
export * from './storage/src'

storage/framework/core/utils/src/helpers.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
import type { AddressInfo } from 'node:net'
2-
3-
// import { runAction } from '@stacksjs/actions'
42
import { log, runCommand } from '@stacksjs/cli'
53
import type { Result } from '@stacksjs/error-handling'
64
import { err, handleError, ok } from '@stacksjs/error-handling'
75
import { frameworkPath, projectPath } from '@stacksjs/path'
86
import * as storage from '@stacksjs/storage'
9-
import type { CliOptions, Manifest, SyncSubprocess } from '@stacksjs/types'
7+
import type { CliOptions, Manifest, Subprocess } from '@stacksjs/types'
108
import type { NpmScript } from '@stacksjs/enums'
119
import { Action } from '@stacksjs/enums'
1210
import { parse } from 'yaml'
11+
import { app, ui } from '@stacksjs/config'
1312

1413
// import { semver } from './versions'
15-
import { app, ui } from '@stacksjs/config'
1614

1715
export async function packageManager() {
1816
const { packageManager } = await storage.readPackageJson(frameworkPath('package.json'))
1917
return packageManager
2018
}
2119

22-
export async function initProject(): Promise<Result<SyncSubprocess, Error>> {
20+
export async function initProject(): Promise<Result<Subprocess, Error>> {
2321
if (app.env !== 'production')
2422
log.info('Project not yet initialized, generating application key...')
2523
else
@@ -131,10 +129,11 @@ export async function setEnvValue(key: string, value: string) {
131129
/**
132130
* Runs the specified NPM script in the package.json file.
133131
*/
134-
export async function runNpmScript(script: NpmScript, options?: CliOptions): Promise<Result<SyncSubprocess, Error>> {
132+
export async function runNpmScript(script: NpmScript, options?: CliOptions): Promise<Result<Subprocess, Error>> {
135133
const { data: manifest } = await storage.readJsonFile('package.json', frameworkPath())
136134

137-
if (isManifest(manifest) && hasScript(manifest, script)) // simple, yet effective check to see if the script exists
135+
// simple, yet effective check to see if the script exists
136+
if (isManifest(manifest) && hasScript(manifest, script))
138137
return await runCommand(`bun --bun run ${script}`, options)
139138

140139
return err(handleError(`The ${script} script does not exist in the package.json file.`))

0 commit comments

Comments
 (0)