aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRubén Beltrán del Río <ben@nsovocal.com>2017-01-19 00:25:01 -0600
committerGitHub <noreply@github.com>2017-01-19 00:25:01 -0600
commit287fa13b3e600b2340895a5463a288bf08101bb5 (patch)
tree68b35cdd1bea40a6d51665ac7ed6dc4044eeda49 /config
parentcc69fef4b7e1587a91a0603d4bd1a46d0b133dd5 (diff)
Add Login (#2)
* Add dependencies * Add barebones app * Ignore .DS_Store * Add base static assets * Expose port on docker * Ignore env files * Add instructions to use env.dist * Add twitter configs * Use latest node version * Read env file properly * Add dependencies to start parsing twitter * Add helper for twitter login operations * Add handler for titter login routes * Use twitter handler * Add JWT related keys * Add jwt dependencies * Move index static file * Rename twitter handler to auth, add jwt support * Add new yarn lock * Add instructions for twitter * Remove twitter image * Fix return value lint errors * Ignore require-yield errors in linter
Diffstat (limited to 'config')
-rw-r--r--config/config.js21
-rw-r--r--config/env.dist4
2 files changed, 25 insertions, 0 deletions
diff --git a/config/config.js b/config/config.js
new file mode 100644
index 0000000..1c1c8a0
--- /dev/null
+++ b/config/config.js
@@ -0,0 +1,21 @@
+'use strict';
+
+const Getenv = require('getenv');
+
+const internals = {};
+
+module.exports = internals.Config = {
+ cookieKeys: Getenv.array('DASEIN_COOKIE_KEYS'), // Signatures for the cookies
+ port: Getenv.int('DASEIN_PORT', 1927), // Port to listen on
+ hostname: Getenv('DASEIN_HOSTNAME', 'localhost'), // Domain to listen on, used for cookies
+ staticDirectory: Getenv('DASEIN_STATIC_DIRECTORY', 'static'), // Location of static assets
+ jwt: {
+ cookieName: Getenv('DASEIN_JWT_COOKIE_NAME', 'dasein_jwt'), // Name of cookie where jwt is stored
+ duration: Getenv('DASEIN_JWT_DURATION', 86400), // Duration of JWT (24 hours)
+ secret: Getenv('DASEIN_JWT_SECRET') // Secret to sign JWT
+ },
+ twitter: {
+ consumerKey: Getenv('DASEIN_TWITTER_CONSUMER_KEY'), // Consumer key for twitter
+ consumerSecret: Getenv('DASEIN_TWITTER_CONSUMER_SECRET') // Consumer secret for twitter
+ }
+};
diff --git a/config/env.dist b/config/env.dist
new file mode 100644
index 0000000..ee23ee1
--- /dev/null
+++ b/config/env.dist
@@ -0,0 +1,4 @@
+DASEIN_COOKIE_KEYS=comma,separated,keys
+DASEIN_TWITTER_CONSUMER_KEY=your_twitter_key
+DASEIN_TWITTER_CONSUMER_SECRET=your_twitter_secret
+DASEIN_JWT_SECRET=some_random_string