Permalink
Browse files

admin example configs

  • Loading branch information...
1 parent b9ff697 commit 3171c671c04c7886474704d7cc875ca963eb04c3 @isaacs isaacs committed May 7, 2012
Showing with 59 additions and 2 deletions.
  1. +41 −0 config.admin.example.js
  2. +18 −2 config.js
View
@@ -0,0 +1,41 @@
+// This is an example only.
+// Fill in with appropriate values, uncomment, and rename
+// this file to 'config.admin.js' to enable these features.
+//
+// Every one of these should be set in production.
+
+// The admin user that does admin things on couchdb.
+// For instance, resetting user account passwords and such.
+exports.couchAuth = null
+// exports.couchAuth = "the-username-here:the-password-here"
+
+// The redis authorization password.
+// This should match the "requirepass" directive in your
+// redis config file. It should be very long, because redis's
+// speed makes it a vulnerable target to brute force attacks.
+exports.redisAuth = null
+// exports.redisAuth = "redis-super-secret-long-awesome-password-here"
+
+// Keys that are used to sign cookies.
+// Should be something more unique and special. In production, it
+// should certainly at least be different from this.
+exports.keys = null
+// exports.keys = [ "super duper secrets go here!" ]
+
+// Authorization settings for Amazon's Simple Email Service.
+// Without this, you can't send email to users to reset their password.
+exports.mailTransportType = null
+exports.mailTransportSettings = null
+// exports.mailTransportType = "SES"
+// exports.mailTransportSettings = {
+// AWSAccessKeyID: "XXXXXXXXXXXXXXXXXXXX",
+// AWSSecretKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
+// }
+
+// HTTP keys
+// Should be PEM strings. Feel free to read from files.
+exports.https = null
+// exports.https = {
+// key: fs.readFileSync('ssl/server.key'),
+// cert: fs.readFileSync('ssl/server.crt')
+// }
View
@@ -1,5 +1,3 @@
-exports.keys = [ "super duper secrets go here!" ]
-
exports.port = 15443
exports.cluster = { size : require("os").cpus().length }
@@ -27,3 +25,21 @@ exports.package = require('./package.json')
exports.errorPage = { debug: true }
exports.debug = true
+
+
+
+/*****************/
+/* don't delete! */
+/*****************/
+if (process.env.NODE_ENV === 'production') {
+ var admin = require('./couch.admin.js')
+} else try {
+ var admin = require('./config.admin.js')
+} catch (er) {
+ console.error('Warning: No admin configurations. Not suitable for production use.')
+ return
+}
+Object.keys(admin).forEach(function (k) {
+ if (k === 'redisAuth') exports.redis.auth = admin[k]
+ exports[k] = admin[k]
+})

0 comments on commit 3171c67

Please sign in to comment.