-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
executable file
·68 lines (51 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
NAME
raptcha.rb
SYNOPSIS
super low drain bamage, K.I.S.S., storage-less, session-less,
plugin-less, dependency-less, zero admin, single-source-file secure
captcha system for ruby and/or rails.
bitchin.
DESCRIPTION
raptcha manages image generation via a streaming controller. the result
is that *no* disk storage is ever needed for captcha images. it also
manages authentication via openssl(aes-256) encoded hidden fields which
are relayed through the form submission process, obviating the need for
session/database interaction for captcha validation. the library is
useful outside of rails, even from the command line.
what this means to you is that you can have a nice looking, and easy to
customize, safe captcha solution in about 1 minute that requires zero
maintenance moving forward.
see a sample image here
http://github.com/ahoward/raptcha/blob/master/images/raptcha.png
INSTALL
1) INSTALL Image Magick
~> which convert
2) COPY A SINGLE FILE INTO YOUR RAILS APP
~> cp raptcha.rb ./app/lib/
3) GENERATE THE CONROLLER
ruby lib/raptcha.rb generate controller
4) ADD A ROUTE
match 'raptcha(/:action)', :controller => 'raptcha'
5) PUT A RAPTCHA IMAGE AND FORM INPUT IN YOUR VIEW
<%= Raptcha.input %>
6) REQUIRE VALID RAPTCHA INPUT IN A CONTROLLER ACTION
class SessionsController < ApplicationController
def create
unless Raptcha.valid?(params)
# ...
end
end
end
7) TRY THE EXAMPLES LOCALLY AT
http://0.0.0.0:3000/raptcha/form
http://0.0.0.0:3000/raptcha/inline
URIS
http://github.com/ahoward/raptcha
http://codforpeople.com
COMMAND LINE USAGE
* make an image by hand
~> ruby lib/raptcha.rb image foreground:pink raptcha.png && open raptcha.png
* generate the controller
~> ruby lib/rapcha.rb generate controller
DOC
less lib/raptcha.rb