-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
should move sensitive configs into local.js to prevent them from being in the repos #301
Comments
@mikedevita you can achieve the same behavior with default Sails setup. Just create http://sailsjs.com/documentation/concepts/configuration/the-local-js-file |
Does it override or does it merge? |
@mikedevita it overrides and merges. If property exists, it will be overridden, otherwise it will be merged. |
@ghaiklor that idea wont work as is because you call which if going the route of sails.config.services then i don't think it works out of box because sails isn't accessible in the services files as is. Some minor refactoring will need to be redone.. each service should module.exports and then be wrapped in a function.. module.exports = {
jwt: function() {
return cipher('jwt', sails.config.services.cipher.jwt)
}
} |
@mikedevita yeah, I see, makes sense. It will be great to get rid of direct requiring of configuration files and use |
Ill look into this and submit another PR..
|
a bit of an update, by making the services functions you can then obtain access to e.g; api/services/CipherService.js module.exports = {
jwt: (config) => cipher('jwt', _.merge({}, sails.config.services.cipher.jwt, config))
} doing this you can then change anywhere |
I will be submitting another PR to resolve this if you like, basically in the api/services/* files you do something like this.. this can be applied for things like db name, user, host and password.
and create a config/local.js with something like this....
The text was updated successfully, but these errors were encountered: