backup 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backup/database/postgresql.rb +1 -1
- data/lib/backup/notifier/command.rb +3 -0
- data/lib/backup/notifier/hipchat.rb +7 -1
- data/lib/backup/notifier/mail.rb +7 -2
- data/lib/backup/notifier/ses.rb +19 -2
- data/lib/backup/version.rb +1 -1
- metadata +21 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba72c8ccbdf1baf26dba6c3e5ebd6710439e5264
|
4
|
+
data.tar.gz: 241aa7d8aa000d13de51befcb257f4d90d9b37ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf61900047f75ce5829209b122f78d7ccb0c18f7f283dac7e66e2ff41f5213080b684aeb93cbb9b1b13bc0ffb2718965746de73429d9d19a84e953af580fa48b
|
7
|
+
data.tar.gz: 5752616830b3e3ab035d2e7c85fa84ace35689aba1699e1c52c31804c42d5573d1e03343e2beea2ad86f92f5aceff1bbaf0593a04d9602121df8808709e03cd2
|
@@ -23,6 +23,7 @@ module Backup
|
|
23
23
|
#
|
24
24
|
# %l - Model label
|
25
25
|
# %t - Model trigger
|
26
|
+
# %d - Backup duration (HH:MM:SS)
|
26
27
|
# %s - Status (success/failure/warning)
|
27
28
|
# %v - Status verb (succeeded/failed/succeeded with warnings)
|
28
29
|
#
|
@@ -73,6 +74,8 @@ module Backup
|
|
73
74
|
model.label
|
74
75
|
when "t"
|
75
76
|
model.trigger.to_s
|
77
|
+
when "d"
|
78
|
+
model.duration
|
76
79
|
when "v"
|
77
80
|
status_verb(status)
|
78
81
|
when "s"
|
@@ -18,6 +18,10 @@ module Backup
|
|
18
18
|
# Who the notification should appear from
|
19
19
|
attr_accessor :from
|
20
20
|
|
21
|
+
##
|
22
|
+
# Custom server URL
|
23
|
+
attr_accessor :server_url
|
24
|
+
|
21
25
|
##
|
22
26
|
# The rooms that should be notified
|
23
27
|
attr_accessor :rooms_notified
|
@@ -79,7 +83,9 @@ module Backup
|
|
79
83
|
end
|
80
84
|
|
81
85
|
def client_options
|
82
|
-
{ api_version: @api_version }
|
86
|
+
{ api_version: @api_version }.tap do |h|
|
87
|
+
h[:server_url] = server_url if server_url
|
88
|
+
end
|
83
89
|
end
|
84
90
|
|
85
91
|
# Hipchat::Client will raise an error if unsuccessful.
|
data/lib/backup/notifier/mail.rb
CHANGED
@@ -188,9 +188,9 @@ module Backup
|
|
188
188
|
options =
|
189
189
|
case method
|
190
190
|
when 'smtp'
|
191
|
-
|
191
|
+
opts = {
|
192
|
+
:address => @address,
|
192
193
|
:port => @port,
|
193
|
-
:domain => @domain,
|
194
194
|
:user_name => @user_name,
|
195
195
|
:password => @password,
|
196
196
|
:authentication => @authentication,
|
@@ -199,6 +199,11 @@ module Backup
|
|
199
199
|
:ssl => @encryption == :ssl,
|
200
200
|
:tls => @encryption == :tls
|
201
201
|
}
|
202
|
+
|
203
|
+
# Don't override default domain setting if domain not applicable.
|
204
|
+
# ref https://github.com/mikel/mail/blob/2.6.3/lib/mail/network/delivery_methods/smtp.rb#L82
|
205
|
+
opts[:domain] = @domain if @domain
|
206
|
+
opts
|
202
207
|
when 'sendmail'
|
203
208
|
opts = {}
|
204
209
|
opts.merge!(:location => utility(:sendmail))
|
data/lib/backup/notifier/ses.rb
CHANGED
@@ -21,6 +21,18 @@ module Backup
|
|
21
21
|
# Receiver Email Address
|
22
22
|
attr_accessor :to
|
23
23
|
|
24
|
+
##
|
25
|
+
# CC receiver Email Address
|
26
|
+
attr_accessor :cc
|
27
|
+
|
28
|
+
##
|
29
|
+
# BCC receiver Email Address
|
30
|
+
attr_accessor :bcc
|
31
|
+
|
32
|
+
##
|
33
|
+
# Set reply to email address
|
34
|
+
attr_accessor :reply_to
|
35
|
+
|
24
36
|
def initialize(model, &block)
|
25
37
|
super
|
26
38
|
instance_eval(&block) if block_given?
|
@@ -66,8 +78,13 @@ module Backup
|
|
66
78
|
# : backup log, if `on_failure` is `true`.
|
67
79
|
#
|
68
80
|
def notify!(status)
|
69
|
-
email = ::Mail.new
|
70
|
-
email.
|
81
|
+
email = ::Mail.new
|
82
|
+
email.to = to
|
83
|
+
email.from = from
|
84
|
+
email.cc = cc
|
85
|
+
email.bcc = bcc
|
86
|
+
email.reply_to = reply_to
|
87
|
+
email.subject = message.call(model, :status => status_data_for(status))
|
71
88
|
|
72
89
|
send_log = send_log_on.include?(status)
|
73
90
|
template = Backup::Template.new({ :model => model, :send_log => send_log })
|
data/lib/backup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: CFPropertyList
|
@@ -613,19 +613,19 @@ dependencies:
|
|
613
613
|
- !ruby/object:Gem::Version
|
614
614
|
version: 2.4.3
|
615
615
|
- !ruby/object:Gem::Dependency
|
616
|
-
name:
|
616
|
+
name: mini_portile2
|
617
617
|
requirement: !ruby/object:Gem::Requirement
|
618
618
|
requirements:
|
619
619
|
- - '='
|
620
620
|
- !ruby/object:Gem::Version
|
621
|
-
version:
|
621
|
+
version: 2.1.0
|
622
622
|
type: :runtime
|
623
623
|
prerelease: false
|
624
624
|
version_requirements: !ruby/object:Gem::Requirement
|
625
625
|
requirements:
|
626
626
|
- - '='
|
627
627
|
- !ruby/object:Gem::Version
|
628
|
-
version:
|
628
|
+
version: 2.1.0
|
629
629
|
- !ruby/object:Gem::Dependency
|
630
630
|
name: multi_json
|
631
631
|
requirement: !ruby/object:Gem::Requirement
|
@@ -730,14 +730,14 @@ dependencies:
|
|
730
730
|
requirements:
|
731
731
|
- - '='
|
732
732
|
- !ruby/object:Gem::Version
|
733
|
-
version: 1.6.
|
733
|
+
version: 1.6.8
|
734
734
|
type: :runtime
|
735
735
|
prerelease: false
|
736
736
|
version_requirements: !ruby/object:Gem::Requirement
|
737
737
|
requirements:
|
738
738
|
- - '='
|
739
739
|
- !ruby/object:Gem::Version
|
740
|
-
version: 1.6.
|
740
|
+
version: 1.6.8
|
741
741
|
- !ruby/object:Gem::Dependency
|
742
742
|
name: open4
|
743
743
|
requirement: !ruby/object:Gem::Requirement
|
@@ -766,6 +766,20 @@ dependencies:
|
|
766
766
|
- - '='
|
767
767
|
- !ruby/object:Gem::Version
|
768
768
|
version: 2.0.0
|
769
|
+
- !ruby/object:Gem::Dependency
|
770
|
+
name: pkg-config
|
771
|
+
requirement: !ruby/object:Gem::Requirement
|
772
|
+
requirements:
|
773
|
+
- - '='
|
774
|
+
- !ruby/object:Gem::Version
|
775
|
+
version: 1.1.7
|
776
|
+
type: :runtime
|
777
|
+
prerelease: false
|
778
|
+
version_requirements: !ruby/object:Gem::Requirement
|
779
|
+
requirements:
|
780
|
+
- - '='
|
781
|
+
- !ruby/object:Gem::Version
|
782
|
+
version: 1.1.7
|
769
783
|
- !ruby/object:Gem::Dependency
|
770
784
|
name: qiniu
|
771
785
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1074,4 +1088,3 @@ signing_key:
|
|
1074
1088
|
specification_version: 4
|
1075
1089
|
summary: Provides an elegant DSL in Ruby for performing backups on UNIX-like systems.
|
1076
1090
|
test_files: []
|
1077
|
-
has_rdoc:
|