Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into KarelJanVanHaute/i…
Browse files Browse the repository at this point in the history
…ssue427
  • Loading branch information
KarelJanVanHaute committed Feb 12, 2025
2 parents fb71691 + 6cf339a commit bc97aed
Show file tree
Hide file tree
Showing 51 changed files with 2,065 additions and 852 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ SYSTEM_NAME="Craft"
# postmarkapp.com API key
POSTMARK_API_KEY=""

# Recaptcha
RECAPTCHA_SITE_KEY=""
RECAPTCHA_SECRET_KEY=""

# Address to which Craft's testToEmailAddress will be site
DEBUG_EMAIL=""

Expand All @@ -42,4 +46,4 @@ ALGOLIA_APP_ID=""
ALGOLIA_API_KEY=""
ALGOLIA_SEARCH_KEY=""

SITE_PASSWORD=""
SITE_PASSWORD=""
1 change: 1 addition & 0 deletions config/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'enableGql' => false,
'defaultWeekStartDay' => 1,
'defaultTokenDuration' => 'P10D',
'defaultCpLocale' => 'nl-BE',
'useEmailAsUsername' => true,
'enableCsrfProtection' => true,
'omitScriptNameInUrls' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ data:
javascript:
enabled: '1'
showAllPages: '1'
recaptcha:
enabled: '1'
showAllPages: ''
limitSubmissions: false
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
limitSubmissionsNumber: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ data:
javascript:
enabled: '1'
showAllPages: '1'
recaptcha:
enabled: '1'
showAllPages: ''
limitSubmissions: false
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
limitSubmissionsNumber: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ data:
javascript:
enabled: '1'
showAllPages: '1'
recaptcha:
enabled: '1'
showAllPages: ''
limitSubmissions: false
limitSubmissionsMessage: '[{"type":"paragraph","attrs":{"textAlign":"start"}}]'
limitSubmissionsNumber: null
Expand Down
144 changes: 112 additions & 32 deletions config/project/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dateModified: 1739370540
dateModified: 1739372611
elementSources:
craft\elements\Entry:
-
Expand Down Expand Up @@ -428,7 +428,7 @@ plugins:
licenseKey: WLZ7JMGY8H2EIESZYMEZ3EPW
schemaVersion: 3.4.8
settings:
ajaxTimeout: '10'
ajaxTimeout: 10
alertEmails: null
captchas:
__assoc__:
Expand All @@ -441,7 +441,10 @@ plugins:
- verbb\formie\integrations\captchas\Recaptcha
-
- enabled
- false
- '1'
-
- saveSpam
- true
-
- settings
-
Expand All @@ -451,10 +454,10 @@ plugins:
- recaptcha
-
- secretKey
- ''
- $RECAPTCHA_SECRET_KEY
-
- siteKey
- ''
- $RECAPTCHA_SITE_KEY
-
- type
- v3
Expand All @@ -466,16 +469,19 @@ plugins:
- light
-
- badge
- bottomright
- inline
-
- language
- en
-
- minScore
- '0.5'
- 0.5
-
- projectId
- ''
- scriptLoadingMethod
- asyncDefer
-
- enterpriseType
- score
-
- hcaptcha
-
Expand All @@ -485,32 +491,32 @@ plugins:
- verbb\formie\integrations\captchas\Hcaptcha
-
- enabled
- false
- '0'
-
- saveSpam
- true
-
- settings
-
__assoc__:
-
0:
- handle
- hcaptcha
-
- secretKey
- ''
-
- siteKey
- ''
-
3:
- size
- normal
-
4:
- theme
- light
-
5:
- language
- en
-
6:
- minScore
- '0.5'
- 0.5
7:
- scriptLoadingMethod
- asyncDefer
-
- duplicate
-
Expand All @@ -520,7 +526,10 @@ plugins:
- verbb\formie\integrations\captchas\Duplicate
-
- enabled
- false
- '0'
-
- saveSpam
- true
-
- settings
-
Expand All @@ -537,6 +546,9 @@ plugins:
- verbb\formie\integrations\captchas\Honeypot
-
- enabled
- '1'
-
- saveSpam
- true
-
- settings
Expand All @@ -554,6 +566,9 @@ plugins:
- verbb\formie\integrations\captchas\Javascript
-
- enabled
- '1'
-
- saveSpam
- true
-
- settings
Expand All @@ -562,9 +577,64 @@ plugins:
-
- handle
- javascript
-
- minTime
- ''
-
- friendlyCaptcha
-
__assoc__:
-
- type
- verbb\formie\integrations\captchas\FriendlyCaptcha
-
- enabled
- '0'
-
- saveSpam
- true
-
- settings
-
__assoc__:
0:
- handle
- friendlyCaptcha
3:
- language
- en
4:
- startMode
- none
-
- turnstile
-
__assoc__:
-
- type
- verbb\formie\integrations\captchas\Turnstile
-
- enabled
- '0'
-
- saveSpam
- true
-
- settings
-
__assoc__:
0:
- handle
- turnstile
3:
- scriptLoadingMethod
- asyncDefer
4:
- theme
- auto
5:
- size
- normal
6:
- appearance
- always
defaultDateDisplayType: ''
defaultDateTime: null
defaultDateValueOption: ''
Expand All @@ -574,24 +644,34 @@ plugins:
defaultInstructionsPosition: verbb\formie\positions\AboveInput
defaultLabelPosition: verbb\formie\positions\AboveInput
defaultPage: forms
enableCsrfValidationForGuests: '1'
enableGatsbyCompatibility: false
enableUnloadWarning: '1'
maxIncompleteSubmissionAge: '30'
emptyValuePlaceholder: 'No response.'
enableBackSubmission: true
enableCsrfValidationForGuests: true
enableLargeFieldStorage: false
enableUnloadWarning: true
filterIntegrationMapping: true
includeDraftElementUsage: false
includeRevisionElementUsage: false
maxIncompleteSubmissionAge: 30
maxSentNotificationsAge: 30
pdfPaperOrientation: portrait
pdfPaperSize: letter
pluginName: Formie
queuePriority: null
saveSpam: true
sendEmailAlerts: false
sentNotifications: true
setOnlyCurrentPagePayload: false
spamBehaviour: showSuccess
spamBehaviourMessage: ''
spamEmailNotifications: false
spamKeywords: ''
spamLimit: 500
useQueueForIntegrations: ''
useQueueForNotifications: ''
submissionsBehaviour: all
useCssLayers: false
useQueueForIntegrations: false
useQueueForNotifications: false
validateCustomTemplates: true
hyper:
edition: standard
enabled: true
Expand Down
28 changes: 27 additions & 1 deletion modules/statik/src/console/controllers/SetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function actionIndex(): int
$this->setProjectCode();
$this->removeAccountFlow();
$this->setPostmarkKey();
$this->setRecaptchaKey();
$this->setupGit();

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

