Files
pezkuwi-telegram-miniapp/ops/functions-registry.json
T
SatoshiQaziMuhammed 07cd642051 ops: run the Telegram bots and the assistant on vps3 (#46)
* ops: run the Telegram bots and the assistant on vps3

telegram-bot and ask ran on the free cloud project, which paused itself
after a quiet week; every bot went silent and the deploy job failed against
the paused project. They now run in their own edge-runtime container on vps3
(bots/), from /opt/pezkuwi-bots.

Separate from the shared functions runtime because that one verifies a JWT
on every request, which Telegram cannot send, and holds the platform's wallet
keys, which a public bot feeding user text to a language model should not
sit next to. The new runtime holds only the keys the two functions read.

- telegram-bot refuses updates without Telegram's secret-token header
  (TELEGRAM_WEBHOOK_SECRET); the main slot reads TELEGRAM_BOT_TOKEN_MAIN,
  since TELEGRAM_BOT_TOKEN on vps3 is the miniapp's sign-in check.
- nginx keeps the public URL shape:
  supabase.pezkuwichain.io/functions/v1/{telegram-bot,ask}.
- deploy.yml ships them with a new bots-deploy verb on the existing deploy
  key; the host script accepts exactly main, telegram-bot and ask, restarts
  the container and fails unless the bot comes back refusing unsigned updates.
- Registry: _cloud_hosted becomes _hosted_elsewhere; the gate refuses those
  names in the shared volume and reports any copy there as stale.

* ask: send the legacy service key as a bearer token on vps3

The vps3 gateway has no opaque sb_secret keys and honours the service_role JWT
only as a bearer token; sent on apikey alone it reads as anon, the limiter's
count fails, and every question is refused as rate-limited.
2026-10-22 13:51:35 +04:00

60 lines
2.4 KiB
JSON

{
"_comment": "Ownership registry for the shared self-hosted Supabase edge-function volume.",
"_rule": "Every function directory under volumes/functions MUST be listed here with exactly one owning project. A project may only write the names it owns. Adding a new function requires adding it here FIRST.",
"_enforced_by": "/usr/local/bin/supabase-deploy-functions",
"_updated": "2026-10-22",
"projects": {
"pezkuwi-telegram-miniapp": [
"accept-p2p-offer",
"announcement-reaction",
"check-deposits",
"create-offer-telegram",
"get-deposit-code",
"get-deposit-info",
"get-deposits",
"get-internal-balance",
"get-my-offers",
"get-p2p-offers",
"get-p2p-trades",
"get-payment-methods",
"p2p-dispute",
"p2p-messages",
"process-deposits",
"request-withdraw-telegram",
"save-wallet-address",
"tgm-process-withdraw",
"tgm-telegram-auth",
"trade-action",
"verify-deposit-telegram"
],
"pwap-web": [
"_shared",
"cleanup-proofs",
"confirm-payment",
"lock-escrow",
"notifications-manager",
"process-withdraw",
"process-withdrawal",
"resolve-dispute",
"telegram-auth",
"two-factor-auth",
"verify-deposit"
],
"_platform": [
"hello",
"main"
]
},
"_retired": {
"email-verification": "pwap-web, 2026-08-01. Repodan 2026-07-30da silindi ama volume rsync --delete kullanmadigi icin sunucuda calismaya devam etti: anon key ile erisilebilir, service-role ile calisan, Access-Control-Allow-Origin * bir endpoint. send yolu zaten bozuktu (getUserByEmail SDKda yok) ve token tablosu bostu, yani somurulebilir degildi — ama bozuk olmasi koruyordu, tasarimi degil. /opt/supabase-self-hosted/retired-functions/ altinda karantinada."
},
"_hosted_elsewhere": {
"_comment": "Served by the separate bots runtime on vps3 (/opt/pezkuwi-bots, container pezkuwi-bots), not from this volume: both Telegram bots' webhook and the assistant behind news.pex.mom and ick.pezkiwi.app. That runtime does not verify JWTs (Telegram cannot send one) and holds only the keys these two need. Copies in this volume are stale; retire them. Until 2026-10-22 these ran on the cloud project vbhftvdayqfmcgmzdxfv.",
"where": "/opt/pezkuwi-bots",
"names": [
"telegram-bot",
"ask"
]
}
}