Skip to content

Commit 1007278

Browse files
Merge branch 'develop' into KarelJanVanHaute/issue400
2 parents db0d718 + e05d8ce commit 1007278

6 files changed

+153
-34
lines changed

.env.example

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ SYSTEM_NAME="Craft"
2323
# postmarkapp.com API key
2424
POSTMARK_API_KEY=""
2525

26+
# Recaptcha
27+
RECAPTCHA_SITE_KEY=""
28+
RECAPTCHA_SECRET_KEY=""
29+
2630
# Address to which Craft's testToEmailAddress will be site
2731
DEBUG_EMAIL=""
2832

@@ -42,4 +46,4 @@ ALGOLIA_APP_ID=""
4246
ALGOLIA_API_KEY=""
4347
ALGOLIA_SEARCH_KEY=""
4448

45-
SITE_PASSWORD=""
49+
SITE_PASSWORD=""

config/project/formie/stencils/contactForm_EN--ac589bc4-75c7-4f97-b57b-61025fc0643f.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ data:
395395
javascript:
396396
enabled: '1'
397397
showAllPages: '1'
398+
recaptcha:
399+
enabled: '1'
400+
showAllPages: ''
398401
limitSubmissions: false
399402
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
400403
limitSubmissionsNumber: null

config/project/formie/stencils/contactForm_FR--68c6a8e9-4391-473a-8b44-293bb38d1f32.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,9 @@ data:
395395
javascript:
396396
enabled: '1'
397397
showAllPages: '1'
398+
recaptcha:
399+
enabled: '1'
400+
showAllPages: ''
398401
limitSubmissions: false
399402
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
400403
limitSubmissionsNumber: null

config/project/formie/stencils/contactForm_NL--b1ca80f0-4eed-4f99-bebc-bca6c694cb00.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ data:
399399
javascript:
400400
enabled: '1'
401401
showAllPages: '1'
402+
recaptcha:
403+
enabled: '1'
404+
showAllPages: ''
402405
limitSubmissions: false
403406
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
404407
limitSubmissionsNumber: null

config/project/project.yaml

+112-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dateModified: 1739370540
1+
dateModified: 1739372611
22
elementSources:
33
craft\elements\Entry:
44
-
@@ -428,7 +428,7 @@ plugins:
428428
licenseKey: WLZ7JMGY8H2EIESZYMEZ3EPW
429429
schemaVersion: 3.4.8
430430
settings:
431-
ajaxTimeout: '10'
431+
ajaxTimeout: 10
432432
alertEmails: null
433433
captchas:
434434
__assoc__:
@@ -441,7 +441,10 @@ plugins:
441441
- verbb\formie\integrations\captchas\Recaptcha
442442
-
443443
- enabled
444-
- false
444+
- '1'
445+
-
446+
- saveSpam
447+
- true
445448
-
446449
- settings
447450
-
@@ -451,10 +454,10 @@ plugins:
451454
- recaptcha
452455
-
453456
- secretKey
454-
- ''
457+
- $RECAPTCHA_SECRET_KEY
455458
-
456459
- siteKey
457-
- ''
460+
- $RECAPTCHA_SITE_KEY
458461
-
459462
- type
460463
- v3
@@ -466,16 +469,19 @@ plugins:
466469
- light
467470
-
468471
- badge
469-
- bottomright
472+
- inline
470473
-
471474
- language
472475
- en
473476
-
474477
- minScore
475-
- '0.5'
478+
- 0.5
476479
-
477-
- projectId
478-
- ''
480+
- scriptLoadingMethod
481+
- asyncDefer
482+
-
483+
- enterpriseType
484+
- score
479485
-
480486
- hcaptcha
481487
-
@@ -485,32 +491,32 @@ plugins:
485491
- verbb\formie\integrations\captchas\Hcaptcha
486492
-
487493
- enabled
488-
- false
494+
- '0'
495+
-
496+
- saveSpam
497+
- true
489498
-
490499
- settings
491500
-
492501
__assoc__:
493-
-
502+
0:
494503
- handle
495504
- hcaptcha
496-
-
497-
- secretKey
498-
- ''
499-
-
500-
- siteKey
501-
- ''
502-
-
505+
3:
503506
- size
504507
- normal
505-
-
508+
4:
506509
- theme
507510
- light
508-
-
511+
5:
509512
- language
510513
- en
511-
-
514+
6:
512515
- minScore
513-
- '0.5'
516+
- 0.5
517+
7:
518+
- scriptLoadingMethod
519+
- asyncDefer
514520
-
515521
- duplicate
516522
-
@@ -520,7 +526,10 @@ plugins:
520526
- verbb\formie\integrations\captchas\Duplicate
521527
-
522528
- enabled
523-
- false
529+
- '0'
530+
-
531+
- saveSpam
532+
- true
524533
-
525534
- settings
526535
-
@@ -537,6 +546,9 @@ plugins:
537546
- verbb\formie\integrations\captchas\Honeypot
538547
-
539548
- enabled
549+
- '1'
550+
-
551+
- saveSpam
540552
- true
541553
-
542554
- settings
@@ -554,6 +566,9 @@ plugins:
554566
- verbb\formie\integrations\captchas\Javascript
555567
-
556568
- enabled
569+
- '1'
570+
-
571+
- saveSpam
557572
- true
558573
-
559574
- settings
@@ -562,9 +577,64 @@ plugins:
562577
-
563578
- handle
564579
- javascript
565-
-
566-
- minTime
567-
- ''
580+
-
581+
- friendlyCaptcha
582+
-
583+
__assoc__:
584+
-
585+
- type
586+
- verbb\formie\integrations\captchas\FriendlyCaptcha
587+
-
588+
- enabled
589+
- '0'
590+
-
591+
- saveSpam
592+
- true
593+
-
594+
- settings
595+
-
596+
__assoc__:
597+
0:
598+
- handle
599+
- friendlyCaptcha
600+
3:
601+
- language
602+
- en
603+
4:
604+
- startMode
605+
- none
606+
-
607+
- turnstile
608+
-
609+
__assoc__:
610+
-
611+
- type
612+
- verbb\formie\integrations\captchas\Turnstile
613+
-
614+
- enabled
615+
- '0'
616+
-
617+
- saveSpam
618+
- true
619+
-
620+
- settings
621+
-
622+
__assoc__:
623+
0:
624+
- handle
625+
- turnstile
626+
3:
627+
- scriptLoadingMethod
628+
- asyncDefer
629+
4:
630+
- theme
631+
- auto
632+
5:
633+
- size
634+
- normal
635+
6:
636+
- appearance
637+
- always
568638
defaultDateDisplayType: ''
569639
defaultDateTime: null
570640
defaultDateValueOption: ''
@@ -574,24 +644,34 @@ plugins:
574644
defaultInstructionsPosition: verbb\formie\positions\AboveInput
575645
defaultLabelPosition: verbb\formie\positions\AboveInput
576646
defaultPage: forms
577-
enableCsrfValidationForGuests: '1'
578-
enableGatsbyCompatibility: false
579-
enableUnloadWarning: '1'
580-
maxIncompleteSubmissionAge: '30'
647+
emptyValuePlaceholder: 'No response.'
648+
enableBackSubmission: true
649+
enableCsrfValidationForGuests: true
650+
enableLargeFieldStorage: false
651+
enableUnloadWarning: true
652+
filterIntegrationMapping: true
653+
includeDraftElementUsage: false
654+
includeRevisionElementUsage: false
655+
maxIncompleteSubmissionAge: 30
581656
maxSentNotificationsAge: 30
582657
pdfPaperOrientation: portrait
583658
pdfPaperSize: letter
584659
pluginName: Formie
660+
queuePriority: null
585661
saveSpam: true
586662
sendEmailAlerts: false
587663
sentNotifications: true
664+
setOnlyCurrentPagePayload: false
588665
spamBehaviour: showSuccess
589666
spamBehaviourMessage: ''
590667
spamEmailNotifications: false
591668
spamKeywords: ''
592669
spamLimit: 500
593-
useQueueForIntegrations: ''
594-
useQueueForNotifications: ''
670+
submissionsBehaviour: all
671+
useCssLayers: false
672+
useQueueForIntegrations: false
673+
useQueueForNotifications: false
674+
validateCustomTemplates: true
595675
hyper:
596676
edition: standard
597677
enabled: true

