siba 0.5.3 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/siba/helpers/security_helper.rb +1 -1
- data/lib/siba/plugins/plugins.yml +1 -0
- data/lib/siba/version.rb +1 -1
- data/test/integration/i9n_backup.rb +2 -3
- data/test/integration/i9n_test_unicode_files.rb +3 -1
- data/test/integration/plugins/encryption/gpg/i9n_encryption.rb +1 -1
- data/test/integration/tasks/i9n_siba_tasks.rb +2 -1
- data/test/integration/yml/valid.yml +1 -1
- data/test/unit/test_siba_check.rb +1 -0
- metadata +8 -8
data/README.md
CHANGED
@@ -6,7 +6,7 @@ module Siba
|
|
6
6
|
class SecurityHelper
|
7
7
|
class << self
|
8
8
|
def generate_password_for_yaml(length = 16)
|
9
|
-
characters = (32..126).to_a - "\\\"".bytes.to_a
|
9
|
+
characters = (32..126).to_a - "\\\"".bytes.to_a - "`".bytes.to_a
|
10
10
|
|
11
11
|
(0...length).map{
|
12
12
|
characters[SecureRandom.random_number(characters.size)].chr
|
data/lib/siba/version.rb
CHANGED
@@ -19,7 +19,8 @@ describe Siba::Backup do
|
|
19
19
|
test_yml_path = prepare_yml @path_to_src_yml,
|
20
20
|
{ src_dir: src_dir,
|
21
21
|
src_file: src_file,
|
22
|
-
dest_dir: dest_dir
|
22
|
+
dest_dir: dest_dir,
|
23
|
+
password: %("#{Siba::SecurityHelper.generate_password_for_yaml}") }
|
23
24
|
|
24
25
|
log_file = File.join File.dirname(test_yml_path), "testlog.log"
|
25
26
|
|
@@ -30,7 +31,6 @@ describe Siba::Backup do
|
|
30
31
|
Siba.tmp_dir_clean?.must_equal true, "Tmp dir must be cleaned"
|
31
32
|
Siba::LoggerPlug.opened?.must_equal false, "Logger must be closed"
|
32
33
|
|
33
|
-
|
34
34
|
# Test restore
|
35
35
|
sources_copy_dir = mkdir_in_tmp_dir "source-copy"
|
36
36
|
FileUtils.mv src_dir, sources_copy_dir
|
@@ -43,7 +43,6 @@ describe Siba::Backup do
|
|
43
43
|
Siba::SibaLogger.quiet = true
|
44
44
|
SibaTest::KernelMock.gets_return_value = "yes"
|
45
45
|
Siba::Restore.new.restore test_yml_path, false
|
46
|
-
|
47
46
|
File.directory?(src_dir).must_equal true
|
48
47
|
File.file?(src_file).must_equal true
|
49
48
|
dirs_same? src_dir, path_to_dir_copy
|
@@ -30,7 +30,9 @@ describe Siba::Backup do
|
|
30
30
|
test_yml_path = prepare_yml @path_to_src_yml,
|
31
31
|
{ src_dir: src_dir,
|
32
32
|
src_file: src_file,
|
33
|
-
dest_dir: dest_dir
|
33
|
+
dest_dir: dest_dir,
|
34
|
+
password: %("#{Siba::SecurityHelper.generate_password_for_yaml}") }
|
35
|
+
|
34
36
|
|
35
37
|
log_file = File.join File.dirname(test_yml_path), "testlog.log"
|
36
38
|
@backup.backup test_yml_path, log_file
|
@@ -5,7 +5,7 @@ require 'siba/plugins/encryption/gpg/init'
|
|
5
5
|
|
6
6
|
describe Siba::Encryption::Gpg::Encryption do
|
7
7
|
before do
|
8
|
-
@passphrase =
|
8
|
+
@passphrase = Siba::SecurityHelper.generate_password_for_yaml
|
9
9
|
end
|
10
10
|
|
11
11
|
it "init should fail if cipher is not supported" do
|
@@ -16,7 +16,8 @@ describe Siba::SibaTasks do
|
|
16
16
|
path_to_test_yml = prepare_yml @path_to_src_yml,
|
17
17
|
{ src_dir: src_dir,
|
18
18
|
src_file: src_file,
|
19
|
-
dest_dir: dest_dir
|
19
|
+
dest_dir: dest_dir,
|
20
|
+
password: %("#{Siba::SecurityHelper.generate_password_for_yaml}") }
|
20
21
|
|
21
22
|
options = SibaTest.load_options path_to_test_yml
|
22
23
|
|
@@ -40,6 +40,7 @@ describe Siba::SibaCheck do
|
|
40
40
|
->{@cls.options_string_array({"name"=>" "}, "name", false)}.must_raise Siba::CheckError
|
41
41
|
->{@cls.options_string_array({"name"=>nil}, "name", false)}.must_raise Siba::CheckError
|
42
42
|
->{@cls.options_string_array({"name"=>["1", " "]}, "name", false)}.must_raise Siba::CheckError
|
43
|
+
->{@cls.options_string_array({"name"=>["1", ""]}, "name", false)}.must_raise Siba::CheckError
|
43
44
|
->{@cls.options_string_array({"name"=>["1", nil]}, "name", false)}.must_raise Siba::CheckError
|
44
45
|
end
|
45
46
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: siba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &81058820 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.10'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *81058820
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &81058590 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.9'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *81058590
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: guard-minitest
|
38
|
-
requirement: &
|
38
|
+
requirement: &81058360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0.4'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *81058360
|
47
47
|
description: ! 'SIBA is a backup and restore utility. It implements daily backup rotation
|
48
48
|
scheme. It retains full year history of backups by keeping 23 files in total: for
|
49
49
|
the last 6 days, 5 weeks and 12 months. Backups are archived and encrypted. Various
|