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

vk-ssl-auto-deploy

v0.8.3

Published

SSL证书自动部署工具 - 提供HTTP API接口,支持证书文件自动上传和部署

Readme

vk-ssl-auto-deploy

SSL证书自动部署工具 - 提供HTTP API接口,支持证书文件自动上传和部署

一键安装(推荐)

Linux 服务器执行以下命令,自动完成安装、部署和开机自启配置:

curl -fsSL https://gitee.com/vk1688/vk-ssl-auto-deploy/raw/master/install.sh | sudo bash

安装完成后,访问 http://服务器IP:6001/admin,默认密码:admin@123456

支持 CentOS/RHEL 和 Debian/Ubuntu 系统,自动安装 Node.js 和 PM2


手动安装部署

如果一键安装失败,可以按照以下步骤手动安装:

1. 安装node环境(如果node环境已安装,则跳过这一步骤)

linux系统

curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash - && sudo yum install -y nodejs

Windows系统

winget install --id OpenJS.NodeJS.LTS -e

验证node环境是否完成完成

node -v && npm -v

2. 安装pm2

npm install -g pm2

3. 安装证书自动部署工具

npm install -g vk-ssl-auto-deploy@latest

4. 查看安装目录

npm root -g

假设返回 /usr/lib/node_modules

则拼接上 vk-ssl-auto-deploy,即执行命令 cd /usr/lib/node_modules/vk-ssl-auto-deploy 进入工具目录

5. 编辑配置文件,修改证书保存目录

此步骤可忽略,可以先启动服务,进入可视化管理面板设置

vim config.json

编辑配置文件

基本操作:

  • 按 i - 进入插入模式(可以编辑)
  • 按 ESC - 退出插入模式
  • 输入 :wq - 保存并退出
  • 输入 :q! - 不保存退出
  • 输入 :w - 仅保存

配置说明

编辑 config.json 文件,主要修改3参数,certSaveDirnginxDirkey

{
	"key": "",
	"certSaveDir": "/vk-cert",
	"nginxDir": "/www/server/nginx/sbin/nginx",
	"domains": [],
	"callbackCommand": [],
	"port": 6001
}
  • key: 你的密钥
  • certSaveDir: 证书存储目录,最终证书路径为 ${certSaveDir}/域名.crt${certSaveDir}/域名.key${certSaveDir}/域名.pem
  • nginxDir: 你的nginx的安装目录
  • domains: 指定拉取的域名,不指定代表拉取你的所有域名证书
  • callbackCommand: 一般不需要改
  • port: 服务监听端口(默认 6001)(一般无需改动)

6. 启动服务,并设置开机自启

Linux系统

使用PM2的startup功能来实现开机自动启动:

步骤1:启动服务并保存进程列表

# 进入安装目录(需改成你的目录)
cd /usr/lib/node_modules/vk-ssl-auto-deploy

# 生成开机启动脚本
pm2 startup

# 启动服务
npm run start

# 保存当前PM2进程列表(重要!)
pm2 save

步骤2:验证开机启动

# 重启服务器
sudo reboot

# 重启后检查服务是否自动运行
pm2 list

取消开机自动启动

# 取消开机启动
pm2 unstartup systemd

# 删除保存的进程列表
pm2 delete all
pm2 save --force

Windows系统

使用pm2-windows-startup

# 安装pm2-windows-startup
npm install -g pm2-windows-startup

# 配置开机启动(需要管理员权限运行PowerShell或CMD)
pm2-startup install

# 进入安装目录并启动服务
cd <安装目录>
npm run start

# 保存当前PM2进程列表
pm2 save

验证开机启动

# 重启电脑后,检查服务是否自动运行
pm2 list

取消开机自动启动

# 方法一:卸载pm2-windows-startup
pm2-startup uninstall

# 方法二:在任务计划程序中删除对应的任务

7. 进入可视化操作面板

在浏览器上输入 http://服务器外网IP:6001/admin 进入可视化操作面板,口令默认为 admin@123456

查找nginx安装目录

通过查看进程信息

ps aux | grep nginx

// 查找nginx配置所在地址
find / -name nginx.conf 2>/dev/null

// 查看配置,确认证书所在地址
vim /www/server/nginx/conf/nginx.conf

// 假设
证书内容文件地址:/www/server/nginx/cert/xxx.xxx.xxx/cert.pem
证书私钥文件地址://www/server/nginx/cert/xxx.xxx.xxx/key.pem;


// 重载nginx配置,假设nginx的安装目录是 /www/server/nginx/sbin/nginx 
执行nginx重载配置:/www/server/nginx/sbin/nginx -s reload

重置 root账号密码

sudo passwd root

服务器常用命令

终止程序

// 先查找进程id
ss -tulpn | grep 6001

// 根据进程id关闭
kill 12345

进入证书目录

ls /vk-cert

查看证书文件

ls /vk-cert/你的域名

基础文件列表命令

ls                    # 列出当前目录文件
ls -l                 # 详细列表(长格式)
ls -la                # 显示所有文件(包括隐藏文件)
ls -lh                # 人类可读的文件大小(KB, MB, GB)
ls -lt                # 按修改时间排序
ls -ltr               # 按时间倒序(最新的在最后)
ls -lS                # 按文件大小排序
ls /path/to/dir       # 列出指定目录

分页查看(长列表时很有用)

ls -la | less         # 使用 less 分页查看
ls -la | more         # 使用 more 分页查看

# 在 less 或 more 中:
Space / f           # 下一页(向下翻页)
b                   # 上一页(向上翻页)
d                   # 向下半页
u                   # 向上半页
j / ↓               # 向下一行
k / ↑               # 向上一行
g                   # 跳到开头
G                   # 跳到结尾
/keyword            # 向下搜索关键词
?keyword            # 向上搜索关键词
n                   # 下一个搜索结果
N                   # 上一个搜索结果
q                   # 退出

目录导航命令

cd /path/to/dir     # 进入指定目录
cd ..               # 返回上一级目录
cd -                # 返回上一次所在目录(切换)
cd ~                # 返回用户主目录
cd /                # 返回根目录
pwd                 # 显示当前目录的完整路径

快捷键(命令行通用)

Ctrl + C            # 终止当前命令
Ctrl + D            # 退出当前 shell(或结束输入)
Ctrl + L            # 清屏(等同于 clear)
Ctrl + R            # 搜索历史命令
Ctrl + A            # 光标移到行首
Ctrl + E            # 光标移到行尾
Ctrl + U            # 删除光标前的内容
Ctrl + K            # 删除光标后的内容
↑ / ↓              # 浏览历史命令
Tab                 # 自动补全

查找文件

find . -name "*.txt"              # 查找当前目录下所有 .txt 文件
find /path -type f -name "file*"  # 查找指定路径的文件
find . -mtime -7                  # 查找最近7天修改的文件
locate filename                   # 快速查找文件(需要更新数据库)

文件内容预览

cat file.txt        # 显示整个文件内容
head file.txt       # 显示文件前10行
head -n 20 file.txt # 显示文件前20行
tail file.txt       # 显示文件最后10行
tail -n 20 file.txt # 显示文件最后20行
tail -f file.log    # 实时追踪文件更新(日志文件常用)

PM2 进程管理

cd /usr/lib/node_modules/vk-ssl-auto-deploy

# 启动服务
npm run start

或直接 npm --prefix /usr/lib/node_modules/vk-ssl-auto-deploy run start

# 停止服务
npm run stop

# 重启服务
npm run restart

# 查看日志
npm run logs

# 删除进程
npm run delete

# 查看进程
npm run list

卸载

pm2 delete vk-ssl-auto-deploy; pm2 unstartup systemd; pm2 save --force; npm uninstall -g vk-ssl-auto-deploy

License

MIT