From f4e5c97a57c70f66d09596b7b5d0a6cdfdc03e7b Mon Sep 17 00:00:00 2001 From: Clayton Dewey Date: Thu, 3 Jan 2019 16:08:16 -0700 Subject: [PATCH 1/4] Add AntiBot, composer.json --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ac84c3c..c4e2a82 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,8 @@ "drupal/google_analytics": "^2.3", "drupal/honeypot": "^1.29", "drupal/diff": "^1.0@RC", - "drupal/menu_trail_by_path": "^1.1" + "drupal/menu_trail_by_path": "^1.1", + "drupal/antibot": "^1.2" }, "repositories": { "drupal": { From 7dbec35edfe9588b8546355e77d57968636b7c13 Mon Sep 17 00:00:00 2001 From: Clayton Dewey Date: Thu, 3 Jan 2019 16:08:31 -0700 Subject: [PATCH 2/4] Add AntiBot, composer.locl --- composer.lock | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 20323e6..a759306 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8242eb77dab2ab68d0e0f052fffac99b", + "content-hash": "2ff581aba1400afb74b53605e46969a5", "packages": [ { "name": "asm89/stack-cors", @@ -2521,6 +2521,53 @@ "source": "http://cgit.drupalcode.org/allowed_formats" } }, + { + "name": "drupal/antibot", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://git.drupal.org/project/antibot", + "reference": "8.x-1.2" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/antibot-8.x-1.2.zip", + "reference": "8.x-1.2", + "shasum": "4cb067e77929984c8cf5b05a84734c62d6fd19b3" + }, + "require": { + "drupal/core": "~8.0" + }, + "type": "drupal-module", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + }, + "drupal": { + "version": "8.x-1.2", + "datestamp": "1522335671", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "mstef", + "homepage": "https://www.drupal.org/user/107190" + } + ], + "description": "Prevent forms from being submitted without JavaScript enabled", + "homepage": "https://www.drupal.org/project/antibot", + "support": { + "source": "http://cgit.drupalcode.org/antibot" + } + }, { "name": "drupal/better_normalizers", "version": "1.0.0-beta3", From ea1daa3943cbfc827714b1dfde226208e46d88d1 Mon Sep 17 00:00:00 2001 From: Clayton Dewey Date: Thu, 3 Jan 2019 16:09:48 -0700 Subject: [PATCH 3/4] Enable and configure AntiBot to protect Contact and Training forms --- config/sync/antibot.settings.yml | 12 ++++++++++ ...ot.snapshot.config_sync.module.antibot.yml | 23 +++++++++++++++++++ config/sync/core.extension.yml | 1 + 3 files changed, 36 insertions(+) create mode 100644 config/sync/antibot.settings.yml create mode 100644 config/sync/config_snapshot.snapshot.config_sync.module.antibot.yml diff --git a/config/sync/antibot.settings.yml b/config/sync/antibot.settings.yml new file mode 100644 index 0000000..ed0c87b --- /dev/null +++ b/config/sync/antibot.settings.yml @@ -0,0 +1,12 @@ +form_ids: + - comment_comment_form + - user_login_form + - user_pass + - user_register_form + - contact_message_feedback_form + - contact_message_personal_form + - webform-submission-training-node-58-add-form + - webform-submission-contact-node-163-add-form +show_form_ids: 1 +_core: + default_config_hash: f8-7hVX66ftHnUweoB4XDVx8q1hEr4PiqFvPvFB6yRc diff --git a/config/sync/config_snapshot.snapshot.config_sync.module.antibot.yml b/config/sync/config_snapshot.snapshot.config_sync.module.antibot.yml new file mode 100644 index 0000000..7c942bb --- /dev/null +++ b/config/sync/config_snapshot.snapshot.config_sync.module.antibot.yml @@ -0,0 +1,23 @@ +uuid: 8d3537a1-c75d-47f2-9d56-398adc51fb6f +langcode: en +status: true +dependencies: + module: + - antibot +id: config_sync.module.antibot +snapshotSet: config_sync +extensionType: module +extensionName: antibot +items: + - + collection: '' + name: antibot.settings + data: + form_ids: + - comment_comment_form + - user_login_form + - user_pass + - user_register_form + - contact_message_feedback_form + - contact_message_personal_form + show_form_ids: false diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 3121656..3729a3b 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -5,6 +5,7 @@ module: admin_toolbar_tools: 0 agaric_migration: 0 allowed_formats: 0 + antibot: 0 automated_cron: 0 better_normalizers: 0 block: 0 From d2220e076c12d2784e000543b49d4be0cd7effe2 Mon Sep 17 00:00:00 2001 From: Clayton Dewey Date: Thu, 3 Jan 2019 16:10:46 -0700 Subject: [PATCH 4/4] Make it more obvious when we get a submission from the contact form --- config/sync/webform.webform.contact.yml | 40 ++----------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/config/sync/webform.webform.contact.yml b/config/sync/webform.webform.contact.yml index 6cf254f..146abc3 100644 --- a/config/sync/webform.webform.contact.yml +++ b/config/sync/webform.webform.contact.yml @@ -99,7 +99,7 @@ settings: draft_loaded_message: '' confirmation_type: url_message confirmation_title: '' - confirmation_message: 'Your message has been sent.' + confirmation_message: 'Thanks for reaching out! We'll get back to you as soon as one of us (probably Clayton) checks our email.' confirmation_url: '' confirmation_attributes: { } confirmation_back: true @@ -172,40 +172,6 @@ access: users: { } permissions: { } handlers: - email_confirmation: - id: email - label: 'Email confirmation' - handler_id: email_confirmation - status: true - conditions: { } - weight: 1 - settings: - states: - - completed - to_mail: '[webform_submission:values:email:raw]' - to_options: { } - cc_mail: '' - cc_options: { } - bcc_mail: '' - bcc_options: { } - from_mail: _default - from_options: { } - from_name: _default - subject: '[webform_submission:values:subject:raw]' - body: '[webform_submission:values:message:value]' - excluded_elements: { } - ignore_access: false - exclude_empty: true - exclude_empty_checkbox: false - html: true - attachments: false - twig: false - theme_name: '' - debug: false - reply_to: '' - return_path: '' - sender_mail: '' - sender_name: '' email_notification: id: email label: 'Email notification' @@ -226,14 +192,14 @@ handlers: from_options: { } from_name: '[webform_submission:values:name:raw]' subject: '[webform_submission:values:subject:raw]' - body: '[webform_submission:values:message:value]' + body: "Hi Agarics, \r\n\r\nYou got some fan mail.\r\n\r\nSincerely,\r\nAgaric Bot\r\n\r\n

Submitted on {{ webform_token('[webform_submission:created]', webform_submission) }}

\r\n

Submitted by: {{ webform_token('[webform_submission:user]', webform_submission) }}

\r\n

Submitted values are:

\r\n{{ webform_token('[webform_submission:values]', webform_submission) }}\r\n" excluded_elements: { } ignore_access: false exclude_empty: true exclude_empty_checkbox: false html: true attachments: false - twig: false + twig: true theme_name: '' debug: false reply_to: ''