f16dc290b7
addresses #1789, #1364 - Moves ./core/server/loader -> ./core/bootstrap. The bootstrap file is only accessed once during startup, and it’s sole job is to ensure a config.js file exists (creating one if it doesn’t) and then validates the contents of the config file. Since this is directly related to the initializing the application is is appropriate to have it in the ./core folder, named bootstrap as that is what it does. This also improves the dependency graph, as now the bootstrap file require’s the ./core/server/config module and is responsible for passing in the validated config file. Whereas before we had ./core/server/config require’ing ./core/server/loader and running its init code and then passing that value back to itself, the flow is now more straight forward of ./core/bootstrap handling initialization and then instatiation of config module - Merges ./core/server/config/paths into ./core/server/config This flow was always confusing me to that some config options were on the config object, and some were on the paths object. This change now incorporates all of the variables previously defined in config/paths directly into the config module, and in extension, the config.js file. This means that you now have the option of deciding at startup where the content directory for ghost should reside. - broke out loader tests in config_spec to bootstrap_spec - updated all relevant files to now use config().paths - moved urlFor and urlForPost function into ./server/config/url.js
146 lines
3.9 KiB
JavaScript
146 lines
3.9 KiB
JavaScript
// # Ghost Configuration
|
|
// Setup your Ghost install for various environments
|
|
// Documentation can be found at http://docs.ghost.org/usage/configuration/
|
|
|
|
var path = require('path'),
|
|
config;
|
|
|
|
config = {
|
|
// ### Development **(default)**
|
|
development: {
|
|
// The url to use when providing links to the site, E.g. in RSS and email.
|
|
url: 'http://my-ghost-blog.com',
|
|
|
|
// Example mail config
|
|
// Visit http://docs.ghost.org/mail for instructions
|
|
// ```
|
|
// mail: {
|
|
// transport: 'SMTP',
|
|
// options: {
|
|
// service: 'Mailgun',
|
|
// auth: {
|
|
// user: '', // mailgun username
|
|
// pass: '' // mailgun password
|
|
// }
|
|
// }
|
|
// },
|
|
// ```
|
|
|
|
database: {
|
|
client: 'sqlite3',
|
|
connection: {
|
|
filename: path.join(__dirname, '/content/data/ghost-dev.db')
|
|
},
|
|
debug: false
|
|
},
|
|
server: {
|
|
// Host to be passed to node's `net.Server#listen()`
|
|
host: '127.0.0.1',
|
|
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
|
|
port: '2368'
|
|
},
|
|
paths: {
|
|
contentPath: path.join(__dirname, '/content/')
|
|
}
|
|
},
|
|
|
|
// ### Production
|
|
// When running Ghost in the wild, use the production environment
|
|
// Configure your URL and mail settings here
|
|
production: {
|
|
url: 'http://my-ghost-blog.com',
|
|
mail: {},
|
|
database: {
|
|
client: 'sqlite3',
|
|
connection: {
|
|
filename: path.join(__dirname, '/content/data/ghost.db')
|
|
},
|
|
debug: false
|
|
},
|
|
server: {
|
|
// Host to be passed to node's `net.Server#listen()`
|
|
host: '127.0.0.1',
|
|
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
|
|
port: '2368'
|
|
}
|
|
},
|
|
|
|
// **Developers only need to edit below here**
|
|
|
|
// ### Testing
|
|
// Used when developing Ghost to run tests and check the health of Ghost
|
|
// Uses a different port number
|
|
testing: {
|
|
url: 'http://127.0.0.1:2369',
|
|
database: {
|
|
client: 'sqlite3',
|
|
connection: {
|
|
filename: path.join(__dirname, '/content/data/ghost-test.db')
|
|
}
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: '2369'
|
|
}
|
|
},
|
|
|
|
// ### Travis
|
|
// Automated testing run through GitHub
|
|
'travis-sqlite3': {
|
|
url: 'http://127.0.0.1:2369',
|
|
database: {
|
|
client: 'sqlite3',
|
|
connection: {
|
|
filename: path.join(__dirname, '/content/data/ghost-travis.db')
|
|
}
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: '2369'
|
|
}
|
|
},
|
|
|
|
// ### Travis
|
|
// Automated testing run through GitHub
|
|
'travis-mysql': {
|
|
url: 'http://127.0.0.1:2369',
|
|
database: {
|
|
client: 'mysql',
|
|
connection: {
|
|
host : '127.0.0.1',
|
|
user : 'travis',
|
|
password : '',
|
|
database : 'ghost_travis',
|
|
charset : 'utf8'
|
|
}
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: '2369'
|
|
}
|
|
},
|
|
|
|
// ### Travis
|
|
// Automated testing run through GitHub
|
|
'travis-pg': {
|
|
url: 'http://127.0.0.1:2369',
|
|
database: {
|
|
client: 'pg',
|
|
connection: {
|
|
host : '127.0.0.1',
|
|
user : 'postgres',
|
|
password : '',
|
|
database : 'ghost_travis',
|
|
charset : 'utf8'
|
|
}
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: '2369'
|
|
}
|
|
}
|
|
};
|
|
|
|
// Export config
|
|
module.exports = config;
|