{"id":14969841,"url":"https://github.com/evgeniradev/captchah","last_synced_at":"2025-07-25T09:42:36.916Z","repository":{"id":35075587,"uuid":"203891117","full_name":"evgeniradev/captchah","owner":"evgeniradev","description":"A Rails captcha gem that attempts to determine whether or not a user is human.","archived":false,"fork":false,"pushed_at":"2022-12-21T14:20:04.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T05:02:16.243Z","etag":null,"topics":["captcha","rails","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/evgeniradev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-22T23:57:50.000Z","updated_at":"2023-05-09T02:39:46.000Z","dependencies_parsed_at":"2023-01-15T13:18:53.013Z","dependency_job_id":null,"html_url":"https://github.com/evgeniradev/captchah","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evgeniradev%2Fcaptchah","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evgeniradev%2Fcaptchah/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evgeniradev%2Fcaptchah/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evgeniradev%2Fcaptchah/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evgeniradev","download_url":"https://codeload.github.com/evgeniradev/captchah/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250371894,"owners_count":21419682,"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":["captcha","rails","ruby","ruby-on-rails"],"created_at":"2024-09-24T13:42:28.870Z","updated_at":"2025-04-23T04:32:10.491Z","avatar_url":"https://github.com/evgeniradev.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Captchah\n\nA Rails captcha gem that attempts to determine whether or not a user is human.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```\ngem 'captchah'\n```\n\nAnd execute:\n\n```\n$ bundle\n```\n\n## Requirements\n\nImageMagick or GraphicsMagick command-line tool has to be installed. You can check if you have it installed by running:\n\n```\n$ convert -version\n```\n\n## Dependencies\n\n```\ngem 'rails', '~\u003e 5'\n```\n\n```\ngem 'mini_magick', '~\u003e 4.0'\n```\n\n## Usage\n\nInclude the Captchah module into your controller. Example:\n\n```\nclass YourController \u003c ApplicationController\n  include Captchah\n```\n\nAdd the captchah_tag form helper to your form. Note, only 1 captchah_tag per form is allowed. Example:\n\n```\n\u003c%= form_tag('/your-path') do %\u003e\n  \u003c%= captchah_tag %\u003e\n```\n\nNote, the gem uses the 'Verdana' font to create the puzzle image. If the font is missing from your system, please install it, or specify a different one as the 'puzzle_font' argument shown below. To see what fonts are available to ImageMagick, you can run:\n\n```\n$ convert -list font\n```\n\nOnce a user submits your form, you can verify if they have typed in the correct characters by calling the verify_captchah method inside your controller. Example:\n\n```\nclass YourController \u003c ApplicationController\n  include Captchah\n\n  def create\n    redirect_to('/your-path') unless verify_captchah == :valid\n  end\n```\n\n## Details\n\nThe captchah_tag form helper accepts the following arguments:\n```\ncaptchah_tag(\n  id: 'unique-id',           # String value                     Default: (automatically generated)\n  difficulty: 3,             # Integer value between 1 and 5    Default: 3\n  expiry: 10.minutes,        # ActiveSupport::Duration object   Default: 10.minutes\n  width: 140,                # Integer value                    Default: 140(pixels)\n  action_label: 'Type...',   # String value                     Default: 'Type the letters you see:'\n  reload_label: 'Reload',    # String value                     Default: 'Reload'\n  reload_max: 5,             # Integer value                    Default: 5\n  reload: true,              # Boolean value                    Default: true\n  css: true,                 # Boolean value                    Default: true\n  csp_nonce: 'csp-id',       # String value                     Default: nil\n  required: true,            # Boolean value                    Default: false\n  puzzle_font: 'Verdana'     # String value                     Default: 'Verdana'\n)\n```\n\nThe verify_captchah method returns the following statuses:\n```\n:valid                          # The user has typed in the correct characters.\n:invalid                        # The user has not typed in the correct characters.\n:expired                        # The captcha has expired.\n:no_params                      # params[:captchah] is empty.\n```\n\n## Running the tests\n\n```\n$ bundle exec rspec\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/evgeniradev/captchah](https://github.com/evgeniradev/captchah).\n\n## License\n\nCaptchah is released under the MIT License. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgeniradev%2Fcaptchah","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevgeniradev%2Fcaptchah","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgeniradev%2Fcaptchah/lists"}