suckless-quark/config.def.h
Ivan Delalande e42bb27846 change the behavior of docroot
Change the behavior of docroot, which is now used as a prefix path for
all file operations related to static files. And add chrootdir, which is
just the old docroot behavior and allows to control the path into which
quark will chroot.

Not having properly distinct configuration variables for chroot,
document root and CGI root was specially annoying since commit 2822488
which allowed users to retrieve the CGI script or binary by just
guessing its path, since quark was chrooting into docroot before
anything else, and thus the CGI script/binary was in the user accessible
path.

This is implemented by moving the reqbuf buffer in the middle of a
bigger buffer, reqpath. That buffer contains the value of docroot at its
beginning and reqbuf simply points to the first byte after this value.
2014-11-30 23:35:10 +01:00

31 lines
985 B
C

/* quark configuration */
static const char *servername = "127.0.0.1";
static const char *serverport = "80";
static const char *chrootdir = ".";
static const char *docroot = ".";
static const char *docindex = "index.html";
static const char *user = "nobody";
static const char *group = "nobody";
static const char *cgi_dir = ".";
static const char *cgi_script = "/werc.rc";
static int cgi_mode = 0;
static int allowdirlist = 0;
static const MimeType servermimes[] = {
{ "html", "text/html; charset=UTF-8" },
{ "htm", "text/html; charset=UTF-8" },
{ "css", "text/css" },
{ "js", "application/javascript" },
{ "txt", "text/plain" },
{ "md", "text/plain" },
{ "png", "image/png" },
{ "gif", "image/gif" },
{ "jpeg", "image/jpeg" },
{ "jpg", "image/jpeg" },
{ "iso", "application/x-iso9660-image" },
{ "gz", "application/x-gtar" },
{ "pdf", "application/x-pdf" },
{ "tar", "application/tar" },
{ "mp3", "audio/mp3" }
};