{"id":30954717,"url":"https://github.com/tito10047/altcha-bundle","last_synced_at":"2026-05-29T04:01:23.634Z","repository":{"id":264435285,"uuid":"893372793","full_name":"tito10047/altcha-bundle","owner":"tito10047","description":"A Symfony bundle to help integrate ALTCHA with Symfony forms. ","archived":false,"fork":false,"pushed_at":"2026-05-19T08:39:15.000Z","size":11533,"stargazers_count":18,"open_issues_count":2,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-19T11:19:59.722Z","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/tito10047.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-24T09:13:47.000Z","updated_at":"2026-05-19T08:39:20.000Z","dependencies_parsed_at":"2025-06-03T13:54:12.134Z","dependency_job_id":"e9ecee9b-43d5-489d-bf04-6b5fb3bb4645","html_url":"https://github.com/tito10047/altcha-bundle","commit_stats":null,"previous_names":["huluti/altcha-bundle","tito10047/altcha-bundle"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/tito10047/altcha-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito10047%2Faltcha-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito10047%2Faltcha-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito10047%2Faltcha-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito10047%2Faltcha-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tito10047","download_url":"https://codeload.github.com/tito10047/altcha-bundle/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tito10047%2Faltcha-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33635961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-09-11T11:05:43.214Z","updated_at":"2026-05-29T04:01:23.623Z","avatar_url":"https://github.com/tito10047.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/tito10047/altcha-bundle)\n![Packagist License](https://img.shields.io/packagist/l/tito10047/altcha-bundle)\n![Packagist Downloads](https://img.shields.io/packagist/dt/tito10047/altcha-bundle)\n[![Tests](https://github.com/Tito10047/altcha-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/Tito10047/altcha-bundle/actions/workflows/ci.yml)\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 | 7.4 | 8.0+\n- PHP 8.2+\n- Webpack | Asset Mapper | Twig\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require tito10047/altcha-bundle\n```\n\nAdd bundle into config/bundles.php file:\n\n```php\nTito10047\\AltchaBundle\\AltchaBundle::class =\u003e ['all' =\u003e true]\n```\n\nAdd a config file:\n\n### YML\n\n`config/packages/altcha.yaml`\n\n```yml\naltcha:\n    enable: true\n    hmacSignature: '%env(APP_SECRET)%' # Replaces deprecated hmacKey\n    hmacAlgorithm: 'SHA-256'\n    hmacKeySignature: ~ # Optional signature key\n    cost: 5000\n    counter_min: 5000\n    counter_max: 10000\n    timeout: 30.0\n    floating: true\n    overlay: false\n    use_stimulus: false\n    include_script: true\n    hide_logo: false\n    hide_footer: false\n\nwhen@test:\n    altcha:\n        enable: false\n```\n\nImport bundle routes:\n\n### YML\n\n```yml\naltcha:\n    resource: '@AltchaBundle/config/routes.yml'\n    type: yaml\n```\n\n⚠️ **Important – Security Configuration**\n\nIf your application restricts access globally using a rule like:\n\n```yaml\naccess_control:\n    - { path: ^/, roles: ROLE_USER }\n```\n\nThen the Altcha challenge endpoint (`/altcha/challenge`) will also be protected by default.\n\nTo allow it to be publicly accessible (as intended for the challenge mechanism to work), **you must explicitly add the following rule before the global one**:\n\n```yaml\naccess_control:\n    - { path: ^/altcha/challenge, roles: PUBLIC_ACCESS }\n    - { path: ^/, roles: ROLE_USER }\n```\n\nThis ensures that the challenge endpoint is reachable by unauthenticated users, while keeping the rest of your app secure.\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 Tito10047\\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                // Optional: override global config\n                // 'cost' =\u003e 5000,\n                // 'timeout' =\u003e 30.0,\n                // 'counter_min' =\u003e 5000,\n                // 'counter_max' =\u003e 10000,\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 with Webpack Encore\n\n```js\n//webpack.config.js\nmodule.exports = Encore.getWebpackConfig();\nmodule.exports.resolve.alias[\"altcha/dist/i18n/all.js\"]='altcha/i18n';\n```\n```yaml\n#config/packages/altcha.yaml\naltcha:\n    use_stimulus: true\n    include_script: false\n```\n\n### Optional: usage with  UX Live components\n\nThere is only one option need to be changed to work with or UX Live component.\n\n```yml\naltcha:\n    use_stimulus: true\n    floating: false\n    include_script: false\n```\n\n### Optional: usage with Sentinel\n\nConfigure the package by providing your sentinel instance endpoint and your API key:\n\n```yml\naltcha:\n    sentinel:\n        base_url: 'http://localhost:8080'\n        api_key: 'key_xxxxxxxxxxxx'\n```\n\nActivating this configuration will have the effect to use the sentinel server to generate a new challenge and for it's verification. \nIf the sentinel instance is not reachable by the client or by the server, we will fallback on our local configuration.\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%2Ftito10047%2Faltcha-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftito10047%2Faltcha-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftito10047%2Faltcha-bundle/lists"}