Changes

From SME Server
Jump to navigationJump to search
151 bytes added ,  11:46, 7 October 2020
no edit summary
Line 158: Line 158:  
  mongo
 
  mongo
 
  use rocketchat
 
  use rocketchat
  db.rocketchat_settings.update({"_id" <nowiki>: "SMTP_Host"}, {$set: {"value":"mail.yourdomain.com"}})
+
  db.rocketchat_settings.update({"_id" : "SMTP_Host"}, {$set: {"value":"mail.yourdomain.com"}})
      db.rocketchat_settings.update({"_id"</nowiki> <nowiki>: "From_Email"}, {$set: {"value":"admin@yourdomain.com"}})
+
db.rocketchat_settings.update({"_id": "From_Email"}, {$set: {"value":"admin@yourdomain.com"}})
       exit</nowiki>
+
       exit<
    
Restart Rocket.Chat to be sure:
 
Restart Rocket.Chat to be sure:
Line 318: Line 318:  
  db.rocketchat_settings.findOne({_id : "SMTP_Host"}, {_id:0, value: 1})
 
  db.rocketchat_settings.findOne({_id : "SMTP_Host"}, {_id:0, value: 1})
   −
  <nowiki>db.rocketchat_settings.update({"_id":"From_Email"}, {$set: {"value":"admin@yourdomain.com"}})
+
  db.rocketchat_settings.update({"_id":"From_Email"}, {$set: {"value":"admin@yourdomain.com"}})
  db.rocketchat_settings.update({"_id":"SMTP_Host"}, {$set: {"value":"mail.yourdomain.com"}})</nowiki>
+
  db.rocketchat_settings.update({"_id":"SMTP_Host"}, {$set: {"value":"mail.yourdomain.com"}})
      Line 345: Line 345:     
Replace specific user ID's password in the database:
 
Replace specific user ID's password in the database:
  <nowiki>db.users.update( {'_id': 'useridhere'}, {$set: {'services.password.bcrypt': 'bcryptedpasswordhere'}}, {multi:true} )</nowiki>
+
  db.users.update( {'_id': 'useridhere'}, {$set: {'services.password.bcrypt': 'bcryptedpasswordhere'}}, {multi:true} )
    
My only issue with above (only time I needed it for recovery purposes), was that I didn't know which tool to use to generate a bcrypted password. So in the hurry I copied the hash from one account I already knew (my own). If someone knows a good command for creating one directly in bash, I assume it would do.
 
My only issue with above (only time I needed it for recovery purposes), was that I didn't know which tool to use to generate a bcrypted password. So in the hurry I copied the hash from one account I already knew (my own). If someone knows a good command for creating one directly in bash, I assume it would do.
Line 360: Line 360:     
  db.users.find({'username':'SomeUserName'}).forEach( function(u) { print(u.services.password.bcrypt + " ; " + u.username); } )  
 
  db.users.find({'username':'SomeUserName'}).forEach( function(u) { print(u.services.password.bcrypt + " ; " + u.username); } )  
 +
 +
Set a user config item:
 +
 +
db.users.update( {'username': 'SomeUserName'}, {$set: {'settings.preferences.showMessageInMainThread': 'true'}} )
 +
 +
Find a single user:
 +
 +
db.getCollection('users').find( {'username':'SomeUserName'} )
     

Navigation menu