Security Settings
Configure security features including email verification, CAPTCHA, and Terms of Service.
Breadcrumb: System Configuration > Security Settings
Overview
Security Settings control authentication and fraud prevention features:
Email verification for new accounts
Google reCAPTCHA protection
Terms of Service content
Spam and bot prevention
These settings help protect your panel from abuse while ensuring legitimate users can register and use your services.
Settings Overview
Require Email Verification
Select
✓
Email verification requirement level
Google CAPTCHA Verification
Boolean
✓
Enable reCAPTCHA on forms
Google CAPTCHA Site Key
Text
✓
reCAPTCHA site key (public)
Google CAPTCHA Secret Key
Secret
✓
reCAPTCHA secret key (private)
Terms of Service
Twig
✓
ToS page content
Note: Security settings are only configurable via Admin Panel, not the CLI wizard.
Configuration via Admin Panel
All security settings are managed through the Admin Panel.
Access Security Settings
Log in to the Admin Panel
Navigate to Settings in the main menu
Click Security
Update values
Click Save
Setting Details
Require Email Verification
Setting Code: require_email_verification Field Type: Select (Dropdown) Required: Yes Default: disabled
Control email verification requirements for new user registrations.
Available Options:
disabled
No verification
Users can log in immediately after registration
optional
Verification encouraged
Users can log in, but receive reminders to verify
required
Verification mandatory
Users must verify email before accessing panel
Option Details:
Disabled:
Optional:
Required:
Verification Flow (when Optional or Required):
User registers account
Email sent with verification link
User clicks link in email
Email address verified
Access granted (if Required) or reminder dismissed (if Optional)
Best Practices:
Use "Required" If:
You want to prevent spam accounts
Need guaranteed valid email addresses
Require strong account security
Want to reduce bot registrations
Have reliable email delivery
Use "Optional" If:
Want balance between security and UX
Encourage verification without blocking access
Building trust gradually with users
Have other anti-abuse measures
Use "Disabled" If:
Using alternative verification (SMS, manual approval)
Want fastest possible onboarding
Have strong anti-abuse systems in place
Testing/development environment
Target audience may not have email access
Considerations:
Requires working SMTP configuration (see Email Settings)
Users may not check spam folder
Verification links typically expire after 24 hours
Provide easy resend verification option
Consider email deliverability to common providers
Impact on User Experience:
Required: Adds friction but ensures quality
Optional: Gentle reminder without blocking
Disabled: Smooth onboarding, potential for abuse
Google CAPTCHA Verification
Setting Code: google_captcha_verification Field Type: Boolean (Toggle) Required: No Default: false
Enable Google reCAPTCHA on registration and login forms.
When Enabled:
CAPTCHA displayed on forms
Prevents automated bot submissions
Reduces spam registrations
Protects against brute force
When Disabled:
No CAPTCHA challenge
Faster form submission
Better user experience
More vulnerable to bots
Protected Forms:
User registration
Login page
Password reset
Contact forms (if applicable)
reCAPTCHA Versions:
PteroCA supports Google reCAPTCHA v2 (checkbox).
Setup Required:
Create Google reCAPTCHA account
Register your site
Get Site Key and Secret Key
Configure in Security Settings
Test CAPTCHA display
See Google reCAPTCHA Setup below for details.
Google CAPTCHA Site Key
Setting Code: google_captcha_site_key Field Type: Text Required: Only if CAPTCHA enabled Default: None
Your Google reCAPTCHA site key (public key).
Format:
Purpose:
Identifies your site to Google
Embedded in HTML
Public (visible in page source)
Obtaining Site Key:
Visit https://www.google.com/recaptcha/admin
Click "Register a new site" or "+"
Fill in site information:
Label: Your panel name
reCAPTCHA type: reCAPTCHA v2 → "I'm not a robot" Checkbox
Domains: Add your domain(s)
panel.example.comlocalhost(for testing)
Accept Terms of Service
Click Submit
Copy Site Key
Multiple Domains: Add all domains where panel is accessible:
Security:
Public key, safe to expose
Specific to your domains
Cannot be used on other sites (by Google enforcement)
Google CAPTCHA Secret Key
Setting Code: google_captcha_secret_key Field Type: Secret (Password) Required: Only if CAPTCHA enabled Default: None
Your Google reCAPTCHA secret key (private key).
Format:
Purpose:
Verifies CAPTCHA response on server
Kept secret
Never exposed to clients
Obtaining Secret Key:
Follow same steps as Site Key above. Secret Key is shown alongside Site Key in reCAPTCHA admin console.
Security:
Keep absolutely confidential
Never commit to version control
Store in environment variables if possible
Rotate if compromised
Verification Process:
User solves CAPTCHA
Google returns response token
PteroCA sends token + secret key to Google
Google validates and responds
PteroCA allows/denies form submission
Terms of Service
Setting Code: terms_of_service Field Type: Twig Template (Textarea) Required: No Default: None
Content for your Terms of Service page.
Purpose:
Legal protection
User agreement
Service conditions
Liability disclaimers
Format:
Supports HTML formatting for rich content.
HTML Example:
Best Practices:
Consult Legal Counsel:
ToS is legal document
Seek professional advice
Ensure compliance with local laws
Cover Key Topics:
Account terms
Payment and refunds
Service availability
Acceptable use
Limitation of liability
Privacy policy reference
Governing law
Contact information
Keep Updated:
Review and update regularly
Notify users of changes
Include "Last Updated" date
Make Accessible:
Link in footer
Show during registration
Easy to find and read
Use Clear Language:
Avoid excessive legal jargon
Break into sections
Use headings and lists
Legal Considerations:
Depending on your jurisdiction, you may need to cover:
GDPR compliance (EU)
CCPA compliance (California)
Data retention policies
Cookie usage
Age restrictions
Intellectual property
Dispute resolution
Checkbox on Registration:
PteroCA displays ToS with acceptance checkbox during registration:
User cannot register without checking this box.
Google reCAPTCHA Setup
Complete guide to setting up Google reCAPTCHA.
Step 1: Create reCAPTCHA Account
Visit https://www.google.com/recaptcha/admin
Sign in with Google account
You'll see reCAPTCHA Admin Console
Step 2: Register Your Site
Click "+" or "Register a new site"
Configuration:
Label:
reCAPTCHA type:
Select: reCAPTCHA v2
Choose: "I'm not a robot" Checkbox
Domains: Add all domains (one per line):
Owners:
Add email addresses of admins
They can manage reCAPTCHA settings
Accept reCAPTCHA Terms of Service:
☑ Accept
Submit
Step 3: Copy Keys
After registration, you'll see:
Copy both keys.
Step 4: Configure in PteroCA
Navigate to Settings → Security
Enable "Google CAPTCHA Verification"
Paste Site Key
Paste Secret Key
Save
Step 5: Test CAPTCHA
Log out of panel
Go to registration page
Verify reCAPTCHA checkbox appears
Complete registration with CAPTCHA
Verify it works
Troubleshooting reCAPTCHA
CAPTCHA not appearing:
Check JavaScript errors in browser console
Verify Site Key is correct
Clear browser cache
Check domain is registered in Google Admin
"Invalid site key" error:
Verify Site Key (not Secret Key) in HTML
Check domain matches registered domain
Ensure reCAPTCHA type matches (v2)
CAPTCHA validation fails:
Verify Secret Key is correct
Check server can reach Google APIs
Verify no firewall blocking
Test with different network
Rate limiting:
Google may rate limit if:
Too many requests from same IP
Suspicious activity detected
Solution: Wait and retry, or contact Google support.
Best Practices
Email Verification
Clear Communication:
Explain verification is required
Provide resend option
Set reasonable expiration (24-48 hours)
Email Deliverability:
Ensure SMTP is configured correctly
Check spam folders
Use verified sender domain
Fallback Options:
Manual verification by admin
Support contact for issues
Alternative verification methods
CAPTCHA Implementation
Balance Security vs UX:
Use on high-risk forms only
Consider invisible reCAPTCHA for better UX
Don't overuse
Accessibility:
Provide audio alternative
Ensure keyboard navigation
Consider accessibility guidelines
Monitor Effectiveness:
Track bot registration attempts
Adjust if needed
Consider rate limiting as alternative
Terms of Service
Legal Review:
Have lawyer review
Ensure compliance
Update when laws change
User Understanding:
Write clearly
Use headings
Highlight key points
Version Control:
Keep historical versions
Log when users accepted
Notify of major changes
Troubleshooting
Email Verification Issues
Problem: Verification emails not received
Causes:
Email configuration broken
Spam filtering
Invalid email address
Email send rate limiting
Solutions:
Test Email Settings:
Settings → Email → Test SMTP Connection
Send test email
Check Spam Folder:
Instruct users to check spam
Whitelist sender address
Resend Verification:
Provide resend button
Check rate limiting
Manual Verification:
Admin can verify users manually
User Management → Edit User → Verify Email
Problem: Verification link expired
Cause: Default expiration is 24 hours
Solutions:
Resend verification email
User requests new link
Admin manually verifies
CAPTCHA Problems
Problem: CAPTCHA not loading
Causes:
Google reCAPTCHA API blocked
JavaScript errors
Adblockers
Network issues
Solutions:
Check Browser Console:
F12 → Console
Look for errors
Disable Adblockers:
Some block reCAPTCHA
Whitelist your domain
Test Different Browser:
Rule out browser-specific issues
Check Firewall:
Ensure access to www.google.com/recaptcha
Port 443 must be open
Problem: "Invalid site key" error
Cause: Site Key mismatch or domain not registered
Solutions:
Verify Site Key:
Check for typos
Ensure using Site Key (not Secret)
Check Domain Registration:
Google Admin Console
Add current domain
Clear Cache:
Browser cache
Application cache
Problem: CAPTCHA validation fails
Cause: Secret Key incorrect or server cannot reach Google
Solutions:
Verify Secret Key:
Check for typos
Regenerate if needed
Test Google API Access:
Check Server Firewall:
Allow outbound HTTPS to google.com
Terms of Service Issues
Problem: ToS page blank
Cause: Content not set
Solution:
Navigate to Settings → Security
Add Terms of Service content
Save
Problem: Twig syntax error
Cause: Invalid Twig template
Solutions:
Check HTML Syntax:
Verify properly closed tags
Validate HTML structure
Test Content:
Start with simple HTML
Test display after changes
Problem: ToS checkbox not appearing
Cause: JavaScript or template issue
Solutions:
Check Browser Console:
Look for JavaScript errors
Clear Cache:
Verify Template:
Check registration template
Related Settings
General Settings - Site title, branding
Email Settings - Email verification delivery
Access Control - User permissions
Additional Resources
Google reCAPTCHA - Official reCAPTCHA site
reCAPTCHA Documentation - Developer docs
GDPR Compliance - EU data protection
Terms of Service Generator - ToS template tool
Twig Documentation - Template syntax
Security Best Practices - Additional security guides
Last updated