nitro 0.8.0 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +3 -4
- data/ChangeLog +418 -0
- data/LICENSE +1 -1
- data/README +157 -89
- data/RELEASES +50 -0
- data/Rakefile +5 -7
- data/benchmark/nitro/bench.rb +5 -0
- data/benchmark/nitro/simple-webrick-n-200.txt +44 -0
- data/benchmark/nitro/static-webrick-n-200.txt +43 -0
- data/benchmark/nitro/tiny-lhttpd-n-200-c-5.txt +43 -0
- data/benchmark/nitro/tiny-webrick-n-200-c-5.txt +44 -0
- data/benchmark/nitro/tiny-webrick-n-200.txt +44 -0
- data/benchmark/nitro/tiny2-webrick-n-200.txt +44 -0
- data/{lib/nitro/server/cluster.rb → bin/cluster} +26 -30
- data/bin/proto/README +2 -2
- data/bin/proto/{apache.conf → conf/apache.conf} +0 -0
- data/bin/proto/conf/app.conf.rb +22 -0
- data/bin/proto/conf/lhttpd.conf +236 -0
- data/bin/proto/ctl +4 -0
- data/bin/proto/lib/README +5 -0
- data/bin/proto/log/README +3 -0
- data/bin/proto/root/fcgi.rb +6 -0
- data/bin/proto/root/index.xhtml +65 -7
- data/bin/proto/root/m/nitro.png +0 -0
- data/examples/blog/README +7 -5
- data/examples/blog/{apache.conf → conf/apache.conf} +0 -0
- data/examples/blog/conf/app.conf.rb +56 -0
- data/examples/blog/conf/lhttpd.conf +236 -0
- data/examples/blog/ctl +4 -0
- data/examples/blog/lib/blog.rb +11 -136
- data/examples/blog/lib/blog/controller.rb +99 -0
- data/examples/blog/lib/blog/model.rb +39 -0
- data/examples/blog/log/README +3 -0
- data/examples/blog/root/comments.xhtml +2 -2
- data/examples/blog/root/fcgi.rb +6 -0
- data/examples/blog/root/index.xhtml +4 -5
- data/examples/blog/root/login.xhtml +2 -2
- data/examples/blog/root/style.xsl +9 -9
- data/examples/blog/root/view_entry.xhtml +2 -2
- data/examples/flash/conf/app.conf.rb +23 -0
- data/examples/flash/ctl +4 -0
- data/examples/flash/log/README +3 -0
- data/examples/flash/root/index.xhtml +0 -9
- data/examples/flash/root/show_inline_text.xhtml +10 -5
- data/examples/no_xsl_blog/README +12 -0
- data/examples/no_xsl_blog/conf/apache.conf +0 -0
- data/examples/no_xsl_blog/conf/app.conf.rb +57 -0
- data/examples/no_xsl_blog/conf/lhttpd.conf +236 -0
- data/examples/no_xsl_blog/ctl +4 -0
- data/examples/no_xsl_blog/lib/blog.rb +20 -0
- data/examples/no_xsl_blog/lib/blog/controller.rb +102 -0
- data/examples/no_xsl_blog/lib/blog/model.rb +39 -0
- data/examples/no_xsl_blog/lib/blog/template.rb +134 -0
- data/examples/no_xsl_blog/log/README +3 -0
- data/examples/no_xsl_blog/root/comments.xhtml +41 -0
- data/examples/no_xsl_blog/root/entry_form.xhtml +22 -0
- data/examples/no_xsl_blog/root/fcgi.rb +6 -0
- data/examples/no_xsl_blog/root/index.xhtml +39 -0
- data/examples/no_xsl_blog/root/login.xhtml +21 -0
- data/examples/no_xsl_blog/root/m/bubbles.gif +0 -0
- data/examples/no_xsl_blog/root/m/comments_curve.gif +0 -0
- data/examples/no_xsl_blog/root/m/down.gif +0 -0
- data/examples/no_xsl_blog/root/m/footer_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/garrow.gif +0 -0
- data/examples/no_xsl_blog/root/m/gbull.gif +0 -0
- data/examples/no_xsl_blog/root/m/grbull.gif +0 -0
- data/examples/no_xsl_blog/root/m/h1_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/header_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/nitro.gif +0 -0
- data/examples/no_xsl_blog/root/m/obull.gif +0 -0
- data/examples/no_xsl_blog/root/m/page_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/rss.gif +0 -0
- data/examples/no_xsl_blog/root/m/side_title_bg.gif +0 -0
- data/examples/no_xsl_blog/root/m/sidebar_bg.gif +0 -0
- data/examples/no_xsl_blog/root/recent_posts.xhtml +14 -0
- data/examples/no_xsl_blog/root/style.css +301 -0
- data/examples/no_xsl_blog/root/view_entry.xhtml +25 -0
- data/examples/no_xsl_blog/root/view_entry.xml +12 -0
- data/examples/og/run.rb +2 -2
- data/examples/tiny/README +2 -2
- data/examples/tiny/conf/apache.conf +5 -0
- data/examples/tiny/conf/app.conf.rb +21 -0
- data/examples/tiny/conf/lhttpd.conf +236 -0
- data/examples/tiny/ctl +4 -0
- data/examples/tiny/log/README +3 -0
- data/examples/tiny/root/fcgi.rb +6 -0
- data/examples/tiny/root/index.xhtml +7 -4
- data/examples/tiny/root/nitro.png +0 -0
- data/lib/glue.rb +13 -9
- data/lib/glue/array.rb +1 -1
- data/lib/glue/cache.rb +1 -1
- data/lib/glue/flexob.rb +12 -0
- data/lib/glue/hash.rb +1 -1
- data/lib/glue/inflector.rb +2 -2
- data/lib/glue/logger.rb +4 -8
- data/lib/glue/misc.rb +14 -0
- data/lib/glue/number.rb +1 -1
- data/lib/glue/object.rb +26 -0
- data/lib/glue/pool.rb +1 -1
- data/lib/glue/property.rb +84 -91
- data/lib/glue/string.rb +1 -1
- data/lib/glue/time.rb +1 -1
- data/lib/glue/validation.rb +1 -1
- data/lib/nitro.rb +18 -6
- data/lib/nitro/adaptors/cgi.rb +291 -0
- data/lib/nitro/adaptors/fastcgi.rb +42 -0
- data/lib/nitro/adaptors/runner.rb +123 -0
- data/lib/nitro/adaptors/webrick.rb +110 -0
- data/lib/nitro/buffering.rb +43 -0
- data/lib/nitro/builders/form.rb +1 -1
- data/lib/nitro/builders/rss.rb +1 -1
- data/{bin → lib/nitro}/cluster.rb +26 -30
- data/lib/nitro/context.rb +82 -0
- data/lib/nitro/controller.rb +50 -0
- data/lib/nitro/cookie.rb +46 -0
- data/lib/nitro/dispatcher.rb +105 -0
- data/lib/nitro/filters.rb +9 -10
- data/lib/nitro/localization.rb +42 -0
- data/lib/nitro/mail.rb +11 -14
- data/lib/nitro/render.rb +275 -0
- data/lib/nitro/request.rb +128 -0
- data/lib/nitro/response.rb +38 -0
- data/lib/nitro/scaffold.rb +11 -11
- data/lib/nitro/session.rb +84 -0
- data/lib/nitro/{server/shaders.rb → shaders.rb} +56 -36
- data/lib/nitro/ui/pager.rb +23 -26
- data/lib/nitro/{sitemap.rb → ui/sitemap.rb} +4 -12
- data/lib/nitro/uri.rb +1 -1
- data/lib/nitro/version.rb +10 -8
- data/lib/og.rb +66 -65
- data/lib/og/backend.rb +1 -1
- data/lib/og/backends/mysql.rb +48 -52
- data/lib/og/backends/psql.rb +34 -37
- data/lib/og/connection.rb +15 -15
- data/lib/og/enchant.rb +16 -9
- data/lib/og/meta.rb +127 -54
- data/lib/og/mock.rb +18 -18
- data/lib/og/version.rb +6 -4
- data/lib/parts/content.rb +4 -8
- data/test/glue/tc_logger.rb +3 -0
- data/test/glue/tc_property.rb +19 -3
- data/test/nitro/adaptors/tc_cgi.rb +63 -0
- data/test/nitro/adaptors/tc_webrick.rb +15 -0
- data/test/nitro/builders/tc_xml.rb +2 -2
- data/test/nitro/tc_context.rb +13 -0
- data/test/nitro/tc_controller.rb +47 -0
- data/test/nitro/tc_dispatcher.rb +64 -0
- data/test/nitro/tc_session.rb +20 -0
- data/test/nitro/{tc_sitemap.rb → ui/tc_sitemap.rb} +1 -1
- data/test/root/blog/list.xhtml +6 -0
- data/test/tc_og.rb +41 -4
- metadata +115 -59
- data/bin/proto/app.rb +0 -20
- data/bin/proto/config.rb +0 -77
- data/examples/blog/app.rb +0 -21
- data/examples/blog/config.rb +0 -95
- data/examples/blog/env.rb +0 -22
- data/examples/flash/README +0 -34
- data/examples/flash/app.rb +0 -20
- data/examples/flash/config.rb +0 -38
- data/examples/flash/lib/flash.rb +0 -40
- data/examples/flash/tmp.swf +0 -0
- data/examples/tiny/app.rb +0 -19
- data/examples/tiny/config.rb +0 -29
- data/examples/tiny/root/nitro-small.png +0 -0
- data/lib/nitro/application.rb +0 -217
- data/lib/nitro/config.rb +0 -128
- data/lib/nitro/events.rb +0 -122
- data/lib/nitro/html.rb +0 -151
- data/lib/nitro/http.rb +0 -102
- data/lib/nitro/l10n.rb +0 -30
- data/lib/nitro/server.rb +0 -59
- data/lib/nitro/server/appserver.rb +0 -67
- data/lib/nitro/server/cookie.rb +0 -87
- data/lib/nitro/server/dispatcher.rb +0 -62
- data/lib/nitro/server/filters.rb +0 -75
- data/lib/nitro/server/filters/autologin.rb +0 -51
- data/lib/nitro/server/fragment.rb +0 -70
- data/lib/nitro/server/handlers.rb +0 -127
- data/lib/nitro/server/render.rb +0 -426
- data/lib/nitro/server/request.rb +0 -658
- data/lib/nitro/server/requestpart.rb +0 -54
- data/lib/nitro/server/script.rb +0 -387
- data/lib/nitro/server/server.rb +0 -57
- data/lib/nitro/server/session.rb +0 -220
- data/lib/nitro/server/user.rb +0 -46
- data/lib/nitro/server/webrick.rb +0 -180
- data/lib/nitro/service.rb +0 -26
- data/lib/xsl/ui.xsl +0 -51
- data/lib/xsl/xforms.xsl +0 -28
- data/test/nitro/server/tc_cookie.rb +0 -34
- data/test/nitro/server/tc_filters.rb +0 -38
- data/test/nitro/server/tc_request.rb +0 -70
- data/test/nitro/server/tc_requestpart.rb +0 -28
- data/test/nitro/server/tc_session.rb +0 -34
- data/test/nitro/tc_events.rb +0 -44
- data/test/nitro/tc_html.rb +0 -79
- data/test/nitro/tc_http.rb +0 -18
@@ -0,0 +1,39 @@
|
|
1
|
+
# * George Moschovitis <gm@navel.gr>
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
+
# $Id$
|
4
|
+
|
5
|
+
require 'parts/content'
|
6
|
+
|
7
|
+
# The models used in the Blog part.
|
8
|
+
|
9
|
+
# Forward reference to the Comment definition.
|
10
|
+
|
11
|
+
class Comment; end
|
12
|
+
|
13
|
+
# Common properties/methods for the other classes.
|
14
|
+
# Since markup is required, automatically handles
|
15
|
+
# the markup expanding/compacting for the body.
|
16
|
+
|
17
|
+
module Common
|
18
|
+
include N::BaseContent
|
19
|
+
include N::CreateTime
|
20
|
+
|
21
|
+
prop_accessor :author, String
|
22
|
+
validate_value :body
|
23
|
+
end
|
24
|
+
|
25
|
+
# An entry in the Blog.
|
26
|
+
|
27
|
+
class BlogEntry
|
28
|
+
include Common
|
29
|
+
has_many :comments, Comment, :linkback => 'entry_oid'
|
30
|
+
validate_value :title, :msg => 'Please provide a title'
|
31
|
+
end
|
32
|
+
|
33
|
+
# A comment to the blog entry.
|
34
|
+
|
35
|
+
class Comment
|
36
|
+
include Common
|
37
|
+
belongs_to :entry, BlogEntry
|
38
|
+
validate_value :author, :msg => 'Please enter your name'
|
39
|
+
end
|
@@ -11,7 +11,7 @@ if comments = @entry.comments
|
|
11
11
|
#{comment.body}
|
12
12
|
<div class="footer">
|
13
13
|
by #{comment.author} at #{comment.create_time.strftime('%R %p')}
|
14
|
-
<?r if session[
|
14
|
+
<?r if session[:owner] ?>
|
15
15
|
[<a href="del_comment?oid=#{comment.oid}">del</a>]
|
16
16
|
<?r end ?>
|
17
17
|
</div>
|
@@ -26,7 +26,7 @@ no comments.
|
|
26
26
|
<input type="hidden" name="entry_oid" value="#{@entry.oid}" />
|
27
27
|
<p>
|
28
28
|
<b>Your name:</b><br />
|
29
|
-
<input type="text" name="author" value="#{session[
|
29
|
+
<input type="text" name="author" value="#{session[:username]}" />
|
30
30
|
<x:error attr="author" />
|
31
31
|
<x:error attr="title" />
|
32
32
|
</p>
|
@@ -3,7 +3,6 @@
|
|
3
3
|
<x:page xmlns:x="http://www.navel.gr/xml/shader.xsd">
|
4
4
|
|
5
5
|
<x:cell id="main">
|
6
|
-
|
7
6
|
<?r
|
8
7
|
if @entries
|
9
8
|
for entry in @entries
|
@@ -16,7 +15,7 @@
|
|
16
15
|
<div class="footer">
|
17
16
|
posted by #{entry.author} at <a href="view_entry?oid=#{entry.oid}">#{entry.create_time.strftime('%R %p')}</a> |
|
18
17
|
<a href="view_entry?oid=#{entry.oid}#comments">#{entry.comments_count} comments</a>.
|
19
|
-
<?r if session[
|
18
|
+
<?r if session[:owner] ?>
|
20
19
|
[<a href="del_entry?oid=#{entry.oid}">del</a>]
|
21
20
|
<?r end ?>
|
22
21
|
</div>
|
@@ -34,14 +33,14 @@
|
|
34
33
|
<div class="clear">.</div>
|
35
34
|
</div>
|
36
35
|
|
37
|
-
<?r if session[
|
38
|
-
<
|
36
|
+
<?r if session[:owner] ?>
|
37
|
+
<render href="entry_form" />
|
39
38
|
<?r end ?>
|
40
39
|
|
41
40
|
</x:cell>
|
42
41
|
|
43
42
|
<x:cell id="side">
|
44
|
-
<
|
43
|
+
<render href="recent_posts" />
|
45
44
|
</x:cell>
|
46
45
|
|
47
46
|
</x:page>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<p>
|
8
8
|
Please login as an author by entering the blog password.
|
9
9
|
<br />
|
10
|
-
The password is: <b
|
10
|
+
The password is: <b>#{Blog.password}</b>.
|
11
11
|
</p>
|
12
12
|
|
13
13
|
<div class="error">#@error</div>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<form action="login" method="post">
|
16
16
|
<p>
|
17
17
|
<b>Password:</b><br />
|
18
|
-
<input type="password" name="password" value="
|
18
|
+
<input type="password" name="password" value="#{Blog.password}" />
|
19
19
|
</p>
|
20
20
|
<input type="submit" value="Login" />
|
21
21
|
</form>
|
@@ -7,7 +7,7 @@ code:
|
|
7
7
|
* George Moschovitis <gm@navel.gr>
|
8
8
|
|
9
9
|
(c) 2004 Navel, all rights reserved.
|
10
|
-
$Id: style.xsl
|
10
|
+
$Id: style.xsl 225 2005-01-27 12:35:07Z gmosx $
|
11
11
|
-->
|
12
12
|
|
13
13
|
<!DOCTYPE shader
|
@@ -31,7 +31,7 @@ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
|
|
31
31
|
|
32
32
|
<xsl:template name="x:head">
|
33
33
|
<head>
|
34
|
-
<title
|
34
|
+
<title>#{@context.conf.name}</title>
|
35
35
|
<meta name="title" content="Blog" />
|
36
36
|
<meta name="description" content="Example" />
|
37
37
|
<meta name="keywords" content="nitro, example, blog" />
|
@@ -41,17 +41,17 @@ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
|
|
41
41
|
|
42
42
|
<xsl:apply-templates select="x:block[@id='meta']"/>
|
43
43
|
|
44
|
-
<base href="
|
44
|
+
<base href="#{@context.host_url}/" />
|
45
45
|
<link href="/style.css" rel="stylesheet" type="text/css" media="screen" />
|
46
|
-
<link rel="alternate" type="application/rss+xml" title="Latest Entries" href="
|
47
|
-
<link rel="alternate" type="application/rss+xml" title="Latest Comments" href="
|
46
|
+
<link rel="alternate" type="application/rss+xml" title="Latest Entries" href="#{@context.host_url}/xml/list_entry" />
|
47
|
+
<link rel="alternate" type="application/rss+xml" title="Latest Comments" href="#{@context.host_url}/xml/list_comment" />
|
48
48
|
<xsl:apply-templates select="x:cell[@id='head']"/>
|
49
49
|
</head>
|
50
50
|
</xsl:template>
|
51
51
|
|
52
52
|
<xsl:template name="x:header">
|
53
53
|
<div id="header">
|
54
|
-
<h1><a href="/"
|
54
|
+
<h1><a href="/">#{@context.conf.name}</a></h1>
|
55
55
|
</div>
|
56
56
|
</xsl:template>
|
57
57
|
|
@@ -90,7 +90,7 @@ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
|
|
90
90
|
This is a simple blog powered by <a href="http://www.navel.gr/nitro">
|
91
91
|
Nitro</a> Web Engine. Have a look at the source code and enjoy
|
92
92
|
the power of Ruby.
|
93
|
-
<ruby>unless session[
|
93
|
+
<ruby>unless session[:owner]</ruby>
|
94
94
|
<p><a href="login">Login</a> as owner.</p>
|
95
95
|
<ruby>else</ruby>
|
96
96
|
<p><a href="logout">Logout</a>.</p>
|
@@ -109,8 +109,8 @@ $Id: style.xsl 194 2004-12-20 20:23:57Z gmosx $
|
|
109
109
|
|
110
110
|
<br />
|
111
111
|
<ul class="rss">
|
112
|
-
<li><a href="
|
113
|
-
<li><a href="
|
112
|
+
<li><a href="xml/list_entry">Latest entries</a></li>
|
113
|
+
<li><a href="xml/list_comment">Latest comments</a></li>
|
114
114
|
</ul>
|
115
115
|
|
116
116
|
<br />
|
@@ -11,7 +11,7 @@
|
|
11
11
|
#{@entry.body}
|
12
12
|
<div class="footer">
|
13
13
|
posted by gmosx at #{@entry.create_time.strftime('%R %p')}
|
14
|
-
<?r if session[
|
14
|
+
<?r if session[:owner] ?>
|
15
15
|
[<a href="del_entry?oid=#{@entry.oid}">del</a>]
|
16
16
|
<?r end ?>
|
17
17
|
</div>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<div id="comments">
|
22
|
-
<
|
22
|
+
<render href="comments" />
|
23
23
|
</div>
|
24
24
|
|
25
25
|
<p><a href="/">Home</a></p>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# * George Moschovitis <gm@navel.gr>
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
+
# $Id$
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
|
6
|
+
|
7
|
+
$DBG = true
|
8
|
+
|
9
|
+
require 'ostruct'
|
10
|
+
|
11
|
+
require 'nitro'
|
12
|
+
|
13
|
+
include N
|
14
|
+
|
15
|
+
dispatcher = Dispatcher.new
|
16
|
+
|
17
|
+
conf = {
|
18
|
+
:host => 'localhost',
|
19
|
+
:port => 8080,
|
20
|
+
:dispatcher => dispatcher,
|
21
|
+
}
|
22
|
+
|
23
|
+
$conf = OpenStruct.new(conf)
|
data/examples/flash/ctl
ADDED
@@ -4,15 +4,6 @@
|
|
4
4
|
|
5
5
|
<h1>Dynamic flash generation.</h1>
|
6
6
|
|
7
|
-
<p>
|
8
|
-
<h3>Implemented as an action</h3>
|
9
|
-
<form name="t1" action="show_text">
|
10
|
-
Enter some text here:<br />
|
11
|
-
<input type="text" name="text" /><br />
|
12
|
-
<input type="submit" />
|
13
|
-
</form>
|
14
|
-
</p>
|
15
|
-
|
16
7
|
<p>
|
17
8
|
<h3>Implemented inline in the template action</h3>
|
18
9
|
<form name="t1" action="show_inline_text">
|
@@ -1,12 +1,17 @@
|
|
1
1
|
<?xml version="1.0"?>
|
2
2
|
|
3
|
-
<!--
|
4
|
-
This template is transormed to a template inside the FlashService.
|
5
|
-
-->
|
6
3
|
<root>
|
7
4
|
<?r
|
8
|
-
|
9
|
-
|
5
|
+
require 'ming/ming'
|
6
|
+
m = SWFMovie.new
|
7
|
+
f = SWFBrowserFont.new('_serif')
|
8
|
+
t = SWFTextField.new
|
9
|
+
t.set_font(f)
|
10
|
+
t.add_string(@contexts['text'])
|
11
|
+
m.add(t)
|
12
|
+
@context.response_headers['Content-Type'] = 'application/x-shockwave-flash'
|
13
|
+
m.save('tmp.swf')
|
14
|
+
@out = File.read('tmp.swf')
|
10
15
|
?>
|
11
16
|
</root>
|
12
17
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= No XSL Blog
|
2
|
+
|
3
|
+
A this is a simple version of the blog example. This
|
4
|
+
version does not use XSLT so it is easier to get this
|
5
|
+
up and running (especially on Windows).
|
6
|
+
|
7
|
+
For configuration and startup instructions, please
|
8
|
+
have a look at examples/blog/README. At the very
|
9
|
+
least you shold configure the database username/password.
|
10
|
+
|
11
|
+
When running on windows, the database binaries should
|
12
|
+
be in the PATH.
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# * George Moschovitis <gm@navel.gr>
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
3
|
+
# $Id$
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
6
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
|
7
|
+
|
8
|
+
$DBG = true
|
9
|
+
|
10
|
+
require 'ostruct'
|
11
|
+
|
12
|
+
require 'nitro'
|
13
|
+
require 'glue/validation'
|
14
|
+
require 'og'
|
15
|
+
|
16
|
+
require 'blog'
|
17
|
+
|
18
|
+
include N
|
19
|
+
=begin
|
20
|
+
og = Og::Database.new(
|
21
|
+
:address => 'localhost',
|
22
|
+
:backend => 'mysql',
|
23
|
+
:database => 'blog',
|
24
|
+
:user => 'root',
|
25
|
+
:password => 'navelrulez',
|
26
|
+
:connection_count => 3
|
27
|
+
)
|
28
|
+
=end
|
29
|
+
|
30
|
+
og = Og::Database.new(
|
31
|
+
:address => 'localhost',
|
32
|
+
:backend => 'psql',
|
33
|
+
:database => 'blog',
|
34
|
+
:user => 'postgres',
|
35
|
+
:password => 'navelrulez',
|
36
|
+
:connection_count => 3
|
37
|
+
)
|
38
|
+
|
39
|
+
controllers = {
|
40
|
+
:index => BlogController
|
41
|
+
}
|
42
|
+
|
43
|
+
apis = {
|
44
|
+
:xml => 'text/xml'
|
45
|
+
}
|
46
|
+
|
47
|
+
dispatcher = Dispatcher.new(controllers, apis)
|
48
|
+
|
49
|
+
conf = {
|
50
|
+
:name => 'Blog sans XSLT',
|
51
|
+
:host => 'localhost',
|
52
|
+
:port => 8080,
|
53
|
+
:dispatcher => dispatcher,
|
54
|
+
:og => og
|
55
|
+
}
|
56
|
+
|
57
|
+
$conf = OpenStruct.new(conf)
|
@@ -0,0 +1,236 @@
|
|
1
|
+
# lighttpd configuration file
|
2
|
+
# $Id$
|
3
|
+
|
4
|
+
############ Options you really have to take care of ####################
|
5
|
+
|
6
|
+
## modules to load
|
7
|
+
# at least mod_access and mod_accesslog should be loaded
|
8
|
+
# all other module should only be loaded if really neccesary
|
9
|
+
# - saves some time
|
10
|
+
# - saves memory
|
11
|
+
|
12
|
+
server.modules = (
|
13
|
+
"mod_rewrite",
|
14
|
+
# "mod_redirect",
|
15
|
+
"mod_access",
|
16
|
+
# "mod_auth",
|
17
|
+
# "mod_status",
|
18
|
+
"mod_fastcgi",
|
19
|
+
# "mod_simple_vhost",
|
20
|
+
# "mod_evhost",
|
21
|
+
# "mod_cgi",
|
22
|
+
# "mod_compress",
|
23
|
+
# "mod_ssi",
|
24
|
+
# "mod_usertrack",
|
25
|
+
# "mod_rrdtool",
|
26
|
+
"mod_accesslog"
|
27
|
+
)
|
28
|
+
|
29
|
+
## a static document-root, for virtual-hosting take look at the
|
30
|
+
## server.virtual-* options
|
31
|
+
server.document-root = "/home/gmosx/navel/nitro/examples/no_xsl_blog/root/"
|
32
|
+
|
33
|
+
## where to send error-messages to
|
34
|
+
server.errorlog = "/home/gmosx/navel/nitro/examples/no_xsl_blog/log/lighttpd.error.log"
|
35
|
+
|
36
|
+
# files to check for if .../ is requested
|
37
|
+
server.indexfiles = ( "index.html" )
|
38
|
+
|
39
|
+
# mimetype mapping
|
40
|
+
mimetype.assign = (
|
41
|
+
".pdf" => "application/pdf",
|
42
|
+
".sig" => "application/pgp-signature",
|
43
|
+
".spl" => "application/futuresplash",
|
44
|
+
".class" => "application/octet-stream",
|
45
|
+
".ps" => "application/postscript",
|
46
|
+
".torrent" => "application/x-bittorrent",
|
47
|
+
".dvi" => "application/x-dvi",
|
48
|
+
".gz" => "application/x-gzip",
|
49
|
+
".pac" => "application/x-ns-proxy-autoconfig",
|
50
|
+
".swf" => "application/x-shockwave-flash",
|
51
|
+
".tar.gz" => "application/x-tgz",
|
52
|
+
".tgz" => "application/x-tgz",
|
53
|
+
".tar" => "application/x-tar",
|
54
|
+
".zip" => "application/zip",
|
55
|
+
".mp3" => "audio/mpeg",
|
56
|
+
".m3u" => "audio/x-mpegurl",
|
57
|
+
".wma" => "audio/x-ms-wma",
|
58
|
+
".wax" => "audio/x-ms-wax",
|
59
|
+
".ogg" => "audio/x-wav",
|
60
|
+
".wav" => "audio/x-wav",
|
61
|
+
".gif" => "image/gif",
|
62
|
+
".jpg" => "image/jpeg",
|
63
|
+
".jpeg" => "image/jpeg",
|
64
|
+
".png" => "image/png",
|
65
|
+
".xbm" => "image/x-xbitmap",
|
66
|
+
".xpm" => "image/x-xpixmap",
|
67
|
+
".xwd" => "image/x-xwindowdump",
|
68
|
+
".css" => "text/css",
|
69
|
+
".html" => "text/html",
|
70
|
+
".htm" => "text/html",
|
71
|
+
".js" => "text/javascript",
|
72
|
+
".asc" => "text/plain",
|
73
|
+
".c" => "text/plain",
|
74
|
+
".conf" => "text/plain",
|
75
|
+
".text" => "text/plain",
|
76
|
+
".txt" => "text/plain",
|
77
|
+
".dtd" => "text/xml",
|
78
|
+
".xml" => "text/xml",
|
79
|
+
".mpeg" => "video/mpeg",
|
80
|
+
".mpg" => "video/mpeg",
|
81
|
+
".mov" => "video/quicktime",
|
82
|
+
".qt" => "video/quicktime",
|
83
|
+
".avi" => "video/x-msvideo",
|
84
|
+
".asf" => "video/x-ms-asf",
|
85
|
+
".asx" => "video/x-ms-asf",
|
86
|
+
".wmv" => "video/x-ms-wmv"
|
87
|
+
)
|
88
|
+
|
89
|
+
# Use the "Content-Type" extended attribute to obtain mime type if possible
|
90
|
+
# mimetypes.use-xattr = "enable"
|
91
|
+
|
92
|
+
#### accesslog module
|
93
|
+
accesslog.filename = "/home/gmosx/navel/nitro/examples/no_xsl_blog/log/access.log"
|
94
|
+
|
95
|
+
## deny access the file-extensions
|
96
|
+
#
|
97
|
+
# ~ is for backupfiles from vi, emacs, joe, ...
|
98
|
+
# .inc is often used for code includes which should in general not be part
|
99
|
+
# of the document-root
|
100
|
+
url.access-deny = ( "~", ".inc" )
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
######### Options that are good to be but not neccesary to be changed #######
|
105
|
+
|
106
|
+
## bind to port (default: 80)
|
107
|
+
server.port = 8080
|
108
|
+
|
109
|
+
## bind to localhost (default: all interfaces)
|
110
|
+
#server.bind = "grisu.home.kneschke.de"
|
111
|
+
|
112
|
+
## error-handler for status 404
|
113
|
+
#server.error-handler-404 = "/error-handler.html"
|
114
|
+
#server.error-handler-404 = "/error-handler.php"
|
115
|
+
|
116
|
+
## to help the rc.scripts
|
117
|
+
# server.pid-file = "/var/run/lighttpd.pid"
|
118
|
+
|
119
|
+
|
120
|
+
###### virtual hosts
|
121
|
+
##
|
122
|
+
## If you want name-based virtual hosting add the next three settings and load
|
123
|
+
## mod_simple_vhost
|
124
|
+
##
|
125
|
+
## document-root =
|
126
|
+
## virtual-server-root + virtual-server-default-host + virtual-server-docroot or
|
127
|
+
## virtual-server-root + http-host + virtual-server-docroot
|
128
|
+
##
|
129
|
+
#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
|
130
|
+
#simple-vhost.default-host = "grisu.home.kneschke.de"
|
131
|
+
#simple-vhost.document-root = "/pages/"
|
132
|
+
|
133
|
+
|
134
|
+
##
|
135
|
+
## Format: <errorfile-prefix><status>.html
|
136
|
+
## -> ..../status-404.html for 'File not found'
|
137
|
+
#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
|
138
|
+
|
139
|
+
## virtual directory listings
|
140
|
+
#server.dir-listing = "enable"
|
141
|
+
|
142
|
+
## send unhandled HTTP-header headers to error-log
|
143
|
+
#debug.dump-unknown-headers = "enable"
|
144
|
+
|
145
|
+
### only root can use these options
|
146
|
+
#
|
147
|
+
# chroot() to directory (default: no chroot() )
|
148
|
+
#server.chroot = "/"
|
149
|
+
|
150
|
+
## change uid to <uid> (default: don't care)
|
151
|
+
#server.username = "wwwrun"
|
152
|
+
|
153
|
+
## change uid to <uid> (default: don't care)
|
154
|
+
#server.groupname = "wwwrun"
|
155
|
+
|
156
|
+
#### compress module
|
157
|
+
#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
|
158
|
+
#compress.filetype = ("text/plain", "text/html")
|
159
|
+
|
160
|
+
#### fastcgi module
|
161
|
+
## read fastcgi.txt for more info
|
162
|
+
fastcgi.server = ( ".rb" =>
|
163
|
+
( "localhost" =>
|
164
|
+
(
|
165
|
+
"socket" => "/tmp/nitro-fcgi.socket",
|
166
|
+
"bin-path" => "/home/gmosx/navel/nitro/examples/no_xsl_blog/root/fcgi.rb"
|
167
|
+
)
|
168
|
+
)
|
169
|
+
)
|
170
|
+
|
171
|
+
#### CGI module
|
172
|
+
#cgi.assign = ( ".pl" => "/usr/bin/perl",
|
173
|
+
# ".cgi" => "/usr/bin/perl" )
|
174
|
+
#
|
175
|
+
|
176
|
+
#### SSL engine
|
177
|
+
#ssl.engine = "enable"
|
178
|
+
#ssl.pemfile = "server.pem"
|
179
|
+
|
180
|
+
#### status module
|
181
|
+
# status.status-url = "/server-status"
|
182
|
+
# status.config-url = "/server-config"
|
183
|
+
|
184
|
+
#### auth module
|
185
|
+
## read authentification.txt for more info
|
186
|
+
# auth.backend = "plain"
|
187
|
+
# auth.backend.plain.userfile = "lighttpd.user"
|
188
|
+
# auth.backend.plain.groupfile = "lighttpd.group"
|
189
|
+
|
190
|
+
# auth.backend.ldap.hostname = "localhost"
|
191
|
+
# auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
|
192
|
+
# auth.backend.ldap.filter = "(uid=$)"
|
193
|
+
|
194
|
+
# auth.require = ( "/server-status" =>
|
195
|
+
# (
|
196
|
+
# "method" => "digest",
|
197
|
+
# "realm" => "download archiv",
|
198
|
+
# "require" => "group=www|user=jan|host=192.168.2.10"
|
199
|
+
# ),
|
200
|
+
# "/server-info" =>
|
201
|
+
# (
|
202
|
+
# "method" => "digest",
|
203
|
+
# "realm" => "download archiv",
|
204
|
+
# "require" => "group=www|user=jan|host=192.168.2.10"
|
205
|
+
# )
|
206
|
+
# )
|
207
|
+
|
208
|
+
#### url handling modules (rewrite, redirect, access)
|
209
|
+
|
210
|
+
url.rewrite = (
|
211
|
+
"^/([\/\-_a-zA-Z0-9]+)?$" => "/fcgi.rb",
|
212
|
+
"^/([\/\-_a-zA-Z0-9]+)?\?([\-_a-zA-Z0-9=;&%]*)$" => "/fcgi.rb?$2"
|
213
|
+
)
|
214
|
+
|
215
|
+
# url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
|
216
|
+
|
217
|
+
#
|
218
|
+
# define a pattern for the host url finding
|
219
|
+
# %% => % sign
|
220
|
+
# %0 => domain name + tld
|
221
|
+
# %1 => tld
|
222
|
+
# %2 => domain name without tld
|
223
|
+
# %3 => subdomain 1 name
|
224
|
+
# %4 => subdomain 2 name
|
225
|
+
#
|
226
|
+
# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
|
227
|
+
|
228
|
+
#### expire module
|
229
|
+
# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
|
230
|
+
|
231
|
+
#### ssi
|
232
|
+
# ssi.extension = ( ".shtml" )
|
233
|
+
|
234
|
+
#### rrdtool
|
235
|
+
# rrdtool.binary = "/usr/bin/rrdtool"
|
236
|
+
# rrdtool.db-name = "/var/www/lighttpd.rrd"
|