Changes for 3.1.0beta0.
[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 3.1.0beta0, released 3 Sep 2007.
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 => "execPath", undefIfEmpty => 1},
85     NmbLookupPath       => {type => "execPath", undefIfEmpty => 1},
86     PingPath            => {type => "execPath", undefIfEmpty => 1},
87     DfPath              => {type => "execPath", undefIfEmpty => 1},
88     DfCmd               => "string",
89     SplitPath           => {type => "execPath", undefIfEmpty => 1},
90     ParPath             => {type => "execPath", undefIfEmpty => 1},
91     CatPath             => {type => "execPath", undefIfEmpty => 1},
92     GzipPath            => {type => "execPath", undefIfEmpty => 1},
93     Bzip2Path           => {type => "execPath", 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                 order     => [qw(ipAddrBase first last)],
103                 child     => {
104                     ipAddrBase => "string",
105                     first      => "integer",
106                     last       => "integer",
107                 },
108             },
109     },
110     BackupPCUser        => "string",
111     CgiDir              => "string",
112     InstallDir          => "string",
113     TopDir              => "string",
114     ConfDir             => "string",
115     LogDir              => "string",
116     BackupPCUserVerify  => "boolean",
117     HardLinkMax         => "integer",
118     PerlModuleLoad      => {
119             type    => "list",
120             emptyOk => 1,
121             undefIfEmpty => 1,
122             child   => "string",
123     },
124     ServerInitdPath     => {type => "string", undefIfEmpty => 1},
125     ServerInitdStartCmd => "string",
126
127     ######################################################################
128     # What to backup and when to do it
129     # (can be overridden in the per-PC config.pl)
130     ######################################################################
131     FullPeriod          => "float",
132     IncrPeriod          => "float",
133     FullKeepCnt         => {
134             type   => "shortlist",
135             child  => "integer",
136     },
137     FullKeepCntMin      => "integer",
138     FullAgeMax          => "float",
139     IncrKeepCnt         => "integer",
140     IncrKeepCntMin      => "integer",
141     IncrAgeMax          => "float",
142     IncrLevels          => {
143             type   => "shortlist",
144             child  => "integer",
145     },
146     PartialAgeMax       => "float",
147     BackupsDisable      => "integer",
148     IncrFill            => "boolean",
149     RestoreInfoKeepCnt  => "integer",
150     ArchiveInfoKeepCnt  => "integer",
151
152     BackupFilesOnly     => {
153             type      => "hash",
154             emptyOk   => 1,
155             childType => {
156                 type      => "list",
157                 emptyOk   => 1,
158                 child     => "string",
159             },
160     },
161     BackupFilesExclude  => {
162             type      => "hash",
163             emptyOk   => 1,
164             childType => {
165                 type      => "list",
166                 emptyOk   => 1,
167                 child     => "string",
168             },
169     },
170
171     BlackoutBadPingLimit => "integer",
172     BlackoutGoodCnt      => "integer",
173     BlackoutPeriods      => {
174             type    => "list",
175             emptyOk => 1,
176             child   => {
177                 type      => "hash",
178                 noKeyEdit => 1,
179                 child     => {
180                     hourBegin => "float",
181                     hourEnd   => "float",
182                     weekDays  => {
183                         type  => "shortlist",
184                         child => "integer",
185                     },
186                 },
187             },
188         },
189
190     BackupZeroFilesIsFatal => "boolean",
191
192     ######################################################################
193     # How to backup a client
194     ######################################################################
195     XferMethod => {
196             type   => "select",
197             values => [qw(archive rsync rsyncd smb tar)],
198     },
199     XferLogLevel        => "integer",
200
201     ClientCharset       => "string",
202     ClientCharsetLegacy => "string",
203
204     SmbShareName        => {
205             type   => "list",
206             child  => "string",
207     },
208     SmbShareUserName    => "string",
209     SmbSharePasswd      => "string",
210     SmbClientPath       => {type => "execPath", undefIfEmpty => 1},
211     SmbClientFullCmd    => "string",
212     SmbClientIncrCmd    => "string",
213     SmbClientRestoreCmd => "string",
214
215     TarShareName        => {
216             type   => "list",
217             child  => "string",
218     },
219     TarClientCmd        => "string",
220     TarFullArgs         => "string",
221     TarIncrArgs         => "string",
222     TarClientRestoreCmd => "string",
223     TarClientPath       => {type => "string", undefIfEmpty => 1},
224
225     RsyncShareName      => {
226             type   => "list",
227             child  => "string",
228     },
229     RsyncClientPath     => {type => "string", undefIfEmpty => 1},
230     RsyncClientCmd      => "string",
231     RsyncClientRestoreCmd => "string",
232
233     RsyncdClientPort    => "integer",
234     RsyncdUserName      => "string",
235     RsyncdPasswd        => "string",
236     RsyncdAuthRequired  => "boolean",
237
238     RsyncCsumCacheVerifyProb => "float",
239     RsyncArgs           => {
240             type   => "list",
241             emptyOk => 1,
242             child  => "string",
243     },
244     RsyncRestoreArgs    => {
245             type   => "list",
246             emptyOk => 1,
247             child  => "string",
248     },
249
250     BackupPCdCmd        => "string",
251     BackupPCdPath       => "string",
252     BackupPCdShareName  => "string",
253     BackupPCdRestoreCmd => "string",
254
255     ArchiveDest         => "string",
256     ArchiveComp         => {
257             type   => "select",
258             values => [qw(none bzip2 gzip)],
259     },
260     ArchivePar          => "boolean",
261     ArchiveSplit        => "float",
262     ArchiveClientCmd    => "string",
263
264     NmbLookupCmd        => "string",
265     NmbLookupFindHostCmd => "string",
266
267     FixedIPNetBiosNameCheck => "boolean",
268     PingCmd             => "string",
269     PingMaxMsec         => "float",
270
271     ClientTimeout       => "integer",
272
273     MaxOldPerPCLogFiles => "integer",
274
275     CompressLevel       => "integer",
276
277     DumpPreUserCmd      => {type => "string", undefIfEmpty => 1},
278     DumpPostUserCmd     => {type => "string", undefIfEmpty => 1},
279     DumpPreShareCmd     => {type => "string", undefIfEmpty => 1},
280     DumpPostShareCmd    => {type => "string", undefIfEmpty => 1},
281     RestorePreUserCmd   => {type => "string", undefIfEmpty => 1},
282     RestorePostUserCmd  => {type => "string", undefIfEmpty => 1},
283     ArchivePreUserCmd   => {type => "string", undefIfEmpty => 1},
284     ArchivePostUserCmd  => {type => "string", undefIfEmpty => 1},
285     UserCmdCheckStatus  => "boolean",
286
287     ClientNameAlias     => {type => "string", undefIfEmpty => 1},
288
289     ######################################################################
290     # Email reminders, status and messages
291     # (can be overridden in the per-PC config.pl)
292     ######################################################################
293     SendmailPath              => {type => "execPath", undefIfEmpty => 1},
294     EMailNotifyMinDays        => "float",
295     EMailFromUserName         => "string",
296     EMailAdminUserName        => "string",
297     EMailUserDestDomain       => "string",
298     EMailNoBackupEverSubj     => {type => "string",    undefIfEmpty => 1},
299     EMailNoBackupEverMesg     => {type => "bigstring", undefIfEmpty => 1},
300     EMailNotifyOldBackupDays  => "float",
301     EMailNoBackupRecentSubj   => {type => "string",    undefIfEmpty => 1},
302     EMailNoBackupRecentMesg   => {type => "bigstring", undefIfEmpty => 1},
303     EMailNotifyOldOutlookDays => "float",
304     EMailOutlookBackupSubj    => {type => "string",    undefIfEmpty => 1},
305     EMailOutlookBackupMesg    => {type => "bigstring", undefIfEmpty => 1},
306     EMailHeaders              => {type => "bigstring", undefIfEmpty => 1},
307
308     ######################################################################
309     # CGI user interface configuration settings
310     ######################################################################
311     CgiAdminUserGroup   => "string",
312     CgiAdminUsers       => "string",
313     CgiURL              => "string",
314     Language            => {
315             type   => "select",
316             values => [qw(de en es fr it nl pt_br zh_CN)],
317     },
318     CgiUserHomePageCheck => "string",
319     CgiUserUrlCreate    => "string",
320     CgiDateFormatMMDD   => "integer",
321     CgiNavBarAdminAllHosts => "boolean",
322     CgiSearchBoxEnable  => "boolean",
323     CgiNavBarLinks      => {
324             type    => "list",
325             emptyOk => 1,
326             child   => {
327                 type => "hash",
328                 noKeyEdit => 1,
329                 child => {
330                     link  => "string",
331                     lname => {type => "string", undefIfEmpty => 1},
332                     name  => {type => "string", undefIfEmpty => 1},
333                 },
334             },
335     },
336     CgiStatusHilightColor => {
337             type => "hash",
338             noKeyEdit => 1,
339             child => {
340                 Reason_backup_failed           => "string",
341                 Reason_backup_done             => "string",
342                 Reason_no_ping                 => "string",
343                 Reason_backup_canceled_by_user => "string",
344                 Status_backup_in_progress      => "string",
345                 Disabled_OnlyManualBackups     => "string", 
346                 Disabled_AllBackupsDisabled    => "string",  
347             },
348     },
349     CgiHeaders          => "bigstring",
350     CgiImageDir         => "string",
351     CgiExt2ContentType  => {
352             type      => "hash",
353             emptyOk   => 1,
354             childType => "string",
355         },
356     CgiImageDirURL      => "string",
357     CgiCSSFile          => "string",
358     CgiUserConfigEditEnable => "boolean",
359     CgiUserConfigEdit   => {
360             type => "hash",
361             noKeyEdit => 1,
362             child => {
363                 FullPeriod                => "boolean",
364                 IncrPeriod                => "boolean",
365                 FullKeepCnt               => "boolean",
366                 FullKeepCntMin            => "boolean",
367                 FullAgeMax                => "boolean",
368                 IncrKeepCnt               => "boolean",
369                 IncrKeepCntMin            => "boolean",
370                 IncrAgeMax                => "boolean",
371                 IncrLevels                => "boolean",
372                 PartialAgeMax             => "boolean",
373                 IncrFill                  => "boolean",
374                 RestoreInfoKeepCnt        => "boolean",
375                 ArchiveInfoKeepCnt        => "boolean",
376                 BackupFilesOnly           => "boolean",
377                 BackupFilesExclude        => "boolean",
378                 BackupsDisable            => "boolean",
379                 BlackoutBadPingLimit      => "boolean",
380                 BlackoutGoodCnt           => "boolean",
381                 BlackoutPeriods           => "boolean",
382                 BackupZeroFilesIsFatal    => "boolean",
383                 XferMethod                => "boolean",
384                 XferLogLevel              => "boolean",
385                 ClientCharset             => "boolean",
386                 ClientCharsetLegacy       => "boolean",
387                 SmbShareName              => "boolean",
388                 SmbShareUserName          => "boolean",
389                 SmbSharePasswd            => "boolean",
390                 SmbClientFullCmd          => "boolean",
391                 SmbClientIncrCmd          => "boolean",
392                 SmbClientRestoreCmd       => "boolean",
393                 TarShareName              => "boolean",
394                 TarFullArgs               => "boolean",
395                 TarIncrArgs               => "boolean",
396                 TarClientCmd              => "boolean",
397                 TarClientPath             => "boolean",
398                 TarClientRestoreCmd       => "boolean",
399                 RsyncShareName            => "boolean",
400                 RsyncdClientPort          => "boolean",
401                 RsyncdUserName            => "boolean",
402                 RsyncdPasswd              => "boolean",
403                 RsyncdAuthRequired        => "boolean",
404                 RsyncCsumCacheVerifyProb  => "boolean",
405                 RsyncArgs                 => "boolean",
406                 RsyncRestoreArgs          => "boolean",
407                 RsyncClientCmd            => "boolean",
408                 RsyncClientPath           => "boolean",
409                 RsyncClientRestoreCmd     => "boolean",
410                 ArchiveDest               => "boolean",
411                 ArchiveComp               => "boolean",
412                 ArchivePar                => "boolean",
413                 ArchiveSplit              => "boolean",
414                 ArchiveClientCmd          => "boolean",
415                 FixedIPNetBiosNameCheck   => "boolean",
416                 PingMaxMsec               => "boolean",
417                 NmbLookupCmd              => "boolean",
418                 NmbLookupFindHostCmd      => "boolean",
419                 PingCmd                   => "boolean",
420                 ClientTimeout             => "boolean",
421                 MaxOldPerPCLogFiles       => "boolean",
422                 CompressLevel             => "boolean",
423                 ClientNameAlias           => "boolean",
424                 DumpPreUserCmd            => "boolean",
425                 DumpPostUserCmd           => "boolean",
426                 RestorePreUserCmd         => "boolean",
427                 RestorePostUserCmd        => "boolean",
428                 ArchivePreUserCmd         => "boolean",
429                 ArchivePostUserCmd        => "boolean",
430                 DumpPostShareCmd          => "boolean",
431                 DumpPreShareCmd           => "boolean",
432                 UserCmdCheckStatus        => "boolean",
433                 EMailNotifyMinDays        => "boolean",
434                 EMailFromUserName         => "boolean",
435                 EMailAdminUserName        => "boolean",
436                 EMailUserDestDomain       => "boolean",
437                 EMailNoBackupEverSubj     => "boolean",
438                 EMailNoBackupEverMesg     => "boolean",
439                 EMailNotifyOldBackupDays  => "boolean",
440                 EMailNoBackupRecentSubj   => "boolean",
441                 EMailNoBackupRecentMesg   => "boolean",
442                 EMailNotifyOldOutlookDays => "boolean",
443                 EMailOutlookBackupSubj    => "boolean",
444                 EMailOutlookBackupMesg    => "boolean",
445                 EMailHeaders              => "boolean",
446             },
447     },
448
449     ######################################################################
450     # Fake config setting for editing the hosts
451     ######################################################################
452     Hosts => {
453             type    => "list",
454             emptyOk => 1,
455             child   => {
456                 type  => "horizHash",
457                 order => [qw(host dhcp user moreUsers)],
458                 noKeyEdit => 1,
459                 child => {
460                     host       => { type => "string", size => 20 },
461                     dhcp       => { type => "boolean"            },
462                     user       => { type => "string", size => 20 },
463                     moreUsers  => { type => "string", size => 30 },
464                 },
465             },
466     },
467 );
468
469 1;