Commit | Line | Data |
---|---|---|
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 | ||
21 | signature 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 | |
085b569a CE |
30 | val validIpv6 : string -> bool |
31 | val validIp : string -> bool | |
08688401 AC |
32 | val yourDomain : string -> bool |
33 | val validUser : string -> bool | |
2e96b9d4 | 34 | val validEmailUser : string -> bool |
629a34f6 | 35 | |
97665758 AC |
36 | val ip : string Env.arg |
37 | ||
71420f8b AC |
38 | val registerResetGlobal : (unit -> unit) -> unit |
39 | val registerResetLocal : (unit -> unit) -> unit | |
40 | (* Register functions for clearing out all Domtool configuration at the global | |
41 | * (AFS) and local levels, respectively. *) | |
42 | ||
43 | val resetGlobal : unit -> unit | |
44 | val resetLocal : unit -> unit | |
45 | (* Call all registered functions *) | |
46 | ||
a3698041 AC |
47 | val registerBefore : (string -> unit) -> unit |
48 | val registerAfter : (string -> unit) -> unit | |
49 | (* Register handlers to run just before and after entering a domain | |
50 | * block. *) | |
51 | ||
dac62e84 AC |
52 | val currentDomain : unit -> string |
53 | ||
e0b0abd2 AC |
54 | val domainFile : {node : string, name : string} -> TextIO.outstream |
55 | (* Open one of the current domain's configuration files for a particular | |
56 | * node. *) | |
dac62e84 | 57 | |
e0b80e65 AC |
58 | val currentAliasDomains : unit -> string list |
59 | val currentDomains : unit -> string list | |
60 | (* Return the auxiliary domains being configured (not including | |
61 | * currentDomain) or the list of all domains being configured, | |
62 | * respectively. *) | |
63 | ||
64 | (* The type of a set of files open for different domains. *) | |
65 | type files = {write : string -> unit, (* Write a string to each. *) | |
66 | writeDom : unit -> unit, (* Write each's domain name to it. *) | |
67 | close : unit -> unit} (* Close all files. *) | |
68 | ||
69 | val domainsFile : {node : string, name : string} -> files | |
70 | (* Open a configuration file for every domain being configured. *) | |
71 | ||
e0b0abd2 AC |
72 | val dnsMaster : unit -> string option |
73 | (* Name of the node that is the DNS master for the current domain, if there | |
74 | * is one *) | |
2ed6d0e5 AC |
75 | |
76 | val nodes : string list | |
77 | (* Names of all system nodes *) | |
78 | val nodeMap : string Ast.StringMap.map | |
79 | (* Map node names to IP addresses *) | |
8a7c40fa AC |
80 | val nodeIp : string -> string |
81 | (* Look up a node in nodeMap *) | |
12adf55a AC |
82 | |
83 | val setUser : string -> unit | |
84 | val getUser : unit -> string | |
85 | (* Name of the UNIX user providing this configuration *) | |
86 | ||
87 | val your_domains : unit -> DataStructures.StringSet.set | |
88 | (* The domains the current user may configure *) | |
8a7c40fa AC |
89 | |
90 | val your_users : unit -> DataStructures.StringSet.set | |
91 | val your_groups : unit -> DataStructures.StringSet.set | |
92 | val your_paths : unit -> DataStructures.StringSet.set | |
93 | (* UNIX users, groups, and paths the user may act with *) | |
36e42cb8 | 94 | |
9b8c6dc8 | 95 | val get_context : unit -> OpenSSL.context |
36e42cb8 | 96 | val set_context : OpenSSL.context -> unit |
60695e99 | 97 | |
be1bea4c | 98 | val hasPriv : string -> bool |
c189cbe9 | 99 | |
e69e60cc | 100 | val rmdom : string list -> unit |
1638d5a2 | 101 | val rmdom' : string -> string list -> unit |
0da1c677 AC |
102 | |
103 | val homedirOf : string -> string | |
104 | val homedir : unit -> string | |
314ce7bd AC |
105 | |
106 | type subject = {node : string, domain : string} | |
107 | ||
108 | val registerDescriber : (subject -> string) -> unit | |
109 | (* When a user runs [domtool-admin describe $DOM], every function passed to | |
110 | * [registerDescriber] will be run on [$DOM]. *) | |
111 | val describe : string -> string | |
112 | (* Argument is domain to describe, over all nodes. *) | |
113 | ||
114 | datatype description = | |
41c58daf | 115 | Filename of { filename : string, heading : string, showEmpty : bool } |
314ce7bd AC |
116 | | Extension of { extension : string, heading : string -> string } |
117 | ||
118 | val considerAll : description list -> subject -> string | |
119 | (* Find files in a domain directory matching some patterns and generate | |
120 | * headings and contents listings for them. *) | |
563e7792 AC |
121 | |
122 | (* Callbacks to run whenever the set of Domtool users has changed *) | |
123 | val registerOnUsersChange : (unit -> unit) -> unit | |
124 | val onUsersChange : unit -> unit | |
a3698041 | 125 | end |