jschat 0.2.0 → 0.2.1

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.
@@ -16,7 +16,9 @@ ServerConfigDefaults = {
16
16
  'tmp_files' => File.join(Dir::tmpdir, 'jschat'),
17
17
  'db_name' => 'jschat',
18
18
  'db_host' => 'localhost',
19
- 'db_port' => 27017
19
+ 'db_port' => 27017,
20
+ #'db_user' => '',
21
+ #'db_password' => '',
20
22
  # Register your instance of JsChat here: http://twitter.com/apps/create
21
23
  # 'twitter' => { 'key' => '', 'secret' => '' }
22
24
  }
@@ -7,6 +7,11 @@ module JsChat::Storage
7
7
  module MongoDriver
8
8
  def self.connect!
9
9
  @db = Mongo::Connection.new(ServerConfig['db_host'], ServerConfig['db_port']).db(ServerConfig['db_name'])
10
+ if ServerConfig['db_username'] and ServerConfig['db_password']
11
+ unless @db.authenticate(ServerConfig['db_username'], ServerConfig['db_password'])
12
+ raise 'Bad Mongo username or password'
13
+ end
14
+ end
10
15
  end
11
16
 
12
17
  def self.log(message, room)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alex R. Young