Print on start of mysql-fixperms in domtool-server
[hcoop/domtool2.git] / src / domain.sig
CommitLineData
a3698041
AC
1(* HCoop Domtool (http://hcoop.sourceforge.net/)
2 * Copyright (c) 2006, Adam Chlipala
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
dac62e84 17 *)
a3698041
AC
18
19(* Domain-related primitive actions *)
20
21signature DOMAIN = sig
22
04502362
AC
23 val declareClient : unit -> unit
24 val fakePrivileges : unit -> unit
25
b271ecb0 26 val yourPath : string -> bool
629a34f6
AC
27 val isIdent : char -> bool
28 val validHost : string -> bool
29 val validDomain : string -> bool
08688401
AC
30 val yourDomain : string -> bool
31 val validUser : string -> bool
2e96b9d4 32 val validEmailUser : string -> bool
629a34f6 33
97665758
AC
34 val ip : string Env.arg
35
71420f8b
AC
36 val registerResetGlobal : (unit -> unit) -> unit
37 val registerResetLocal : (unit -> unit) -> unit
38 (* Register functions for clearing out all Domtool configuration at the global
39 * (AFS) and local levels, respectively. *)
40
41 val resetGlobal : unit -> unit
42 val resetLocal : unit -> unit
43 (* Call all registered functions *)
44
a3698041
AC
45 val registerBefore : (string -> unit) -> unit
46 val registerAfter : (string -> unit) -> unit
47 (* Register handlers to run just before and after entering a domain
48 * block. *)
49
dac62e84
AC
50 val currentDomain : unit -> string
51
e0b0abd2
AC
52 val domainFile : {node : string, name : string} -> TextIO.outstream
53 (* Open one of the current domain's configuration files for a particular
54 * node. *)
dac62e84 55
e0b80e65
AC
56 val currentAliasDomains : unit -> string list
57 val currentDomains : unit -> string list
58 (* Return the auxiliary domains being configured (not including
59 * currentDomain) or the list of all domains being configured,
60 * respectively. *)
61
62 (* The type of a set of files open for different domains. *)
63 type files = {write : string -> unit, (* Write a string to each. *)
64 writeDom : unit -> unit, (* Write each's domain name to it. *)
65 close : unit -> unit} (* Close all files. *)
66
67 val domainsFile : {node : string, name : string} -> files
68 (* Open a configuration file for every domain being configured. *)
69
e0b0abd2
AC
70 val dnsMaster : unit -> string option
71 (* Name of the node that is the DNS master for the current domain, if there
72 * is one *)
2ed6d0e5
AC
73
74 val nodes : string list
75 (* Names of all system nodes *)
76 val nodeMap : string Ast.StringMap.map
77 (* Map node names to IP addresses *)
8a7c40fa
AC
78 val nodeIp : string -> string
79 (* Look up a node in nodeMap *)
12adf55a
AC
80
81 val setUser : string -> unit
82 val getUser : unit -> string
83 (* Name of the UNIX user providing this configuration *)
84
85 val your_domains : unit -> DataStructures.StringSet.set
86 (* The domains the current user may configure *)
8a7c40fa
AC
87
88 val your_users : unit -> DataStructures.StringSet.set
89 val your_groups : unit -> DataStructures.StringSet.set
90 val your_paths : unit -> DataStructures.StringSet.set
91 (* UNIX users, groups, and paths the user may act with *)
36e42cb8
AC
92
93 val set_context : OpenSSL.context -> unit
60695e99 94
be1bea4c 95 val hasPriv : string -> bool
c189cbe9 96
e69e60cc 97 val rmdom : string list -> unit
1638d5a2 98 val rmdom' : string -> string list -> unit
0da1c677
AC
99
100 val homedirOf : string -> string
101 val homedir : unit -> string
314ce7bd
AC
102
103 type subject = {node : string, domain : string}
104
105 val registerDescriber : (subject -> string) -> unit
106 (* When a user runs [domtool-admin describe $DOM], every function passed to
107 * [registerDescriber] will be run on [$DOM]. *)
108 val describe : string -> string
109 (* Argument is domain to describe, over all nodes. *)
110
111 datatype description =
41c58daf 112 Filename of { filename : string, heading : string, showEmpty : bool }
314ce7bd
AC
113 | Extension of { extension : string, heading : string -> string }
114
115 val considerAll : description list -> subject -> string
116 (* Find files in a domain directory matching some patterns and generate
117 * headings and contents listings for them. *)
a3698041 118end