/[smecontribs]/rpms/smeserver-BackupPC/contribs8/smeserver-BackupPC-0.1-encrypt_archives.patch
ViewVC logotype

Contents of /rpms/smeserver-BackupPC/contribs8/smeserver-BackupPC-0.1-encrypt_archives.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Feb 7 02:18:15 2013 UTC (11 years, 8 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-BackupPC-0_1-12_el5_sme, HEAD
Initial import

1 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/etc/BackupPC/localArchive.conf mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/localArchive.conf
2 --- smeserver-BackupPC-0.1/root/etc/BackupPC/localArchive.conf 2009-05-13 01:35:34.000000000 +0200
3 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/localArchive.conf 2009-05-13 01:33:52.000000000 +0200
4 @@ -7,6 +7,23 @@
5 # Compression. Can be gzip, bzip2 or none
6 compress = gzip
7
8 +# Encryption of the archives, using OpenSSL
9 +# You can put here the name of the cipher you want to use
10 +# To obtain a list of available cipher, run the command
11 +# man enc
12 +# eg: cipher = aes-256-cbc
13 +# If encryption is turned on, .enc will be appended
14 +# At the end of the archive's name.
15 +# To be able tu use this archive talter, you'll have to
16 +# decrypt it using the same key
17 +# cat archive.tar.gz.enc | openssl enc aes-256-cbc -d -pass file:/etc/BackupPC/archive.key > archive.tar.gz
18 +cipher = off
19 +
20 +# The key file to use to encrypt the archive
21 +# You should backup this key somewhere. If you lost it
22 +# your archives will be unusuable
23 +key = /etc/BackupPC/archive.key
24 +
25 # The backup number to archive, -1 means the last one
26 backupNum = -1
27
28 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/etc/BackupPC/remoteArchive.conf mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/remoteArchive.conf
29 --- smeserver-BackupPC-0.1/root/etc/BackupPC/remoteArchive.conf 2009-05-13 01:35:34.000000000 +0200
30 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/remoteArchive.conf 2009-05-13 01:34:34.000000000 +0200
31 @@ -10,6 +10,23 @@
32 # Compression. Can be gzip, bzip2 or none
33 compress = gzip
34
35 +# Encryption of the archives, using OpenSSL
36 +# You can put here the name of the cipher you want to use
37 +# To obtain a list of available cipher, run the command
38 +# man enc
39 +# eg: cipher = aes-256-cbc
40 +# If encryption is turned on, .enc will be appended
41 +# At the end of the archive's name.
42 +# To be able tu use this archive talter, you'll have to
43 +# decrypt it using the same key
44 +# cat archive.tar.gz.enc | openssl enc aes-256-cbc -d -pass file:/etc/BackupPC/archive.key > archive.tar.gz
45 +cipher = off
46 +
47 +# The key file to use to encrypt the archive
48 +# You should backup this key somewhere. If you lost it
49 +# your archives will be unusuable
50 +key = /etc/BackupPC/archive.key
51 +
52 # The backup number to archive, -1 means the last one
53 backupNum = -1
54
55 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/etc/BackupPC/usbArchive.conf mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/usbArchive.conf
56 --- smeserver-BackupPC-0.1/root/etc/BackupPC/usbArchive.conf 2009-05-13 01:35:34.000000000 +0200
57 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/etc/BackupPC/usbArchive.conf 2009-05-13 01:34:12.000000000 +0200
58 @@ -7,6 +7,23 @@
59 # Compression. Can be gzip, bzip2 or none
60 compress = gzip
61
62 +# Encryption of the archives, using OpenSSL
63 +# You can put here the name of the cipher you want to use
64 +# To obtain a list of available cipher, run the command
65 +# man enc
66 +# eg: cipher = aes-256-cbc
67 +# If encryption is turned on, .enc will be appended
68 +# At the end of the archive's name.
69 +# To be able tu use this archive talter, you'll have to
70 +# decrypt it using the same key
71 +# cat archive.tar.gz.enc | openssl enc aes-256-cbc -d -pass file:/etc/BackupPC/archive.key > archive.tar.gz
72 +cipher = off
73 +
74 +# The key file to use to encrypt the archive
75 +# You should backup this key somewhere. If you lost it
76 +# your archives will be unusuable
77 +key = /etc/BackupPC/archive.key
78 +
79 # The backup number to archive, -1 means the last one
80 backupNum = -1
81
82 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_localArchive mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_localArchive
83 --- smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_localArchive 2008-10-06 19:01:51.000000000 +0200
84 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_localArchive 2009-05-11 17:19:09.000000000 +0200
85 @@ -39,6 +39,8 @@
86 'destination'=>"/tmp/",
87 'split'=>"0",
88 'compress'=>"gzip",
89 + 'cipher'=>'off',
90 + 'key'=>'/etc/BackupPC/archive.key',
91 'backupNum'=>"-1",
92 'share'=>"*",
93 'parity'=>'0',
94 @@ -53,7 +55,7 @@
95
96 print STDERR "\nYou have requested to archive these hosts: $params{hosts} to this destination: $params{destination}\n\n";
97
98 -localArchive($params{hosts},$params{backupNum},$params{share},$params{compress},$params{split},$params{destination});
99 +localArchive($params{hosts},$params{backupNum},$params{share},$params{compress},$params{split},$params{cipher},$params{key},$params{destination});
100
101 print STDERR "\n\nArchive finished: ".`$path{date}`."\n";
102
103 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_remoteArchive mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_remoteArchive
104 --- smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_remoteArchive 2008-10-06 19:01:05.000000000 +0200
105 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_remoteArchive 2009-05-11 21:11:02.000000000 +0200
106 @@ -40,6 +40,8 @@
107 'remoteUser'=>"backuppc",
108 'remoteDir'=>"/tmp/",
109 'compress'=>"gzip",
110 + 'cipher'=>'off',
111 + 'key'=>'/etc/BackupPC/archive.key',
112 'backupNum'=>"-1",
113 'share'=>"*",
114 'hosts'=>'localhost',
115 @@ -53,7 +55,7 @@
116
117 print STDERR "\nYou have requested to archive these hosts: $params{hosts} to this destination: $params{remoteUser}\@$params{remoteHost}:/$params{remoteDir}\n\n";
118
119 -remoteArchive($params{remoteHost},$params{remoteUser},$params{remoteDir},$params{hosts},$params{backupNum},$params{share},$params{compress});
120 +remoteArchive($params{remoteHost},$params{remoteUser},$params{remoteDir},$params{hosts},$params{backupNum},$params{share},$params{compress},$params{cipher},$params{key});
121
122 print STDERR "\n\nArchive finished: ".`$path{date}`."\n";
123
124 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_usbArchive mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_usbArchive
125 --- smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_usbArchive 2008-10-06 18:58:43.000000000 +0200
126 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/bin/BackupPC_SME_usbArchive 2009-05-11 17:21:32.000000000 +0200
127 @@ -39,7 +39,8 @@
128 my %params=(
129 'split'=>"0",
130 'compress'=>"/bin/gzip",
131 - 'extension'=>"tar.gz",
132 + 'cipher'=>'off',
133 + 'key'=>'/etc/BackupPC/archive.key',
134 'backupNum'=>"-1",
135 'share'=>"*",
136 'hosts'=>'localhost',
137 @@ -59,7 +60,7 @@
138 $check = mountUsb($params{destination},$params{device});
139
140 if ($check eq 1){
141 - localArchive($params{hosts},$params{backupNum},$params{share},$params{compress},$params{split},$params{destination});
142 + localArchive($params{hosts},$params{backupNum},$params{share},$params{compress},$params{split},$params{cipher},$params{key},$params{destination});
143 }
144 else{
145 print STDERR "\n\nAborting, an error occured while mounting the removable device $params{device} on $params{destination}\n\n";
146 diff -Nur -x '*.orig' -x '*.rej' smeserver-BackupPC-0.1/root/usr/share/BackupPC/lib/BackupPC/SMEarchive.pm mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/lib/BackupPC/SMEarchive.pm
147 --- smeserver-BackupPC-0.1/root/usr/share/BackupPC/lib/BackupPC/SMEarchive.pm 2008-10-06 19:05:37.000000000 +0200
148 +++ mezzanine_patched_smeserver-BackupPC-0.1/root/usr/share/BackupPC/lib/BackupPC/SMEarchive.pm 2009-05-11 21:10:15.000000000 +0200
149 @@ -43,6 +43,7 @@
150 $path{bzip2} = '/usr/bin/bzip2';
151 $path{rsync} = '/usr/bin/rsync';
152 $path{tar} = '/bin/tar';
153 +$path{openssl} = '/usr/bin/openssl';
154
155 sub checkExec{
156 # On vérifie que les executables sont bien executables
157 @@ -157,8 +158,8 @@
158 system("$path{rm} -f $file");
159 }
160
161 -sub localArchive($$$$$$){
162 - my ($hosts,$backupNum,$share,$compress,$split,$destination) = @_;
163 +sub localArchive($$$$$$$$){
164 + my ($hosts,$backupNum,$share,$compress,$split,$cipher,$key,$destination) = @_;
165 my $check = 1;
166 my $extension = 'tar';
167 # on fixe l'extension de l'archive en fonction de la compression utilisée
168 @@ -190,6 +191,10 @@
169 if (($compress eq 'gzip') || ($compress eq 'bzip2')){
170 $cmd .= "| $path{$compress} -c ";
171 }
172 + if (($cipher ne 'off') && (-e $key)){
173 + $cmd .= "| $path{openssl} enc -$cipher -salt -pass file:$key";
174 + $extension .= '.enc';
175 + }
176 if ($split eq '0'){
177 $cmd .= "> $destination/$host.$backupNum.$extension";
178 }
179 @@ -255,8 +260,8 @@
180 return $ok;
181 }
182
183 -sub remoteArchive($$$$$$$){
184 - my ($remoteHost,$remoteUser,$remoteDir,$hosts,$backupNum,$share,$compress) = @_;
185 +sub remoteArchive($$$$$$$$$){
186 + my ($remoteHost,$remoteUser,$remoteDir,$hosts,$backupNum,$share,$compress,$cipher,$key) = @_;
187 my $check = 1;
188 my $extension = 'tar';
189 # on fixe l'extension de l'archive en fonction de la compression utilisée
190 @@ -277,7 +282,10 @@
191 if (($compress eq 'gzip') || ($compress eq 'bzip2')){
192 $cmd .= "| $path{$compress} -c ";
193 }
194 -
195 + if (($cipher ne 'off') && (-e $key)){
196 + $cmd .= "| $path{openssl} enc -$cipher -salt -pass file:$key";
197 + $extension .= '.enc';
198 + }
199 $cmd .= " | $path{ssh} -l $remoteUser $remoteHost \"(cd $remoteDir && $path{cat} > $remoteDir/$host.$backupNum.$extension)\"";
200
201 logAndPerform($cmd);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed