diff --git a/.jshintrc b/.jshintrc index e6f298d..bf34dcb 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,6 +2,7 @@ "asi": false, "expr": true, "loopfunc": true, + "quotmark": true, "curly": false, "evil": true, "white": true, diff --git a/config/default.json b/config/default.json index 1ddd8fc..b7ff260 100644 --- a/config/default.json +++ b/config/default.json @@ -13,5 +13,18 @@ "color": "false" }, "app": "logs/app" - } + }, + "rss": { + "title": "Node Security Advisories", + "description": "description", + "feed_url": "https://nodesecurity.io/rss.xml", + "site_url": "https://nodesecurity.io", + "image_url": "https://nodesecurity.io/img/nodesecurity.png", + "author": "Node Security Team contact@liftsecurity.io", + "managingEditor": "Node Security Team contact@liftsecurity.io", + "webMaster": "Node Security Team contact@liftsecurity.io", + "language": "en", + "pubDate": "", + "ttl": "20" + } } diff --git a/config/runtime.json b/config/runtime.json index 9e26dfe..dadee7a 100644 --- a/config/runtime.json +++ b/config/runtime.json @@ -1 +1,5 @@ -{} \ No newline at end of file +{ + "rss": { + "pubDate": "Wed Mar 05 2014 22:11:02 GMT+0000 (WET)" + } +} \ No newline at end of file diff --git a/hapi-advisories/_rss-config.js b/hapi-advisories/_rss-config.js deleted file mode 100644 index 65a842c..0000000 --- a/hapi-advisories/_rss-config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - 'title': 'Node Security Advisories', - 'description': 'description', - 'feed_url': 'https://nodesecurity.io/rss.xml', - 'site_url': 'https://nodesecurity.io', - 'image_url': 'https://nodesecurity.io/img/nodesecurity.png', - // 'docs': 'http://example.com/rss/docs.html', - 'author': 'Node Security Team contact@liftsecurity.io', - 'managingEditor': 'Node Security Team contact@liftsecurity.io', - 'webMaster': 'Node Security Team contact@liftsecurity.io', - // 'copyright': '2014 Dylan Greene', - 'language': 'en', - // 'categories': ['Category 1','Category 2','Category 3'], - 'pubDate': (function () { - return new Date().toString(); - })(), - 'ttl': '20' -}; - diff --git a/hapi-advisories/index.js b/hapi-advisories/index.js index e2a2a51..29d6d6e 100644 --- a/hapi-advisories/index.js +++ b/hapi-advisories/index.js @@ -6,7 +6,8 @@ var path = require('path'); var semver = require('semver'); var jade = require('jade'); var RSS = require('rss'); -var rss_config = require('./_rss-config.js'); +var rss_config = require('config').rss; + var validate = require('./validate'); @@ -48,6 +49,7 @@ exports.register = function (plugin, options, next) { var advisories = {}; var advisories_templates = {}; var advisories_html; + // rss_config.pubDate = new Date().toString(); var advisories_rss_feed = new RSS(rss_config); var advisories_rss_xml; var previousDate = 0; diff --git a/server.js b/server.js index c65e427..b2ca7f8 100644 --- a/server.js +++ b/server.js @@ -48,7 +48,7 @@ server.pack.register(advisories, {}, function (err) { console.log('Loaded advisories'); // Start the server server.start(function () { - console.log("Started Server"); + console.log('Started Server'); }); } });