Reorganize configuration variables, now all settings can be customized from initrc.local and the default initrc documents the available options
This commit is contained in:
parent
e286d4c57b
commit
bcd3d0e1b4
@ -1,24 +1,6 @@
|
||||
#!/usr/local/plan9/bin/rc
|
||||
path=(. ./bin $PLAN9/bin /bin/ /usr/bin)
|
||||
|
||||
uri = `{echo -n $REQUEST_URI | sed -e 's/\?.*//; s/[^a-zA-Z0-9_+\-\/\.]//g; s/\.\.*/./g;' -e '1q'}
|
||||
ifs='/' {
|
||||
args = `{echo -n $uri}
|
||||
}
|
||||
cd ..
|
||||
|
||||
# default config
|
||||
formatter=markdown.pl
|
||||
formatter=md_cache # markdown cacher
|
||||
site=$SERVER_NAME
|
||||
sitedir=sites/$site
|
||||
headers=inc/headers.tpl
|
||||
template=_default
|
||||
sidebar=sidebar
|
||||
baseuri=http://$site/
|
||||
for(i in siteTitle siteSubTitle title extraHeaders)
|
||||
$i = ''
|
||||
|
||||
|
||||
# Useful functions
|
||||
fn dprint {
|
||||
@ -242,13 +224,35 @@ dprint $body
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn genbody {
|
||||
# Actually execute request
|
||||
$handler $handler_args
|
||||
}
|
||||
|
||||
|
||||
# Careful, the proper p9p path might not be set until initrc.local is sourced
|
||||
path=(. $PLAN9/bin ./bin/ /bin/ /usr/bin)
|
||||
|
||||
site=$SERVER_NAME
|
||||
headers=inc/headers.tpl
|
||||
template=_default
|
||||
sidebar=sidebar
|
||||
baseuri=http://$site/
|
||||
for(i in siteTitle siteSubTitle title extraHeaders)
|
||||
$i = ''
|
||||
|
||||
. etc/initrc
|
||||
|
||||
if(test -f etc/initrc.local)
|
||||
. etc/initrc.local
|
||||
|
||||
|
||||
# Parse request URL
|
||||
uri = `{echo -n $REQUEST_URI | sed -e 's/\?.*//; s/[^a-zA-Z0-9_+\-\/\.]//g; s/\.\.*/./g;' -e '1q'}
|
||||
ifs='/' {
|
||||
args = `{echo -n $uri}
|
||||
}
|
||||
|
||||
|
||||
if(! ~ $#debug 0)
|
||||
dprint ' ' $SERVER_NAME^$REQUEST_URI^' - '^$"HTTP_USER_AGENT
|
||||
|
27
etc/initrc
27
etc/initrc
@ -1,4 +1,29 @@
|
||||
# This file contains the default werc settings.
|
||||
# To change any of this settings globally, copy them to etc/initrc.local
|
||||
# and customize them there.
|
||||
#
|
||||
# Some settings can also be set for a specific site in their respective _config
|
||||
# or their master-site _config file.
|
||||
|
||||
# General options
|
||||
|
||||
# Location of your Plan 9 from User Space installation (usually /usr/local/plan9)
|
||||
plan9port=$PLAN9
|
||||
|
||||
# Path, make sure the plan9port /bin directory is included before /bin and /usr/bin
|
||||
path=(. $PLAN9/bin ./bin/ /bin/ /usr/bin)
|
||||
|
||||
# Directory where your site(s) live ($site here is your domain name, eg., example.com)
|
||||
sitedir=sites/$site
|
||||
|
||||
# Set this to your favorite markdown formatter, eg., markdown.pl
|
||||
# (md_cache is a wrapper around markdown.pl that caches output)
|
||||
formatter=md_cache
|
||||
|
||||
# Enable debugging, to disable set to ()
|
||||
debug=true
|
||||
|
||||
# Default site variables (Should be set on the _config file of each site or master site)
|
||||
masterSite=cat-v.org
|
||||
siteTitle='cat-v'
|
||||
siteSubTitle='Considered harmful'
|
||||
debug=true
|
||||
|
Loading…
Reference in New Issue
Block a user