feat: multi-endpoint + daemon auth guard + message delay + memory cap #3

Closed
tata wants to merge 1 commit from tata/intergram-js:master into master
First-time contributor

以 h02 多 endpoint 版為基底,整合拍拍的改進

新增功能(from 拍拍 72db12c

  1. Daemon auth guardcheckAuthorization() 先檢查 session,失效時直接 exit(1),不走 interactive auth
  2. MESSAGE_DELAY_SECOND — 環境變數控制 relay delay(預設 0)
  3. run.sh — 加 --max-old-space-size memory cap
  4. .env.example — 所有設定參數範例

保留功能(h02 多 endpoint 版)

  • 多 endpoint 支援(endpoint-*.json)
  • 每 endpoint 獨立 source_chats + bot_exclude
  • Health check HTTP server (:19200)
  • Slash command escape(全形斜線)

解決的問題

  • intergram-js auth retry 無限迴圈造成 9.87GB memory leak(apex0 事件 2026-03-20)
## 以 h02 多 endpoint 版為基底,整合拍拍的改進 ### 新增功能(from 拍拍 72db12c) 1. **Daemon auth guard** — `checkAuthorization()` 先檢查 session,失效時直接 exit(1),不走 interactive auth 2. **MESSAGE_DELAY_SECOND** — 環境變數控制 relay delay(預設 0) 3. **run.sh** — 加 `--max-old-space-size` memory cap 4. **.env.example** — 所有設定參數範例 ### 保留功能(h02 多 endpoint 版) - 多 endpoint 支援(endpoint-*.json) - 每 endpoint 獨立 source_chats + bot_exclude - Health check HTTP server (:19200) - Slash command escape(全形斜線) ### 解決的問題 - intergram-js auth retry 無限迴圈造成 9.87GB memory leak(apex0 事件 2026-03-20)
Cherry-picked from tata/1dcb01a — adapted to single-endpoint architecture.
Replaces /command with /command (fullwidth slash) in bot messages
to prevent triggering other bots through the bridge.
Merged from paipai's 72db12c improvements into multi-endpoint architecture:
- Daemon auth guard: checkAuthorization + INTERGRAM_ALLOW_INTERACTIVE_AUTH
- MESSAGE_DELAY_SECOND env var (default 0, configurable)
- run.sh with --max-old-space-size memory cap
- .env.example with all config options
- Slash command escape (already present)
- package.json start → run.sh
- Add js-yaml dependency
- config.yaml takes priority over .env when present
- message_delay_second is now per-bot (in bots array)
- Health port configurable via settings.health_port
- config.yaml.example with full documentation
- README.md rewritten with both config methods
- .env + CONFIG_FILE still supported as fallback
- Remove .env.example and endpoint.json.example
- Remove loadDotenv(), requireEnv(), CONFIG_FILE logic from config.js
- config.yaml is now the sole config source
- Simplify README to only document config.yaml
- npm start now runs node --max-old-space-size=1024 main.js directly
- Remove run.sh
tata closed this pull request 2026-03-20 13:49:39 +08:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eagle/intergram-js!3
No description provided.