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
88cae6e429
commit
ca3c688c52
2 changed files with 49 additions and 20 deletions
|
|
@ -1,24 +1,6 @@
|
||||||
#!/usr/local/plan9/bin/rc
|
#!/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 ..
|
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
|
# Useful functions
|
||||||
fn dprint {
|
fn dprint {
|
||||||
|
|
@ -242,13 +224,35 @@ dprint $body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fn genbody {
|
fn genbody {
|
||||||
# Actually execute request
|
# Actually execute request
|
||||||
$handler $handler_args
|
$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
|
. 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)
|
if(! ~ $#debug 0)
|
||||||
dprint ' ' $SERVER_NAME^$REQUEST_URI^' - '^$"HTTP_USER_AGENT
|
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
|
masterSite=cat-v.org
|
||||||
siteTitle='cat-v'
|
siteTitle='cat-v'
|
||||||
siteSubTitle='Considered harmful'
|
siteSubTitle='Considered harmful'
|
||||||
debug=true
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue