From ec8f70e799e76898572f65be73ec4b2975474e89 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Thu, 23 Apr 2026 11:17:06 +0700 Subject: [PATCH] docs: focus README on phow2sim only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the doantu/miti99bot integration section — phow2sim is a standalone building block; consumer-specific wiring doesn't belong in its README. Replace with a short generic 'Auth' note about fronting the service with a reverse proxy. Also correct the MODEL_URL row — it's no longer required since the runtime accepts either a URL or a pre-populated MODEL_PATH. --- README.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 96fe449..c687cfc 100644 --- a/README.md +++ b/README.md @@ -137,23 +137,13 @@ docker compose down -v && docker compose up --build | Var | Default | Meaning | |---|---|---| -| `MODEL_URL` | *(required)* | Any URL that serves the zip via a plain GET. Bake any auth into the URL. | -| `MODEL_PATH` | `/data/phow2v/word2vec_vi_words_300dims.txt` | Where the text-format vectors are persisted. | +| `MODEL_URL` | `""` | URL that serves the zip via a plain GET. Bake any auth into the URL. Optional if `MODEL_PATH` is already populated via a bind mount. | +| `MODEL_PATH` | `/data/phow2v/word2vec_vi_words_300dims.txt` | Where the text-format vectors live. A binary `.bin` sibling is written on first parse. | -## Using from doantu (miti99bot) +## Auth -The Cloudflare Worker module's `api-client.js` already produces the same -response shape. Replace `embedPair` + local cosine with a single `fetch`: - -```js -const url = `${env.PHOW2SIM_URL}/similarity?a=${encodeURIComponent(a)}&b=${encodeURIComponent(b)}`; -const resp = await fetch(url, { headers: { Authorization: `Bearer ${env.PHOW2SIM_TOKEN}` } }); -return await resp.json(); // { in_vocab_a, in_vocab_b, similarity, ... } -``` - -Auth is **not** built-in here — add a reverse proxy (Caddy, Cloudflare -Tunnel, or nginx) in front that checks a bearer token before passing -through. The service itself trusts its caller. +The service does not authenticate its callers. Put it behind a reverse +proxy (Caddy, nginx, Cloudflare Tunnel) if you need access control. ## Project layout @@ -165,7 +155,7 @@ phow2sim/ ├── Dockerfile ├── docker-compose.yml ├── requirements.txt -└── .env.example # copy to .env and fill in Nextcloud creds +└── .env.example # copy to .env and set MODEL_URL ``` ## Credits