Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 412 lines (354 sloc) 16.38 kb
21abc5b @klacke Initial revision
authored
1 %%%----------------------------------------------------------------------
2 %%% File : yaws.hrl
3 %%% Author : Claes Wikstrom <klacke@hyber.org>
455578a @vinoski major trailing whitespace cleanup
vinoski authored
4 %%% Purpose :
21abc5b @klacke Initial revision
authored
5 %%% Created : 16 Jan 2002 by Claes Wikstrom <klacke@hyber.org>
6 %%%----------------------------------------------------------------------
7
8 -author('klacke@hyber.org').
3c06a9e @klacke rearr of includefiles
authored
9
21abc5b @klacke Initial revision
authored
10
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
11
455578a @vinoski major trailing whitespace cleanup
vinoski authored
12 %% flags for gconfs
14176e6 @klacke added feature to not pick first sconf when virthosting
authored
13 -define(GC_TTY_TRACE, 1).
14 -define(GC_DEBUG, 2).
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
15 -define(GC_COPY_ERRLOG, 4).
16 -define(GC_BACKWARDS_COMPAT_PARSE, 8).
17 -define(GC_LOG_RESOLVE_HOSTNAME, 16).
18 -define(GC_FAIL_ON_BIND_ERR, 32).
19 -define(GC_PICK_FIRST_VIRTHOST_ON_NOMATCH, 64).
20 -define(GC_USE_FDSRV, 128).
21 -define(GC_USE_OLD_SSL, 256).
c887a37 @capflam Add the way to configure the version of sendfile method to use
capflam authored
22 -define(GC_USE_ERLANG_SENDFILE, 512).
23 -define(GC_USE_YAWS_SENDFILE, 1024).
6e49e77 @klacke git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk…
authored
24
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
25
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
26
27 -define(GC_DEF, ?GC_FAIL_ON_BIND_ERR).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
28
455578a @vinoski major trailing whitespace cleanup
vinoski authored
29 -define(gc_has_tty_trace(GC),
d0caaf6 @klacke tabs cleanup
authored
30 ((GC#gconf.flags band ?GC_TTY_TRACE) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
31 -define(gc_has_debug(GC),
d0caaf6 @klacke tabs cleanup
authored
32 ((GC#gconf.flags band ?GC_DEBUG) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
33 -define(gc_has_copy_errlog(GC),
d0caaf6 @klacke tabs cleanup
authored
34 ((GC#gconf.flags band ?GC_COPY_ERRLOG) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
35 -define(gc_log_has_resolve_hostname(GC),
d0caaf6 @klacke tabs cleanup
authored
36 ((GC#gconf.flags band ?GC_LOG_RESOLVE_HOSTNAME) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
37 -define(gc_fail_on_bind_err(GC),
d0caaf6 @klacke tabs cleanup
authored
38 ((GC#gconf.flags band ?GC_FAIL_ON_BIND_ERR) /= 0)).
14176e6 @klacke added feature to not pick first sconf when virthosting
authored
39 -define(gc_pick_first_virthost_on_nomatch(GC),
d0caaf6 @klacke tabs cleanup
authored
40 ((GC#gconf.flags band ?GC_PICK_FIRST_VIRTHOST_ON_NOMATCH) /= 0)).
6e49e77 @klacke git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk…
authored
41 -define(gc_use_old_ssl(GC),
42 ((GC#gconf.flags band ?GC_USE_OLD_SSL) /= 0)).
c887a37 @capflam Add the way to configure the version of sendfile method to use
capflam authored
43 -define(gc_use_erlang_sendfile(GC),
44 ((GC#gconf.flags band ?GC_USE_ERLANG_SENDFILE) /= 0)).
45 -define(gc_use_yaws_sendfile(GC),
46 ((GC#gconf.flags band ?GC_USE_YAWS_SENDFILE) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
47
455578a @vinoski major trailing whitespace cleanup
vinoski authored
48 -define(gc_set_tty_trace(GC, Bool),
d0caaf6 @klacke tabs cleanup
authored
49 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_TTY_TRACE, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
50 -define(gc_set_debug(GC, Bool),
d0caaf6 @klacke tabs cleanup
authored
51 GC#gconf{flags = yaws:flag(GC#gconf.flags, ?GC_DEBUG, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
52 -define(gc_set_copy_errlog(GC, Bool),
d0caaf6 @klacke tabs cleanup
authored
53 GC#gconf{flags = yaws:flag(GC#gconf.flags, ?GC_COPY_ERRLOG, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
54 -define(gc_log_set_resolve_hostname(GC, Bool),
55 GC#gconf{flags = yaws:flag(GC#gconf.flags,
d0caaf6 @klacke tabs cleanup
authored
56 ?GC_LOG_RESOLVE_HOSTNAME, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
57 -define(gc_set_fail_on_bind_err(GC, Bool),
d0caaf6 @klacke tabs cleanup
authored
58 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_FAIL_ON_BIND_ERR,Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
59 -define(gc_set_pick_first_virthost_on_nomatch(GC, Bool),
d0caaf6 @klacke tabs cleanup
authored
60 GC#gconf{flags = yaws:flag(GC#gconf.flags,
61 ?GC_PICK_FIRST_VIRTHOST_ON_NOMATCH,Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
62 -define(gc_set_use_old_ssl(GC, Bool),
6e49e77 @klacke git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk…
authored
63 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_USE_OLD_SSL,Bool)}).
c887a37 @capflam Add the way to configure the version of sendfile method to use
capflam authored
64 -define(gc_set_use_erlang_sendfile(GC, Bool),
65 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_USE_ERLANG_SENDFILE,Bool)}).
66 -define(gc_set_use_yaws_sendfile(GC, Bool),
67 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_USE_YAWS_SENDFILE,Bool)}).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
68
c9bd56d @klacke added config flag 'use_large_ssl_pool = bool()'
authored
69
21abc5b @klacke Initial revision
authored
70 %% global conf
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
71 -record(gconf,{
72 yaws_dir, % topdir of Yaws installation
73 trace, % false | {true,http} | {true,traffic}
74 flags = ?GC_DEF, % boolean flags
75 logdir,
76 ebin_dir = [],
08b12ca @capflam Add the global directive 'src_dir' to define source directories
capflam authored
77 src_dir = [],
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
78 runmods = [], % runmods for entire server
79 keepalive_timeout = 30000,
80 keepalive_maxuses = nolimit, % nolimit or non negative integer
81 max_num_cached_files = 400,
82 max_num_cached_bytes = 1000000, % 1 MEG
83 max_size_cached_file = 8000,
84 max_connections = nolimit, % max number of TCP connections
85
86 %% Override default connection handler processes spawn options for
87 %% performance/memory tuning.
88 %% [] | [{fullsweep_after,Number}, {min_heap_size, Size}]
89 %% other options such as monitor, link are ignored.
90 process_options = [],
91
92 large_file_chunk_size = 10240,
93 mnesia_dir = [],
94 log_wrap_size = 10000000, % wrap logs after 10M
95 cache_refresh_secs = 30, % seconds (auto zero when debug)
96 include_dir = [], % list of inc dirs for .yaws files
97 phpexe = "/usr/bin/php-cgi", % cgi capable php executable
98
99 yaws, % server string
100 id = "default", % string identifying this instance of yaws
101
102 enable_soap = false, % start yaws_soap_srv iff true
103
104 %% a list of
105 %% {{Mod, Func}, WsdlFile, Prefix} | {{Mod, Func}, WsdlFile}
106 %% automatically setup in yaws_soap_srv init.
107 soap_srv_mods = [],
108
109 ysession_mod = yaws_session_server, % storage module for ysession
89a64ef Make the mime types mappings configurable
Christopher Faulet authored
110 acceptor_pool_size = 8, % size of acceptor proc pool
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
111
53fdbfe @dumbbell Add a nslookup_pref global parameter
dumbbell authored
112 mime_types_info, % undefined | #mime_types_info{}
113 nslookup_pref = [inet] % [inet | inet6]
89a64ef Make the mime types mappings configurable
Christopher Faulet authored
114 }).
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
115
1c065c4 @capflam Add 'honor_cipher_order' option in ssl part
capflam authored
116
117 -ifdef(HAVE_SSL_HONOR_CIPHER_ORDER).
118 -define(HONOR_CIPHER_ORDER, true).
119 -else.
120 -define(HONOR_CIPHER_ORDER, undefined).
121 -endif.
122
f6d26c6 @capflam Check support for the SSL 'log_alert' option
capflam authored
123 -ifdef(HAVE_SSL_LOG_ALERT).
124 -define(SSL_LOG_ALERT, {log_alert, false}).
125 -else.
126 -define(SSL_LOG_ALERT, false).
127 -endif.
128
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
129 -record(ssl, {
130 keyfile,
131 certfile,
132 verify = 0,
133 fail_if_no_peer_cert,
134 depth = 1,
135 password,
136 cacertfile,
137 ciphers,
2dcb7a5 Add 'secure_renegotiate' option in ssl part
Christopher Faulet authored
138 cachetimeout,
1c065c4 @capflam Add 'honor_cipher_order' option in ssl part
capflam authored
139 secure_renegotiate = false,
e080033 @vinoski Add SSL protocol_version configuration element
vinoski authored
140 honor_cipher_order = ?HONOR_CIPHER_ORDER,
141 protocol_version
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
142 }).
661bd8c @klacke ""
authored
143
144
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
145 %% flags for sconfs
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
146 -define(SC_ACCESS_LOG, 1).
147 -define(SC_AUTH_LOG, 2).
148 -define(SC_ADD_PORT, 4).
149 -define(SC_STATISTICS, 8).
150 -define(SC_TILDE_EXPAND, 16).
151 -define(SC_DIR_LISTINGS, 32).
152 -define(SC_DEFLATE, 64).
153 -define(SC_DIR_ALL_ZIP, 128).
154 -define(SC_DAV, 512).
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
155 -define(SC_FCGI_TRACE_PROTOCOL, 1024).
156 -define(SC_FCGI_LOG_APP_ERROR, 2048).
157 -define(SC_FORWARD_PROXY, 4096).
158 -define(SC_AUTH_SKIP_DOCROOT, 8192).
159
82a449b @klacke Forward prox functionality added through a patch by Colm Dougan
authored
160
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
161
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
162 -define(SC_DEF, ?SC_ACCESS_LOG bor ?SC_ADD_PORT bor ?SC_AUTH_LOG).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
163
455578a @vinoski major trailing whitespace cleanup
vinoski authored
164 -define(sc_has_access_log(SC),
d0caaf6 @klacke tabs cleanup
authored
165 (((SC)#sconf.flags band ?SC_ACCESS_LOG) /= 0)).
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
166 -define(sc_has_auth_log(SC),
167 (((SC)#sconf.flags band ?SC_AUTH_LOG) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
168 -define(sc_has_add_port(SC),
d0caaf6 @klacke tabs cleanup
authored
169 (((SC)#sconf.flags band ?SC_ADD_PORT) /= 0)).
8c969fe @oliv3 Support for the statistics option per virtual host
oliv3 authored
170 -define(sc_has_statistics(SC),
171 (((SC)#sconf.flags band ?SC_STATISTICS) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
172 -define(sc_has_tilde_expand(SC),
d0caaf6 @klacke tabs cleanup
authored
173 (((SC)#sconf.flags band ?SC_TILDE_EXPAND) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
174 -define(sc_has_dir_listings(SC),
d0caaf6 @klacke tabs cleanup
authored
175 (((SC)#sconf.flags band ?SC_DIR_LISTINGS) /= 0)).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
176 -define(sc_has_deflate(SC),
d0caaf6 @klacke tabs cleanup
authored
177 (((SC)#sconf.flags band ?SC_DEFLATE) /= 0)).
2e8e005 @mbj4668 Added auto-generate all.zip to dir listings. It needs the zip comman…
mbj4668 authored
178 -define(sc_has_dir_all_zip(SC),
d0caaf6 @klacke tabs cleanup
authored
179 (((SC)#sconf.flags band ?SC_DIR_ALL_ZIP) /= 0)).
868ce8a @mbj4668 reworked the DAV support a bit - don't use an appmod, instead yaws ha…
mbj4668 authored
180 -define(sc_has_dav(SC),
d0caaf6 @klacke tabs cleanup
authored
181 (((SC)#sconf.flags band ?SC_DAV) /= 0)).
2fa66b0 @klacke cgi support
authored
182 -define(sc_fcgi_trace_protocol(SC),
183 (((SC)#sconf.flags band ?SC_FCGI_TRACE_PROTOCOL) /= 0)).
184 -define(sc_fcgi_log_app_error(SC),
185 (((SC)#sconf.flags band ?SC_FCGI_LOG_APP_ERROR) /= 0)).
82a449b @klacke Forward prox functionality added through a patch by Colm Dougan
authored
186 -define(sc_forward_proxy(SC),
187 (((SC)#sconf.flags band ?SC_FORWARD_PROXY) /= 0)).
5155b86 @vinoski Add auth_skip_docroot server config variable (Christian Hennig)
vinoski authored
188 -define(sc_auth_skip_docroot(SC),
189 (((SC)#sconf.flags band ?SC_AUTH_SKIP_DOCROOT) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
190
3dc56a7 @klacke javascript support in ehtml
authored
191
455578a @vinoski major trailing whitespace cleanup
vinoski authored
192 -define(sc_set_access_log(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
193 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ACCESS_LOG, Bool)}).
d9342f8 server-specific logger_mod and auth_mod (capflam)
Christopher Faulet authored
194 -define(sc_set_auth_log(SC, Bool),
195 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_AUTH_LOG, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
196 -define(sc_set_add_port(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
197 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ADD_PORT, Bool)}).
8c969fe @oliv3 Support for the statistics option per virtual host
oliv3 authored
198 -define(sc_set_statistics(SC, Bool),
199 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_STATISTICS, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
200 -define(sc_set_tilde_expand(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
201 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_TILDE_EXPAND, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
202 -define(sc_set_dir_listings(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
203 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DIR_LISTINGS, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
204 -define(sc_set_deflate(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
205 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DEFLATE, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
206 -define(sc_set_dir_all_zip(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
207 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DIR_ALL_ZIP, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
208 -define(sc_set_dav(SC, Bool),
d0caaf6 @klacke tabs cleanup
authored
209 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DAV, Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
210 -define(sc_set_fcgi_trace_protocol(SC, Bool),
211 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_FCGI_TRACE_PROTOCOL,
82a449b @klacke Forward prox functionality added through a patch by Colm Dougan
authored
212 Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
213 -define(sc_set_fcgi_log_app_error(SC, Bool),
214 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_FCGI_LOG_APP_ERROR,
82a449b @klacke Forward prox functionality added through a patch by Colm Dougan
authored
215 Bool)}).
455578a @vinoski major trailing whitespace cleanup
vinoski authored
216 -define(sc_set_forward_proxy(SC, Bool),
82a449b @klacke Forward prox functionality added through a patch by Colm Dougan
authored
217 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_FORWARD_PROXY, Bool)}).
5155b86 @vinoski Add auth_skip_docroot server config variable (Christian Hennig)
vinoski authored
218 -define(sc_set_auth_skip_docroot(SC, Bool),
219 SC#sconf{flags = yaws:flag(SC#sconf.flags,?SC_AUTH_SKIP_DOCROOT,Bool)}).
3dc56a7 @klacke javascript support in ehtml
authored
220
221
21abc5b @klacke Initial revision
authored
222 %% server conf
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
223 %% we cannot compare sconfs directly due to the ets field in #sconf{} use
224 %% yaws_config:eq_sconfs/2
225 -record(sconf, {
226 port = 8000, % which port is this server listening to
227 flags = ?SC_DEF,
228 redirect_map=[], % a list of
229 % {Prefix, #url{}, append|noappend}
230 % #url{} can be partially populated
231
232 rhost, % forced redirect host (+ optional port)
233 rmethod, % forced redirect method
234 docroot, % path to the docs
235 xtra_docroots = [], % if we have additional pseudo docroots
236 listen = [{127,0,0,1}], % bind to this IP, {0,0,0,0} is possible
237 servername = "localhost", % servername is what Host: header is
377f10d Add serveralias directive
Christopher Faulet authored
238 serveralias = [], % Alternate names for this vhost
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
239 yaws, % server string for this vhost
240 ets, % local store for this server
241 ssl, % undefined | #ssl{}
48c0510 Add access functions for #gconf{} and #sconf{} records
Christopher Faulet authored
242 authdirs = [], % [{docroot, [#auth{}]}]
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
243 partial_post_size = 10240,
244
245 %% An item in the appmods list can be either of the
246 %% following, this is all due to backwards compat issues.
247 %% 1. an atom - this is the equivalent to {atom, atom}
248 %% 2 . A two tuple {Path, Mod}
249 %% 3 A three tuple {Path, Mod, [ExcludeDir ....]}
250 appmods = [],
251
252 expires = [],
253 errormod_401 = yaws_outmod, % the default 401 error module
254 errormod_404 = yaws_outmod, % the default 404 error module
255 errormod_crash = yaws_outmod, % use the same module for crashes
256 arg_rewrite_mod = yaws,
257 logger_mod = yaws_log, % access/auth logging module
258 opaque = [], % useful in embedded mode
259 start_mod, % user provided module to be started
260 allowed_scripts = [yaws,php,cgi,fcgi],
261 tilde_allowed_scripts = [],
6c6f62f Add index_files directive into the server part configuration
Christopher Faulet authored
262 index_files = ["index.yaws", "index.html", "index.php"],
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
263 revproxy = [],
6e2a971 Do not set recbuf by default on listening sockets
Christopher Faulet authored
264 soptions = [{listen_opts, [{backlog, 1024}]}],
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
265 extra_cgi_vars = [],
266 stats, % raw traffic statistics
267 fcgi_app_server, % FastCGI application server {host,port}
268 php_handler = {cgi, "/usr/bin/php-cgi"},
c74a92e Add options to configure deflate compression behaviour
Christopher Faulet authored
269 shaper,
48c0510 Add access functions for #gconf{} and #sconf{} records
Christopher Faulet authored
270 deflate_options, % undefined | #deflate{}
271 mime_types_info, % undefined | #mime_types_info{}
272 % if undefined, global config is used
75dbb60 @vinoski add a configurable dispatch module
vinoski authored
273 dispatch_mod % custom dispatch module
55c9af7 Changed implementation of multipart form data. There is a new config
Seah Hinde authored
274 }).
21abc5b @klacke Initial revision
authored
275
3dc56a7 @klacke javascript support in ehtml
authored
276
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
277 %% Auth conf - from server conf and .yaws_auth
278 -record(auth, {
279 dir = [],
280 docroot = [],
281 files = [],
282 realm = "",
283 type = "Basic",
284 headers = [], % headers to send on 401
285 users = [], % list of {User, Password} tuples
286 acl = none, % list of allowed/denies IPs or none
287 mod = [], % authentication module callback
288 outmod = [], % module to handles 401 unauthorized messages
289 pam = false % should we use pam to auth a user
290 }).
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
291
4ad4101 @jonhen Virtual Directory support. ARG record and CGI variable changes
jonhen authored
292
c74a92e Add options to configure deflate compression behaviour
Christopher Faulet authored
293 %% Macro used to list default compressible mime-types
294 -define(DEFAULT_COMPRESSIBLE_MIME_TYPES, [
295 {"text", all},
296 {"application", "rtf"},
297 {"application", "msword"},
298 {"application", "postscript"},
299 {"application", "pdf"},
300 {"application", "x-dvi"},
301 {"application", "javascript"},
302 {"application", "x-javascript"}
303 ]).
304
305 %% Internal record used to initialize a zlib stream for compression
306 -record(deflate, {
307 min_compress_size = nolimit, % nolimit or non negative integer
308 % (in bytes)
309 compression_level = default, % none | default | best_compression |
310 % best_speed | 0..9
311 window_size = -15, % -15..-9
312 mem_level = 8, % 1..9
313 strategy = default, % default | filtered | huffman_only
8981ce2 Add support for precompressed static files
Christopher Faulet authored
314 use_gzip_static = false,
c74a92e Add options to configure deflate compression behaviour
Christopher Faulet authored
315
316 %% [{Type, undefined|SubType}] | all
317 mime_types = ?DEFAULT_COMPRESSIBLE_MIME_TYPES
318 }).
319
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
320
89a64ef Make the mime types mappings configurable
Christopher Faulet authored
321 %% Internal record used to set information about mime-types
322 -record(mime_types_info, {
323 mime_types_file, % an absolute filename path
324 types = [], % a map between mime-types and extensions
325 charsets = [], % a map between charsets and extensions
326 default_type = "text/plain",
327 default_charset
328 }).
329
330
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
331 %% this internal record is used and returned by the URL path parser
332 -record(urltype, {
333 type, % error | yaws | regular | directory | forbidden |
334 % appmod
335 finfo,
336 path = [],
337 fullpath = [], % deep list (WHY?)
338 dir = [], % relative dir where the path leads to
339 % flat | unflat need flat for authentication
340 data, % type-specific
341 % e.g: Binary | FileDescriptor | DirListing | undefined
342 deflate, % undefined | Binary | dynamic
343 mime = "text/html",
344 getpath, % as GET'ed by client
345 pathinfo
346 }).
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
347
348
349
350
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
351 %% this record is constructed as we build up the outgoing headers
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
352 -record(outh, {
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
353 status, % int status code
354
355 doclose, % bool
356 chunked, % bool
357 exceedmaxuses=false, % bool, true if hit keep-alive max uses
cab8a28 Improve how the responses compression is handled
Christopher Faulet authored
358 encoding=decide, % decide, identity, deflate
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
359 contlen, % integer
360 act_contlen, % actual content length for dynamic pages
361 % and the total set of out headers we can have as
362 % actual strings
d0caaf6 @klacke tabs cleanup
authored
363 connection,
364 server,
365 location,
366 cache_control,
c60fc5f add control for "Expires" and "Cache-Control" response headers (capflam)
Christopher Faulet authored
367 expires,
d0caaf6 @klacke tabs cleanup
authored
368 date,
369 allow,
370 last_modified,
371 etag,
372 set_cookie,
373 content_range,
374 content_length,
375 content_type,
376 content_encoding,
377 transfer_encoding,
378 www_authenticate,
d748f92 Add support of the 'Vary' header in response
Christopher Faulet authored
379 vary,
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
380 other % misc other headers
381 }).
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
382
383
cccc578 @vinoski add reverse proxy intercept module capability
vinoski authored
384 %% forward and reverse proxy config info
385 -record(proxy_cfg, {
386 prefix,
387 url,
388 intercept_mod
389 }).
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatib…
authored
390
b67bbd8 @klacke Rewrote url splitting (again), and made the redir to index.{html,yaws…
authored
391
31fdaae @klacke pam cleanup, add env record, yaws_ls enhancements by doccarcass@gmail…
authored
392 %% as read by application:get_env()
c1bdfc7 cosmetic comment and whitespace cleanup in yaws.hrl
Christopher Faulet authored
393 -record(env, {
394 debug,
395 trace,
396 traceoutput,
397 conf,
398 runmod,
399 embedded,
400 id
401 }).
31fdaae @klacke pam cleanup, add env record, yaws_ls enhancements by doccarcass@gmail…
authored
402
9ab391e @klacke warn when crypto app is not there
authored
403 %% Typically used in error printouts as in:
404 %% error_logger:format("Err ~p at ~p~n", [Reason, ?stack()])
405 -define(stack(), try throw(1) catch _:_ -> erlang:get_stacktrace() end).
a1e2e74 @lefant add implementation of X-Forwarded-For header (Fabian Linzberger)
lefant authored
406
407
408 %%% The following is for emacs, do not remove
409 %%% Local Variables:
410 %%% comment-column: 36
411 %%% End:
Something went wrong with that request. Please try again.