forked from visnup/npm-www
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
85 lines (69 loc) · 1.86 KB
/
config.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
exports.port = 15443
exports.host = 'localhost'
exports.httpPort = 15080
exports.cluster = { size : require("os").cpus().length }
// redis auth
exports.redis = { host: '127.0.0.1', port: 6379 }
exports.registryCouch = "https://isaacs.iriscouch.net/"
// npm config settings
exports.npm =
{ loglevel: "warn"
, registry: "http://registry.npmjs.org/"
, "strict-ssl": false
, _auth: ''
, username: ''
, _password: ''
}
// bunyan config
exports.log =
{ name: 'npm-www'
, level: 'trace'
}
exports.package = require('./package.json')
exports.contributors = require('fs').readFileSync('AUTHORS', 'utf8')
exports.errorPage = { debug: true }
exports.debug = true
// probably don't need to change these.
// extra fields we hang on the profile.
exports.profileFields =
{ fullname: "Full Name"
, email: "Email"
, github: "Github Username"
, twitter: "Twitter Username"
, homepage: "Homepage URL"
, freenode: "IRC Handle"
}
exports.emailFrom = '"The npm Website Robot" <[email protected]>'
// For development only!
// Don't send 304s for templar (still does for styl and some others)
// npm config set npm-www:nocache 1
exports.nocache = process.env.npm_package_config_nocache === '1'
exports.templateOptions = {
cache: !exports.nocache
}
/*****************/
/* don't delete! */
/*****************/
var env = process.env.NODE_ENV
var admin
if (env === 'production') {
admin = require('./config.admin.js')
} else try {
if (env !== 'dev') {
admin = require('./config.admin.js')
} else {
admin = require('./config.dev.js')
}
} catch (er) {
console.error('Warning: No admin configurations. Not suitable for production use.')
admin = {}
}
Object.keys(admin).forEach(function (k) {
if (k === 'redisAuth') exports.redis.auth = admin[k]
exports[k] = admin[k]
})
if (module === require.main) {
// just show the configs
console.log(exports)
process.exit(0)
}