No description
Find a file
Akizon77 1186aafb0d build(docker): use COPY --chmod to set executable bit
Simplify Dockerfile by using COPY --chmod instead of separate RUN chmod.
2026-08-07 16:57:42 +08:00
.github/workflows feat: add support for loong64 architecture on Linux 2026-07-16 23:56:48 +08:00
cmd fix(config): remove Cloudflare Access credentials from agent config 2026-07-08 21:04:43 +08:00
dnsresolver feat: add an option to choose IP version preference to connect dashboard 2026-06-12 22:05:19 +08:00
monitoring feat(gpu): add Windows NVIDIA detailed GPU monitoring via nvidia-smi (#109) 2026-07-27 17:14:30 +08:00
protocol perf: reduce report JSON allocations 2026-06-30 12:09:41 +08:00
server fix(config): remove Cloudflare Access credentials from agent config 2026-07-08 21:04:43 +08:00
terminal test(terminal): cover POSIX MOTD prelude command 2026-07-01 14:22:37 +08:00
update feat: support snapshot auto updates 2026-07-06 16:32:12 +08:00
utils fix: 修复域名转化 ipv6 失效 2025-11-05 17:33:01 +08:00
ws feat: 添加ping检测 2025-06-21 16:21:30 +08:00
.gitattributes Add .gitattributes for line ending normalization 2025-07-13 14:30:17 +08:00
.gitignore add fake agent for testing 2026-07-27 14:22:20 +08:00
build_all.ps1 feat: add support for loong64 architecture on Linux 2026-07-16 23:56:48 +08:00
build_all.sh feat: add support for loong64 architecture on Linux 2026-07-16 23:56:48 +08:00
Dockerfile build(docker): use COPY --chmod to set executable bit 2026-08-07 16:57:42 +08:00
fake-agent.md add fake agent for testing 2026-07-27 14:22:20 +08:00
fake_agent.py add fake agent for testing 2026-07-27 14:22:20 +08:00
go.mod chore: 更新gopsutil版本和依赖项,修复上游导致的错误循环 2026-05-22 22:12:49 +08:00
go.sum chore: 更新gopsutil版本和依赖项,修复上游导致的错误循环 2026-05-22 22:12:49 +08:00
install.ps1 feat: 添加对 FreeBSD 和 Windows 及 x86 的支持 2025-09-12 22:41:19 +08:00
install.sh feat: #437 support non-root installation with systemd user services 2026-07-22 16:19:01 +08:00
LICENSE Add files via upload 2025-04-29 21:48:09 +08:00
main.go Refactor monitoring package: remove platform-specific files and consolidate OS detection and process counting logic 2025-05-16 19:56:22 +08:00
readme.md docs: explain agent configuration in README 2026-07-01 14:58:57 +08:00

komari-agent

配置方式

agent 参数可以通过命令行参数、环境变量或 JSON 配置文件传入。

最小启动示例:

./komari-agent --endpoint "https://example.com" --token "your-token"

使用环境变量:

export AGENT_ENDPOINT="https://example.com"
export AGENT_TOKEN="your-token"
./komari-agent

使用 JSON 配置文件:

./komari-agent --config ./config.json

config.json 示例:

{
  "endpoint": "https://example.com",
  "token": "your-token",
  "interval": 3,
  "disable_auto_update": false,
  "disable_web_ssh": false,
  "ignore_unsafe_cert": false
}

配置优先级从低到高为默认值、命令行参数、环境变量、JSON 配置文件。

常用配置项:

表中支持版本表示该参数本身首次在发布 tag 中出现;环境变量和 JSON 配置文件方式从 1.1.33 起支持,早于最早 tag 的参数记为 0.0.9

JSON 字段 环境变量 命令行参数 说明 支持版本
endpoint AGENT_ENDPOINT --endpoint, -e 面板地址 0.0.9
token AGENT_TOKEN --token, -t agent token 0.0.9
interval AGENT_INTERVAL --interval, -i 数据采集间隔,单位秒 0.0.9
disable_auto_update AGENT_DISABLE_AUTO_UPDATE --disable-auto-update 禁用自动更新 0.0.9
disable_web_ssh AGENT_DISABLE_WEB_SSH --disable-web-ssh 禁用远程控制 0.0.9
ignore_unsafe_cert AGENT_IGNORE_UNSAFE_CERT --ignore-unsafe-cert, -u 忽略不安全证书 0.0.9
include_nics AGENT_INCLUDE_NICS --include-nics 仅统计指定网卡,逗号分隔 0.0.22
exclude_nics AGENT_EXCLUDE_NICS --exclude-nics 排除指定网卡,逗号分隔 0.0.22
include_mountpoints AGENT_INCLUDE_MOUNTPOINTS --include-mountpoint 仅统计指定挂载点,分号分隔 0.1.0
month_rotate AGENT_MONTH_ROTATE --month-rotate 流量统计每月重置日期,0 为禁用 0.1.0
auto_discovery_key AGENT_AUTO_DISCOVERY_KEY --auto-discovery 自动发现密钥 1.0.40
custom_dns AGENT_CUSTOM_DNS --custom-dns 自定义 DNS 服务器 1.0.80
enable_gpu AGENT_ENABLE_GPU --gpu 启用详细 GPU 监控 1.0.80
protocol_version AGENT_PROTOCOL_VERSION --protocol-version 上报协议版本,默认 2 1.2.10
disable_compression AGENT_DISABLE_COMPRESSION --disable-compression 禁用 v2 传输压缩 1.2.10
prefer_ip_version AGENT_PREFER_IP_VERSION --prefer-ip-version 优先使用 IP 版本,可选 46 未发布

完整参数可运行:

./komari-agent --help

详见 cmd/flags/flags.gocmd/root.go