## -*- shell-script -*-
## This is the `configuration file' for the Thy init script.
##
## Note: If the documentation says that a given option accepts a list
## of arguments, the list must be comma separated!

# Configuration files to read upon startup
THY_CONFFILES="$(find /etc/thy/conf.d/ -type f 2>/dev/null || true)"

# The userid to run as
# Default: 65535
THY_UID=$(id -u www-data 2>/dev/null)
THY_UID=${THY_UID:-$(id -u nobody 2>/dev/null)}

# The IP and port Thy should listen on.
# Default: 0.0.0.0/80
THY_LISTEN=

# The directory to serve documents from
# Default: /var/www
THY_WEBROOT=

# You might want to set this to text/plain
# Default: application/octet-stream
THY_DEFTYPE=

# If you want authorization, add auth. If you want virtualhosting,
# add vhost. To disable CGI support, remove CGI. To enable CGI
# execution inside user directories, add usercgi. Must be separated by
# a single coma, no whitespace allowed!
# Default: userdir
THY_OPTS="cgi"

# A list of directories to treat as special CGI directories: every
# executable file in them will be treated as a CGI.
# Example: THY_CGIDIR="/usr/lib/cgi-bin"
THY_CGIDIRS=

# Controls compression properties, like type and compression level.
# Default: type=static
THY_GZIP=

# A list of recognised CGI extensions. No whitespace allowed!
# Default: .cgi
THY_CGIEXTS=".cgi,.pl"

# A list of postfix=handler pairs, to be used for PHP, for example.
# Like: THY_HANDLERS=".php4=/usr/bin/php4,.php=/usr/bin/php4"
THY_HANDLERS=

# A list of external method handlers. This can be used to add, eg,
# WebDAV support to Thy.
# For example: THY_METHODS="PROPFIND=/usr/lib/cgi-bin/nph-webdav"
THY_METHODS=

# A list of variable=value pairs, to be passed to CGI scripts.
# Example: THY_CGIENV="EASTER_EGG=yes"
THY_CGIENV=

# A list of field=value paris, which will be appended to all response
# headers.
# Example: THY_HEADERS="DAV=1" # This will add `Dav: 1' to each
# response.
THY_HEADERS=

# The file in which Thy should place its PID.
# Default: /var/run/thy.pid
THY_PIDFILE=

# Number of seconds after a connection should time out.
# Default: 180
THY_TIMEOUT=

# Thy directory to look at (inside the users home) upon a /~user
# request.
# Default: public_html
THY_USERDIR=

# A list of files considered `indexes'. When one of these is present,
# Thy will not generate a directory index.
# Default: index.html
THY_INDEXES=

# A list of extra EXTENSION=MIME-TYPE mappings. These are used
# additionally to the built-in list.
# Example: THY_MIMES=".stuff=text/x-stuff"
THY_MIMES=

# Various SSL options, such as the certificate, key, and other stuff.
THY_SSL=

# One can control certain limits on buffers Thy uses to store stuff
# in, while parsing. This is the hook that can be used to set them
# easily.
# Default: header=2048,post_buffer=65536
THY_LIMITS=

# A set of flags to be passed to Thy verbatim. This can be used to add
# flags wich cannot be set with the hooks provided by this file.
THY_FLAGS=

## --  Construct a command-line  -- ##
### YOU DO NOT NEED TO MODIFY THIS ###
THY_OPTIONS="${THY_CONFFILES} \
${THY_UID:+-U ${THY_UID}} ${THY_WEBROOT:+-w ${THY_WEBROOT}} \
${THY_DEFTYPE:+-d ${THY_DEFTYPE}} ${THY_CGIEXTS:+-c ${THY_CGIEXTS}} \
${THY_HANDLERS:+-H ${THY_HANDLERS}} ${THY_LISTEN:+-l ${THY_LISTEN}} \
${THY_PIDFILE:+-P ${THY_PIDFILE}} ${THY_TIMEOUT:+-t ${THY_TIMEOUT}} \
${THY_USERDIR:+-u ${THY_USERDIR}} ${THY_INDEXES:+-i ${THY_INDEXES}} \
${THY_MIMES:+-m ${THY_MIMES}} ${THY_OPTS:+-o ${THY_OPTS}} \
${THY_GZIP:+-g ${THY_GZIP}} ${THY_SSL:+-s ${THY_SSL}} \
${THY_METHODS:+-M ${THY_METHODS}} ${THY_CGIENV:+-E ${THY_CGIENV}} \
${THY_HEADERS:+-D ${THY_HEADERS}} ${THY_LIMITS:+-L ${THY_LIMITS}} \
${THY_CGIDIRS:+-C ${THY_CGIDIRS}} ${THY_FLAGS}"
