Various changes, including changes in 2.1.1 and 2.1.2 releases.
[BackupPC.git] / lib / BackupPC / Config / Meta.pm
1 #============================================================= -*-perl-*-
2 #
3 # BackupPC::Config::Meta package
4 #
5 # DESCRIPTION
6 #
7 #   This library defines a BackupPC::Config::Meta class.
8 #
9 # AUTHOR
10 #   Craig Barratt  <cbarratt@users.sourceforge.net>
11 #
12 # COPYRIGHT
13 #   Copyright (C) 2004  Craig Barratt
14 #
15 #   This program is free software; you can redistribute it and/or modify
16 #   it under the terms of the GNU General Public License as published by
17 #   the Free Software Foundation; either version 2 of the License, or
18 #   (at your option) any later version.
19 #
20 #   This program is distributed in the hope that it will be useful,
21 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
22 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 #   GNU General Public License for more details.
24 #
25 #   You should have received a copy of the GNU General Public License
26 #   along with this program; if not, write to the Free Software
27 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28 #
29 #========================================================================
30 #
31 # Version 2.1.0, released 20 Jun 2004.
32 #
33 # See http://backuppc.sourceforge.net.
34 #
35 #========================================================================
36
37 package BackupPC::Config::Meta;
38
39 use strict;
40
41 require Exporter;
42
43 use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );
44
45 use vars qw(%ConfigMeta);
46
47 @ISA = qw(Exporter);
48
49 @EXPORT    = qw( );
50
51 @EXPORT_OK = qw(
52                     %ConfigMeta
53              );
54
55 %EXPORT_TAGS = (
56     'all'    => [ @EXPORT_OK ],
57 );
58
59 #
60 # Define the data types for all the config variables
61 #
62
63 %ConfigMeta = (
64
65     ######################################################################
66     # General server configuration
67     ######################################################################
68     ServerHost          => "string",
69     ServerPort          => "integer",
70     ServerMesgSecret    => "string",
71     MyPath              => {type => "string", undefIfEmpty => 1},
72     UmaskMode           => "integer",
73     WakeupSchedule => {
74             type  => "shortlist",
75             child => "float",
76         },
77     MaxBackups          => "integer",
78     MaxUserBackups      => "integer",
79     MaxPendingCmds      => "integer",
80     MaxBackupPCNightlyJobs => "integer",
81     BackupPCNightlyPeriod  => "integer",
82     MaxOldLogFiles      => "integer",
83
84     SshPath             => {type => "string", undefIfEmpty => 1},
85     NmbLookupPath       => {type => "string", undefIfEmpty => 1},
86     PingPath            => {type => "string", undefIfEmpty => 1},
87     DfPath              => {type => "string", undefIfEmpty => 1},
88     DfCmd               => "string",
89     SplitPath           => {type => "string", undefIfEmpty => 1},
90     ParPath             => {type => "string", undefIfEmpty => 1},
91     CatPath             => {type => "string", undefIfEmpty => 1},
92     GzipPath            => {type => "string", undefIfEmpty => 1},
93     Bzip2Path           => {type => "string", undefIfEmpty => 1},
94     DfMaxUsagePct       => "float",
95     TrashCleanSleepSec  => "integer",
96     DHCPAddressRanges   => {
97             type    => "list",
98             emptyOk => 1,
99             child   => {
100                 type      => "hash",
101                 noKeyEdit => 1,
102                 child     => {
103                     ipAddrBase => "string",
104                     first      => "integer",
105                     last       => "integer",
106                 },
107             },
108     },
109     BackupPCUser        => "string",
110     CgiDir              => "string",
111     InstallDir          => "string",
112     BackupPCUserVerify  => "integer",
113     HardLinkMax         => "integer",
114     PerlModuleLoad      => {
115             type    => "list",
116             emptyOk => 1,
117             undefIfEmpty => 1,
118             child   => "string",
119     },
120     ServerInitdPath     => {type => "string", undefIfEmpty => 1},
121     ServerInitdStartCmd => "string",
122
123     ######################################################################
124     # What to backup and when to do it
125     # (can be overridden in the per-PC config.pl)
126     ######################################################################
127     FullPeriod          => "float",
128     IncrPeriod          => "float",
129     FullKeepCnt         => {
130             type   => "shortlist",
131             child  => "integer",
132     },
133     FullKeepCntMin      => "integer",
134     FullAgeMax          => "float",
135     IncrKeepCnt         => "integer",
136     IncrKeepCntMin      => "integer",
137     IncrAgeMax          => "float",
138     PartialAgeMax       => "float",
139     IncrFill            => "integer",
140     RestoreInfoKeepCnt  => "integer",
141     ArchiveInfoKeepCnt  => "integer",
142
143     BackupFilesOnly     => {
144             type         => "list",
145             emptyOk      => 1,
146             undefIfEmpty => 1,
147             child        => "string",
148     },
149     BackupFilesExclude  => {
150             type         => "list",
151             emptyOk      => 1,
152             undefIfEmpty => 1,
153             child        => "string",
154     },
155
156     BlackoutBadPingLimit => "integer",
157     BlackoutGoodCnt      => "integer",
158     BlackoutPeriods      => {
159             type    => "list",
160             emptyOk => 1,
161             child   => {
162                 type      => "hash",
163                 noKeyEdit => 1,
164                 child     => {
165                     hourBegin => "float",
166                     hourEnd   => "float",
167                     weekDays  => {
168                         type  => "shortlist",
169                         child => "integer",
170                     },
171                 },
172             },
173         },
174
175     BackupZeroFilesIsFatal => "integer",
176
177     ######################################################################
178     # How to backup a client
179     ######################################################################
180     XferMethod => {
181             type   => "select",
182             values => [qw(archive rsync rsyncd smb tar)],
183     },
184     XferLogLevel        => "integer",
185
186     SmbShareName        => {
187             type   => "list",
188             child  => "string",
189     },
190     SmbShareUserName    => "string",
191     SmbSharePasswd      => "string",
192     SmbClientPath       => {type => "string", undefIfEmpty => 1},
193     SmbClientFullCmd    => "string",
194     SmbClientIncrCmd    => "string",
195     SmbClientRestoreCmd => "string",
196
197     TarShareName        => {
198             type   => "list",
199             child  => "string",
200     },
201     TarClientCmd        => "string",
202     TarFullArgs         => "string",
203     TarIncrArgs         => "string",
204     TarClientRestoreCmd => "string",
205     TarClientPath       => {type => "string", undefIfEmpty => 1},
206
207     RsyncShareName      => {
208             type   => "list",
209             child  => "string",
210     },
211     RsyncClientPath     => {type => "string", undefIfEmpty => 1},
212     RsyncClientCmd      => "string",
213     RsyncClientRestoreCmd => "string",
214
215     RsyncdClientPort    => "integer",
216     RsyncdPasswd        => "string",
217     RsyncdAuthRequired  => "integer",
218
219     RsyncCsumCacheVerifyProb => "float",
220     RsyncArgs           => {
221             type   => "list",
222             emptyOk => 1,
223             child  => "string",
224     },
225     RsyncRestoreArgs    => {
226             type   => "list",
227             emptyOk => 1,
228             child  => "string",
229     },
230
231     ArchiveDest         => "string",
232     ArchiveComp         => {
233             type   => "select",
234             values => [qw(none bzip2 gzip)],
235     },
236     ArchivePar          => "integer",
237     ArchiveSplit        => "float",
238     ArchiveClientCmd    => "string",
239
240     NmbLookupCmd        => "string",
241     NmbLookupFindHostCmd => "string",
242
243     FixedIPNetBiosNameCheck => "integer",
244     PingCmd             => "string",
245     PingMaxMsec         => "float",
246
247     ClientTimeout       => "integer",
248
249     MaxOldPerPCLogFiles => "integer",
250
251     CompressLevel       => "integer",
252
253     DumpPreUserCmd      => {type => "string", undefIfEmpty => 1},
254     DumpPostUserCmd     => {type => "string", undefIfEmpty => 1},
255     DumpPreShareCmd     => {type => "string", undefIfEmpty => 1},
256     DumpPostShareCmd    => {type => "string", undefIfEmpty => 1},
257     RestorePreUserCmd   => {type => "string", undefIfEmpty => 1},
258     RestorePostUserCmd  => {type => "string", undefIfEmpty => 1},
259     ArchivePreUserCmd   => {type => "string", undefIfEmpty => 1},
260     ArchivePostUserCmd  => {type => "string", undefIfEmpty => 1},
261
262     ClientNameAlias     => {type => "string", undefIfEmpty => 1},
263
264     ######################################################################
265     # Email reminders, status and messages
266     # (can be overridden in the per-PC config.pl)
267     ######################################################################
268     SendmailPath              => {type => "string", undefIfEmpty => 1},
269     EMailNotifyMinDays        => "float",
270     EMailFromUserName         => "string",
271     EMailAdminUserName        => "string",
272     EMailUserDestDomain       => "string",
273     EMailNoBackupEverSubj     => {type => "string",    undefIfEmpty => 1},
274     EMailNoBackupEverMesg     => {type => "bigstring", undefIfEmpty => 1},
275     EMailNotifyOldBackupDays  => "float",
276     EMailNoBackupRecentSubj   => {type => "string",    undefIfEmpty => 1},
277     EMailNoBackupRecentMesg   => {type => "bigstring", undefIfEmpty => 1},
278     EMailNotifyOldOutlookDays => "float",
279     EMailOutlookBackupSubj    => {type => "string",    undefIfEmpty => 1},
280     EMailOutlookBackupMesg    => {type => "bigstring", undefIfEmpty => 1},
281
282     ######################################################################
283     # CGI user interface configuration settings
284     ######################################################################
285     CgiAdminUserGroup   => "string",
286     CgiAdminUsers       => "string",
287     CgiURL              => "string",
288     Language            => "string",
289     CgiUserHomePageCheck => "string",
290     CgiUserUrlCreate    => "string",
291     CgiDateFormatMMDD   => "integer",
292     CgiNavBarAdminAllHosts => "integer",
293     CgiSearchBoxEnable  => "integer",
294     CgiNavBarLinks      => {
295             type    => "list",
296             emptyOk => 1,
297             child   => {
298                 type => "hash",
299                 noKeyEdit => 1,
300                 child => {
301                     link  => "string",
302                     lname => {type => "string", undefIfEmpty => 1},
303                     name  => {type => "string", undefIfEmpty => 1},
304                 },
305             },
306     },
307     CgiStatusHilightColor => {
308             type => "hash",
309             noKeyEdit => 1,
310             child => {
311                 Reason_backup_failed           => "string",
312                 Reason_backup_done             => "string",
313                 Reason_no_ping                 => "string",
314                 Reason_backup_canceled_by_user => "string",
315                 Status_backup_in_progress      => "string",
316             },
317     },
318     CgiHeaders          => "bigstring",
319     CgiImageDir         => "string",
320     CgiExt2ContentType  => {
321             type      => "hash",
322             emptyOk   => 1,
323             childType => "string",
324         },
325     CgiImageDirURL      => "string",
326     CgiCSSFile          => "string",
327     CgiUserConfigEdit   => {
328             type => "hash",
329             noKeyEdit => 1,
330             child => {
331                 FullPeriod                => "boolean",
332                 IncrPeriod                => "boolean",
333                 FullKeepCnt               => "boolean",
334                 FullKeepCntMin            => "boolean",
335                 FullAgeMax                => "boolean",
336                 IncrKeepCnt               => "boolean",
337                 IncrKeepCntMin            => "boolean",
338                 IncrAgeMax                => "boolean",
339                 PartialAgeMax             => "boolean",
340                 IncrFill                  => "boolean",
341                 RestoreInfoKeepCnt        => "boolean",
342                 ArchiveInfoKeepCnt        => "boolean",
343                 BackupFilesOnly           => "boolean",
344                 BackupFilesExclude        => "boolean",
345                 BlackoutBadPingLimit      => "boolean",
346                 BlackoutGoodCnt           => "boolean",
347                 BlackoutPeriods           => "boolean",
348                 BackupZeroFilesIsFatal    => "boolean",
349                 XferMethod                => "boolean",
350                 XferLogLevel              => "boolean",
351                 SmbShareName              => "boolean",
352                 SmbShareUserName          => "boolean",
353                 SmbSharePasswd            => "boolean",
354                 TarShareName              => "boolean",
355                 TarFullArgs               => "boolean",
356                 TarIncrArgs               => "boolean",
357                 RsyncShareName            => "boolean",
358                 RsyncdClientPort          => "boolean",
359                 RsyncdPasswd              => "boolean",
360                 RsyncdAuthRequired        => "boolean",
361                 RsyncCsumCacheVerifyProb  => "boolean",
362                 RsyncArgs                 => "boolean",
363                 RsyncRestoreArgs          => "boolean",
364                 ArchiveDest               => "boolean",
365                 ArchiveComp               => "boolean",
366                 ArchivePar                => "boolean",
367                 ArchiveSplit              => "boolean",
368                 FixedIPNetBiosNameCheck   => "boolean",
369                 PingMaxMsec               => "boolean",
370                 ClientTimeout             => "boolean",
371                 MaxOldPerPCLogFiles       => "boolean",
372                 CompressLevel             => "boolean",
373                 ClientNameAlias           => "boolean",
374                 EMailNotifyMinDays        => "boolean",
375                 EMailFromUserName         => "boolean",
376                 EMailAdminUserName        => "boolean",
377                 EMailUserDestDomain       => "boolean",
378                 EMailNoBackupEverSubj     => "boolean",
379                 EMailNoBackupEverMesg     => "boolean",
380                 EMailNotifyOldBackupDays  => "boolean",
381                 EMailNoBackupRecentSubj   => "boolean",
382                 EMailNoBackupRecentMesg   => "boolean",
383                 EMailNotifyOldOutlookDays => "boolean",
384                 EMailOutlookBackupSubj    => "boolean",
385                 EMailOutlookBackupMesg    => "boolean",
386             },
387     },
388 );
389
390 1;