@pleasenobugs/server 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/app.d.ts +27 -0
  4. package/dist/app.d.ts.map +1 -0
  5. package/dist/app.js +43 -0
  6. package/dist/app.js.map +1 -0
  7. package/dist/auth.d.ts +37 -0
  8. package/dist/auth.d.ts.map +1 -0
  9. package/dist/auth.js +108 -0
  10. package/dist/auth.js.map +1 -0
  11. package/dist/board.d.ts +23 -0
  12. package/dist/board.d.ts.map +1 -0
  13. package/dist/board.js +45 -0
  14. package/dist/board.js.map +1 -0
  15. package/dist/bootstrap.d.ts +42 -0
  16. package/dist/bootstrap.d.ts.map +1 -0
  17. package/dist/bootstrap.js +68 -0
  18. package/dist/bootstrap.js.map +1 -0
  19. package/dist/importer.d.ts +50 -0
  20. package/dist/importer.d.ts.map +1 -0
  21. package/dist/importer.js +85 -0
  22. package/dist/importer.js.map +1 -0
  23. package/dist/index.d.ts +12 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +10 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/limit.d.ts +14 -0
  28. package/dist/limit.d.ts.map +1 -0
  29. package/dist/limit.js +32 -0
  30. package/dist/limit.js.map +1 -0
  31. package/dist/main.d.ts +3 -0
  32. package/dist/main.d.ts.map +1 -0
  33. package/dist/main.js +164 -0
  34. package/dist/main.js.map +1 -0
  35. package/dist/memory-store.d.ts +59 -0
  36. package/dist/memory-store.d.ts.map +1 -0
  37. package/dist/memory-store.js +177 -0
  38. package/dist/memory-store.js.map +1 -0
  39. package/dist/projects.d.ts +64 -0
  40. package/dist/projects.d.ts.map +1 -0
  41. package/dist/projects.js +163 -0
  42. package/dist/projects.js.map +1 -0
  43. package/dist/router.d.ts +28 -0
  44. package/dist/router.d.ts.map +1 -0
  45. package/dist/router.js +391 -0
  46. package/dist/router.js.map +1 -0
  47. package/dist/sqlite-store.d.ts +61 -0
  48. package/dist/sqlite-store.d.ts.map +1 -0
  49. package/dist/sqlite-store.js +290 -0
  50. package/dist/sqlite-store.js.map +1 -0
  51. package/dist/store.d.ts +108 -0
  52. package/dist/store.d.ts.map +1 -0
  53. package/dist/store.js +2 -0
  54. package/dist/store.js.map +1 -0
  55. package/dist/telemetry.d.ts +83 -0
  56. package/dist/telemetry.d.ts.map +1 -0
  57. package/dist/telemetry.js +174 -0
  58. package/dist/telemetry.js.map +1 -0
  59. package/package.json +53 -4
@@ -0,0 +1,174 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import express from 'express';
3
+ import { rateLimit } from './limit.js';
4
+ /**
5
+ * How many bugs and ideas PleaseNoBugs has carried, and how many were fixed or
6
+ * built. That is the whole of what leaves a server, once a day.
7
+ *
8
+ * **What is sent**, per project: its name, how many bugs and ideas it has, and
9
+ * how many of each an owner marked done. Plus a random id for the installation,
10
+ * so a server is not counted twice, and the version. **Never** a post's text,
11
+ * a wallet address, a display name, a vote or an origin.
12
+ *
13
+ * **On unless switched off** (`PNB_TELEMETRY=off`), and said out loud at start
14
+ * so nobody has to read the source to find out. Hidden posts are not counted:
15
+ * those are spam an owner took down, not feedback.
16
+ *
17
+ * The counts are cumulative, so the collector keeps only the latest report per
18
+ * installation and project, and a report sent twice changes nothing.
19
+ */
20
+ /**
21
+ * Where reports go unless `PNB_TELEMETRY_URL` says otherwise: the makers'
22
+ * server, which collects with `PNB_COLLECT=on`. Every published version keeps
23
+ * sending here for as long as it runs, so this Railway service must keep its
24
+ * name and its domain.
25
+ */
26
+ export const DEFAULT_TELEMETRY_URL = 'https://pleasenobugs-production.up.railway.app/telemetry';
27
+ export const TELEMETRY_EVERY_MS = 24 * 60 * 60 * 1000;
28
+ /** The first report waits a minute, so a crash loop does not send one per restart. */
29
+ const FIRST_AFTER_MS = 60_000;
30
+ /** This installation's id, made on first use and kept in the database. */
31
+ export async function instanceId(store) {
32
+ const known = await store.getMeta('instance');
33
+ if (known)
34
+ return known;
35
+ const id = randomUUID();
36
+ await store.setMeta('instance', id);
37
+ return id;
38
+ }
39
+ /** Everything a report would say, so it can be logged before it is sent. */
40
+ export async function buildReport(store, version) {
41
+ const projects = await store.projects();
42
+ return {
43
+ instance: await instanceId(store),
44
+ version,
45
+ projects: await Promise.all(projects.map(async (p) => ({ name: p.name, ...(await store.projectStats(p.id)) }))),
46
+ };
47
+ }
48
+ /** The line a server prints at start, saying exactly what it sends and how to stop it. */
49
+ export function telemetryNotice(url) {
50
+ return (`[pleasenobugs] telemetry: once a day this server sends ${url} each project's name and how many ` +
51
+ 'bugs and ideas it has, and how many of each are done. Never post text, wallets or names of people. ' +
52
+ 'Set PNB_TELEMETRY=off to stop.');
53
+ }
54
+ /** Send one report. Answers whether it arrived; never throws. */
55
+ export async function sendReport(url, report, doFetch = fetch) {
56
+ try {
57
+ const res = await doFetch(url, {
58
+ method: 'POST',
59
+ headers: { 'content-type': 'application/json' },
60
+ body: JSON.stringify(report),
61
+ signal: AbortSignal.timeout(10_000),
62
+ });
63
+ return res.ok;
64
+ }
65
+ catch {
66
+ return false;
67
+ }
68
+ }
69
+ /**
70
+ * Report now-ish and then once a day, for as long as the process runs.
71
+ * Answers a function that stops it. The timers are `unref`'d so they never
72
+ * keep a process alive that is otherwise done.
73
+ */
74
+ export function startTelemetry(options) {
75
+ const tick = async () => {
76
+ const report = await buildReport(options.store, options.version);
77
+ await sendReport(options.url, report);
78
+ };
79
+ const first = setTimeout(() => void tick(), FIRST_AFTER_MS);
80
+ const every = setInterval(() => void tick(), TELEMETRY_EVERY_MS);
81
+ first.unref();
82
+ every.unref();
83
+ return () => {
84
+ clearTimeout(first);
85
+ clearInterval(every);
86
+ };
87
+ }
88
+ // ---- The collecting side ----
89
+ const MAX_PROJECTS = 20;
90
+ const MAX_COUNT = 10_000_000;
91
+ /**
92
+ * A report as received, or null. Strict, because anybody can post one: these
93
+ * are vanity numbers, and the most a liar can do is inflate them, but nothing
94
+ * odd gets stored.
95
+ */
96
+ export function readReport(body) {
97
+ if (!body || typeof body !== 'object')
98
+ return null;
99
+ const b = body;
100
+ if (typeof b.instance !== 'string' || !/^[A-Za-z0-9-]{8,64}$/.test(b.instance))
101
+ return null;
102
+ if (typeof b.version !== 'string' || b.version.length > 20)
103
+ return null;
104
+ if (!Array.isArray(b.projects) || b.projects.length > MAX_PROJECTS)
105
+ return null;
106
+ const count = (v) => (typeof v === 'number' && Number.isInteger(v) && v >= 0 && v <= MAX_COUNT ? v : null);
107
+ const projects = [];
108
+ for (const raw of b.projects) {
109
+ if (!raw || typeof raw !== 'object')
110
+ return null;
111
+ const p = raw;
112
+ const name = typeof p.name === 'string' ? p.name.trim() : '';
113
+ const bugs = count(p.bugs);
114
+ const ideas = count(p.ideas);
115
+ const bugsDone = count(p.bugsDone);
116
+ const ideasDone = count(p.ideasDone);
117
+ if (!name || name.length > 60 || bugs === null || ideas === null || bugsDone === null || ideasDone === null) {
118
+ return null;
119
+ }
120
+ if (bugsDone > bugs || ideasDone > ideas)
121
+ return null;
122
+ projects.push({ name, bugs, ideas, bugsDone, ideasDone });
123
+ }
124
+ return { instance: b.instance, version: b.version, projects };
125
+ }
126
+ const ACTIVE_MS = 30 * 24 * 60 * 60 * 1000;
127
+ /**
128
+ * The totals across everything ever reported. A server that went quiet keeps
129
+ * its numbers in the totals, because what it carried was still carried; it
130
+ * only stops counting as an installation.
131
+ */
132
+ export function summarize(rows, now) {
133
+ const active = new Set(rows.filter((r) => now - r.receivedAt <= ACTIVE_MS).map((r) => r.instance));
134
+ const sum = (k) => rows.reduce((n, r) => n + r[k], 0);
135
+ return {
136
+ installations: active.size,
137
+ projects: rows.length,
138
+ bugs: sum('bugs'),
139
+ ideas: sum('ideas'),
140
+ bugsDone: sum('bugsDone'),
141
+ ideasDone: sum('ideasDone'),
142
+ };
143
+ }
144
+ /**
145
+ * The two routes of a collecting server (`PNB_COLLECT=on`).
146
+ *
147
+ * `POST /telemetry` takes a report. `GET /telemetry/summary` answers the
148
+ * totals and nothing per project: the names of other people's apps are not
149
+ * published here. They are read on the server itself with
150
+ * `pleasenobugs-server telemetry`.
151
+ */
152
+ export function telemetryRouter(store, now = Date.now) {
153
+ const router = express.Router();
154
+ router.use(express.json({ limit: '16kb' }));
155
+ router.post('/telemetry', rateLimit({ windowMs: 60 * 60_000, max: 30, name: 'telemetry' }), (req, res, next) => {
156
+ const report = readReport(req.body);
157
+ if (!report) {
158
+ res.status(400).json({ error: 'bad_request' });
159
+ return;
160
+ }
161
+ const at = now();
162
+ Promise.all(report.projects.map((p) => store.putTelemetry({ ...p, project: p.name, instance: report.instance, version: report.version, receivedAt: at })))
163
+ .then(() => res.json({ ok: true }))
164
+ .catch(next);
165
+ });
166
+ router.get('/telemetry/summary', (_req, res, next) => {
167
+ store
168
+ .telemetry()
169
+ .then((rows) => res.json(summarize(rows, now())))
170
+ .catch(next);
171
+ });
172
+ return router;
173
+ }
174
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,0DAA0D,CAAC;AAEhG,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD,sFAAsF;AACtF,MAAM,cAAc,GAAG,MAAM,CAAC;AAQ9B,0EAA0E;AAC1E,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAY;IAC3C,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,IAAI,K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C,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAChD,KAAK,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@pleasenobugs/server",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "The PleaseNoBugs API: a feedback board for Nimiq mini apps, with pluggable storage.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/lennylenders/PleaseNoBugs.git",
9
+ "directory": "packages/server"
10
+ },
11
+ "homepage": "https://github.com/lennylenders/PleaseNoBugs#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/lennylenders/PleaseNoBugs/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "type": "module",
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./sqlite": {
27
+ "types": "./dist/sqlite-store.d.ts",
28
+ "import": "./dist/sqlite-store.js"
29
+ }
30
+ },
31
+ "bin": {
32
+ "pleasenobugs-server": "dist/main.js"
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "engines": {
38
+ "node": ">=22.13"
39
+ },
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.json",
42
+ "start": "node dist/main.js"
43
+ },
44
+ "dependencies": {
45
+ "@nimiq/core": "^2.7.1",
46
+ "@pleasenobugs/core": "0.1.1",
47
+ "cors": "^2.8.5",
48
+ "express": "^4.21.2"
49
+ },
50
+ "devDependencies": {
51
+ "@types/cors": "^2.8.17",
52
+ "@types/express": "^4.17.21",
53
+ "@types/node": "^22.13.0"
54
+ }
55
+ }