From 323792691bbf76dbb96f2c6955becf97cef2a007 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 17 Dec 2020 14:13:44 -0500 Subject: [PATCH] All node stderr should go to the log files. Also fixing unread counts coffeescript. --- config/supervisor_imageproxy.conf | 4 ++-- config/supervisor_mongomms.conf | 2 +- config/supervisor_node_favicons.conf | 2 +- config/supervisor_node_original.conf | 2 +- config/supervisor_node_text.conf | 2 +- config/supervisor_node_unread.conf | 2 +- config/supervisor_node_unread_ssl.conf | 4 ++-- node/unread_counts.coffee | 2 +- node/unread_counts.js | 6 +++--- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/supervisor_imageproxy.conf b/config/supervisor_imageproxy.conf index 9a19b6d96..cc74e70b4 100644 --- a/config/supervisor_imageproxy.conf +++ b/config/supervisor_imageproxy.conf @@ -4,8 +4,8 @@ directory=/srv/code/go/bin/ user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /srv/newsblur/logs/imageproxy.log -environment = IMAGEPROXY_CACHE="memory:200:4h",IMAGEPROXY_ADDR="localhost:4593",IMAGEPROXY_SIGNATUREKEY="@/etc/imageproxy.key",IMAGEPROXY_VERBOSE=1 \ No newline at end of file +environment = IMAGEPROXY_CACHE="memory:200:4h",IMAGEPROXY_ADDR="localhost:4593",IMAGEPROXY_SIGNATUREKEY="@/etc/imageproxy.key",IMAGEPROXY_VERBOSE=1 diff --git a/config/supervisor_mongomms.conf b/config/supervisor_mongomms.conf index aaefbf7b9..370f93087 100644 --- a/config/supervisor_mongomms.conf +++ b/config/supervisor_mongomms.conf @@ -4,7 +4,7 @@ directory=/srv/newsblur user=root autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /var/log/mongodb/mms-agent.log diff --git a/config/supervisor_node_favicons.conf b/config/supervisor_node_favicons.conf index 349c493fe..44a7559c9 100644 --- a/config/supervisor_node_favicons.conf +++ b/config/supervisor_node_favicons.conf @@ -4,7 +4,7 @@ directory=/srv/newsblur user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /srv/newsblur/logs/favicons.log diff --git a/config/supervisor_node_original.conf b/config/supervisor_node_original.conf index 2e3b0990b..496931e25 100644 --- a/config/supervisor_node_original.conf +++ b/config/supervisor_node_original.conf @@ -5,7 +5,7 @@ environment=NODE_ENV=production user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /srv/newsblur/logs/original_page.log diff --git a/config/supervisor_node_text.conf b/config/supervisor_node_text.conf index c672c5111..b82f48ee1 100644 --- a/config/supervisor_node_text.conf +++ b/config/supervisor_node_text.conf @@ -5,7 +5,7 @@ environment=NODE_ENV=production user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /srv/newsblur/logs/original_text.log diff --git a/config/supervisor_node_unread.conf b/config/supervisor_node_unread.conf index 276298c95..9451c3ef0 100644 --- a/config/supervisor_node_unread.conf +++ b/config/supervisor_node_unread.conf @@ -5,7 +5,7 @@ environment=NODE_ENV=production user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True minfds = 10000 priority=991 stopsignal=HUP diff --git a/config/supervisor_node_unread_ssl.conf b/config/supervisor_node_unread_ssl.conf index a89d2e0b8..4ad64be2a 100644 --- a/config/supervisor_node_unread_ssl.conf +++ b/config/supervisor_node_unread_ssl.conf @@ -4,8 +4,8 @@ directory=/srv/newsblur user=sclay autostart=true autorestart=true -#redirect_stderr=True +redirect_stderr=True priority=991 stopsignal=HUP stdout_logfile = /srv/newsblur/logs/unread_counts.log -environment = NODE_ENV=production,NODE_SSL=on \ No newline at end of file +environment = NODE_ENV=production,NODE_SSL=on diff --git a/node/unread_counts.coffee b/node/unread_counts.coffee index 2ea9dd230..3a6b11504 100644 --- a/node/unread_counts.coffee +++ b/node/unread_counts.coffee @@ -54,7 +54,7 @@ io.on 'connection', (socket) -> ip = socket.handshake.headers['X-Forwarded-For'] || socket.handshake.address socket.on 'subscribe:feeds', (@feeds, @username) -> - log.info @username, "Connecting (#{feeds.length} feeds, #{ip})," + + log.info @username, "Connecting (#{@feeds.length} feeds, #{ip})," + " (#{io.engine.clientsCount} connected) " + " #{if SECURE then "(SSL)" else "(non-SSL)"}" diff --git a/node/unread_counts.js b/node/unread_counts.js index 56cf7faba..ed2eb49e9 100644 --- a/node/unread_counts.js +++ b/node/unread_counts.js @@ -67,11 +67,11 @@ io.on('connection', function(socket) { var ip; ip = socket.handshake.headers['X-Forwarded-For'] || socket.handshake.address; - socket.on('subscribe:feeds', function(feeds1, username) { + socket.on('subscribe:feeds', function(feeds, username) { var ref; - this.feeds = feeds1; + this.feeds = feeds; this.username = username; - log.info(this.username, `Connecting (${feeds.length} feeds, ${ip}),` + ` (${io.engine.clientsCount} connected) ` + ` ${SECURE ? "(SSL)" : "(non-SSL)"}`); + log.info(this.username, `Connecting (${this.feeds.length} feeds, ${ip}),` + ` (${io.engine.clientsCount} connected) ` + ` ${SECURE ? "(SSL)" : "(non-SSL)"}`); if (!this.username) { return; }