diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-03-28 22:59:28 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-03-28 22:59:28 +0000 |
commit | 732bdbdaacb429c94c4120070e531038e3d6f132 (patch) | |
tree | ecd16d380ae1d2dcd0d65e089177eb16cca6d47f /lib/backupclient | |
parent | 4fca88ed02c1f0b5208abf2420f73023de54c23e (diff) |
Allow configuration of the server port that the client will connect to
(bbackupd and bbackupquery).
Redesign ConfigurationVerify to use classes instead of structs.
Use port 22011 instead of 2201 during tests, to reduce the chances of
conflicting with a running bbstored or other process.
Ignore autogen_* in svn:ignore everywhere instead of individual per-file
ignores.
Diffstat (limited to 'lib/backupclient')
-rw-r--r-- | lib/backupclient/BackupDaemonConfigVerify.cpp | 89 |
1 files changed, 52 insertions, 37 deletions
diff --git a/lib/backupclient/BackupDaemonConfigVerify.cpp b/lib/backupclient/BackupDaemonConfigVerify.cpp index 61033b5b..db1de4fa 100644 --- a/lib/backupclient/BackupDaemonConfigVerify.cpp +++ b/lib/backupclient/BackupDaemonConfigVerify.cpp @@ -17,15 +17,15 @@ static const ConfigurationVerifyKey backuplocationkeys[] = { - {"ExcludeFile", 0, ConfigTest_MultiValueAllowed, 0}, - {"ExcludeFilesRegex", 0, ConfigTest_MultiValueAllowed, 0}, - {"ExcludeDir", 0, ConfigTest_MultiValueAllowed, 0}, - {"ExcludeDirsRegex", 0, ConfigTest_MultiValueAllowed, 0}, - {"AlwaysIncludeFile", 0, ConfigTest_MultiValueAllowed, 0}, - {"AlwaysIncludeFilesRegex", 0, ConfigTest_MultiValueAllowed, 0}, - {"AlwaysIncludeDir", 0, ConfigTest_MultiValueAllowed, 0}, - {"AlwaysIncludeDirsRegex", 0, ConfigTest_MultiValueAllowed, 0}, - {"Path", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("ExcludeFile", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("ExcludeFilesRegex", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("ExcludeDir", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("ExcludeDirsRegex", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("AlwaysIncludeFile", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("AlwaysIncludeFilesRegex", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("AlwaysIncludeDir", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("AlwaysIncludeDirsRegex", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("Path", ConfigTest_Exists | ConfigTest_LastEntry) }; static const ConfigurationVerify backuplocations[] = @@ -64,39 +64,54 @@ static const ConfigurationVerify verifyserver[] = static const ConfigurationVerifyKey verifyrootkeys[] = { - {"AccountNumber", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - - {"UpdateStoreInterval", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"MinimumFileAge", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"MaxUploadWait", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"MaxFileTimeInFuture", "172800", ConfigTest_IsInt, 0}, // file is uploaded if the file is this much in the future (2 days default) - - {"AutomaticBackup", "yes", ConfigTest_IsBool, 0}, + ConfigurationVerifyKey("AccountNumber", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("UpdateStoreInterval", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("MinimumFileAge", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("MaxUploadWait", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("MaxFileTimeInFuture", ConfigTest_IsInt, 172800), + // file is uploaded if the file is this much in the future + // (2 days default) + ConfigurationVerifyKey("AutomaticBackup", ConfigTest_IsBool, true), - {"SyncAllowScript", 0, 0, 0}, // optional script to run to see if the sync should be started now - // return "now" if it's allowed, or a number of seconds if it's not - - {"MaximumDiffingTime", 0, ConfigTest_IsInt, 0}, - {"DeleteRedundantLocationsAfter", "172800", ConfigTest_IsInt, 0}, + ConfigurationVerifyKey("SyncAllowScript", 0), + // script that returns "now" if backup is allowed now, or a number + // of seconds to wait before trying again if not - {"FileTrackingSizeThreshold", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"DiffingUploadSizeThreshold", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"StoreHostname", 0, ConfigTest_Exists, 0}, - {"ExtendedLogging", "no", ConfigTest_IsBool, 0}, // extended log to syslog - {"ExtendedLogFile", NULL, 0, 0}, // extended log to a file - {"LogAllFileAccess", "no", ConfigTest_IsBool, 0}, + ConfigurationVerifyKey("MaximumDiffingTime", ConfigTest_IsInt), + ConfigurationVerifyKey("DeleteRedundantLocationsAfter", + ConfigTest_IsInt, 172800), - {"CommandSocket", 0, 0, 0}, // not compulsory to have this - {"KeepAliveTime", 0, ConfigTest_IsInt, 0}, // optional - {"StoreObjectInfoFile", 0, 0, 0}, // optional + ConfigurationVerifyKey("FileTrackingSizeThreshold", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("DiffingUploadSizeThreshold", + ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("StoreHostname", ConfigTest_Exists), + ConfigurationVerifyKey("StorePort", ConfigTest_IsInt, + BOX_PORT_BBSTORED), + ConfigurationVerifyKey("ExtendedLogging", ConfigTest_IsBool, false), + // extended log to syslog + ConfigurationVerifyKey("ExtendedLogFile", 0), + // extended log to a file + ConfigurationVerifyKey("LogAllFileAccess", ConfigTest_IsBool, false), + ConfigurationVerifyKey("CommandSocket", 0), + // not compulsory to have this + ConfigurationVerifyKey("KeepAliveTime", ConfigTest_IsInt), + ConfigurationVerifyKey("StoreObjectInfoFile", 0), + // optional - {"NotifyScript", 0, 0, 0}, // optional script to run when backup needs attention, eg store full + ConfigurationVerifyKey("NotifyScript", 0), + // optional script to run when backup needs attention, eg store full - {"CertificateFile", 0, ConfigTest_Exists, 0}, - {"PrivateKeyFile", 0, ConfigTest_Exists, 0}, - {"TrustedCAsFile", 0, ConfigTest_Exists, 0}, - {"KeysFile", 0, ConfigTest_Exists, 0}, - {"DataDirectory", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("CertificateFile", ConfigTest_Exists), + ConfigurationVerifyKey("PrivateKeyFile", ConfigTest_Exists), + ConfigurationVerifyKey("TrustedCAsFile", ConfigTest_Exists), + ConfigurationVerifyKey("KeysFile", ConfigTest_Exists), + ConfigurationVerifyKey("DataDirectory", + ConfigTest_Exists | ConfigTest_LastEntry), }; const ConfigurationVerify BackupDaemonConfigVerify = |