diff --git a/backend/server.js b/backend/server.js index 63305c3..457a679 100644 --- a/backend/server.js +++ b/backend/server.js @@ -15,7 +15,10 @@ const host = process.env.HOST || "localhost"; const port = parseInt(process.env.PORT || "") || 6119; const tlsPort = parseInt(process.env.TLS_PORT || "") || 6120; const useTLS = process.env.TLS ? true : false; -const analyticsTag = process.env.ANALYTICS_TAG || ""; +const analyticsTag = (process.env.ANALYTICS_TAG || "").replace( + /^'(.+)'$/, + "$1" +); const langs = await langsPromise; const app = express(); diff --git a/doc/selfhosting.md b/doc/selfhosting.md index 35ef4ab..43bb580 100644 --- a/doc/selfhosting.md +++ b/doc/selfhosting.md @@ -264,8 +264,9 @@ enable all the fun CloudFlare options you'd like. ## Set up analytics (optional) Sign up for Fathom Analytics, enter your domain name, and get a tag -for embedding. Set this as `ANALYTICS_TAG` in your `.env` file (don't -forget the appropriate quoting), and build and roll out a new web AMI. +for embedding. Set this as `ANALYTICS_TAG` in your `.env` file (use +single quoting, as Makefile handling of quotes is a bit nonstandard), +and build and roll out a new web AMI. ## Set up monitoring (optional) diff --git a/frontend/pages/app.ejs b/frontend/pages/app.ejs index 495d279..4b56337 100644 --- a/frontend/pages/app.ejs +++ b/frontend/pages/app.ejs @@ -23,7 +23,7 @@ <% if (analyticsTag) { %> - <%= analyticsTag %> + <%- analyticsTag %> <% } %>
diff --git a/frontend/pages/index.ejs b/frontend/pages/index.ejs index fe25f16..ac45a26 100644 --- a/frontend/pages/index.ejs +++ b/frontend/pages/index.ejs @@ -4,6 +4,9 @@