Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Security to Theme Deliver

Solved by Vadym View solution

Started by zbigniew 3 years ago · 11 replies · 430 views
3 years ago

Hello,
I'm new
I'm looking for how to add security to Theme Deliver.
Contact Form I would like to add Turnstile Captcha Field (Cloudflare) or Google ReCaptcha or Basic-Captcha.
I've searched but all to no avail.
Please help, I want to protect myself from spam.
Please provide a step-by-step description of how to implement any security measures.
Thank you all for your help.
Zbigniew,

3 years ago

@Zbigniew,

@Zbigniew:
Please provide a step-by-step description of how to implement any security measures.

Before asking the community to spend time on a "step-by-step instruction", please show what steps you have taken yourself?

  • What docs have you read?
  • What steps have you tried?
  • Where did you got stuck?
    • What did you expect to happen?
    • And what did happen instead?
3 years ago

Hello,
All right
I will briefly describe what I did.

3 years ago

hi,

  1. cloundflare - turnsite
    i have site key and secret key
  2. gravcms - plugin - Form - added site and secret key.
  3. I added turnstile api.js to base.html.twig
  4. Clean Theme Deliver adds to pages : modular_alt.md
    `---
    title: 'Kontakt - '
    onpage_menu: false
    body_classes: 'modular header-lite fullwidth'
    bg_color: '#B4B093'
    form:
    name: my-nice-form
    action: /kontakt
    fields:

    YAML
        name: name
        id: name
        label: 'UWAGA! Wysyłając widomość e-mail akceptujesz <a href="/polityka-priv">Politykę Prywatności</a>'
        classes: 'form-control form-control-lg'
        placeholder: 'Wpisz swoje Imię'
        autocomplete: 'on'
        type: text
        validate:
            required: true
    -
        name: email
        id: email
        classes: 'form-control form-control-lg'
        label: Email
        placeholder: 'Wpisz swój adres email'
        type: email
        validate:
            rule: email
            required: true
    -
        name: message
        label: Message
        classes: 'form-control form-control-lg'
        size: long
        placeholder: 'Napisz swoją wiadomość i podaj nr telefonu do kontaktu'
        type: textarea
        validate:
            required: true
    -
        captcha:
            type: turnstile
            theme: light
    

    buttons:

    YAML
        type: submit
        value: 'Wyślij Wiadomość'
        classes: 'btn btn-primary btn-block'
    

    process:

    • TXT
      turnstile: true
      
    • TWIG
      email:
          from: '{{ config.plugins.email.from }}'
          to:
              - '{{ config.plugins.email.from }}'
              - '{{ form.value.email }}'
          subject: '[Formularz Kontaktowy - Meble Na Wymiar] {{ form.value.name|e }}'
          body: '{% include ''forms/data.html.twig'' %}'
      
    • TWIG
      save:
          fileprefix: feedback-
          dateformat: Ymd-His-u
          extension: txt
          body: '{% include ''forms/data.txt.twig'' %}'
      
    • TXT
      message: 'Dziękujemy za Wiadomość!'
      
    • TXT
      display: thankyou
      

      content:
      items: '@self.modular'
      order:
      by: default
      dir: asc
      media_order: blog-header.webp
      metadata:
      description: 'Kontakt - '
      menu: Kontakt

But it doesn't work. I probably still need to correct the view file, but which one and what should I add?
I need files adapted to work with turnsite.
Help :)

3 years ago

Nobody would try to read unformatted yaml, where every whitespace matters. What you posted above, just can't work. Try to edit your post by formatting code with ```

3 years ago

I apologize you

code

YAML
---
title: 'Kontakt '
onpage_menu: false
body_classes: 'modular header-lite fullwidth'
bg_color: '#B4B093'
form:
    name: my-nice-form
    action: /kontakt
    fields:
        -
            name: name
            id: name
            label: 'UWAGA! '
            classes: 'form-control form-control-lg'
            placeholder: 'Wpisz swoje Imię'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        -
            name: email
            id: email
            classes: 'form-control form-control-lg'
            label: Email
            placeholder: 'Wpisz swój adres email'
            type: email
            validate:
                rule: email
                required: true
        -
            name: message
            label: Message
            classes: 'form-control form-control-lg'
            size: long
            placeholder: 'Napisz swoją wiadomość i podaj nr telefonu do kontaktu'
            type: textarea
            validate:
                required: true
        -
            captcha:
                type: turnstile
                theme: light
    buttons:
        -
            type: submit
            value: 'Wyślij Wiadomość'
            classes: 'btn btn-primary btn-block'
    process:
        -   
            turnstile: true
        -
            email:
                from: '{{ config.plugins.email.from }}'
                to:
                    - '{{ config.plugins.email.from }}'
                    - '{{ form.value.email }}'
                subject: '[Formularz Kontaktowy - Meble Na Wymiar] {{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
        -
            save:
                fileprefix: feedback-
                dateformat: Ymd-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
        -
            message: 'Dziękujemy za Wiadomość!'
        -
            display: thankyou
content:
    items: '@self.modular'
    order:
        by: default
        dir: asc
media_order: blog-header.webp
metadata:
    description: 'Kontakt '
menu: Kontakt
---

3 years ago

Hello,
does anyone have a turntile integrated with the Theme Deliver - form?
Help :)

3 years ago

:heavy_dollar_sign:
✅ I will pay for help with Turnstile Captcha integration.
I've had enough already. 🙏
I invite you to contact me.

3 years ago

@Zbigniew,

I will briefly describe what I did.

  1. cloundflare - turnsite
    i have site key and secret key
  2. gravcms - plugin - Form - added site and secret key.
  3. I added turnstile api.js to base.html.twig
  4. Clean Theme Deliver adds to pages : modular_alt.md

Above information is quite meaningless and can't be reproduced. A proper question should provide clear/accurate/detailed and yet succinct information (and properly formatted) that can be reproduced by the reader.

But it doesn’t work.

What tells you it doesn't work?

If a question does not provide sufficient meaningful information, the reader will simply skip the question.

3 years ago

Hello,
will anyone help?
I read, browse the forum, websites and I can't find a description of the integration.
How to properly add turnsite to Deliver.
That's why I'm even willing to pay someone to describe it nicely.
I'm waiting for volunteers.

3 years ago Solution

Regarding the solution:

  1. the form had markup error, in this version should be:

    YAML
        -
            name: captcha
            type: turnstile
            theme: light
    
  2. as reminder this must be the first entry in the process: section

YAML
    process:
        -
            turnstile: true
  1. Important set for forms in modular pages (in this case contact/_main/form.md) is missing in the Deliver Skeleton
YAML
---
cache_enable: false
---
  1. And it seems that option "Include externals in JS pipeline" should be set to false in the system config

Tip: you can use this sitekeys and secret keys for testing purposes on your localhost

last edited 02/28/23 by Vadym

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago