npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

iphealth

v1.0.0

Published

Interactive one-shot deploy: VLESS+Reality, Hysteria2, subscription, IP health monitoring

Readme

iphealth

在新 VPS 上一键按需部署完整套件:VLESS + Reality + Hysteria2代理订阅服务IP 健康监控(VictoriaMetrics + blackbox + vmagent + nginx /vm)及系统/网络优化。

使用方式

sudo -E npx iphealth@latest

进入交互式 CLI,按提示勾选模块并输入必要参数(敏感信息仅通过交互或环境变量注入,不入库、不打印明文)。

模块说明

| 模块 ID | 说明 | |--------|------| | 系统基础与安全 | | | base | 基础初始化:apt update/upgrade(可选)、curl/jq/unzip/nginx、时区 | | ssh_harden | SSH 安全加固:禁用密码登录、修改端口(有断连风险,需二次确认) | | firewall | UFW:放行 22 / 80 / 443,开启前二次确认 | | 网络加速与系统调优 | | | bbr | BBR + TCP 调优,写入 /etc/sysctl.d/99-iphealth.conf,可回滚 | | ulimit | 提高 NOFILE,作用于 xray / vmagent / victoriametrics 等服务 | | 代理内核 | | | xray_core | 安装 Xray 到 /usr/local/bin/xray,systemd 单元不自动启动 | | xray_config | 生成 /etc/xray/config.json(VLESS+Reality,端口默认 443),权限 600 | | 代理订阅服务 | | | sub_source | 生成 /etc/iphealth/subscription/source.json(节点源数据),权限 600 | | sub_builder | 订阅构建服务:127.0.0.1:29100,systemd iphealth-sub.service,X-Sub-Token / query token | | sub_nginx | nginx 80 暴露 /sub/ → 127.0.0.1:29100,不占用 443 | | sub_policy | 订阅内容策略:最小 Clash/Stash YAML(proxies + PROXY/DIRECT + MATCH,PROXY) | | IPhealth 监控栈 | | | vm | VictoriaMetrics,127.0.0.1:8428,retention 默认 60d | | blackbox | blackbox_exporter,127.0.0.1:9115,modules: http/https/icmp/github_head | | vmagent | 抓取 blackbox → 写入本地 VM,127.0.0.1:8429,探测目标运行时输入 | | nginx_vm | nginx 80 暴露 /vm/,X-VM-Token 鉴权,反代到本机 18080(VM 只读) |

订阅 URL 示例(占位)

  • Clash:http://<DOMAIN>/sub/clash?token=<TOKEN>
    或 Header:X-Sub-Token: <TOKEN>
  • Stash:http://<DOMAIN>/sub/stash?token=<TOKEN>

<DOMAIN> 替换为服务器域名或 IP,<TOKEN> 替换为部署时生成/输入的订阅 Token。

监控 /vm URL 示例(占位)

  • 只读查询(GET):http://<DOMAIN>/vm/api/v1/query?query=...
    请求头:X-VM-Token: <VM_TOKEN>

<DOMAIN> 替换为 nginx 中配置的 server_name<VM_TOKEN> 为部署时生成/输入的 X-VM-Token。

安全提示

  • 不要将任何生成的配置或密钥提交到 Git/etc/xray/config.json/etc/iphealth/subscription/source.jsontoken、X-VM-Token 等均为敏感信息。
  • 使用密码管理器保存 UUID、Reality 私钥/公钥、订阅 Token、VM Token。
  • 本工具不在 NPM 包、Git 仓库或模板中包含域名、IP、UUID、密钥、Token;所有敏感信息仅在运行时交互输入或环境变量注入。
  • 落盘敏感文件均为 权限 600、归属 root;CLI 日志不打印敏感明文,最多显示末尾 4 位用于确认。
  • 涉及系统级变更(sysctl / 防火墙 / SSH)时,会先展示变更摘要并二次确认后再执行。

回滚建议

  • sysctl:删除 /etc/sysctl.d/99-iphealth.conf 后执行 sysctl -p 或重启。
  • systemd 服务sudo systemctl stop <service>; sudo systemctl disable <service>(如 xray、iphealth-sub、victoriametrics、blackbox_exporter、vmagent)。
  • nginx:删除 /etc/nginx/conf.d/iphealth-*.confnginx -t && systemctl reload nginx

NPM 发布说明

npm login
npm publish --access public

发布后用户可通过 npx iphealth@latest 使用。

本地开发 / 试运行

cd iphealth-cli
node bin/cli.js
# 或仅生成计划不执行
node bin/cli.js --dry-run

示例运行输出(无敏感信息)

iphealth — 一键按需部署:VLESS+Reality / Hysteria2 / 订阅 / IP 健康监控

可选模块(按组):
[系统基础与安全]
  base: 基础初始化 (apt/nginx/时区)
  ...
输入要启用的模块 ID,逗号分隔: base,xray_core,xray_config,sub_source,sub_builder,sub_nginx
已选(含依赖): base, xray_core, xray_config, sub_source, sub_builder, sub_nginx
  UUID: ...xyz1
  Reality privateKey: ...abcd
  X-Sub-Token: ...ef12
--- 执行计划 (plan.json) ---
  { "version": "1.0", "modules": [...], "options": {...}, "secretRefs": { "xray_uuid": "/tmp/iphealth-secrets.xxx/xray_uuid", ... } }
Ports: 22 (SSH), 80, 443; 443 (Xray); 29100 (subscription, 127.0.0.1); 80 /sub/
是否执行 apply?(将运行 sudo bash apply.sh) (y/N): 

依赖

  • Node.js >= 18
  • 执行 apply 的机器需具备:jq(解析 plan.json)、sudo、root 权限以写入 /etc 与敏感文件。
  • 二进制:apply 脚本仅部署配置与 systemd 单元,不自动下载 Xray / blackbox_exporter / VictoriaMetrics / vmagent。部署前请自行将对应二进制安装到 /usr/local/bin/(如从 GitHub releases 下载),或先选 base 安装 curl/jq 后手动执行下载脚本。

License

MIT