diff --git a/hermes_squid/README.md b/hermes_squid/README.md index 79f981a..7b01bd9 100644 --- a/hermes_squid/README.md +++ b/hermes_squid/README.md @@ -1,26 +1,18 @@ -# Domains should be limited +# hermes_squid -## Not accessible - ifconfig.me/ip - 192.168.1.0/24 - 192.168.0.0/24 - http://admin:admin@100.70.193.97:8088 +Compose for the prod stack `hermes_infra` (squid, sarg, hermes-ui, hermes-gateway, docker-socket-proxy, brencher-state-proxy). One hermes-gateway, one Telegram bot, one Telegram chat-id. Do **not** mix this stack with the separate `hermes` stack that lives under `poc/hermes/` — that one targets a different bot and a different chat. -## Accessible - google.com - -# Open in browser google.com -## It should be Comofox by default +Sources -# Websearch something -## It should be duckduckgo +- Prod compose: `hermes_squid/stack-compose.yml`. +- Telegram chat id mapping: see `docs/gateway-channels.md`. -# Allow self install packages - -# DockerInDocker for subprofiles -UI sessions lost - -# Image generation +Update +- Edit `hermes_squid/stack-compose.yml`, commit, push. +- Brencher picks up `admin/ansible:master` on the next scheduler tick. +Pitfalls +- The admin mirror of this repo is `admin/ansible`; cross-fork PRs go into it. +- The `hermes-gateway` service binds the dashboard to `0.0.0.0:8087` (compose). Healthcheck lives here too. diff --git a/hermes_squid/docs/gateway-channels.md b/hermes_squid/docs/gateway-channels.md new file mode 100644 index 0000000..b56eb14 --- /dev/null +++ b/hermes_squid/docs/gateway-channels.md @@ -0,0 +1,29 @@ +# Gateway ↔ chat-id mapping + +Hard rule when editing anything in `hermes_infra/`: do not merge two Telegram stacks into a single compose. Today there are two live `hermes-gateway` services in the swarm, on **different chat-ids**: + +| Stack | Service | chat-id | Bot token | +|--------------------------|------------------------|----------------|---------------| +| `hermes_infra` (prod) | `hermes-gateway` | `-1004417969359` (Home) | prod token (from docker secret) | +| `hermes` (poc) | `hermes-gateway` | `-1004355191149` | alt token | +| `docker_socket_proxy` | `hermes-gateway` | (none, `platforms={}`) | not connected | + +Each gateway reads its token from a separate docker secret. Sharing a compose file between them **will** double-connect to a chat, double-respond to inbound messages, and make every "interrupted" warning meaningless. + +How to find a service's chat-id at runtime: + +```bash +# from the agent host, read gateway state from inside the container: +docker exec -it $(docker ps -qf name=hermes_infra_hermes-gateway) \ + cat /opt/data/gateway_state.json | jq '.platforms.telegram.chat_id' +``` + +Sources + +- `hermes_squid/stack-compose.yml` (compose for the prod stack). +- `poc/hermes/stack-compose.yml` (compose for the other stack; lives one level up — intentionally kept separate). +- `admin/ansible#26` (incident that motivated this file). + +Update + +- When a new gateway is added, add a row to the table above with the chat-id. The chat-id is what comes out of `gateway_state.json`; do not invent values.