|
1 |
| -import type { StacksConfig } from '@stacksjs/types' |
| 1 | +import type { StacksOptions } from '@stacksjs/types' |
2 | 2 | import { path as p } from '@stacksjs/path'
|
3 | 3 | // import { userConfig as overrides } from './overrides'
|
4 | 4 |
|
@@ -40,7 +40,7 @@ const sidebar = {
|
40 | 40 | ],
|
41 | 41 | }
|
42 | 42 |
|
43 |
| -export const defaults: StacksConfig = { |
| 43 | +export default { |
44 | 44 | app: {
|
45 | 45 | name: 'Stacks',
|
46 | 46 | env: 'local',
|
@@ -309,18 +309,228 @@ export const defaults: StacksConfig = {
|
309 | 309 | default: 'email',
|
310 | 310 | },
|
311 | 311 |
|
312 |
| - // wip |
313 |
| - payment: {}, |
| 312 | + payment: { |
| 313 | + driver: 'stripe', |
| 314 | + }, |
314 | 315 |
|
315 |
| - queue: {}, |
316 |
| - searchEngine: {}, |
317 |
| - security: {}, |
318 |
| - services: {}, |
319 |
| - storage: {}, |
320 |
| - ui: {}, |
321 |
| -} |
| 316 | + queue: { |
| 317 | + default: 'sync', |
| 318 | + |
| 319 | + connections: { |
| 320 | + sync: { |
| 321 | + driver: 'sync', |
| 322 | + }, |
| 323 | + |
| 324 | + database: { |
| 325 | + driver: 'database', |
| 326 | + table: 'jobs', |
| 327 | + queue: 'default', |
| 328 | + retry_after: 90, |
| 329 | + }, |
| 330 | + |
| 331 | + redis: { |
| 332 | + driver: 'redis', |
| 333 | + connection: 'default', |
| 334 | + queue: 'default', |
| 335 | + retry_after: 90, |
| 336 | + }, |
| 337 | + |
| 338 | + sqs: { |
| 339 | + driver: 'sqs', |
| 340 | + key: '', |
| 341 | + secret: '', |
| 342 | + prefix: '', |
| 343 | + suffix: '', |
| 344 | + queue: 'default', |
| 345 | + region: 'us-east-1', |
| 346 | + }, |
| 347 | + }, |
| 348 | + }, |
| 349 | + |
| 350 | + searchEngine: { |
| 351 | + driver: 'meilisearch', |
| 352 | + }, |
| 353 | + |
| 354 | + security: { |
| 355 | + app: { |
| 356 | + firewall: { |
| 357 | + immunity: 300, // CAPTCHA immunity time 300 seconds |
| 358 | + challenge: { |
| 359 | + captcha: { |
| 360 | + duration: 300, |
| 361 | + headerName: 'x-captcha', |
| 362 | + headerValue: 'true', |
| 363 | + }, |
| 364 | + }, |
| 365 | + |
| 366 | + rules: [ |
| 367 | + // rule to limit requests to 1000 per 5 minutes |
| 368 | + { |
| 369 | + action: { block: {} }, |
| 370 | + name: 'RateLimitRule', |
| 371 | + priority: 0, |
| 372 | + statement: { |
| 373 | + rateBasedStatement: { |
| 374 | + aggregateKeyType: 'IP', |
| 375 | + limit: 1000, |
| 376 | + }, |
| 377 | + }, |
| 378 | + visibilityConfig: { |
| 379 | + sampledRequestsEnabled: true, |
| 380 | + cloudWatchMetricsEnabled: true, |
| 381 | + metricName: 'rateLimitRuleMetric', |
| 382 | + }, |
| 383 | + }, |
| 384 | + |
| 385 | + // use managed rule AWSManagedRulesAmazonIpReputationList |
| 386 | + { |
| 387 | + name: 'AWSManagedRulesAmazonIpReputationList', |
| 388 | + priority: 1, |
| 389 | + // use rule action |
| 390 | + action: { allow: {} }, |
| 391 | + visibilityConfig: { |
| 392 | + sampledRequestsEnabled: true, |
| 393 | + cloudWatchMetricsEnabled: true, |
| 394 | + metricName: 'AWSManagedRulesAmazonIpReputationList', |
| 395 | + }, |
| 396 | + statement: { |
| 397 | + managedRuleGroupStatement: { |
| 398 | + vendorName: 'AWS', |
| 399 | + name: 'AWSManagedRulesAmazonIpReputationList', |
| 400 | + }, |
| 401 | + }, |
| 402 | + }, |
| 403 | + |
| 404 | + // use managed rule AWSManagedRulesKnownBadInputsRuleSet |
| 405 | + { |
| 406 | + name: 'AWSManagedRulesKnownBadInputsRuleSet', |
| 407 | + priority: 2, |
| 408 | + // use rule action |
| 409 | + action: { allow: {} }, |
| 410 | + visibilityConfig: { |
| 411 | + sampledRequestsEnabled: true, |
| 412 | + cloudWatchMetricsEnabled: true, |
| 413 | + metricName: 'AWSManagedRulesKnownBadInputsRuleSet', |
| 414 | + }, |
| 415 | + statement: { |
| 416 | + managedRuleGroupStatement: { |
| 417 | + vendorName: 'AWS', |
| 418 | + name: 'AWSManagedRulesKnownBadInputsRuleSet', |
| 419 | + }, |
| 420 | + }, |
| 421 | + }, |
| 422 | + |
| 423 | + // use managed rule Account takeover prevention |
| 424 | + // { |
| 425 | + // name: 'AWSManagedRulesAccountTakeoverProtectionRuleSet', |
| 426 | + // priority: 4, |
| 427 | + // // use rule action |
| 428 | + // action: { allow: {} }, |
| 429 | + // visibilityConfig: { |
| 430 | + // sampledRequestsEnabled: true, |
| 431 | + // cloudWatchMetricsEnabled: true, |
| 432 | + // metricName: 'AWSManagedRulesAccountTakeoverProtectionRuleSet', |
| 433 | + // }, |
| 434 | + // statement: { |
| 435 | + // managedRuleGroupStatement: { |
| 436 | + // vendorName: 'AWS', |
| 437 | + // name: 'AWSManagedRulesAccountTakeoverProtectionRuleSet', |
| 438 | + // }, |
| 439 | + // }, |
| 440 | + // }, |
| 441 | + |
| 442 | + // use managed rule Account creation fraud prevention |
| 443 | + // { |
| 444 | + // name: 'AWSManagedRulesAdminProtectionRuleSet', |
| 445 | + // priority: 5, |
| 446 | + // // use rule action |
| 447 | + // action: { allow: {} }, |
| 448 | + // visibilityConfig: { |
| 449 | + // sampledRequestsEnabled: true, |
| 450 | + // cloudWatchMetricsEnabled: true, |
| 451 | + // metricName: 'AWSManagedRulesAdminProtectionRuleSet', |
| 452 | + // }, |
| 453 | + // statement: { |
| 454 | + // managedRuleGroupStatement: { |
| 455 | + // vendorName: 'AWS', |
| 456 | + // name: 'AWSManagedRulesAdminProtectionRuleSet', |
| 457 | + // }, |
| 458 | + // }, |
| 459 | + // }, |
| 460 | + ], |
| 461 | + }, |
| 462 | + }, |
| 463 | + }, |
| 464 | + |
| 465 | + services: { |
| 466 | + aws: { |
| 467 | + accountId: '', |
| 468 | + appId: '', |
| 469 | + apiKey: '', |
| 470 | + region: 'us-east-1', |
| 471 | + }, |
| 472 | + |
| 473 | + algolia: { |
| 474 | + appId: '', |
| 475 | + apiKey: '', |
| 476 | + }, |
| 477 | + |
| 478 | + meilisearch: { |
| 479 | + appId: '', |
| 480 | + apiKey: '', |
| 481 | + }, |
| 482 | + |
| 483 | + stripe: { |
| 484 | + appId: '', |
| 485 | + apiKey: '', |
| 486 | + }, |
| 487 | + |
| 488 | + planetscale: { |
| 489 | + appId: '', |
| 490 | + apiKey: '', |
| 491 | + }, |
| 492 | + |
| 493 | + supabase: { |
| 494 | + appId: '', |
| 495 | + apiKey: '', |
| 496 | + }, |
| 497 | + }, |
| 498 | + |
| 499 | + storage: { |
| 500 | + driver: 's3', |
| 501 | + }, |
| 502 | + |
| 503 | + ui: { |
| 504 | + shortcuts: [ |
| 505 | + ['btn', 'inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer'], |
| 506 | + ], |
| 507 | + safelist: 'prose prose-sm m-auto text-left', |
| 508 | + trigger: ':stx:', |
| 509 | + classPrefix: 'stx-', |
| 510 | + reset: 'tailwind', |
| 511 | + |
| 512 | + icons: ['heroicons'], |
| 513 | + |
| 514 | + fonts: { |
| 515 | + email: { |
| 516 | + title: 'Mona', |
| 517 | + text: 'Hubot', |
| 518 | + }, |
| 519 | + |
| 520 | + desktop: { |
| 521 | + title: 'Mona', |
| 522 | + text: 'Hubot', |
| 523 | + }, |
| 524 | + |
| 525 | + mobile: { |
| 526 | + title: 'Mona', |
| 527 | + text: 'Hubot', |
| 528 | + }, |
322 | 529 |
|
323 |
| -// export { |
324 |
| -// userConfig, |
325 |
| -// defaults, |
326 |
| -// } |
| 530 | + web: { |
| 531 | + title: 'Mona', |
| 532 | + text: 'Hubot', |
| 533 | + }, |
| 534 | + }, |
| 535 | + }, |
| 536 | +} satisfies StacksOptions |
0 commit comments