Skip to content

cakephp-bakeoff/checkpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Configuration

Add config/Bakeoff/Checkpoint.php to your main application.

  • Set enable to true.
  • Set routes to array containing routes you need. Each route here contains the usual CakePHP route elements. Default to no routes (effectively plugin is disabled).
  • Set adapter to use a custom adapter. Default to Honeypot in config/bootstrap.php
  • Set statusCode if you want to serve checkpoint with a specific HTTP status code. Default 200. When monitoring access logs, can be useful to tell which requests had been stopped and which were later allowed.

Example:

<?php

return [
    'Bakeoff/Checkpoint' => [ // Must match the name of this plugin
        'enable' => true,

        // Matching on all routes
        'routes' => true,
        // Matching on specific routes
        'routes' => [
            // Enable for specific plugin
            ['plugin' => 'MyPlugin'],
            // Enable for specific route params
            ['prefix' => 'foo', 'controller' => 'bar', 'action' => 'qux'],
            // Enable for specific route by name
            ['_name' => 'MyPlugin:Articles:View'],
        ],

        // Leave empty to use default adapter
        'adapter' => null,
        // Use specific class as adapter
        'adapter' => '\My\Namespace\Controller\CustomAdapterController',

        // Serve checkpoint with a specific HTTP status code
        'statusCode' => 202,
        /*
         * 202 Accepted. The request subject to processing, and
         * depending on the results it may be disallowed.
         * developers.google.com/crawling/docs/troubleshooting/http-status-codes#2xx-success
         */
    ],
];

About

Simple CakePHP anti-bot challenge

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Contributors