2 Domtool (http://hcoop.sf.net/)
3 Copyright (C) 2004 Adam Chlipala
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 (* Main domtool structure *)
24 val dprint : string -> unit
25 (* If Config.debug, then it prints the argument followed by a newline. *)
26 val inputLine : TextIO.instream -> string option
27 (* Like TextIO.inputLine, but skips past lines commented out with #'s. *)
29 type map = string StringMap.map
30 type set = StringSet.set
33 val error : string * string -> unit
34 (* (error (path, msg)) signals an error about path with description msg. *)
36 val handleException : string * exn -> unit
37 (* Like error, but extracts the diagnostic output from an exception. *)
39 (* Handlers for configuration files *)
40 type handlerData = {path : string, (* Path to the config file *)
41 domain : string, (* Domain in which it lives *)
42 parent : string, (* Parent of that domain *)
43 vars : map, (* Current variable values *)
44 paths : set, (* Authorized filesystem paths *)
45 users : set, (* Authorized UNIX users *)
46 groups : set, (* Authorized UNIX groups *)
47 mxs : set, (* Allowed external MX servers *)
48 certs : set, (* Paths to allowed SSL certificates *)
49 slaves : map, (* DNS slaves, as a function from names
51 nses : map} (* Available DNS server hostnames from
53 type mkdomData = {path : string,
55 type handler = {init : unit -> unit,
56 file : handlerData -> unit,
57 finish : unit -> unit,
58 publish : unit -> OS.Process.status,
59 mkdom : mkdomData -> OS.Process.status}
61 val setVhostHandler : handler -> unit
62 (* Set the handler for virtual host configuration files *)
63 val setHandler : string * handler -> unit
64 (* Set the handler to be used for files with a specific name *)
67 val read : unit -> OS.Process.status
68 (* Command line domtool entry point *)
69 val publish : unit -> OS.Process.status
70 (* Propagate changes to real daemons *)
71 val mkDom : string * string -> OS.Process.status
72 (* (mkDom (dom, user)) creates a new domain record *)