|
1 |
| -# Project Title |
| 1 | +# Laravel Block Bots |
2 | 2 |
|
3 |
| -One Paragraph of project description goes here |
4 | 3 |
|
5 |
| -## Getting Started |
| 4 | +[![Latest Version on Packagist][ico-version]][link-packagist] |
| 5 | +[![Software License][ico-license]](LICENSE.md) |
| 6 | +[![Total Downloads][ico-downloads]][link-downloads] |
6 | 7 |
|
7 |
| -These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. |
8 | 8 |
|
9 |
| -### Prerequisites |
| 9 | +## Introduction |
| 10 | +Laravel Block bots is a pacakge that block bad crawlers, people trying to scrape your website or high-usage users, but lets good and important crawlers such as GoogleBot and Bing pass-thu. |
10 | 11 |
|
11 |
| -What things you need to install the software and how to install them |
12 | 12 |
|
13 |
| -``` |
14 |
| -Give examples |
15 |
| -``` |
| 13 | +## Features |
| 14 | +- ULTRA fast, less than 1ms increase in each request. |
| 15 | +- Verify Crawlers using reverse DNS |
| 16 | +- Highly configurable |
| 17 | +- Redirect users to a page when they got blocked |
| 18 | +- Allow Logged users to always bypass blocks |
16 | 19 |
|
17 |
| -### Installing |
18 | 20 |
|
19 |
| -A step by step series of examples that tell you how to get a development env running |
20 | 21 |
|
21 |
| -Say what the step will be |
| 22 | +## Install |
22 | 23 |
|
| 24 | +Via Composer |
| 25 | +``` bash |
| 26 | +composer require potelo/laravel-block-bots |
23 | 27 | ```
|
24 |
| -Give the example |
25 |
| -``` |
| 28 | +#### Requirement |
| 29 | +- This package rely on heavly on Redis. To use it, make sure that Redis is configured and ready. (see [Laravel Redis Configuration](https://laravel.com/docs/5.6/redis#configuration)) |
| 30 | + |
26 | 31 |
|
27 |
| -And repeat |
| 32 | +#### Before Laravel 5.5 |
| 33 | +In Laravel 5.4. you'll manually need to register the `\Potelo\LaravelBlockBots\BlockBots::class` service provider in `config/app.php`. |
28 | 34 |
|
| 35 | +#### Config |
| 36 | +To adjust the library, you can publish the config file to your project using: |
29 | 37 | ```
|
30 |
| -until finished |
| 38 | +php artisan vendor:publish --provider="\Potelo\LaravelBlockBots\BlockBotsServiceProvider" |
31 | 39 | ```
|
32 | 40 |
|
33 |
| -End with an example of getting some data out of the system or using it for a little demo |
34 |
| - |
35 |
| -## Running the tests |
36 |
| - |
37 |
| -Explain how to run the automated tests for this system |
38 |
| - |
39 |
| -### Break down into end to end tests |
40 |
| - |
41 |
| -Explain what these tests test and why |
| 41 | +## Usage |
42 | 42 |
|
| 43 | +It's simple. Go to `Kernel.php` and add to the `$routeMiddleware` block as : |
43 | 44 | ```
|
44 |
| -Give an example |
| 45 | +protected $routeMiddleware = [ |
| 46 | + ... |
| 47 | + 'block' => \Potelo\LaravelBlockBots\BlockBots::class, |
| 48 | + ]; |
45 | 49 | ```
|
46 | 50 |
|
47 |
| -### And coding style tests |
| 51 | +Than you can put in the desired groups. For exemple, lets set to the Wrb group: |
48 | 52 |
|
49 |
| -Explain what these tests test and why |
50 |
| - |
51 |
| -``` |
52 |
| -Give an example |
53 | 53 | ```
|
54 | 54 |
|
55 |
| -## Deployment |
| 55 | + protected $middlewareGroups = [ |
| 56 | + 'web' => [ |
| 57 | + ... |
| 58 | + \App\Http\Middleware\VerifyCsrfToken::class, |
| 59 | + 'block:100,/limit' |
| 60 | + ], |
| 61 | +``` |
56 | 62 |
|
57 |
| -Add additional notes about how to deploy this on a live system |
| 63 | +Where: |
| 64 | +- **100**: is the number of pages an IP can access every day |
| 65 | +- **/limit**: Is the route we going to redirect the IP after the limit |
58 | 66 |
|
59 |
| -## Built With |
60 | 67 |
|
61 |
| -* [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used |
62 |
| -* [Maven](https://maven.apache.org/) - Dependency Management |
63 |
| -* [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds |
| 68 | +## Change log |
64 | 69 |
|
65 |
| -## Contributing |
| 70 | +Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. |
66 | 71 |
|
67 |
| -Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us. |
68 | 72 |
|
69 |
| -## Versioning |
70 |
| - |
71 |
| -We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). |
| 73 | +## Contributing |
72 | 74 |
|
73 |
| -## Authors |
| 75 | +Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details. |
74 | 76 |
|
75 |
| -* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth) |
| 77 | +## Credits |
76 | 78 |
|
77 |
| -See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. |
| 79 | +- [Potelo][link-author] |
78 | 80 |
|
79 | 81 | ## License
|
80 | 82 |
|
81 |
| -This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details |
82 |
| - |
83 |
| -## Acknowledgments |
| 83 | +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
84 | 84 |
|
85 |
| -* Hat tip to anyone whose code was used |
86 |
| -* Inspiration |
87 |
| -* etc |
| 85 | +[ico-version]: https://img.shields.io/packagist/v/potelo/laravel-block-bots.svg?style=flat-square |
| 86 | +[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square |
| 87 | +[ico-downloads]: https://img.shields.io/packagist/dt/potelo/laravel-block-bots.svg?style=flat-square |
88 | 88 |
|
| 89 | +[link-packagist]: https://packagist.org/packages/potelo/laravel-block-bots |
| 90 | +[link-downloads]: https://packagist.org/packages/potelo/laravel-block-bots |
| 91 | +[link-author]: https://github.com/potelo |
0 commit comments