This repository has been archived by the owner on May 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathoptions.h.in
140 lines (113 loc) · 5.21 KB
/
options.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
Weborf
Copyright (C) 2007-2019 Salvo "LtWorf" Tomaselli
Weborf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
*/
#include "config.h"
#include <unistd.h> //Needed because it defines the _POSIX_IPV6
#ifndef WEBORF_OPTIONS_H
#define WEBORF_OPTIONS_H
#define NAME PACKAGE
//#define VERSION PACKAGE_VERSION
#define SIGNATURE NAME "/" VERSION " (GNU/Linux)"
//----------System
#define ROOTUID 0 //Uid for superuser
#define ROOTGID 0
//----------Network
#define MAXQ 40 //Queue for connect requests
#define PORT "8080" //Default port
#ifdef _POSIX_IPV6 //Enables ipv6 if supported
//Delete the following line to use IPv4 instead.
#define IPV6
#endif
#ifdef IPV6
#define IPVERSION '6'
#else
#define IPVERSION '4'
#endif
//-----------Threads
#define MAXTHREAD 300 //Max threads
#define INITIALTHREAD 6 //Thread started when free threads are low and when starting
#define LOWTHREAD 3 //Minimum number of free threads, before starting new ones
#define MAXFREETHREAD 6 //Maximum number of free threads, before starting to slowly close them
#define THREADCONTROL 10 //Polling frequence in seconds
//------------Server
#define INDEX "index.html" //Default index file that weborf will search
#define BASEDIR "/srv/www" //Default basedir
#define READ_TIMEOUT 5000 //Timeout before closing inactive keep-alive connections, in milliseconds
//------------Buffers
#define INBUFFER 1024 //Size for buffer with the HTTP request
#define FILEBUF 4096 //Size of reads
#define MAXSCRIPTOUT 512000 //Maximum size for a page generated by a script or internally
#define HEADBUF 1024 //Buffer for headers
#define PWDLIMIT 300 //Max size for password
#define INDEXMAXLEN 30
#define NBUFFER 15 //Buffer to contain the string representation of an integer
#define RBUFFER 128 //Buffer to contain a range
#define BUFFERED_READER_SIZE 2048
#define DATEBUFFER 50 //Buffer for text date
#define URI_LEN 256
#define ESCAPED_FNAME_LEN 256 * 3 //To contain escaped filenames, d_name size is 256 on linux
#define PATH_LEN 1024
#define MIMETYPELEN 15 //Size of mimetype string
//Number of index pages allowed to search
#define MAXINDEXCOUNT 10
//-------------LIMITS
#define POST_MAX_SIZE 2000000 //Maximum allowed size for POST data
//-------------HTML
#define HTMLHEAD "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" \
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" \
"<title>" NAME "</title>" \
"<style type=\"text/css\">a, a:active {text-decoration: none; color: blue;}a:visited {color: #48468F;}" \
"a:hover, a:focus {text-decoration: underline; color: red;}body {background-color: #F5F5F5;}" \
"h2 {margin-bottom: 12px;}table {margin-left: 12px;}th, td { font: 90% monospace; text-align: left;}" \
"th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;}td {padding-right: 14px;}" \
"td.s, th.s {text-align: right;}div.list { background-color: white; border-top: 1px solid #646464;" \
"border-bottom: 1px solid #646464; padding-top: 10px; padding-bottom: 14px;}div.foot { font: 80% sans-serif; color: #787878; padding-top: 4px;}</style>" \
"</head><body><h4>" NAME "</h4><div class=\"list\">"
#define HTMLFOOT "</div><div class=\"foot\">" SIGNATURE "</div></body></html>"
#define HTMLLIGHT "white"
#define HTMLDARK "#EAEAEA"
#define HTMLPARENT "#DFDFDF"
//-------------SCRIPTS
#define SCRPT_TIMEOUT 30 //Timeout for the scripts, in seconds
#define HIDE_CGI_ERRORS //Hides all the errors.
#define CGI_PHP "/usr/lib/cgi-bin/php"
#define CGI_PY ""
//-------------COMPRESSING PAGES
//#define __COMPRESSION //enables support for compressing pages, comment to disable
#ifdef __COMPRESSION
#define SIZE_COMPRESS_MIN 512
#define SIZE_COMPRESS_MAX 4000000000
#define GZIPNICE 4 //Nice value for gzip process
#endif
//The following header can be disabled to increase a little the speed
//#define SEND_LAST_MODIFIED_HEADER
#ifdef HAVE_LIBMAGIC
#define SEND_MIMETYPES //Enables support to sending the mimetype to the client
#endif
//-------------RANGE
#define __RANGE //Enables support to range (partial download)
//-------------WEBDAV
#define WEBDAV //Enables webdav support
#ifdef WEBDAV
#define MAXPROPCOUNT 40 //Number of supported properties
#define HIDE_HIDDEN_FILES //Hides hidden files
#endif
//-------------Logging options
//#define THREADDBG
//#define SOCKETDBG
//#define SENDINGDBG
#define SERVERDBG
#define REQUESTDBG
#endif