config.h (1698B)
1 static const char *host = "localhost"; 2 static const char *port = "80"; 3 static const char *servedir = "."; 4 static const char *docindex = "index.html"; 5 static const char *user = "nobody"; 6 static const char *group = "nogroup"; 7 8 static int listdirs = 1; 9 static int vhosts = 0; 10 11 static const int maxnprocs = 512; 12 #define HEADER_MAX 4096 13 #define FIELD_MAX 200 14 15 /* virtual hosts */ 16 static struct { 17 const char *name; 18 const char *regex; 19 const char *dir; 20 regex_t re; 21 } vhost[] = { 22 /* canonical host host regex directory */ 23 { "josuah.net", "josuah\\.net$", "josuah.net" }, 24 { "cyberia.systems", "cyberia\\.systems$", "cyberia.systems" }, 25 { "atelier-fu.fr", "atelier-fu\\.fr", "atelier-fu.fr" } 26 }; 27 28 /* mime-types */ 29 static const struct { 30 char *ext; 31 char *type; 32 } mimes[] = { 33 { "xml", "application/xml" }, 34 { "xhtml", "application/xhtml+xml" }, 35 { "html", "text/html; charset=UTF-8" }, 36 { "htm", "text/html; charset=UTF-8" }, 37 { "css", "text/css; charset=UTF-8" }, 38 { "txt", "text/plain; charset=UTF-8" }, 39 { "md", "text/plain; charset=UTF-8" }, 40 { "c", "text/plain; charset=UTF-8" }, 41 { "h", "text/plain; charset=UTF-8" }, 42 { "gz", "application/x-gtar" }, 43 { "tar", "application/tar" }, 44 { "pdf", "application/x-pdf" }, 45 { "png", "image/png" }, 46 { "gif", "image/gif" }, 47 { "jpeg", "image/jpg" }, 48 { "jpg", "image/jpg" }, 49 { "iso", "application/x-iso9660-image" }, 50 { "webp", "image/webp" }, 51 { "svg", "image/svg+xml" }, 52 { "flac", "audio/flac" }, 53 { "mp3", "audio/mpeg" }, 54 { "opus", "audio/ogg" }, 55 { "ogg", "audio/ogg" }, 56 { "mp4", "video/mp4" }, 57 { "ogv", "video/ogg" }, 58 { "webm", "video/webm" }, 59 };