flapjack 1.2.1rc2 → 1.2.1rc3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c092ff47434ae5b8779b77e422ca2fbc3cec32df
4
- data.tar.gz: 9c921600dc415ebb024ba5207571db063326e7fc
3
+ metadata.gz: 38c70a352010266d6ed0c087dfff6705dcaad41e
4
+ data.tar.gz: 3378b3979749e16bc14ea2d01a82197bfe20fac4
5
5
  SHA512:
6
- metadata.gz: 85c23c132e45faea927de004b369a416fc7f88bc17e4ff6f682bede8a3493749731074fd6112f8bcac3142dfe283787f72526055d40929d618c62836fb99607f
7
- data.tar.gz: 202737eae76714ffaee089982854ba0efe743a0f84fba9d30a3dc0bcf8bd370ee6c265d382051c7c9b49ff89dac9c17753da2cac09f03a05a8c63ae4a0107ada
6
+ metadata.gz: bde5f52706918626c4a1afb1c8b90e106619b027be7c1b6d907835c6f31d1a68b8d1687def8647dfdd3bb3550c6da7bfa5408be3c7c8239d740931a2d49daca2
7
+ data.tar.gz: c3e3deffb1a2baeb9be7d494236d08ed61a024593cf0fc00fa137988bde6b4574ee5d136271f07d446fd36c0848b753ca0842eac07a66caf77fde81ae932ba9e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Flapjack Changelog
2
2
 
3
+ # 1.2.1rc3 - 2014-12-09
4
+ - Bug: flapjack 1.2.0 ignores umask and makes logs world writable #708 (@ali-graham)
5
+ - Bug: Can't get full name email syntax working #690 (@jessereynolds)
6
+
3
7
  # 1.2.1rc2 - 2014-12-04
4
8
  - Bug: Correct scheduled maintenance periods with expiry that don't match their timestamps #734 (@ali-graham)
5
9
 
data/Gemfile-ruby1.9.lock CHANGED
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flapjack (1.2.1rc2)
4
+ flapjack (1.2.1rc3)
5
5
  activesupport (~> 3.2.14)
6
6
  blather (~> 0.8.3)
7
7
  chronic
8
8
  chronic_duration
9
- dante
9
+ dante (= 0.2.0)
10
10
  em-http-request
11
11
  em-resque
12
12
  em-synchrony (~> 1.0.2)
@@ -223,7 +223,7 @@ end
223
223
 
224
224
  When /^the email notification handler runs successfully$/ do
225
225
  Resque.redis = @redis
226
- Flapjack::Gateways::Email.instance_variable_set('@config', {'smtp_config' => {'host' => '127.0.0.1', 'port' => 2525}})
226
+ Flapjack::Gateways::Email.instance_variable_set('@config', {'smtp_config' => {'host' => '127.0.0.1', 'port' => 2525, 'from' => 'flapjack@example'}})
227
227
  Flapjack::Gateways::Email.instance_variable_set('@redis', @redis)
228
228
  Flapjack::Gateways::Email.instance_variable_set('@logger', @logger)
229
229
  Flapjack::Gateways::Email.start
@@ -242,7 +242,7 @@ end
242
242
 
243
243
  When /^the email notification handler fails to send an email$/ do
244
244
  Resque.redis = @redis
245
- Flapjack::Gateways::Email.instance_variable_set('@config', {'smtp_config' => {'host' => '127.0.0.1', 'port' => 2525}})
245
+ Flapjack::Gateways::Email.instance_variable_set('@config', {'smtp_config' => {'host' => '127.0.0.1', 'port' => 2525, 'from' => 'flapjack@example'}})
246
246
  Flapjack::Gateways::Email.instance_variable_set('@redis', @redis)
247
247
  Flapjack::Gateways::Email.instance_variable_set('@logger', @logger)
248
248
  Flapjack::Gateways::Email.start
data/flapjack.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.require_paths = ["lib"]
19
19
  gem.version = Flapjack::VERSION
20
20
 
21
- gem.add_dependency 'dante'
21
+ gem.add_dependency 'dante', '= 0.2.0'
22
22
  gem.add_dependency 'oj', '>= 2.9.0'
23
23
  gem.add_dependency 'eventmachine', '~> 1.0.0'
24
24
  gem.add_dependency 'redis', '~> 3.0.6'
@@ -60,8 +60,14 @@ module Flapjack
60
60
  puts "flapper is already running."
61
61
  else
62
62
  print "flapper starting..."
63
- print "\n" unless @options[:daemonize]
63
+ main_umask = nil
64
+ if @options[:daemonize]
65
+ main_umask = File.umask
66
+ else
67
+ print "\n"
68
+ end
64
69
  runner.execute(:daemonize => @options[:daemonize]) do
