Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

metrics-worker: README matches the code (key-gated routes, metrics/dashboard.json)

xerj-org2320c8afd46b
diff --git a/metrics-worker/README.md b/metrics-worker/README.md
index 1cd285433..6e6901a1c 100644
--- a/metrics-worker/README.md
+++ b/metrics-worker/README.md
@@ -5,13 +5,13 @@ and serves a charts dashboard.
GitHub's traffic API (`/repos/xerj-org/xerj/traffic/{clones,views}`) only returns
a rolling **14 days**, so the numbers vanish unless something snapshots them. The
-cron (`0 6 * * *`) merges the current 14-day window into `metrics/history.json`
+cron (`0 6 * * *`) merges the current 14-day window into `metrics/dashboard.json`
in the `xerj-installs` R2 bucket (upsert by date, so a missed run self-heals),
and counts the `installs/<date>/` objects the installer already writes. No IPs,
cookies or identifiers are stored or read.
-- **Dashboard:** the Worker's root URL (`/`) — Chart.js over the recorded data.
-- **Raw data:** `/data.json`.
+- **Dashboard:** `/?key=$REFRESH_KEY` — Chart.js over the recorded data. Every route is key-gated (403 without the key); nothing is public.
+- **Raw data:** `/data.json?key=$REFRESH_KEY`.
- **Manual snapshot:** `/refresh?key=$REFRESH_KEY`.
## Deploy
@@ -24,5 +24,5 @@ printf '%s' "$(openssl rand -hex 16)" | wrangler secret put REFRESH_KEY
curl "https://<worker-url>/refresh?key=<that key>" # seed the first snapshot
```
-Secrets: `GITHUB_TOKEN` (a PAT with traffic read), `REFRESH_KEY` (gates `/refresh`).
+Secrets: `GITHUB_TOKEN` (a PAT with traffic read), `REFRESH_KEY` (gates every route).
Binding: `INSTALLS` -> R2 bucket `xerj-installs` (shared with the installer).
diff --git a/metrics-worker/wrangler.toml b/metrics-worker/wrangler.toml
index 0fde61ff2..9f47912d3 100644
--- a/metrics-worker/wrangler.toml
+++ b/metrics-worker/wrangler.toml
@@ -10,7 +10,7 @@ compatibility_date = "2024-09-01"
crons = ["0 6 * * *"]
# Reuses the existing bucket the installer writes to; history lives under
-# metrics/history.json, installs under installs/<date>/.
+# metrics/dashboard.json, installs under installs/<date>/.
[[r2_buckets]]
binding = "INSTALLS"
bucket_name = "xerj-installs"