Browse Source

[docs] fix typos, add some details, add rewrite_raw action

personal/stbuehler/wip
Stefan Bühler 8 years ago
parent
commit
e168e0653c
  1. 5
      doc/compile.rb
  2. 5
      doc/mod_cache_disk_etag.xml
  3. 2
      doc/mod_deflate.xml
  4. 5
      doc/mod_fastcgi.xml
  5. 18
      doc/mod_memcached.xml
  6. 16
      doc/mod_progress.xml
  7. 12
      doc/mod_rewrite.xml
  8. 14
      doc/mod_secdownload.lua.xml
  9. 12
      doc/mod_userdir.xml
  10. 4
      src/modules/mod_rewrite.c

5
doc/compile.rb

@ -6,6 +6,11 @@ require 'nokogiri'
require 'bluecloth'
require 'redcloth'
# find all options, actions, setups in the c modules - can be used to check list for completeness (although it doesn't scan the lua modules):
# awk '/static const liPluginOption/, /;/ {print; }' src/*/*.c | grep '"' | cut -d'"' -f2 | perl -e 'print sort <>;'
# awk '/static const liPluginAction/, /;/ {print; }' src/*/*.c | grep '"' | cut -d'"' -f2 | perl -e 'print sort <>;'
# awk '/static const liPluginSetup/, /;/ {print; }' src/*/*.c | grep '"' | cut -d'"' -f2 | perl -e 'print sort <>;'
HTML_TEMPLATE='''
<!DOCTYPE html>
<html>

5
doc/mod_cache_disk_etag.xml

@ -8,12 +8,13 @@
*Hint:*
Use a cron-job like the following to remove old cached data, e.g. in crontab daily:
<pre>
find /var/cache/lighttpd/cache_etag/ -type f -mtime +2 -exec rm -r {} \;
find /var/cache/lighttpd/cache_etag/ -type f -mtime +2 -exec rm -r {} \;
</pre>
*Hint:*
Have a look at mod_deflate to see this module in action.
Have a look at "mod_deflate":mod_deflate.html#mod_deflate to see this module in action.
</textile>
</description>

2
doc/mod_deflate.xml

@ -39,7 +39,7 @@
<section title="Notes">
<textile>
*Important*: As deflate; waits for the response headers, you must handle the request before it (see below how to check whether the request is handled).
*Important*: As @deflate;@ waits for the response headers, you must handle the request before it (see below how to check whether the request is handled).
If the request is not handled, you will get a "500 - Internal error" and a message in the error.log.
Does not compress:

5
doc/mod_fastcgi.xml

@ -34,4 +34,9 @@
</config>
</example>
</action>
<option name="fastcgi.log_plain_errors">
<short>whether to prepend timestamp and other info to FastCGI stderr lines in the "backend" log</short>
<default><value>false</value></default>
</option>
</module>

18
doc/mod_memcached.xml

@ -3,7 +3,7 @@
<short>caches content on memcached servers</short>
<description>
<textile>
<textile><![CDATA[
@lookup@ tries to find data associated with the key, and returns it as http body with status 200 if it finds something.
@store@ stores a http body (generated by another backend) in memcached.
@ -14,7 +14,7 @@
The other way is to purge the keys in your dynamic backend; you can set the memcached content from your backend too, which probably is faster than @memcached.store@.
If the key is longer than 255 bytes or contains characters outside the range 0x21 - 0x7e we will use a hash of it instead (for now sha1, but that may change).
</textile>
]]></textile>
</description>
<action name="memcached.lookup">
@ -41,7 +41,7 @@
</action>
<action name="memcached.store">
<short>searches the content in a memcached database</short>
<short>stores the generated respone in a memcached database</short>
<parameter name="options">
<table>
<entry name="server">
@ -67,7 +67,7 @@
</action>
<example>
<config>
<config><![CDATA[
setup {
module_load "mod_memcached";
}
@ -81,12 +81,12 @@
static;
memcached.store ["key" => "%{req.scheme}://%{req.host}%{req.path}"];
});
</config>
]]></config>
</example>
<section title="lua API" anchor="#">
<textile>
Exports a lua api to per-worker luaStates too (for use in lua.handler):
<section title="Lua API" anchor="#">
<textile><![CDATA[
mod_memcached exports a Lua API to per-worker @luaState@s too (for use in lua.handler):
@memcached.new(address)@ creates a new connection; a connection provides:
* @req = con:get(key, cb | vr)@
@ -103,6 +103,6 @@
* @ttl@
* @cas@
* @data@
</textile>
]]></textile>
</section>
</module>

16
doc/mod_progress.xml

@ -3,7 +3,7 @@
<short>track connection progress (state) via a unique identifier</short>
<description>
<textile>
<textile><![CDATA[
mod_progress lets you track connection progress (or rather state) using a lookup table in which connections are registered via a random unique identifier specified with the request.
It is most commonly used to implement progress bars for file uploads.
@ -13,7 +13,7 @@
A live demonstration of a progress bar implementation can be seen at http://demo.lighttpd.net/progress/
Check the sourcecode there for further insight.
</textile>
]]></textile>
</description>
@ -29,12 +29,12 @@
<parameter name="methods" />
<default><value>("POST")</value></default>
<example>
<config>
<config><![CDATA[
setup {
module_load "mod_progress";
progress.methods ("PUT", "POST");
}
</config>
]]></config>
</example>
</option>
@ -48,7 +48,7 @@
<short>(optional) output format, one of "legacy", "json" or "jsonp". Defaults to "json".</short>
</parameter>
<description>
<textile>
<textile><![CDATA[
Output formats:
* legacy: @new Object({"state": "running"", "received": 123456, "sent": 0, "request_size": 200000, "response_size": 0})@
* json: @{"state": "running", "received": 123456, "sent": 0, "request_size": 200000, "response_size": 0}@
@ -65,18 +65,18 @@
@received@, @request_size@, @sent@ and @response_size@ are only available if @state@ is @"running"@ or @"done"@.
@status@ is only available if @state@ is @"error"@.
</textile>
]]></textile>
</description>
<example>
<config>
<config><![CDATA[
setup {
module_load "mod_progress";
}
if req.path == "/upload.php" { progress.track; }
if req.path == "/progress" { progress.show; }
</config>
]]></config>
</example>
</action>

12
doc/mod_rewrite.xml

@ -75,6 +75,18 @@
</example>
</action>
<action name="rewrite_raw">
<short>modify request path and querystring, matching raw path</short>
<parameter name="rule">
<short>a simple target string or one rule, mapping a regular expression to a target string, or a list of rules.</short>
</parameter>
<description>
<textile>
Similar to "@rewrite@":mod_rewrite.html#mod_rewrite__action_rewrite, but matches the raw path (i.e. the path before URL decoding and sanitizing).
</textile>
</description>
</action>
<option name="rewrite.debug">
<short>enable debug output</short>
<default><value>false</value></default>

14
doc/mod_secdownload.lua.xml

@ -3,13 +3,13 @@
<short>protects files with a time limited code</short>
<section title="Install">
<textile>
<textile><![CDATA[
By default distributions (and @make install@) should provide the necessary files; but you can always find them in the "contrib":http://git.lighttpd.net/lighttpd/lighttpd2.git/tree/contrib folder:
* @secdownload.lua@
* @secdownload__secdownload.lua@
That way you can modify them for your own needs if you have to (although it is recommended to change the names of the files and the actions, so you don't get conflicts).
</textile>
]]></textile>
</section>
<action name="secdownload">
@ -31,19 +31,19 @@
</table>
</parameter>
<description>
<textile>
The @prefix@ is not used to build the filename; include it manually in the @document-root@ (works like @"alias":plugin_core.html#plugin_core__action_alias "/prefix" => "/docroot").
<textile><![CDATA[
The @prefix@ is not used to build the filename; include it manually in the @document-root@ (works like @alias "/prefix" => "/docroot"@, see "@alias@":plugin_core.html#plugin_core__action_alias).
secdownload doesn't actually handle the (valid) request, it just provides the mapping to a filename (and rejects invalid requests).
</textile>
]]></textile>
</description>
<example>
<config>
<config><![CDATA[
setup {
module_load "mod_lua";
lua.plugin "secdownload.lua";
}
secdownload [ "prefix" => "/sec/", "document-root" => "/secret/path", "secret" => "abc", "timeout" => 600 ];
</config>
]]></config>
</example>
</action>

12
doc/mod_userdir.xml

@ -3,10 +3,10 @@
<short>allows you to have user-specific document roots being accessed through http://domain/~user/</short>
<description>
<textile>
<textile><![CDATA[
The document root can be built by using the home directory of a user which is specified by /~username/ at the beginning of the request path.
Alternatively, mod_userdir can build the docroot from a pattern similar to @vhost.pattern@ but using the username instead of the hostname.
</textile>
]]></textile>
</description>
<action name="userdir">
@ -20,8 +20,8 @@
Otherwise the @path@ specifies the absolute docroot to be used.
Placeholders are:
* @*@ replaced by the complete username
* $1-9 replaced by the n-th letter of the username, e.g. $2 is the second letter
* @*@ is replaced by the complete username
* @$1@-@$9@ are replaced by the n-th letter of the username, e.g. @$2@ is the second letter
Examples:
@ -38,13 +38,13 @@
]]></textile>
</description>
<example>
<config>
<config><![CDATA[
setup {
module_load "mod_userdir";
}
userdir "public_html";
</config>
]]></config>
</example>
</action>
</module>

4
src/modules/mod_rewrite.c

@ -1,10 +1,6 @@
/*
* mod_rewrite - modify request path and querystring with support for regular expressions
*
* Todo:
* - implement rewrite_optimized which reorders rules according to hitcount
* - implement rewrite_raw which uses the raw uri
*
* Authors:
* Copyright (c) 2009 Thomas Porzelt
* Copyright (c) 2010 Stefan Bühler

Loading…
Cancel
Save