Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 210 lines (168 sloc) 6.06 kb
21abc5b @klacke Initial revision
authored
1 %%%----------------------------------------------------------------------
2 %%% File : yaws.hrl
3 %%% Author : Claes Wikstrom <klacke@hyber.org>
4 %%% Purpose :
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, c...
authored
11
12 %% flags for gconfs
13 -define(GC_TTY_TRACE, 1).
14 -define(GC_DEBUG, 2).
15 -define(GC_AUTH_LOG, 4).
16 -define(GC_COPY_ERRLOG, 8).
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
17 -define(GC_BACKWARDS_COMPAT_PARSE, 16).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
18
19 -define(GC_DEF, ?GC_AUTH_LOG).
20
21 -define(gc_has_tty_trace(GC),
22 ((GC#gconf.flags band ?GC_TTY_TRACE) /= 0)).
23 -define(gc_has_debug(GC),
24 ((GC#gconf.flags band ?GC_DEBUG) /= 0)).
25 -define(gc_has_auth_log(GC),
26 ((GC#gconf.flags band ?GC_AUTH_LOG) /= 0)).
27 -define(gc_has_copy_errlog(GC),
28 ((GC#gconf.flags band ?GC_COPY_ERRLOG) /= 0)).
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
29 -define(gc_has_backwards_compat_parse(GC),
30 ((GC#gconf.flags band ?GC_BACKWARDS_COMPAT_PARSE) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
31
32 -define(gc_set_tty_trace(GC, Bool),
33 GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_TTY_TRACE, Bool)}).
34 -define(gc_set_debug(GC, Bool),
35 GC#gconf{flags = yaws:flag(GC#gconf.flags, ?GC_DEBUG, Bool)}).
36 -define(gc_set_auth_log(GC, Bool),
37 GC#gconf{flags = yaws:flag(GC#gconf.flags, ?GC_AUTH_LOG, Bool)}).
38 -define(gc_set_copy_errlog(GC, Bool),
39 GC#gconf{flags = yaws:flag(GC#gconf.flags, ?GC_COPY_ERRLOG, Bool)}).
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
40 -define(gc_set_backwards_compat_parse(GC, Bool),
41 GC#gconf{flags = yaws:flag(GC#gconf.flags,
42 ?GC_BACKWARDS_COMPAT_PARSE, Bool)}).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
43
44
45
21abc5b @klacke Initial revision
authored
46 %% global conf
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
47 -record(gconf,{yaws_dir,
961926f @klacke ""
authored
48 trace,
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
49 flags = ?GC_DEF,
21abc5b @klacke Initial revision
authored
50 logdir,
d69e4d8 @klacke ""
authored
51 ebin_dir = [],
8d5aa60 @klacke ""
authored
52 runmods = [],
21abc5b @klacke Initial revision
authored
53 keepalive_timeout = 15000,
54 max_num_cached_files = 400,
55 max_num_cached_bytes = 1000000, %% 1 MEG
f0b4192 @klacke ""
authored
56 max_size_cached_file = 8000,
fc117d0 *** empty log message ***
Johan Bevemyr authored
57 large_file_chunk_size = 10240,
f0341a3 @klacke ""
authored
58 cache_refresh_secs = 30, % seconds (auto zero when debug)
21abc5b @klacke Initial revision
authored
59 default_type = "text/html",
d69e4d8 @klacke ""
authored
60 include_dir = [],
f0341a3 @klacke ""
authored
61 yaws, %% server string
0c9da97 @klacke added ability to run as different user than root
authored
62 username, %% maybe run as a different user than root
dc00e52 @klacke postvar bug by hal snyder, added yaws_api:query_url/1 added the id suppo...
authored
63 uid, %% unix uid of user that started yaws
64 id = "default" %% string identifying this instance of yaws
3dc56a7 @klacke javascript support in ehtml
authored
65 }).
66
21abc5b @klacke Initial revision
authored
67
68
661bd8c @klacke ""
authored
69 -record(ssl,
70 {
71 keyfile,
72 certfile,
73 verify = 0,
74 depth = 1,
75 password,
76 cacertfile,
77 ciphers,
78 cachetimeout}).
79
80
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
81 %% flags for sconfs
82 -define(SC_ACCESS_LOG, 1).
83 -define(SC_ADD_PORT, 2).
84 -define(SC_TILDE_EXPAND, 8).
85 -define(SC_DIR_LISTINGS, 16).
86 -define(SC_DEFLATE, 32).
87
88
89 -define(SC_DEF, ?SC_ACCESS_LOG bor ?SC_ADD_PORT).
90
91 -define(sc_has_access_log(SC),
92 ((SC#sconf.flags band ?SC_ACCESS_LOG) /= 0)).
93 -define(sc_has_add_port(SC),
94 ((SC#sconf.flags band ?SC_ADD_PORT) /= 0)).
95 -define(sc_has_tilde_expand(SC),
96 ((SC#sconf.flags band ?SC_TILDE_EXPAND) /= 0)).
97 -define(sc_has_dir_listings(SC),
98 ((SC#sconf.flags band ?SC_DIR_LISTINGS) /= 0)).
99 -define(sc_has_deflate(SC),
100 ((SC#sconf.flags band ?SC_DEFLATE) /= 0)).
101
3dc56a7 @klacke javascript support in ehtml
authored
102
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
103 -define(sc_set_access_log(SC, Bool),
104 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ACCESS_LOG, Bool)}).
105 -define(sc_set_add_port(SC, Bool),
106 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ADD_PORT, Bool)}).
107 -define(sc_set_ssl(SC, Bool),
108 SC#sconf{flags = yaws:flag(SC#sconf.flags , ?SC_SSL, Bool)}).
109 -define(sc_set_tilde_expand(SC, Bool),
110 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_TILDE_EXPAND, Bool)}).
111 -define(sc_set_dir_listings(SC, Bool),
112 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DIR_LISTINGS, Bool)}).
113 -define(sc_set_deflate(SC, Bool),
114 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DEFLATE, Bool)}).
3dc56a7 @klacke javascript support in ehtml
authored
115
116
117
21abc5b @klacke Initial revision
authored
118 %% server conf
119 -record(sconf,
35208ae Fixed redirect_local
Johan Bevemyr authored
120 {port = 8000, %% which port is this server listening to
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools, c...
authored
121 flags = ?SC_DEF,
44a50e4 Added rhost option for setting explicit redirect host (and port if neede...
Johan Bevemyr authored
122 rhost, %% forced redirect host (+ optional port)
f48ee71 Fixed redirects and added rport and rmethod server settings.
Johan Bevemyr authored
123 rmethod, %% forced redirect method
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a configur...
authored
124 docroot, %% path to the docs
125 listen = {127,0,0,1}, %% bind to this IP, {0,0,0,0} is possible
126 servername = "localhost", %% servername is what Host: header is
127 ets, %% local store for this server
661bd8c @klacke ""
authored
128 ssl,
55c9af7 Changed implementation of multipart form data. There is a new config
Seah Hinde authored
129 authdirs = [],
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a configur...
authored
130 partial_post_size = nolimit,
131 appmods = [], %% list of modules for this app
7cb9a46 @klacke customized crash messages
authored
132 errormod_404 = yaws_404, %% the default 404 error module
133 errormod_crash = yaws_404, %% use the same module for crashes
c3386b0 @klacke added arg_rewrite_mod
authored
134 arg_rewrite_mod = yaws,
b0837d6 More opaque stuff.
Tobbe Tornquist authored
135 opaque = [], %% useful in embedded mode
f0f2614 @carsten3347 Made allowed script types (yaws, php, cgi) configurable.
carsten3347 authored
136 start_mod, %% user provided module to be started
8e69e2c @klacke first almost working vsn of revproxy
authored
137 allowed_scripts = [yaws],
c9cdfa9 @carsten3347 Made the php executable configurable
carsten3347 authored
138 phpexe = "php",
d7b3a5d @klacke backed off the is_default patch
authored
139 revproxy = []
21abc5b @klacke Initial revision
authored
140 }).
141
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a configur...
authored
142
0dd21d2 Added Basic Authentication support with a new subsection to the server c...
Seah Hinde authored
143 % Auth conf - from server conf and .yaws_auth
144 -record(auth,
55c9af7 Changed implementation of multipart form data. There is a new config
Seah Hinde authored
145 {dir = [],
146 realm = "",
147 type = "Basic",
148 users = []
149 }).
21abc5b @klacke Initial revision
authored
150
3dc56a7 @klacke javascript support in ehtml
authored
151
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
152
153 %% this internal record is used and returned by the URL path parser
154
155 -record(urltype, {type, %% error | yaws | regular | directory |
156 %% forbidden | appmod
157 finfo,
158 path,
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
159 fullpath, %% deep list
160 dir, %% relative dir where the path leads to
161 %% flat | unflat need flat for authentication
162 data, %% Binary | FileDescriptor | DirListing | undefined
163 deflate, %% undefined | Binary | dynamic
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
164 mime = "text/html", %% MIME type
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
165 getpath, %% as GET'ed by client
6b289a9 @carsten3347 Added CGI and PHP support.
carsten3347 authored
166 pathinfo
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
167 }).
168
169
170
171
172 %% this record is constructed as we build up
173 %% the outgoing headers
174
175 -record(outh, {
176 status, %% int status code
177
178 doclose, %% bool
179 chunked, %% bool
dc15586 @carsten3347 Support for `Content-Encoding: deflate' using zlib.
carsten3347 authored
180 encoding=identity,
181 %% identity, deflate
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
182 contlen, %% integer
50d5504 @carsten3347 Log file size for dynamic pages.
carsten3347 authored
183 act_contlen, %% actual content length for dynamic pages
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
184
185
186 %% and the total set of out headers we can have
187 %% as actual strings
188 connection,
189 server,
190 location,
191 cache_control,
192 date,
193 allow,
194 last_modified,
195 etag,
196 set_cookie,
0a0a859 @carsten3347 For GETs on regular files:
carsten3347 authored
197 content_range,
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
198 content_length,
199 content_type,
dc15586 @carsten3347 Support for `Content-Encoding: deflate' using zlib.
carsten3347 authored
200 content_encoding,
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
201 transfer_encoding,
06a1bef @klacke ""
authored
202 www_authenticate,
203 other %% misc other headers
204 }).
00303e2 @klacke outh record, the outgoing headers are built up into a record now, much c...
authored
205
206
207
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
208 -define(READ_TIMEOUT, 30000).
209
Something went wrong with that request. Please try again.