vinesmod 0.4.5 → 0.4.5.2

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.
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ directory 'pkg'
13
13
 
14
14
  desc 'Build distributable packages'
15
15
  task :build => [:assets, :pkg] do
16
- system 'gem build vines.gemspec && mv vines-*.gem pkg/'
16
+ system 'gem build vines.gemspec && mv vinesmod-*.gem pkg/'
17
17
  end
18
18
 
19
19
  Rake::TestTask.new(:test) do |test|
data/bin/vines CHANGED
@@ -38,6 +38,10 @@ def parse(args)
38
38
  opts.on('-v', '--version', 'Show version') do |version|
39
39
  options[:version] = version
40
40
  end
41
+
42
+ opts.on('-D', '--debug', 'Override log level') do |debug|
43
+ options[:debug] = debug
44
+ end
41
45
  end
42
46
 
43
47
  begin
@@ -83,6 +87,7 @@ end
83
87
  opts = parse(ARGV)
84
88
  check_config(opts)
85
89
  command = Vines::Command.const_get(opts[:command].capitalize).new
90
+
86
91
  begin
87
92
  command.run(opts)
88
93
  rescue SystemExit
@@ -5,6 +5,7 @@ module Vines
5
5
  :stream => 'http://etherx.jabber.org/streams'.freeze,
6
6
  :client => 'jabber:client'.freeze,
7
7
  :server => 'jabber:server'.freeze,
8
+ :dialback => 'jabber:server:dialback'.freeze,
8
9
  :component => 'jabber:component:accept'.freeze,
9
10
  :roster => 'jabber:iq:roster'.freeze,
10
11
  :register => 'jabber:iq:register'.freeze,
@@ -32,27 +33,6 @@ module Vines
32
33
  :si => 'http://jabber.org/protocol/si'.freeze,
33
34
  :byte_streams => 'http://jabber.org/protocol/bytestreams'.freeze
34
35
  }.freeze
35
-
36
- module Log
37
- @@logger = nil
38
- def log
39
- unless @@logger
40
- @@logger = Logger.new(STDOUT)
41
- @@logger.level = Logger::INFO
42
- @@logger.progname = 'vines'
43
- @@logger.formatter = Class.new(Logger::Formatter) do
44
- def initialize
45
- @time = "%Y-%m-%dT%H:%M:%SZ".freeze
46
- @fmt = "[%s] %5s -- %s: %s\n".freeze
47
- end
48
- def call(severity, time, program, msg)
49
- @fmt % [time.utc.strftime(@time), severity, program, msg2str(msg)]
50
- end
51
- end.new
52
- end
53
- @@logger
54
- end
55
- end
56
36
  end
57
37
 
58
38
  %w[
@@ -6,7 +6,14 @@ module Vines
6
6
  def run(opts)
7
7
  raise 'vines [--pid FILE] start' unless opts[:args].size == 0
8
8
  require opts[:config]
9
- server = XmppServer.new(Config.instance)
9
+
10
+ config = Config.instance
11
+ if opts[:debug]
12
+ config.debug = true
13
+ config.log("debug")
14
+ end
15
+
16
+ server = XmppServer.new(config)
10
17
  daemonize(opts) if opts[:daemonize]
11
18
  server.start
12
19
  end
@@ -25,4 +32,4 @@ module Vines
25
32
  end
26
33
  end
27
34
  end
28
- end
35
+ end
@@ -10,6 +10,7 @@ module Vines
10
10
  LOG_LEVELS = %w[debug info warn error fatal].freeze
11
11
 
12
12
  attr_reader :router
13
+ attr_accessor :debug
13
14
 
14
15
  @@instance = nil
15
16
  def self.configure(&block)
@@ -25,6 +26,8 @@ module Vines
25
26
  @vhosts, @ports, @cluster = {}, {}, nil
26
27
  @null = Storage::Null.new
27
28
  @router = Router.new(self)
29
+ @debug = nil
30
+
28
31
  instance_eval(&block)
29
32
  raise "must define at least one virtual host" if @vhosts.empty?
30
33
 
@@ -31,5 +31,12 @@ module Vines
31
31
  ensure
32
32
  Socket.do_not_reverse_lookup = orig
33
33
  end
34
+
35
+ # Generates dialback key as described in XEP-0185
36
+ def self.dialback_key(receiving_server, originating_server, stream_id)
37
+ sha = Digest::SHA2.new(256)
38
+ sha.update("#{receiving_server} #{originating_server} #{stream_id}")
39
+ sha.to_s
40
+ end
34
41
  end
35
42
  end
@@ -52,6 +52,7 @@ module Vines
52
52
 
53
53
  def receive_data(data)
54
54
  return if @closed
55
+
55
56
  @stanza_size += data.bytesize
56
57
  if @stanza_size < max_stanza_size
57
58
  @parser << data rescue error(StreamErrors::NotWellFormed.new)
@@ -73,7 +73,10 @@ module Vines
73
73
  end
74
74
 
75
75
  def ssl_handshake_completed
76
- close_connection unless cert_domain_matches?(@remote_domain)
76
+ unless cert_domain_matches?(@remote_domain)
77
+ log.info { 'Cert domain not maches' }
78
+ close_connection
79
+ end
77
80
  end
78
81
 
79
82
  # Return an array of allowed authentication mechanisms advertised as
@@ -137,6 +140,7 @@ module Vines
137
140
  attrs = {
138
141
  'xmlns' => NAMESPACES[:server],
139
142
  'xmlns:stream' => NAMESPACES[:stream],
143
+ # 'xmlns:db' => NAMESPACES[:dialback],
140
144
  'xml:lang' => 'en',
141
145
  'id' => Kit.uuid,
142
146
  'from' => @domain,
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Vines
4
- VERSION = '0.4.5'
4
+ VERSION = '0.4.5.2'
5
5
  end
@@ -3,8 +3,8 @@ require './lib/vines/version'
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'vinesmod'
5
5
  s.version = Vines::VERSION
6
- s.summary = %q[Vines is an XMPP chat server that's easy to install and run.]
7
- s.description = %q[Vines is an XMPP chat server that supports thousands of simultaneous connections, using EventMachine and Nokogiri.]
6
+ s.summary = %q[VinesMod is fork of Vines XMPP chat server]
7
+ s.description = %q[VinesMod goal is to make full featured XMPP server]
8
8
 
9
9
  s.authors = ['David Graham', 'Damian Lesiuk']
10
10
  s.email = %w[ja@lesiuk.net]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vinesmod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-19 00:00:00.000000000 Z
13
+ date: 2012-10-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -236,8 +236,7 @@ dependencies:
236
236
  - - ! '>='
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
- description: Vines is an XMPP chat server that supports thousands of simultaneous
240
- connections, using EventMachine and Nokogiri.
239
+ description: VinesMod goal is to make full featured XMPP server
241
240
  email:
242
241
  - ja@lesiuk.net
243
242
  executables:
@@ -419,5 +418,5 @@ rubyforge_project:
419
418
  rubygems_version: 1.8.24
420
419
  signing_key:
421
420
  specification_version: 3
422
- summary: Vines is an XMPP chat server that's easy to install and run.
421
+ summary: VinesMod is fork of Vines XMPP chat server
423
422
  test_files: []