nikou-cli 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -502,15 +502,26 @@ nikou-cli hook log --follow
502
502
 
503
503
  ## 统计上报
504
504
 
505
- 统计上报默认关闭。只有同时配置以下环境变量时才会连接数据库:
505
+ 统计上报默认关闭,只允许由主节点本机私有配置 `~/.nikou-block/master/config.json` 开启。连接信息不会从环境变量读取,也不会写入公开仓库或日志:
506
+
507
+ ```json
508
+ {
509
+ "usage_stat": {
510
+ "enabled": true,
511
+ "host": "YOUR_DB_HOST",
512
+ "port": 3306,
513
+ "user": "YOUR_DB_USER",
514
+ "password": "CHANGE_ME",
515
+ "database": "YOUR_DB_NAME",
516
+ "table": "nikou_usage_daily_stat"
517
+ }
518
+ }
519
+ ```
520
+
521
+ 配置文件必须保持 `0600` 权限。只读汇总使用固定命令,不支持传入任意 SQL:
506
522
 
507
523
  ```bash
508
- export NIKOU_STAT_DB_HOST=127.0.0.1
509
- export NIKOU_STAT_DB_PORT=3306
510
- export NIKOU_STAT_DB_USER=nikou
511
- export NIKOU_STAT_DB_PASSWORD=CHANGE_ME
512
- export NIKOU_STAT_DB_NAME=nikou
513
- export NIKOU_STAT_DB_TABLE=nikou_usage_daily_stat
524
+ nikou-cli hook usage-report --start 2026-07-13 --end 2026-07-19
514
525
  ```
515
526
 
516
527
  ## 开发