This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Core Configuration
cliftonc edited this page Sep 26, 2011
·
5 revisions
The configuration engine in calip.so (as of 0.3.0) is based on nconf, and is completely filebacked. There is no configuration of the application held in MongoDB.
- Configuration is referenced in files stored in the conf folder, named after the NODE_ENV parameter (defaults to development).
This configuration is loaded during the app.js boot process.
The configuration is accessible via:
calipso.config
{
"version":1,
"installed":false,
"database": {
"uri":"mongodb://localhost/calipso"
},
"server": {
"name":"Calipso",
"url":"http://localhost:3000",
"modulePath":"./modules",
"themePath":"./themes",
"hookio":{
"name":"calipso-hook",
"host":"localhost",
"socket":"",
"port":9001,
"debug":false,
"maxListeners":500
},
"events":{
"maxListeners":500
}
},
"performance": {
"cache":{
"enabled":false,
"ttl":600
},
"watchFiles":true
},
"session":{
"secret":"calipso"
},
"theme": {
"default":"cleanslate",
"front":"cleanslate",
"admin":"cleanslate"
},
"i18n": {
"language":"en",
"additive":true
},
"logging": {
"console": {
"enabled": true,
"level": "info",
"timestamp":true,
"colorize":true
},
"file": {
"enabled": false,
"level": "info",
"filepath": "logs/calipso.log",
"timestamp":true
}
},
"libraries":{
"stylus":{
"warn":true,
"compress":false
},
"formidable":{
"keepExtensions":true
}
},
"modules": {
"google-analytics": {
"enabled":false,
"config": {
"key":"UA-17607570-4"
}
},
"disqus": {
"enabled":false,
"config":{
"shortname":"calipsojs"
}
},
"admin":{
"enabled": true
},
"content":{
"enabled": true
},
"contentTypes": {
"enabled": true
},
"user":{
"enabled": true
},
"taxonomy":{
"enabled": true
}
}
}
To access configuration variables from within a Module use nconf syntax:
calipso.config.get('database:uri');
To update configuration, you can use:
calipso.config.set('server:name','My Server');
calipso.config.save();
TODO : Document module specific configuration.