Skip to content

iselt/PentestNotes

Repository files navigation

Pentest Notes

这是一个基于 Docusaurus 的网络安全知识库,最终部署形态是纯静态文件,适合放在 Nginx 一类的静态服务器后面。

目录说明

  • docs/: 知识库正文与附件,是主要内容源
  • src/: 首页、样式和站点相关前端代码
  • static/: 会被原样拷贝到最终站点的静态资源
  • vendor/: 外部仓库源,例如 Awesome-POC 子模块
  • build/: 默认构建产物目录
  • scripts/: 本地部署脚本

开发命令

npm install
npm run start

构建静态站点:

npm run build

本地预览构建结果:

npm run serve

推荐部署方式

这类项目不建议在小服务器上运行 Node.js。更合适的方式是:

  1. 在本地电脑或 CI 上执行 npm run build
  2. 将生成的 build/ 目录同步到服务器静态目录
  3. 由现有的 Nginx / Nginx Proxy Manager 直接提供静态访问

当前服务器静态目录映射示例:

/root/hugo/PentestNotes/public -> /staticapps/PentestNotes

本地手动部署

仓库内提供了两个脚本:

  • Windows PowerShell: scripts/deploy-static.ps1
  • Linux/macOS Shell: scripts/deploy-static.sh

它们会:

  1. 本地执行 npm run build
  2. 通过 ssh 连接服务器
  3. build/ 完整覆盖同步到 /root/hugo/PentestNotes/public

Windows 示例:

./scripts/deploy-static.ps1

Linux/macOS 示例:

./scripts/deploy-static.sh

Git Push 自动部署

如果仓库托管在 GitHub,推荐直接使用仓库里的 GitHub Actions 工作流:

  • 你只需要 git push
  • GitHub Actions 会自动安装 Node、执行 npm cinpm run build
  • 构建完成后通过 SSH 将静态文件同步到服务器

需要在仓库 Secrets 中配置:

  • DEPLOY_HOST: 服务器地址,例如 a.iselt.top
  • DEPLOY_USER: SSH 用户,例如 root
  • DEPLOY_PORT: SSH 端口,默认可设为 22
  • DEPLOY_SSH_KEY: 部署私钥

工作流文件位置:

.github/workflows/deploy-static.yml

这样服务器只负责托管静态文件,不参与构建,资源占用最小,更新流程也最顺手。

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors