diff --git a/Makefile b/Makefile index aad9d3e..819a0b4 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ else SHELL_PORTS := endif -SHELL_ENV := -e Z -e CI -e TEST_PATIENCE -e TEST_CONCURRENCY -e TEST_TIMEOUT_SECS -e FATHOM_SITE_ID +SHELL_ENV := -e Z -e CI -e TEST_PATIENCE -e TEST_CONCURRENCY -e TEST_TIMEOUT_SECS -e ANALYTICS_TAG ifeq ($(I),lang) LANG_TAG := lang-$(L) diff --git a/README.md b/README.md index bd037c1..1a74c56 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,9 @@ being nice include: * *Trying to consume as many resources as possible.* All this will do is prevent others from using Riju, which isn't nice. -* *Mining cryptocurrency.* Since hosting Riju comes out of my - paycheck, this is exactly equivalent to stealing, which isn't nice. +* *Mining cryptocurrency.* Since hosting Riju comes out of ~my + paycheck~ community donations, this is exactly equivalent to + stealing, which isn't nice. ## Can I help? / Documentation diff --git a/backend/server.js b/backend/server.js index f81fcfb..4643aca 100644 --- a/backend/server.js +++ b/backend/server.js @@ -16,7 +16,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 fathomSiteId = process.env.FATHOM_SITE_ID || ""; +const analyticsTag = (process.env.ANALYTICS_TAG || "").replace( + /^'(.+)'$/, + "$1" +); const langs = await langsPromise; const app = express(); @@ -28,7 +31,7 @@ app.get("/", (_, res) => { if (Object.keys(langs).length > 0) { res.render(path.resolve("frontend/pages/index"), { langs, - fathomSiteId, + analyticsTag, }); } else { res @@ -63,7 +66,7 @@ app.get("/:lang", cors(), (req, res) => { } res.render(path.resolve("frontend/pages/app"), { config: langs[lang], - fathomSiteId, + analyticsTag, }); }); app.use("/css", express.static("frontend/styles")); diff --git a/doc/selfhosting.md b/doc/selfhosting.md index 60f62f2..43bb580 100644 --- a/doc/selfhosting.md +++ b/doc/selfhosting.md @@ -263,9 +263,10 @@ 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 site -ID. Set this as `FATHOM_SITE_ID` in your `.env` file, and build and -roll out a new web AMI. +Sign up for Fathom Analytics, enter your domain name, and get a tag +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/financials/2021-10/breakdown.txt b/financials/2021-10/breakdown.txt new file mode 100644 index 0000000..e7b0510 --- /dev/null +++ b/financials/2021-10/breakdown.txt @@ -0,0 +1,18 @@ +Riju :: $106.77 + EC2 :: $81.38 + Data Transfer :: $0.03 + EBS Snapshot :: $2.36 + EBS Volume :: $28.57 + EBS Volume :: $28.57 + gp2 :: $1.07 + gp3 :: $27.49 + Instance :: $50.43 + t3.large :: $23.05 + t3.medium :: $27.38 + ECR :: $5.14 + Storage :: $5.14 + ELB :: $20.14 + Data Transfer :: $0.38 + LCUs :: $0.07 + Load Balancer :: $19.68 + S3 :: $0.11 diff --git a/frontend/pages/app.ejs b/frontend/pages/app.ejs index 18378b2..e23ef9c 100644 --- a/frontend/pages/app.ejs +++ b/frontend/pages/app.ejs @@ -22,8 +22,8 @@ window.rijuConfig = <%- JSON.stringify(config) %>; - <% if (fathomSiteId) { %> - + <% if (analyticsTag) { %> + <%- analyticsTag %> <% } %>
diff --git a/frontend/pages/index.ejs b/frontend/pages/index.ejs index 77c1830..ac45a26 100644 --- a/frontend/pages/index.ejs +++ b/frontend/pages/index.ejs @@ -4,6 +4,9 @@