From bb1aa4aa5508af986cb9f0a80baf9255472bb6af Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 24 Jul 2023 22:21:05 +0200 Subject: [PATCH] Added Umami to pm2 ecosystem file. --- config/default.js | 2 +- ecosystem.config.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config/default.js b/config/default.js index f2b6b849..b6ba2532 100755 --- a/config/default.js +++ b/config/default.js @@ -31,7 +31,7 @@ module.exports = { }, }, analytics: { - enabled: true, + enabled: false, address: 'http://localhost:3000/script.js', siteId: '1b28ac3b-d229-43bf-aec9-75cf0a72a466', }, diff --git a/ecosystem.config.js b/ecosystem.config.js index 15391d25..f2258580 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -1,4 +1,4 @@ -// const config = require('config'); +const config = require('config'); module.exports = { apps: [ @@ -14,5 +14,15 @@ module.exports = { NODE_ENV: 'production', }, }, + ...(config.analytics.enabled ? [{ + name: 'umami', + script: 'npm start', + cwd: process.env.UMAMI_DIR || '../umami', + restart_delay: 3000, + merge_logs: true, + env: { + NODE_ENV: 'production', + }, + }] : []), ], };