Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
7ba66cde
Commit
7ba66cde
authored
9 years ago
by
Gabriel Engel
Browse files
Options
Downloads
Patches
Plain Diff
split server and client settings initial loading logic
parent
91e9f16b
No related branches found
Branches containing commit
Tags
6.10.0-rc.7
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-lib/lib/startup/settings.coffee
+3
-19
3 additions, 19 deletions
packages/rocketchat-lib/lib/startup/settings.coffee
packages/rocketchat-lib/server/startup/settings.coffee
+19
-0
19 additions, 0 deletions
packages/rocketchat-lib/server/startup/settings.coffee
with
22 additions
and
19 deletions
packages/rocketchat-lib/lib/startup/settings.coffee
+
3
−
19
View file @
7ba66cde
if
Meteor
.
isClient
is
true
@
Settings
=
Settings
=
new
Meteor
.
Collection
'rocketchat_settings'
else
Settings
=
RocketChat
.
models
.
Settings
@
Settings
=
Settings
=
new
Meteor
.
Collection
'rocketchat_settings'
initialLoad
=
true
Meteor
.
settings
?=
{}
process
?
.
env
?=
{}
Settings
.
find
().
observe
added
:
(
record
)
->
Meteor
.
settings
[
record
.
_id
]
=
record
.
value
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
Meteor
.
settings
[
record
.
_id
]
=
record
.
value
RocketChat
.
settings
.
load
record
.
_id
,
record
.
value
,
initialLoad
removed
:
(
record
)
->
delete
Meteor
.
settings
?
[
record
.
_id
]
delete
process
?
.
env
?
[
record
.
_id
]
delete
Meteor
.
settings
[
record
.
_id
]
RocketChat
.
settings
.
load
record
.
_id
,
undefined
,
initialLoad
initialLoad
=
false
This diff is collapsed.
Click to expand it.
packages/rocketchat-lib/server/startup/settings.coffee
+
19
−
0
View file @
7ba66cde
...
...
@@ -113,12 +113,31 @@ RocketChat.settings.add 'Layout_Login_Terms', 'By proceeding to create your acco
RocketChat
.
settings
.
add
'Statistics_opt_out'
,
false
,
{
type
:
'boolean'
,
group
:
false
}
initialLoad
=
true
RocketChat
.
models
.
Settings
.
find
().
observe
added
:
(
record
)
->
Meteor
.
settings
[
record
.
_id
]
=
record
.
value
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
RocketChat
.
settings
.
load
record
.
_id
,
record
.
value
,
initialLoad
removed
:
(
record
)
->
delete
Meteor
.
settings
[
record
.
_id
]
delete
process
.
env
[
record
.
_id
]
RocketChat
.
settings
.
load
record
.
_id
,
undefined
,
initialLoad
initialLoad
=
false
Meteor
.
startup
->
if
process
?
.
env
?
and
not
process
.
env
[
'MAIL_URL'
]
?
and
RocketChat
.
settings
.
get
(
'SMTP_Host'
)
and
RocketChat
.
settings
.
get
(
'SMTP_Username'
)
and
RocketChat
.
settings
.
get
(
'SMTP_Password'
)
process
.
env
[
'MAIL_URL'
]
=
"smtp://"
+
encodeURIComponent
(
RocketChat
.
settings
.
get
(
'SMTP_Username'
))
+
':'
+
encodeURIComponent
(
RocketChat
.
settings
.
get
(
'SMTP_Password'
))
+
'@'
+
encodeURIComponent
(
RocketChat
.
settings
.
get
(
'SMTP_Host'
))
if
RocketChat
.
settings
.
get
(
'SMTP_Port'
)
process
.
env
[
'MAIL_URL'
]
+=
':'
+
parseInt
(
RocketChat
.
settings
.
get
(
'SMTP_Port'
))
# Remove runtime settings (non-persistent)
Meteor
.
startup
->
RocketChat
.
models
.
Settings
.
update
({
ts
:
{
$lt
:
RocketChat
.
settings
.
ts
},
persistent
:
false
},
{
$set
:
{
hidden
:
true
}
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment