Do not load all settings to process.env

pull/1754/merge
Rodrigo Nascimento 10 years ago
parent ee16950df5
commit 0f3fa28662
  1. 9
      packages/rocketchat-lib/server/functions/settings.coffee
  2. 8
      packages/rocketchat-lib/server/startup/settings.coffee

@ -147,14 +147,17 @@ RocketChat.settings.init = ->
RocketChat.models.Settings.find().observe
added: (record) ->
Meteor.settings[record._id] = record.value
process.env[record._id] = record.value
if record.env is true
process.env[record._id] = record.value
RocketChat.settings.load record._id, record.value, initialLoad
changed: (record) ->
Meteor.settings[record._id] = record.value
process.env[record._id] = record.value
if record.env is true
process.env[record._id] = record.value
RocketChat.settings.load record._id, record.value, initialLoad
removed: (record) ->
delete Meteor.settings[record._id]
delete process.env[record._id]
if record.env is true
delete process.env[record._id]
RocketChat.settings.load record._id, undefined, initialLoad
initialLoad = false

@ -91,10 +91,10 @@ RocketChat.settings.addGroup 'API', ->
RocketChat.settings.addGroup 'SMTP', ->
@add 'SMTP_Host', '', { type: 'string' }
@add 'SMTP_Port', '', { type: 'string' }
@add 'SMTP_Username', '', { type: 'string' }
@add 'SMTP_Password', '', { type: 'string' }
@add 'SMTP_Host', '', { type: 'string', env: true }
@add 'SMTP_Port', '', { type: 'string', env: true }
@add 'SMTP_Username', '', { type: 'string', env: true }
@add 'SMTP_Password', '', { type: 'string', env: true }
@add 'From_Email', '', { type: 'string', placeholder: 'email@domain' }
@section 'Invitation', ->

Loading…
Cancel
Save