-
Notifications
You must be signed in to change notification settings - Fork 1
/
keystone.js
92 lines (71 loc) · 2.2 KB
/
keystone.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Load .env for development environments
require('dotenv').load();
/**
* Application Initialisation
*/
var keystone = require('keystone'),
pkg = require('./package.json');
keystone.init({
'name': 'HS Hackers',
'brand': 'HS Hackers',
'back': '/me',
'favicon': 'public/favicon.ico',
'less': 'public',
'static': 'public',
'views': 'templates/views',
'view engine': 'jade',
'emails': 'templates/emails',
'auto update': true,
'mongo': process.env.MONGO_URI || 'mongodb://localhost/' + pkg.name,
'session': true,
'auth': true,
'user model': 'User',
'cookie secret': process.env.COOKIE_SECRET || 'yOB~u{rQK`d17JFGn!@&pB9N%b_{rZa7+oVD+xVr&-u^SY^>u9Jy/-3eM+C37[4J',
// the default mandrill api key is a *test* key. it will 'work', but not send emails.
'mandrill api key': process.env.MANDRILL_KEY || 'v17RkIoARDkqTqPSbvrmkw',
'google api key': process.env.GOOGLE_BROWSER_KEY,
'google server api key': process.env.GOOGLE_SERVER_KEY,
'ga property': process.env.GA_PROPERTY,
'ga domain': process.env.GA_DOMAIN,
'chartbeat property': process.env.CHARTBEAT_PROPERTY,
'chartbeat domain': process.env.CHARTBEAT_DOMAIN
});
require('./models');
keystone.set('routes', require('./routes'));
keystone.set('locals', {
_: require('underscore'),
moment: require('moment'),
js: 'javascript:;',
env: keystone.get('env'),
utils: keystone.utils,
plural: keystone.utils.plural,
editable: keystone.content.editable,
google_api_key: keystone.get('google api key'),
ga_property: keystone.get('ga property'),
ga_domain: keystone.get('ga domain'),
chartbeat_property: keystone.get('chartbeat property'),
chartbeat_domain: keystone.get('chartbeat domain')
});
keystone.set('email locals', {
keystoneURL: 'http://hshackers.org/keystone',
logo: '/images/logo_email.jpg',
logo_width: 120,
logo_height: 112,
theme: {
email_bg: '#f9f9f9',
link_color: '#2697de'
}
});
keystone.set('email tests', {
'forgotten-password': {
name: 'User',
link: 'http://hshackers.org/reset-password/key'
}
});
keystone.set('nav', {
'meetups': ['meetups', 'talks'],
'members': ['users', 'organizations'],
'posts': ['posts', 'post-categories', 'post-comments'],
'links': ['links', 'link-tags', 'link-comments']
});
keystone.start();