
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
A Google-style captcha for enterprise Rails apps
script/plugin install git://github.com/winton/captcha.git
Captcha::Config.new( # Used for filename cipher :password => 'something-unique', # Captcha colors :colors => { :background => '#FFFFFF', :font => '#080288' }, # Number of captcha images to generate :count => RAILS_ENV == 'production' ? 500 : 10, # Where to write captchas :destination => "#{RAILS_ROOT}/public/images/captchas", # Generate new batch every day :generate_every => 24 * 60 * 60 )
See lib/captcha/config.rb
for more options.
class ApplicationController < ActionController::Base acts_as_captcha end
You may now use the reset_captcha
method in any controller.
class User < ActiveRecord::Base acts_as_captcha :base => "base error when captcha fails", :field => "field error when captcha fails" end
With no parameters, a default error is added to the "captcha" field (:field => true
).
Specify :base => true
to use a default error for base.
<img src="/images/captchas/<%= session[:captcha] %>.jpg" /> <%= text_field_tag(:captcha) %>
user = User.new user.known_captcha = session[:captcha] user.captcha = params[:captcha] user.save reset_captcha
0 0 * * * cd /path/to/rails/app && /usr/bin/rake RAILS_ENV=production captcha:generate
Your config file sets the captcha refresh period. The rake task just checks if its time to repopulate, and does so if necessary.
FAQs
Unknown package
We found that winton-captcha demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.