70
+ File.umask(main_umask) if @options[:daemonize]
65
71
  main(@options['bind-ip'] || Flapjack::CLI::Flapper.local_ip, @options['bind-port'].to_i, @options[:frequency])
66
72
  end
67
73
  puts " done."
@@ -82,7 +88,9 @@ module Flapjack
82
88
 
83
89
  def restart
84
90
  print "flapper restarting..."
91
+ main_umask = File.umask
85
92
  runner.execute(:daemonize => true, :restart => true) do
93
+ File.umask(main_umask)
86
94
  main(@options['bind-ip'], @options['bind-port'].to_i, @options[:frequency])
87
95
  end
88
96
  puts " done."
@@ -64,9 +64,15 @@ module Flapjack
64
64
  puts "#{@options[:type]}-receiver is already running."
65
65
  else
66
66
  print "#{@options[:type]}-receiver starting..."
67
- print "\n" unless @options[:daemonize]
67
+ main_umask = nil
68
+ if @options[:daemonize]
69
+ main_umask = File.umask
70
+ else
71
+ print "\n"
72
+ end
68
73
  runner(@options[:type]).execute(:daemonize => @options[:daemonize]) do
69
74
  begin
75
+ File.umask(main_umask) if @options[:daemonize]
70
76
  main(:fifo => @options[:fifo], :type => @options[:type])
71
77
  rescue Exception => e
72
78
  p e.message
@@ -91,8 +97,10 @@ module Flapjack
91
97
 
92
98
  def restart
93
99
  print "#{@options[:type]}-receiver restarting..."
100
+ main_umask = File.umask
94
101
  runner(@options[:type]).execute(:daemonize => true, :restart => true) do
95
102
  begin
103
+ File.umask(main_umask)
96
104
  main(:fifo => @options[:fifo], :type => @options[:type])
97
105
  rescue Exception => e
98
106
  p e.message
@@ -48,9 +48,15 @@ module Flapjack
48
48
  puts "Flapjack is already running."
49
49
  else
50
50
  print "Flapjack starting..."
51
- print "\n" unless @options[:daemonize]
51
+ main_umask = nil
52
+ if @options[:daemonize]
53
+ main_umask = File.umask
54
+ else
55
+ print "\n"
56
+ end
52
57
  return_value = nil
53
58
  runner.execute(:daemonize => @options[:daemonize]) {
59
+ File.umask(main_umask) if @options[:daemonize]
54
60
  return_value = start_server
55
61
  }
56
62
  puts " done."
@@ -82,7 +88,10 @@ module Flapjack
82
88
  @runner = nil
83
89
 
84
90
  print "Flapjack starting..."
91
+
92
+ main_umask = File.umask
85
93
  runner.execute(:daemonize => true) {
94
+ File.umask(main_umask)
86
95
  start_server
87
96
  }
88
97
  puts " done."
@@ -70,7 +70,13 @@ module Flapjack
70
70
  :message_id => "<#{alert.notification_id}@#{@fqdn}>",
71
71
  :alert => alert)
72
72
 
73
- smtp_args = {:from => m_from,
73
+ smtp_from = m_from.clone
74
+ while smtp_from =~ /(<|>)/
75
+ smtp_from.sub!(/^.*</, '')
76
+ smtp_from.sub!(/>.*$/, '')
77
+ end
78
+
79
+ smtp_args = {:from => smtp_from,
74
80
  :to => alert.address,
75
81
  :content => "#{mail.to_s}\r\n.\r\n",
76
82
  :domain => @fqdn,
@@ -105,7 +111,7 @@ module Flapjack
105
111
  # returns a Mail object
106
112
  def prepare_email(opts = {})
107
113
  from = opts[:from]
108
- reply_to = opts[:reply_to]
114
+ reply_to = opts[:reply_to]
109
115
  to = opts[:to]
110
116
  message_id = opts[:message_id]
111
117
  alert = opts[:alert]
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module Flapjack
4
- VERSION = "1.2.1rc2"
4
+ VERSION = "1.2.1rc3"
5
5
  end
6
6
 
@@ -45,7 +45,7 @@ describe Flapjack::Gateways::Email, :logger => true do
45
45
  expect(EM::P::SmtpClient).to receive(:send).with(
46
46
  hash_including(host: 'localhost',
47
47
  port: 25,
48
- from: "Full Name <from@example.org>")
48
+ from: "from@example.org")
49
49
  ).and_return(email)
50
50
 
51
51
  response = double(response)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1rc2
4
+ version: 1.2.1rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
@@ -11,22 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-12-04 00:00:00.000000000 Z
14
+ date: 2014-12-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: dante
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ">="
20
+ - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: '0'
22
+ version: 0.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: 0.2.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: oj
32
32
  requirement: !ruby/object:Gem::Requirement