{"id":22535970,"url":"https://github.com/huluti/altcha-bundle","last_synced_at":"2025-04-09T19:09:49.767Z","repository":{"id":264435285,"uuid":"893372793","full_name":"Huluti/altcha-bundle","owner":"Huluti","description":"A Symfony bundle to help integrate ALTCHA with Symfony forms. ","archived":false,"fork":false,"pushed_at":"2025-03-20T14:49:21.000Z","size":112,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T19:09:43.247Z","etag":null,"topics":["altcha","captcha","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Huluti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2024-11-24T09:13:47.000Z","updated_at":"2025-03-20T14:49:07.000Z","dependencies_parsed_at":"2025-02-10T18:38:18.482Z","dependency_job_id":null,"html_url":"https://github.com/Huluti/altcha-bundle","commit_stats":null,"previous_names":["huluti/altcha-bundle"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huluti%2Faltcha-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huluti%2Faltcha-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huluti%2Faltcha-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huluti%2Faltcha-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Huluti","download_url":"https://codeload.github.com/Huluti/altcha-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094992,"owners_count":21046770,"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":["altcha","captcha","symfony","symfony-bundle"],"created_at":"2024-12-07T10:09:17.115Z","updated_at":"2025-04-09T19:09:49.754Z","avatar_url":"https://github.com/Huluti.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"A simple package to help integrate ALTCHA on Symfony Form.\n======================\n\n![Packagist Version](https://img.shields.io/packagist/v/huluti/altcha-bundle)\n![Packagist License](https://img.shields.io/packagist/l/huluti/altcha-bundle)\n![Packagist Downloads](https://img.shields.io/packagist/dt/huluti/altcha-bundle)\n\nThis packages integrates [ALTCHA](https://altcha.org/), a privacy-friendly Captcha alternative, with Symfony forms.\nSimply add an `AltchaType` field to your form and this package will automatically check the challenge issue. \n\n\u003e ALTCHA uses a proof-of-work mechanism to protect your website, APIs, and online services from spam and unwanted content.\n\u003e \n\u003eUnlike other solutions, ALTCHA is free, open-source and self-hosted, does not use cookies nor fingerprinting, does not track users, and is fully compliant with GDPR.\n\u003e\n\u003e Say goodbye to tedious puzzle-solving and improve your website's UX by integrating a fully automated proof-of-work mechanism.\n\n## Support\n\n- Symfony 6.4+\n- PHP 8.1+\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require huluti/altcha-bundle\n```\n\nAdd bundle into config/bundles.php file :\n\n```php\nHuluti\\AltchaBundle\\HulutiAltchaBundle::class =\u003e ['all' =\u003e true]\n```\n\nAdd a config file `config/packages/huluti_altcha.php`: \n\n```php\nuse Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;\n\nreturn static function (ContainerConfigurator $containerConfigurator): void {\n    $containerConfigurator-\u003eextension('huluti_altcha', [\n        'enable' =\u003e true,\n        'hmacKey' =\u003e 'RANDOM_SECRET_KEY',\n        'floating' =\u003e true,\n        'use_stimulus' =\u003e false,\n        'hide_logo' =\u003e false,\n        'hide_footer' =\u003e false\n    ]);\n\n    if ('test' === $containerConfigurator-\u003eenv()) {\n        // Disable captcha in test environment\n        $containerConfigurator-\u003eextension('huluti_altcha', [\n            'enable' =\u003e false,\n        ]);\n    }\n};\n```\n\nImport bundle routes:\n\n```php\n$routingConfigurator-\u003eimport('@HulutiAltchaBundle/config/routes.yml');\n```\n\n### Use with your Symfony Form\n\nCreate a form type and insert an AltchaType to add the captcha: \n\n```php\n\u003c?php\n\nnamespace App\\Form;\n\nuse App\\Entity\\Contact;\nuse Huluti\\AltchaBundle\\Type\\AltchaType;\nuse Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\SubmitType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\TextareaType;\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\nuse Symfony\\Component\\OptionsResolver\\OptionsResolver;\n\nclass ContactType extends AbstractType\n{\n    public function buildForm(FormBuilderInterface $builder, array $options): void\n    {\n        $builder\n            -\u003eadd('name', TextType::class, ['label' =\u003e false, 'attr' =\u003e ['placeholder' =\u003e 'name']])\n            -\u003eadd('message', TextareaType::class, ['label' =\u003e false, 'attr' =\u003e ['placeholder' =\u003e 'message']])\n            -\u003eadd('security', AltchaType::class, [\n                'label' =\u003e false,\n                \"floating\" =\u003e true,\n                \"hide_logo\" =\u003e false,\n                \"hide_footer\" =\u003e false,\n            ])\n            -\u003eadd('submit', SubmitType::class)\n        ;\n    }\n\n    public function configureOptions(OptionsResolver $resolver): void\n    {\n        $resolver-\u003esetDefaults([\n            'data_class' =\u003e Contact::class,\n        ]);\n    }\n}\n```\n\n### Use inside UX Live component\n\nAsset mapper is required to use this package in the UX Live component.\n\n```composer require symfony/asset-mapper```\n\n```php\nuse Symfony\\Component\\DependencyInjection\\Loader\\Configurator\\ContainerConfigurator;\n\nreturn static function (ContainerConfigurator $containerConfigurator): void {\n    $containerConfigurator-\u003eextension('huluti_altcha', [\n        'enable' =\u003e true,\n        'hmacKey' =\u003e 'RANDOM_SECRET_KEY',\n        'floating' =\u003e false,\n        'use_stimulus' =\u003e true\n    ]);\n};\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuluti%2Faltcha-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuluti%2Faltcha-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuluti%2Faltcha-bundle/lists"}