Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 221 lines (175 sloc) 6.322 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…
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 incompatib…
authored
17 -define(GC_BACKWARDS_COMPAT_PARSE, 16).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
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 incompatib…
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…
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 incompatib…
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…
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…
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…
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)
d69e4d8 @klacke ""
authored
59 include_dir = [],
018accf @klacke MOved phpexe config variable from the sconf to the gconf, it doesn't …
authored
60 phpexe = "php",
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 su…
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…
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).
2e8e005 @mbj4668 Added auto-generate all.zip to dir listings. It needs the zip comman…
mbj4668 authored
87 -define(SC_DIR_ALL_ZIP, 64).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
88
89
90 -define(SC_DEF, ?SC_ACCESS_LOG bor ?SC_ADD_PORT).
91
92 -define(sc_has_access_log(SC),
93 ((SC#sconf.flags band ?SC_ACCESS_LOG) /= 0)).
94 -define(sc_has_add_port(SC),
95 ((SC#sconf.flags band ?SC_ADD_PORT) /= 0)).
96 -define(sc_has_tilde_expand(SC),
97 ((SC#sconf.flags band ?SC_TILDE_EXPAND) /= 0)).
98 -define(sc_has_dir_listings(SC),
99 ((SC#sconf.flags band ?SC_DIR_LISTINGS) /= 0)).
100 -define(sc_has_deflate(SC),
101 ((SC#sconf.flags band ?SC_DEFLATE) /= 0)).
2e8e005 @mbj4668 Added auto-generate all.zip to dir listings. It needs the zip comman…
mbj4668 authored
102 -define(sc_has_dir_all_zip(SC),
103 ((SC#sconf.flags band ?SC_DIR_ALL_ZIP) /= 0)).
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
104
3dc56a7 @klacke javascript support in ehtml
authored
105
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
106 -define(sc_set_access_log(SC, Bool),
107 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ACCESS_LOG, Bool)}).
108 -define(sc_set_add_port(SC, Bool),
109 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_ADD_PORT, Bool)}).
110 -define(sc_set_ssl(SC, Bool),
111 SC#sconf{flags = yaws:flag(SC#sconf.flags , ?SC_SSL, Bool)}).
112 -define(sc_set_tilde_expand(SC, Bool),
113 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_TILDE_EXPAND, Bool)}).
114 -define(sc_set_dir_listings(SC, Bool),
115 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DIR_LISTINGS, Bool)}).
116 -define(sc_set_deflate(SC, Bool),
117 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DEFLATE, Bool)}).
2e8e005 @mbj4668 Added auto-generate all.zip to dir listings. It needs the zip comman…
mbj4668 authored
118 -define(sc_set_dir_all_zip(SC, Bool),
119 SC#sconf{flags = yaws:flag(SC#sconf.flags, ?SC_DIR_ALL_ZIP, Bool)}).
3dc56a7 @klacke javascript support in ehtml
authored
120
121
122
21abc5b @klacke Initial revision
authored
123 %% server conf
124 -record(sconf,
35208ae Fixed redirect_local
Johan Bevemyr authored
125 {port = 8000, %% which port is this server listening to
7fd4ad4 @klacke backwards incomp cahnge with flags in gc and sc instead of many bools…
authored
126 flags = ?SC_DEF,
44a50e4 Added rhost option for setting explicit redirect host (and port if ne…
Johan Bevemyr authored
127 rhost, %% forced redirect host (+ optional port)
f48ee71 Fixed redirects and added rport and rmethod server settings.
Johan Bevemyr authored
128 rmethod, %% forced redirect method
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a confi…
authored
129 docroot, %% path to the docs
130 listen = {127,0,0,1}, %% bind to this IP, {0,0,0,0} is possible
131 servername = "localhost", %% servername is what Host: header is
132 ets, %% local store for this server
661bd8c @klacke ""
authored
133 ssl,
55c9af7 Changed implementation of multipart form data. There is a new config
Seah Hinde authored
134 authdirs = [],
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a confi…
authored
135 partial_post_size = nolimit,
136 appmods = [], %% list of modules for this app
7cb9a46 @klacke customized crash messages
authored
137 errormod_404 = yaws_404, %% the default 404 error module
138 errormod_crash = yaws_404, %% use the same module for crashes
c3386b0 @klacke added arg_rewrite_mod
authored
139 arg_rewrite_mod = yaws,
b0837d6 More opaque stuff.
Tobbe Tornquist authored
140 opaque = [], %% useful in embedded mode
f0f2614 @carsten3347 Made allowed script types (yaws, php, cgi) configurable.
carsten3347 authored
141 start_mod, %% user provided module to be started
8e69e2c @klacke first almost working vsn of revproxy
authored
142 allowed_scripts = [yaws],
d7b3a5d @klacke backed off the is_default patch
authored
143 revproxy = []
21abc5b @klacke Initial revision
authored
144 }).
145
0d6e5ea @klacke fixed tilde username expansion it didn't work, also made thta a confi…
authored
146
0dd21d2 Added Basic Authentication support with a new subsection to the serve…
Seah Hinde authored
147 % Auth conf - from server conf and .yaws_auth
148 -record(auth,
55c9af7 Changed implementation of multipart form data. There is a new config
Seah Hinde authored
149 {dir = [],
150 realm = "",
151 type = "Basic",
152 users = []
153 }).
21abc5b @klacke Initial revision
authored
154
3dc56a7 @klacke javascript support in ehtml
authored
155
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
156
157 %% this internal record is used and returned by the URL path parser
158
159 -record(urltype, {type, %% error | yaws | regular | directory |
160 %% forbidden | appmod
161 finfo,
162 path,
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatib…
authored
163 fullpath, %% deep list
164 dir, %% relative dir where the path leads to
165 %% flat | unflat need flat for authentication
166 data, %% Binary | FileDescriptor | DirListing | undefined
167 deflate, %% undefined | Binary | dynamic
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
168 mime = "text/html", %% MIME type
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatib…
authored
169 getpath, %% as GET'ed by client
6b289a9 @carsten3347 Added CGI and PHP support.
carsten3347 authored
170 pathinfo
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
171 }).
172
173
174
175
176 %% this record is constructed as we build up
177 %% the outgoing headers
178
179 -record(outh, {
180 status, %% int status code
181
182 doclose, %% bool
183 chunked, %% bool
dc15586 @carsten3347 Support for `Content-Encoding: deflate' using zlib.
carsten3347 authored
184 encoding=identity,
185 %% identity, deflate
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
186 contlen, %% integer
50d5504 @carsten3347 Log file size for dynamic pages.
carsten3347 authored
187 act_contlen, %% actual content length for dynamic pages
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
188
189
190 %% and the total set of out headers we can have
191 %% as actual strings
192 connection,
193 server,
194 location,
195 cache_control,
196 date,
197 allow,
198 last_modified,
199 etag,
200 set_cookie,
0a0a859 @carsten3347 For GETs on regular files:
carsten3347 authored
201 content_range,
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
202 content_length,
203 content_type,
dc15586 @carsten3347 Support for `Content-Encoding: deflate' using zlib.
carsten3347 authored
204 content_encoding,
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
205 transfer_encoding,
06a1bef @klacke ""
authored
206 www_authenticate,
207 other %% misc other headers
208 }).
00303e2 @klacke outh record, the outgoing headers are built up into a record now, muc…
authored
209
210
211
ef3a52a @klacke Removed the atoms in parse_post and parse query, backwards incompatib…
authored
212 -define(READ_TIMEOUT, 30000).
213
b67bbd8 @klacke Rewrote url splitting (again), and made the redir to index.{html,yaws…
authored
214
215
216
217 -record(appmodspec, {
218 type, %% atom, pair or absolute
219 data}).
220
Something went wrong with that request. Please try again.