mongo-oplog-backup 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41408b43d702bfbe7c3b4ea5ff0d46c89893d6e9
4
- data.tar.gz: cb54777ed47f5c31f1bd9aef664397b59f19806b
3
+ metadata.gz: 8fd77128ff3c7a9fea813efd8fdb04197c7cb42b
4
+ data.tar.gz: 644387bdbdf649dca6527d7e1a0636043f1e3aee
5
5
  SHA512:
6
- metadata.gz: ec83326fefad756510b66faf9fd8b88e268f140ba447c803bc3898cc1345565c9d58aaab71877916d3272bf69e797bcdbd66ee34b6d2bf8c25fdd066aeebde46
7
- data.tar.gz: 7674468a302f77ce3b0039b9e53d6182c09f810542b4b76cb7c14a302f7c08051de6d53d9cfc67a8144bc67e657c92c8d7064dbb2e7c233dc41fab59dc46df01
6
+ metadata.gz: 23665952e8feafd8ef03cdb792b59e07d067a516e1234f64c38884bcfa074563b9a53f0a84adac0e072b912d803b1434272fcf732b6628dfb3901f26ed28233b
7
+ data.tar.gz: 66147160a921815228d5333621e2a082f18653f998014e84a75d2a122b9896cc30c9f9307f1a49fafaed1c517070953617157aae8e949809eee6a336d679a2f5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.2
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.1
3
+ - 2.2.4
4
4
  before_script:
5
5
  - mkdir testdb
6
6
  - mongod --port 27017 --dbpath testdb --replSet rs0 --oplogSize 20 --noprealloc --fork --smallfiles --logpath mongodb.log
@@ -15,6 +15,8 @@ opts = Slop.parse(help: true, strict: true) do
15
15
 
16
16
  on :f, :file, 'Configuration file for common defaults', argument: :required
17
17
  on :ssl, "Connect to a mongod instance over an SSL connection"
18
+ on :sslAllowInvalidCertificates, "Allow connections to a mongod instance with an invalid certificate"
19
+ on :sslCAFile, "Specifies a Certificate Authority file for validating the SSL certificate provided by the mongod instance.", argument: :required
18
20
  on :host, "Specifies a resolvable hostname for the mongod that you wish to backup.", default: 'localhost', argument: :required
19
21
  on :port, "Specifies the port that mongod is running on", default: '27017', argument: :required
20
22
  on :u, :username, "Specifies a username to authenticate to the MongoDB instance, if your database requires authentication. Use in conjunction with the --password option to supply a password.", argument: :required
@@ -24,13 +26,15 @@ opts = Slop.parse(help: true, strict: true) do
24
26
  dir = opts[:dir] || 'backup'
25
27
  config_opts = {
26
28
  dir: dir,
27
- ssl: opts.ssl?
29
+ ssl: opts.ssl?,
30
+ sslAllowInvalidCertificates: opts.sslAllowInvalidCertificates?
28
31
  }
29
32
  config_opts[:file] = opts[:file]
30
33
  config_opts[:host] = opts[:host]
31
34
  config_opts[:port] = opts[:port]
32
35
  config_opts[:username] = opts[:username]
33
36
  config_opts[:password] = opts[:password]
37
+ config_opts[:sslCAFile] = opts[:sslCAFile]
34
38
 
35
39
  mode = :auto
36
40
  if opts.full?
@@ -15,6 +15,8 @@ module MongoOplogBackup
15
15
  unless file.nil?
16
16
  conf = YAML.load_file(file)
17
17
  options[:ssl] = conf["ssl"] unless conf["ssl"].nil?
18
+ options[:sslAllowInvalidCertificates] = conf["sslAllowInvalidCertificates"] unless conf["sslAllowInvalidCertificates"].nil?
19
+ options[:sslCAFile] = conf["sslCAFile"] unless conf["sslCAFile"].nil?
18
20
  options[:host] = conf["host"] unless conf["host"].nil?
19
21
  options[:port] = conf["port"].to_s unless conf["port"].nil?
20
22
  options[:username] = conf["username"] unless conf["username"].nil?
@@ -31,7 +33,8 @@ module MongoOplogBackup
31
33
  def command_line_options
32
34
  args = []
33
35
  args << '--ssl' if options[:ssl]
34
- [:host, :port, :username, :password].each do |option|
36
+ args << '--sslAllowInvalidCertificates' if options[:sslAllowInvalidCertificates]
37
+ [:host, :port, :username, :password, :sslCAFile].each do |option|
35
38
  args += ["--#{option}", options[option].strip] if options[option]
36
39
  end
37
40
 
@@ -1,4 +1,5 @@
1
1
  # Make BSON::Timestamp comparable
2
+ require 'date'
2
3
  require 'bson'
3
4
 
4
5
  module MongoOplogBackup::Ext
@@ -1,3 +1,3 @@
1
1
  module MongoOplogBackup
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-oplog-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ralf Kistner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2016-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.2.2
155
+ rubygems_version: 2.4.5.1
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Incremental backups for MongoDB using the oplog.