/**
* Prompts the user if Mandrill should be used for e-mail transport and asks to enter an API key
* Prompts the user if Postmark should be used for e-mail transport and asks to enter an API key
*/
private function setPostmarkKey(): void
{
Expand All @@ -162,6 +163,31 @@ private function setPostmarkKey(): void
}
}

/**
* Prompts the user if recaptcha will be used and asks to enter an API key
*/
private function setRecaptchaKey(): void
{
if ($this->confirm("Do you want to use Recaptcha for spam protection?", true)) {
$key = $this->prompt("> Enter a recaptcha SITE key:");
if ($key) {
if ($this->setEnvVar("RECAPTCHA_SITE_KEY", $key)) {
$this->stdout("Done!" . PHP_EOL, Console::FG_GREEN);
}
} else {
$this->stdout("Key not found, aborting" . PHP_EOL, Console::FG_RED);
}
$key = $this->prompt("> Enter a recaptcha SECRET key:");
if ($key) {
if ($this->setEnvVar("RECAPTCHA_SECRET_KEY", $key)) {
$this->stdout("Done!" . PHP_EOL, Console::FG_GREEN);
}
} else {
$this->stdout("Key not found, aborting" . PHP_EOL, Console::FG_RED);
}
}
}

private function setupGit(): void
{
if ($this->confirm("Do you want to set up a git repo for this project?", true)) {
Expand Down
Loading

0 comments on commit bc97aed

Please # to comment.