{"id":13481783,"url":"https://github.com/eymengunay/EoHoneypotBundle","last_synced_at":"2025-03-27T12:31:27.654Z","repository":{"id":8571089,"uuid":"10199786","full_name":"eymengunay/EoHoneypotBundle","owner":"eymengunay","description":"Honeypot type for Symfony forms","archived":false,"fork":false,"pushed_at":"2024-05-16T07:50:08.000Z","size":91,"stargazers_count":34,"open_issues_count":4,"forks_count":21,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-28T12:13:36.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/eymengunay/EoHoneypotBundle","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eymengunay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-21T16:02:18.000Z","updated_at":"2024-09-21T11:30:05.000Z","dependencies_parsed_at":"2022-08-07T04:16:38.573Z","dependency_job_id":"d8bf5bbf-93cd-4be3-9eef-8202fd16c35d","html_url":"https://github.com/eymengunay/EoHoneypotBundle","commit_stats":{"total_commits":60,"total_committers":15,"mean_commits":4.0,"dds":0.4666666666666667,"last_synced_commit":"03fa80dd6029ee982d55a1838fe82cc24de699a2"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eymengunay%2FEoHoneypotBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eymengunay%2FEoHoneypotBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eymengunay%2FEoHoneypotBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eymengunay%2FEoHoneypotBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eymengunay","download_url":"https://codeload.github.com/eymengunay/EoHoneypotBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222251881,"owners_count":16955922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:55.615Z","updated_at":"2024-10-30T15:31:24.129Z","avatar_url":"https://github.com/eymengunay.png","language":"PHP","funding_links":[],"categories":["Honeypots","\u003ca name=\"honeypots\"\u003e\u003c/a\u003e Honeypots","Recently Updated"],"sub_categories":["[Apr 02, 2025](/content/2025/04/02/README.md)"],"readme":"# EoHoneypotBundle\n\n[![Build Status](https://travis-ci.org/eymengunay/EoHoneypotBundle.svg?branch=master)](https://travis-ci.org/eymengunay/EoHoneypotBundle)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eymengunay/EoHoneypotBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/EoHoneypotBundle/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/eymengunay/EoHoneypotBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/EoHoneypotBundle/?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/eo/honeypot-bundle/v/stable.svg)](https://packagist.org/packages/eo/honeypot-bundle) \n[![Total Downloads](https://poser.pugx.org/eo/honeypot-bundle/downloads.svg)](https://packagist.org/packages/eo/honeypot-bundle)\n\n\nHoneypot for Symfony2 forms.\n\n## What is Honey pot?\n\u003e A honey pot trap involves creating a form with an extra field that is hidden to human visitors but readable by robots.\n\u003e The robot fills out the invisible field and submits the form, leaving you to simply ignore their spammy submission or blacklist their IP.\n\u003e It’s a very simple concept that can be implemented in a few minutes and it just works – add them to your contact and submission forms to help reduce spam.\n\n## Prerequisites\nThis version of the bundle requires Symfony 2.1+\n\n## Installation\n\n### Step 1: Download EoHoneypotBundle using Composer\nAdd EoHoneypotBundle to your project by running the command:\n```bash\n$ composer require eo/honeypot-bundle\n```\n\nComposer will install the bundle to your project's `vendor/eo` directory.\n\n### Step 2: Enable the bundle\nIf you use Symfony Flex - skip this step. Otherwise, enable the bundle in `bundles.php`:\n```php\n\u003c?php\n// config/bundles.php\n\n\u003c?php\nreturn [\n    // ...\n    Eo\\HoneypotBundle\\EoHoneypotBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n### Step 3 (optional): Configure bundle to use database\nTo save honeypot catched requests into database you have to enable it in your configuration file:\n*All parameters are optional*\n\n```yaml\n# config/packages/eo_honeypot.yaml\neo_honeypot:\n    storage:\n        database:\n            enabled: false\n            driver: mongodb # orm and mongodb are supported\n            class: ApplicationEoHoneypotBundle:HoneypotPrey\n        # You can also use file format to store honeypot preys.\n        # This may come handy if you need to parse logs with fail2ban\n        # file:\n            # enabled: false\n            # output: /var/log/honeypot.log\n    redirect:\n        enabled: true\n        url: \"/\"\n        # route: homepage\n        # route_parameters: ~\n```\n\nIf you enable the database storage, you must create a class which extends\nthe `Eo\\HoneypotBundle\\\u003cEntity|Document\u003e\\HoneypotPrey` base class :\n\n```php\n\u003c?php\nnamespace Application\\Eo\\HoneypotBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Eo\\HoneypotBundle\\Entity\\HoneypotPrey as BaseHoneypotPrey;\n\n/**\n * @ORM\\Entity\n */\nclass HoneypotPrey extends BaseHoneypotPrey\n{\n    /**\n     * @ORM\\Id\n     * @ORM\\Column(type=\"integer\")\n     * @ORM\\GeneratedValue(strategy=\"AUTO\")\n     */\n    protected $id;\n\n    public function getId()\n    {\n        return $this-\u003eid;\n    }\n}\n\n```\n\nor\n\n\n```php\n\u003c?php\nnamespace Application\\Eo\\HoneypotBundle\\Document;\n\nuse Doctrine\\ODM\\MongoDB\\Mapping\\Annotations as MongoDB;\nuse Eo\\HoneypotBundle\\Document\\HoneypotPrey as BaseHoneypotPrey;\n\n/**\n * @MongoDB\\Document\n */\nclass HoneypotPrey extends BaseHoneypotPrey\n{\n    /**\n     * @MongoDB\\Id\n     */\n    protected $id;\n\n    public function getId()\n    {\n        return $this-\u003eid;\n    }\n}\n```\n\n\n## Usage\nOnce installed and configured you can start using `Eo\\HoneypotBundle\\Form\\Type\\HoneypotType`\nform type in your forms.\n\n### Basic usage example:\n```php\n\u003c?php\n\nnamespace Acme\\DemoBundle\\Form\\Type;\n\nuse Eo\\HoneypotBundle\\Form\\Type\\HoneypotType;\nuse Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\EmailType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\n\nclass FooType extends AbstractType\n{\n    public function buildForm(FormBuilderInterface $builder, array $options)\n    {\n        $builder-\u003eadd('name', TextType);\n        $builder-\u003eadd('email', EmailType);\n\n        // Honeypot field\n        $builder-\u003eadd('SOME-FAKE-NAME', HoneypotType::class);\n    }\n}\n```\n\n### Events\n\nIf the hidden honeypot field has some data bundle will dispatch a `bird.in.cage` event. You can create an event listener to execute custom actions. See [Eo\\HoneypotBundle\\Event\\BirdInCage](https://github.com/eymengunay/EoHoneypotBundle/blob/master/Event/BirdInCageEvent.php) and [How to Register Event Listeners and Subscribers](http://symfony.com/doc/current/cookbook/doctrine/event_listeners_subscribers.html) for more information.\n\n## License\nThis bundle is under the MIT license. See the complete license in the bundle:\n```\nResources/meta/LICENSE\n```\n\n## Reporting an issue or a feature request\nIssues and feature requests related to this bundle are tracked in the Github issue tracker https://github.com/eymengunay/EoHoneypotBundle/issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feymengunay%2FEoHoneypotBundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feymengunay%2FEoHoneypotBundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feymengunay%2FEoHoneypotBundle/lists"}