modules/statik/src/console/controllers/SetupController.php

+27-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function actionIndex(): int
5656
$this->setProjectCode();
5757
$this->removeAccountFlow();
5858
$this->setPostmarkKey();
59+
$this->setRecaptchaKey();
5960
$this->setupGit();
6061

6162
$this->stdout("All done! Happy coding!" . PHP_EOL, Console::FG_GREEN);
@@ -140,7 +141,7 @@ private function removeAccountFlow(): bool
140141
}
141142

142143
/**
143-
* Prompts the user if Mandrill should be used for e-mail transport and asks to enter an API key
144+
* Prompts the user if Postmark should be used for e-mail transport and asks to enter an API key
144145
*/
145146
private function setPostmarkKey(): void
146147
{
@@ -162,6 +163,31 @@ private function setPostmarkKey(): void
162163
}
163164
}
164165

166+
/**
167+
* Prompts the user if recaptcha will be used and asks to enter an API key
168+
*/
169+
private function setRecaptchaKey(): void
170+
{
171+
if ($this->confirm("Do you want to use Recaptcha for spam protection?", true)) {
172+
$key = $this->prompt("> Enter a recaptcha SITE key:");
173+
if ($key) {
174+
if ($this->setEnvVar("RECAPTCHA_SITE_KEY", $key)) {
175+
$this->stdout("Done!" . PHP_EOL, Console::FG_GREEN);
176+
}
177+
} else {
178+
$this->stdout("Key not found, aborting" . PHP_EOL, Console::FG_RED);
179+
}
180+
$key = $this->prompt("> Enter a recaptcha SECRET key:");
181+
if ($key) {
182+
if ($this->setEnvVar("RECAPTCHA_SECRET_KEY", $key)) {
183+
$this->stdout("Done!" . PHP_EOL, Console::FG_GREEN);
184+
}
185+
} else {
186+
$this->stdout("Key not found, aborting" . PHP_EOL, Console::FG_RED);
187+
}
188+
}
189+
}
190+
165191
private function setupGit(): void
166192
{
167193
if ($this->confirm("Do you want to set up a git repo for this project?", true)) {

0 commit comments

Comments
 (0)