nov-ruby-openid 2.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +215 -0
- data/CHANGES-2.1.0 +36 -0
- data/INSTALL +47 -0
- data/LICENSE +210 -0
- data/NOTICE +2 -0
- data/README +81 -0
- data/Rakefile +98 -0
- data/UPGRADE +127 -0
- data/VERSION +1 -0
- data/contrib/google/ruby-openid-apps-discovery-1.0.gem +0 -0
- data/contrib/google/ruby-openid-apps-discovery-1.01.gem +0 -0
- data/examples/README +32 -0
- data/examples/active_record_openid_store/README +58 -0
- data/examples/active_record_openid_store/XXX_add_open_id_store_to_db.rb +24 -0
- data/examples/active_record_openid_store/XXX_upgrade_open_id_store.rb +26 -0
- data/examples/active_record_openid_store/init.rb +8 -0
- data/examples/active_record_openid_store/lib/association.rb +10 -0
- data/examples/active_record_openid_store/lib/nonce.rb +3 -0
- data/examples/active_record_openid_store/lib/open_id_setting.rb +4 -0
- data/examples/active_record_openid_store/lib/openid_ar_store.rb +57 -0
- data/examples/active_record_openid_store/test/store_test.rb +212 -0
- data/examples/discover +49 -0
- data/examples/rails_openid/README +153 -0
- data/examples/rails_openid/Rakefile +10 -0
- data/examples/rails_openid/app/controllers/application.rb +4 -0
- data/examples/rails_openid/app/controllers/consumer_controller.rb +122 -0
- data/examples/rails_openid/app/controllers/login_controller.rb +45 -0
- data/examples/rails_openid/app/controllers/server_controller.rb +265 -0
- data/examples/rails_openid/app/helpers/application_helper.rb +3 -0
- data/examples/rails_openid/app/helpers/login_helper.rb +2 -0
- data/examples/rails_openid/app/helpers/server_helper.rb +9 -0
- data/examples/rails_openid/app/views/consumer/index.rhtml +81 -0
- data/examples/rails_openid/app/views/layouts/server.rhtml +68 -0
- data/examples/rails_openid/app/views/login/index.rhtml +56 -0
- data/examples/rails_openid/app/views/server/decide.rhtml +26 -0
- data/examples/rails_openid/config/boot.rb +19 -0
- data/examples/rails_openid/config/database.yml +74 -0
- data/examples/rails_openid/config/environment.rb +54 -0
- data/examples/rails_openid/config/environments/development.rb +19 -0
- data/examples/rails_openid/config/environments/production.rb +19 -0
- data/examples/rails_openid/config/environments/test.rb +19 -0
- data/examples/rails_openid/config/routes.rb +24 -0
- data/examples/rails_openid/doc/README_FOR_APP +2 -0
- data/examples/rails_openid/public/.htaccess +40 -0
- data/examples/rails_openid/public/404.html +8 -0
- data/examples/rails_openid/public/500.html +8 -0
- data/examples/rails_openid/public/dispatch.cgi +12 -0
- data/examples/rails_openid/public/dispatch.fcgi +26 -0
- data/examples/rails_openid/public/dispatch.rb +12 -0
- data/examples/rails_openid/public/favicon.ico +0 -0
- data/examples/rails_openid/public/images/openid_login_bg.gif +0 -0
- data/examples/rails_openid/public/javascripts/controls.js +750 -0
- data/examples/rails_openid/public/javascripts/dragdrop.js +584 -0
- data/examples/rails_openid/public/javascripts/effects.js +854 -0
- data/examples/rails_openid/public/javascripts/prototype.js +1785 -0
- data/examples/rails_openid/public/robots.txt +1 -0
- data/examples/rails_openid/script/about +3 -0
- data/examples/rails_openid/script/breakpointer +3 -0
- data/examples/rails_openid/script/console +3 -0
- data/examples/rails_openid/script/destroy +3 -0
- data/examples/rails_openid/script/generate +3 -0
- data/examples/rails_openid/script/performance/benchmarker +3 -0
- data/examples/rails_openid/script/performance/profiler +3 -0
- data/examples/rails_openid/script/plugin +3 -0
- data/examples/rails_openid/script/process/reaper +3 -0
- data/examples/rails_openid/script/process/spawner +3 -0
- data/examples/rails_openid/script/process/spinner +3 -0
- data/examples/rails_openid/script/runner +3 -0
- data/examples/rails_openid/script/server +3 -0
- data/examples/rails_openid/test/functional/login_controller_test.rb +18 -0
- data/examples/rails_openid/test/functional/server_controller_test.rb +18 -0
- data/examples/rails_openid/test/test_helper.rb +28 -0
- data/lib/hmac/hmac.rb +112 -0
- data/lib/hmac/sha1.rb +11 -0
- data/lib/hmac/sha2.rb +25 -0
- data/lib/openid.rb +20 -0
- data/lib/openid/association.rb +249 -0
- data/lib/openid/consumer.rb +395 -0
- data/lib/openid/consumer/associationmanager.rb +344 -0
- data/lib/openid/consumer/checkid_request.rb +186 -0
- data/lib/openid/consumer/discovery.rb +497 -0
- data/lib/openid/consumer/discovery_manager.rb +123 -0
- data/lib/openid/consumer/html_parse.rb +134 -0
- data/lib/openid/consumer/idres.rb +523 -0
- data/lib/openid/consumer/responses.rb +148 -0
- data/lib/openid/cryptutil.rb +115 -0
- data/lib/openid/dh.rb +89 -0
- data/lib/openid/extension.rb +39 -0
- data/lib/openid/extensions/ax.rb +539 -0
- data/lib/openid/extensions/oauth.rb +91 -0
- data/lib/openid/extensions/pape.rb +179 -0
- data/lib/openid/extensions/sreg.rb +277 -0
- data/lib/openid/extensions/ui.rb +53 -0
- data/lib/openid/extras.rb +11 -0
- data/lib/openid/fetchers.rb +258 -0
- data/lib/openid/kvform.rb +136 -0
- data/lib/openid/kvpost.rb +58 -0
- data/lib/openid/message.rb +553 -0
- data/lib/openid/protocolerror.rb +8 -0
- data/lib/openid/server.rb +1544 -0
- data/lib/openid/store/filesystem.rb +271 -0
- data/lib/openid/store/interface.rb +75 -0
- data/lib/openid/store/memcache.rb +107 -0
- data/lib/openid/store/memory.rb +84 -0
- data/lib/openid/store/nonce.rb +68 -0
- data/lib/openid/trustroot.rb +349 -0
- data/lib/openid/urinorm.rb +75 -0
- data/lib/openid/util.rb +110 -0
- data/lib/openid/yadis/accept.rb +148 -0
- data/lib/openid/yadis/constants.rb +21 -0
- data/lib/openid/yadis/discovery.rb +153 -0
- data/lib/openid/yadis/filters.rb +205 -0
- data/lib/openid/yadis/htmltokenizer.rb +305 -0
- data/lib/openid/yadis/parsehtml.rb +45 -0
- data/lib/openid/yadis/services.rb +42 -0
- data/lib/openid/yadis/xrds.rb +155 -0
- data/lib/openid/yadis/xri.rb +90 -0
- data/lib/openid/yadis/xrires.rb +99 -0
- data/setup.rb +1551 -0
- data/test/data/accept.txt +124 -0
- data/test/data/dh.txt +29 -0
- data/test/data/example-xrds.xml +14 -0
- data/test/data/linkparse.txt +587 -0
- data/test/data/n2b64 +650 -0
- data/test/data/test1-discover.txt +137 -0
- data/test/data/test1-parsehtml.txt +152 -0
- data/test/data/test_discover/malformed_meta_tag.html +19 -0
- data/test/data/test_discover/openid.html +11 -0
- data/test/data/test_discover/openid2.html +11 -0
- data/test/data/test_discover/openid2_xrds.xml +12 -0
- data/test/data/test_discover/openid2_xrds_no_local_id.xml +11 -0
- data/test/data/test_discover/openid_1_and_2.html +11 -0
- data/test/data/test_discover/openid_1_and_2_xrds.xml +16 -0
- data/test/data/test_discover/openid_1_and_2_xrds_bad_delegate.xml +17 -0
- data/test/data/test_discover/openid_and_yadis.html +12 -0
- data/test/data/test_discover/openid_no_delegate.html +10 -0
- data/test/data/test_discover/openid_utf8.html +11 -0
- data/test/data/test_discover/yadis_0entries.xml +12 -0
- data/test/data/test_discover/yadis_2_bad_local_id.xml +15 -0
- data/test/data/test_discover/yadis_2entries_delegate.xml +22 -0
- data/test/data/test_discover/yadis_2entries_idp.xml +21 -0
- data/test/data/test_discover/yadis_another_delegate.xml +14 -0
- data/test/data/test_discover/yadis_idp.xml +12 -0
- data/test/data/test_discover/yadis_idp_delegate.xml +13 -0
- data/test/data/test_discover/yadis_no_delegate.xml +11 -0
- data/test/data/test_xrds/=j3h.2007.11.14.xrds +25 -0
- data/test/data/test_xrds/README +12 -0
- data/test/data/test_xrds/delegated-20060809-r1.xrds +34 -0
- data/test/data/test_xrds/delegated-20060809-r2.xrds +34 -0
- data/test/data/test_xrds/delegated-20060809.xrds +34 -0
- data/test/data/test_xrds/no-xrd.xml +7 -0
- data/test/data/test_xrds/not-xrds.xml +2 -0
- data/test/data/test_xrds/prefixsometimes.xrds +34 -0
- data/test/data/test_xrds/ref.xrds +109 -0
- data/test/data/test_xrds/sometimesprefix.xrds +34 -0
- data/test/data/test_xrds/spoof1.xrds +25 -0
- data/test/data/test_xrds/spoof2.xrds +25 -0
- data/test/data/test_xrds/spoof3.xrds +37 -0
- data/test/data/test_xrds/status222.xrds +9 -0
- data/test/data/test_xrds/subsegments.xrds +58 -0
- data/test/data/test_xrds/valid-populated-xrds.xml +39 -0
- data/test/data/trustroot.txt +153 -0
- data/test/data/urinorm.txt +79 -0
- data/test/discoverdata.rb +131 -0
- data/test/test_accept.rb +170 -0
- data/test/test_association.rb +266 -0
- data/test/test_associationmanager.rb +917 -0
- data/test/test_ax.rb +690 -0
- data/test/test_checkid_request.rb +294 -0
- data/test/test_consumer.rb +257 -0
- data/test/test_cryptutil.rb +119 -0
- data/test/test_dh.rb +86 -0
- data/test/test_discover.rb +852 -0
- data/test/test_discovery_manager.rb +262 -0
- data/test/test_extension.rb +46 -0
- data/test/test_extras.rb +35 -0
- data/test/test_fetchers.rb +565 -0
- data/test/test_filters.rb +270 -0
- data/test/test_idres.rb +963 -0
- data/test/test_kvform.rb +165 -0
- data/test/test_kvpost.rb +65 -0
- data/test/test_linkparse.rb +101 -0
- data/test/test_message.rb +1116 -0
- data/test/test_nonce.rb +89 -0
- data/test/test_oauth.rb +175 -0
- data/test/test_openid_yadis.rb +178 -0
- data/test/test_pape.rb +247 -0
- data/test/test_parsehtml.rb +80 -0
- data/test/test_responses.rb +63 -0
- data/test/test_server.rb +2457 -0
- data/test/test_sreg.rb +479 -0
- data/test/test_stores.rb +298 -0
- data/test/test_trustroot.rb +113 -0
- data/test/test_ui.rb +93 -0
- data/test/test_urinorm.rb +35 -0
- data/test/test_util.rb +145 -0
- data/test/test_xrds.rb +169 -0
- data/test/test_xri.rb +48 -0
- data/test/test_xrires.rb +63 -0
- data/test/test_yadis_discovery.rb +220 -0
- data/test/testutil.rb +127 -0
- data/test/util.rb +53 -0
- metadata +336 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>Rails OpenID Example Relying Party</title>
|
4
|
+
</head>
|
5
|
+
<style type="text/css">
|
6
|
+
* {
|
7
|
+
font-family: verdana,sans-serif;
|
8
|
+
}
|
9
|
+
body {
|
10
|
+
width: 50em;
|
11
|
+
margin: 1em;
|
12
|
+
}
|
13
|
+
div {
|
14
|
+
padding: .5em;
|
15
|
+
}
|
16
|
+
.alert {
|
17
|
+
border: 1px solid #e7dc2b;
|
18
|
+
background: #fff888;
|
19
|
+
}
|
20
|
+
.error {
|
21
|
+
border: 1px solid #ff0000;
|
22
|
+
background: #ffaaaa;
|
23
|
+
}
|
24
|
+
.success {
|
25
|
+
border: 1px solid #00ff00;
|
26
|
+
background: #aaffaa;
|
27
|
+
}
|
28
|
+
#verify-form {
|
29
|
+
border: 1px solid #777777;
|
30
|
+
background: #dddddd;
|
31
|
+
margin-top: 1em;
|
32
|
+
padding-bottom: 0em;
|
33
|
+
}
|
34
|
+
input.openid {
|
35
|
+
background: url( /images/openid_login_bg.gif ) no-repeat;
|
36
|
+
background-position: 0 50%;
|
37
|
+
background-color: #fff;
|
38
|
+
padding-left: 18px;
|
39
|
+
}
|
40
|
+
</style>
|
41
|
+
<body>
|
42
|
+
<h1>Rails OpenID Example Relying Party</h1>
|
43
|
+
<% if flash[:alert] %>
|
44
|
+
<div class='alert'>
|
45
|
+
<%= h(flash[:alert]) %>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
48
|
+
<% if flash[:error] %>
|
49
|
+
<div class='error'>
|
50
|
+
<%= h(flash[:error]) %>
|
51
|
+
</div>
|
52
|
+
<% end %>
|
53
|
+
<% if flash[:success] %>
|
54
|
+
<div class='success'>
|
55
|
+
<%= h(flash[:success]) %>
|
56
|
+
</div>
|
57
|
+
<% end %>
|
58
|
+
<% if flash[:sreg_results] %>
|
59
|
+
<div class='alert'>
|
60
|
+
<%= flash[:sreg_results] %>
|
61
|
+
</div>
|
62
|
+
<% end %>
|
63
|
+
<% if flash[:pape_results] %>
|
64
|
+
<div class='alert'>
|
65
|
+
<%= flash[:pape_results] %>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
68
|
+
<div id="verify-form">
|
69
|
+
<form method="get" accept-charset="UTF-8"
|
70
|
+
action='<%= url_for :action => 'start' %>'>
|
71
|
+
Identifier:
|
72
|
+
<input type="text" class="openid" name="openid_identifier" />
|
73
|
+
<input type="submit" value="Verify" /><br />
|
74
|
+
<input type="checkbox" name="immediate" id="immediate" /><label for="immediate">Use immediate mode</label><br/>
|
75
|
+
<input type="checkbox" name="use_sreg" id="use_sreg" /><label for="use_sreg">Request registration data</label><br/>
|
76
|
+
<input type="checkbox" name="use_pape" id="use_pape" /><label for="use_pape">Request phishing-resistent auth policy (PAPE)</label><br/>
|
77
|
+
<input type="checkbox" name="force_post" id="force_post" /><label for="force_post">Force the transaction to use POST by adding 2K of extra data</label>
|
78
|
+
</form>
|
79
|
+
</div>
|
80
|
+
</body>
|
81
|
+
</html>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<html>
|
2
|
+
<head><title>OpenID Server Example</title></head>
|
3
|
+
<style type="text/css">
|
4
|
+
* {
|
5
|
+
font-family: verdana,sans-serif;
|
6
|
+
}
|
7
|
+
body {
|
8
|
+
width: 50em;
|
9
|
+
margin: 1em;
|
10
|
+
}
|
11
|
+
div {
|
12
|
+
padding: .5em;
|
13
|
+
}
|
14
|
+
table {
|
15
|
+
margin: none;
|
16
|
+
padding: none;
|
17
|
+
}
|
18
|
+
.notice {
|
19
|
+
border: 1px solid #60964f;
|
20
|
+
background: #b3dca7;
|
21
|
+
}
|
22
|
+
.error {
|
23
|
+
border: 1px solid #ff0000;
|
24
|
+
background: #ffaaaa;
|
25
|
+
}
|
26
|
+
#login-form {
|
27
|
+
border: 1px solid #777777;
|
28
|
+
background: #dddddd;
|
29
|
+
margin-top: 1em;
|
30
|
+
padding-bottom: 0em;
|
31
|
+
}
|
32
|
+
table {
|
33
|
+
padding: 1em;
|
34
|
+
}
|
35
|
+
li {margin-bottom: .5em;}
|
36
|
+
span.openid:before {
|
37
|
+
content: url(<%= @base_url %>images/openid_login_bg.gif) ;
|
38
|
+
}
|
39
|
+
span.openid {
|
40
|
+
font-size: smaller;
|
41
|
+
}
|
42
|
+
</style>
|
43
|
+
<body>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<% if session[:username] %>
|
48
|
+
<div style="float:right;">
|
49
|
+
Welcome, <%= session[:username] %> | <%= link_to('Log out', :controller => 'login', :action => 'logout') %><br />
|
50
|
+
<span class="openid"><%= @base_url %>user/<%= session[:username] %></span>
|
51
|
+
</div>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
<h3>Ruby OpenID Server Example</h3>
|
55
|
+
|
56
|
+
<hr/>
|
57
|
+
|
58
|
+
<% if flash[:notice] or flash[:error] %>
|
59
|
+
<div class="<%= flash[:notice].nil? ? 'error' : 'notice' %>">
|
60
|
+
<%= flash[:error] or flash[:notice] %>
|
61
|
+
</div>
|
62
|
+
<% end %>
|
63
|
+
|
64
|
+
<%= @content_for_layout %>
|
65
|
+
|
66
|
+
|
67
|
+
</body>
|
68
|
+
</html>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<% if session[:username].nil? %>
|
4
|
+
|
5
|
+
<div id="login-form">
|
6
|
+
<form method="get" action="<%= url_for :controller => 'login', :action => 'submit' %>">
|
7
|
+
Type a username:
|
8
|
+
<input type="text" name="username" />
|
9
|
+
<input type="submit" value="Log In" />
|
10
|
+
</form>
|
11
|
+
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<p> Welcome to the Ruby OpenID example. This code is a starting point
|
17
|
+
for developers wishing to implement an OpenID provider or relying
|
18
|
+
party. We've used the <a href="http://rubyonrails.org/">Rails</a>
|
19
|
+
platform to demonstrate, but the library code is not Rails specific.</p>
|
20
|
+
|
21
|
+
<h2>To use the example provider</h2>
|
22
|
+
<p>
|
23
|
+
<ol>
|
24
|
+
|
25
|
+
<li>Enter a username in the form above. You will be "Logged In"
|
26
|
+
to the server, at which point you may authenticate using an OpenID
|
27
|
+
consumer. Your OpenID URL will be displayed after you log
|
28
|
+
in.<p>The server will automatically create an identity page for
|
29
|
+
you at <%= @base_url %>user/<i>name</i></p></li>
|
30
|
+
|
31
|
+
<li><p>Because WEBrick can only handle one thing at a time, you'll need to
|
32
|
+
run another instance of the example on another port if you want to use
|
33
|
+
a relying party to use with this example provider:</p>
|
34
|
+
<blockquote>
|
35
|
+
<code>script/server --port=3001</code>
|
36
|
+
</blockquote>
|
37
|
+
|
38
|
+
<p>(The RP needs to be able to access the provider, so unless you're
|
39
|
+
running this example on a public IP, you can't use the live example
|
40
|
+
at <a href="http://openidenabled.com/">openidenabled.com</a> on
|
41
|
+
your local provider.)</p>
|
42
|
+
</li>
|
43
|
+
|
44
|
+
<li>Point your browser to this new instance and follow the directions
|
45
|
+
below.</li>
|
46
|
+
<!-- Fun fact: 'url_for :port => 3001' doesn't work very well. -->
|
47
|
+
</ol>
|
48
|
+
|
49
|
+
</p>
|
50
|
+
|
51
|
+
<h2>To use the example relying party</h2>
|
52
|
+
|
53
|
+
<p>Visit <a href="<%= url_for :controller => 'consumer' %>">/consumer</a>
|
54
|
+
and enter your OpenID.</p>
|
55
|
+
</p>
|
56
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<form method="post" action="<%= url_for :controller => 'server', :action => 'decision' %>">
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr><td>Site:</td><td><%= @oidreq.trust_root %></td></tr>
|
5
|
+
|
6
|
+
<% if @oidreq.id_select %>
|
7
|
+
<tr>
|
8
|
+
<td colspan="2">
|
9
|
+
You entered the server identifier at the relying party.
|
10
|
+
You'll need to send an identifier of your choosing. Enter a
|
11
|
+
username below.
|
12
|
+
</td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td>Identity to send:</td>
|
16
|
+
<td><input type="text" name="id_to_send" size="25" /></td>
|
17
|
+
</tr>
|
18
|
+
<% else %>
|
19
|
+
<tr><td>Identity:</td><td><%= @oidreq.identity %></td></tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<input type="submit" name="yes" value="yes" />
|
24
|
+
<input type="submit" name="no" value="no" />
|
25
|
+
|
26
|
+
</form>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
2
|
+
|
3
|
+
unless defined?(RAILS_ROOT)
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
+
unless RUBY_PLATFORM =~ /mswin32/
|
6
|
+
require 'pathname'
|
7
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
8
|
+
end
|
9
|
+
RAILS_ROOT = root_path
|
10
|
+
end
|
11
|
+
|
12
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
13
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
14
|
+
else
|
15
|
+
require 'rubygems'
|
16
|
+
require 'initializer'
|
17
|
+
end
|
18
|
+
|
19
|
+
Rails::Initializer.run(:set_load_path)
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Get the fast C bindings:
|
4
|
+
# gem install mysql
|
5
|
+
# (on OS X: gem install mysql -- --include=/usr/local/lib)
|
6
|
+
# And be sure to use new-style password hashing:
|
7
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
8
|
+
development:
|
9
|
+
adapter: sqlite3
|
10
|
+
database: db/development.sqlite3
|
11
|
+
|
12
|
+
# Warning: The database defined as 'test' will be erased and
|
13
|
+
# re-generated from your development database when you run 'rake'.
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: ":memory:"
|
18
|
+
|
19
|
+
production:
|
20
|
+
adapter: mysql
|
21
|
+
database: rails_server_production
|
22
|
+
username: root
|
23
|
+
password:
|
24
|
+
socket: /path/to/your/mysql.sock
|
25
|
+
|
26
|
+
|
27
|
+
# PostgreSQL versions 7.4 - 8.1
|
28
|
+
#
|
29
|
+
# Get the C bindings:
|
30
|
+
# gem install postgres
|
31
|
+
# or use the pure-Ruby bindings on Windows:
|
32
|
+
# gem install postgres-pr
|
33
|
+
postgresql_example:
|
34
|
+
adapter: postgresql
|
35
|
+
database: rails_server_development
|
36
|
+
username: rails_server
|
37
|
+
password:
|
38
|
+
|
39
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
40
|
+
# domain socket that doesn't need configuration.
|
41
|
+
#host: remote-database
|
42
|
+
#port: 5432
|
43
|
+
|
44
|
+
# Schema search path. The server defaults to $user,public
|
45
|
+
#schema_search_path: myapp,sharedapp,public
|
46
|
+
|
47
|
+
# Character set encoding. The server defaults to sql_ascii.
|
48
|
+
#encoding: UTF8
|
49
|
+
|
50
|
+
# Minimum log levels, in increasing order:
|
51
|
+
# debug5, debug4, debug3, debug2, debug1,
|
52
|
+
# info, notice, warning, error, log, fatal, or panic
|
53
|
+
# The server defaults to notice.
|
54
|
+
#min_messages: warning
|
55
|
+
|
56
|
+
|
57
|
+
# SQLite version 2.x
|
58
|
+
# gem install sqlite-ruby
|
59
|
+
sqlite_example:
|
60
|
+
adapter: sqlite
|
61
|
+
database: db/development.sqlite2
|
62
|
+
|
63
|
+
|
64
|
+
# SQLite version 3.x
|
65
|
+
# gem install sqlite3-ruby
|
66
|
+
sqlite3_example:
|
67
|
+
adapter: sqlite3
|
68
|
+
database: db/development.sqlite3
|
69
|
+
|
70
|
+
|
71
|
+
# In-memory SQLite 3 database. Useful for tests.
|
72
|
+
sqlite3_in_memory_example:
|
73
|
+
adapter: sqlite3
|
74
|
+
database: ":memory:"
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
2
|
+
|
3
|
+
# Uncomment below to force Rails into production mode when
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
6
|
+
|
7
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
8
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
+
|
10
|
+
Rails::Initializer.run do |config|
|
11
|
+
# Settings in config/environments/* take precedence those specified here
|
12
|
+
|
13
|
+
# Skip frameworks you're not going to use
|
14
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
15
|
+
|
16
|
+
# Add additional load paths for your own custom dirs
|
17
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
18
|
+
|
19
|
+
# Force all environments to use the same logger level
|
20
|
+
# (by default production uses :info, the others :debug)
|
21
|
+
# config.log_level = :debug
|
22
|
+
|
23
|
+
# Use the database for sessions instead of the file system
|
24
|
+
# (create the session table with 'rake create_sessions_table')
|
25
|
+
# config.action_controller.session_store = :active_record_store
|
26
|
+
|
27
|
+
# Enable page/fragment caching by setting a file-based store
|
28
|
+
# (remember to create the caching directory and make it readable to the application)
|
29
|
+
# config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
|
30
|
+
|
31
|
+
# Activate observers that should always be running
|
32
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
33
|
+
|
34
|
+
# Make Active Record use UTC-base instead of local time
|
35
|
+
# config.active_record.default_timezone = :utc
|
36
|
+
|
37
|
+
# Use Active Record's schema dumper instead of SQL when creating the test database
|
38
|
+
# (enables use of different database adapters for development and test environments)
|
39
|
+
# config.active_record.schema_format = :ruby
|
40
|
+
|
41
|
+
# See Rails::Configuration for more options
|
42
|
+
end
|
43
|
+
|
44
|
+
# Add new inflection rules using the following format
|
45
|
+
# (all these examples are active by default):
|
46
|
+
# Inflector.inflections do |inflect|
|
47
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
48
|
+
# inflect.singular /^(ox)en/i, '\1'
|
49
|
+
# inflect.irregular 'person', 'people'
|
50
|
+
# inflect.uncountable %w( fish sheep )
|
51
|
+
# end
|
52
|
+
|
53
|
+
# Include your application configuration below
|
54
|
+
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_key] = '_session_id_2'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Enable the breakpoint server that script/breakpointer connects to
|
12
|
+
config.breakpoint_server = true
|
13
|
+
|
14
|
+
# Show full error reports and disable caching
|
15
|
+
config.action_controller.consider_all_requests_local = true
|
16
|
+
config.action_controller.perform_caching = false
|
17
|
+
|
18
|
+
# Don't care if the mailer can't send
|
19
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Use a different logger for distributed setups
|
8
|
+
# config.logger = SyslogLogger.new
|
9
|
+
|
10
|
+
|
11
|
+
# Full error reports are disabled and caching is turned on
|
12
|
+
config.action_controller.consider_all_requests_local = false
|
13
|
+
config.action_controller.perform_caching = true
|
14
|
+
|
15
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
16
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
17
|
+
|
18
|
+
# Disable delivery errors if you bad email addresses should just be ignored
|
19
|
+
# config.action_mailer.raise_delivery_errors = false
|