backup 4.3.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- 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 +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 27f2f7a25217955273c6b721509dacde87c0ba06715004ee3cf732262a4e3fed
|
4
|
+
data.tar.gz: ee514abc68b3d0ecb52f6965b14dac5d6ac8d17386a5ae8ef46029cf6aa332a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0015adf0f7e1b5e226866a11cdd658c129853508df5301c9df641fd377e55e9c73271577aca41d4d57178ba67238f9cd39d2fbce82fe6f89052f1977292138c3
|
7
|
+
data.tar.gz: d338cf0df9fc344c283aa14cc31e17ebe912e51f49e210ab873941986548c56af72a3acccb0dc259131c12727c5d6957eb535bbad52a11667a399799a5bd2d24
|
@@ -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.1
|
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:
|
11
|
+
date: 2018-03-10 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.3.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.3.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.
|
733
|
+
version: 1.8.2
|
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.
|
740
|
+
version: 1.8.2
|
741
741
|
- !ruby/object:Gem::Dependency
|
742
742
|
name: open4
|
743
743
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1069,9 +1069,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1069
1069
|
version: '0'
|
1070
1070
|
requirements: []
|
1071
1071
|
rubyforge_project:
|
1072
|
-
rubygems_version: 2.
|
1072
|
+
rubygems_version: 2.7.6
|
1073
1073
|
signing_key:
|
1074
1074
|
specification_version: 4
|
1075
1075
|
summary: Provides an elegant DSL in Ruby for performing backups on UNIX-like systems.
|
1076
1076
|
test_files: []
|
1077
|
-
has_rdoc:
|