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

@076lik/git-panel

v2.2.9

Published

轻量级局域网 Git 仓库与 CI/CD 管理平台

Readme

Git Panel

本地 Git 仓库与 CI 流水线管理平台,提供类 GitHub 的 Web 界面。

功能特性

  • Git Smart HTTP/SSH/Git daemon 三重协议支持,局域网开放推送
  • XFS reflink 快照/恢复,秒级备份与回滚
  • CI/CD 流水线:推送自动触发构建,支持 GitHub Actions/GitLab CI 自动识别、多语言模板
  • CD 持续部署:构建成功后自动执行部署步骤,支持手动触发
  • Webhook 通知:构建/部署完成后向局域网设备/智能体发送 HTTP POST(支持事件筛选)
  • 构建摘要 API:外部智能体可轮询 GET /build-summary 获取最新构建状态
  • Git LFS 服务端 Batch API,大文件存储
  • 语言统计:基于 cloc 的代码行统计,自动排除文档/配置/脚本
  • 分支与标签管理:创建、删除、切换分支与标签
  • 文件树搜索:实时过滤文件列表
  • CI 模板:Python/UV、C/C++、Go、Rust、Java、TypeScript、Lua 多语言自动检测
  • 多文件预览:JSON 树、CSV 表格、Diff/Patch 着色、Log 级别高亮、PDF/图片/视频/音频、Markdown、归档文件列表
  • ANSI 颜色转换与日志折叠:CI 日志按步骤折叠,ANSI 转义码自动渲染为 HTML 颜色
  • 统一设置界面:CI/CD、Webhook、远程同步集中配置,支持自定义起始版本号
  • 全局存储路径配置:支持外部硬盘/USB 等任意路径,Web 界面一键修改
  • 多平台适配:Linux/macOS/Windows 自动检测,路径/用户名/系统工具跨平台兼容
  • Vue 3 SPA 前端,GitHub Dark Dimmed 主题
  • Nginx 反向代理,关闭缓冲支持大推送

这工具适合谁?

| ✅ 适合 | ❌ 不适合 | |--------|----------| | 3-5 人小团队,不想买 GitHub Pro / GitLab 企业版 | 你需要多租户、RBAC 权限管理(请用 GitLab) | | 你在局域网/内网开发,没有公网 IP 和域名 | 你需要 GitHub Actions 的云端并行构建矩阵 | | 你的构建产物很大,想存到外部硬盘/USB | 你需要 Kubernetes + Docker 的容器化 CI | | 你想推送代码后自动构建、自动发版,但不想写 YAML | 你需要复杂的流水线编排(如 Jenkins Pipeline) | | 你的服务器是龙芯/ARM 等特殊架构,主流 CI 不支持 | 你需要 SaaS 托管(如 GitHub Actions、Travis CI) | | 你想秒级备份仓库(XFS reflink 快照),硬盘坏了不怕 | 你已经有完善的 DevOps 基础设施 |

一句话:当你想在自己的局域网里搭一个"够用"的 GitHub,零认证、零数据库、插上硬盘就能跑的时候。


项目结构

git-panel/
├── client/          # Vue 3 + TypeScript 前端
│   ├── src/
│   │   ├── components/    # Vue 组件
│   │   ├── types.ts       # 共享类型定义
│   │   ├── App.vue
│   │   └── main.ts
│   ├── index.html
│   ├── vite.config.ts
│   ├── tsconfig.json
│   └── package.json
├── server/          # Express + TypeScript 后端
│   ├── server.ts    # 主入口
│   ├── routes/      # 路由目录
│   ├── tsconfig.json
│   └── package.json
├── web-dist/        # 构建产物(HTML + assets)
├── nginx-full.conf  # Nginx 完整配置
├── deploy.sh        # 一键部署脚本(生产环境)
└── README.md

快速开始

方式一:npm 全局安装(推荐)

npm install -g @076lik/git-panel

# 启动服务(普通用户)
git-panel

# 自定义端口或仓库路径
git-panel --port=8080 --repo-root=/data/git

系统部署(一次性,需要 sudo):

sudo git-panel-deploy

git-panel-deploy 会自动完成:环境预检 → 安装依赖 → 编译前后端 → 生成 nginx 配置 → 创建 systemd 服务 → 配置防火墙 → 启动服务。

方式二:源码一键部署

cd /home/lik/git-panel
sudo bash deploy.sh

deploy.sh 会自动完成:环境预检 → 安装依赖 → 编译前后端 → 生成 nginx 配置 → 创建 systemd 服务 → 配置防火墙 → 启动服务。

环境变量覆盖(可选):

sudo USER=lik REPO_DIR=/home/lik/git PORT=3456 bash deploy.sh

方式三:手动开发模式

如需本地开发调试:

# 后端(ts-node 热重载)
cd server && npm install && npm run dev

# 前端(Vite 热重载)
cd client && npm install && npm run dev

仓库存储路径

默认存储在 ~/git,支持通过前端「系统配置」面板修改,保存后点击「重启服务」即可生效(无需手动操作命令行)。

Nginx 与防火墙

deploy.sh 已自动配置。如需手动:

# Nginx
sudo nginx -c /home/lik/git-panel/nginx-full.conf

# 防火墙(firewalld 示例)
sudo firewall-cmd --add-port=80/tcp --permanent
sudo firewall-cmd --add-port=9418/tcp --permanent
sudo firewall-cmd --reload

防火墙配置(如需手动)

某些发行版(如 AOSC OS)默认会拒绝 1-1024 端口的入站连接。

图形化方式(AOSC OS):

打开 系统设置 → WiFi 和互联网 → 网络设置 → 防火墙设置 → 在列表中 勾选 http → 点击 确定 → 点击 应用

命令行方式(firewalld):

# 仅允许局域网(推荐)
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.3.0/24" service name="http" accept'
sudo firewall-cmd --reload

# 全局开放(不推荐暴露在公网)
sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload

连接方式

| 协议 | 地址 | 说明 | |------|------|------| | Web 面板 | http://192.168.3.130/ | Nginx 反向代理,标准 80 端口 | | Git (只读) | git://192.168.3.130/repo.git | git daemon,端口 9418 | | HTTP (推送) | http://192.168.3.130/api/git/repo.git | Nginx → Node.js 3456 | | SSH | [email protected]:/run/media/lik/git/repo.git | 标准 22 端口 |

技术栈

  • 后端: Node.js 20, Express, TypeScript, git-http-backend CGI 代理
  • 前端: Vue 3, TypeScript, Vite, highlight.js, marked
  • 基础设施: Nginx, XFS, Git LFS
  • 工具链: cloc(语言统计)

语言统计过滤规则

语言统计基于 cloc 计算代码行数,自动排除以下非代码类别:

| 类型 | 被排除的语言 | |------|-------------| | 文档 | Markdown、reStructuredText、TeX、Text | | 配置/数据 | JSON、YAML、XML、TOML、INI、CSV | | 样式 | HTML、CSS、SCSS、Less、Sass | | 构建/脚本 | Dockerfile、Containerfile、Makefile、make、CMake、Gradle、Shell、Bash、PowerShell、Batch | | 其他 | Log、Source Map、SVG |

如果排除后没有剩余语言,则自动回退显示全部结果(避免空列表)。

推送大仓库优化

git config --global pack.windowMemory 512m
git config --global pack.threads 4
git config --global http.postBuffer 2097152000

作者声明

作者: H076lik

本项目由 H076lik 独立构思、设计并主导开发。所有功能均根据实际局域网 DevOps 需求设计,技术栈(Vue 3 + Express + XFS reflink + Python CI Runner)由作者自主决定。

开发过程中使用了 AI 智能体(如 Crush、Claude Code 等)作为代码生成与调试的辅助工具。AI 智能体仅作为开发工具使用,类似于 IDE、编译器等辅助软件,不构成共同创作。所有代码的架构决策、功能设计、逻辑审查、测试验证以及最终知识产权均归属于 H076lik。


赞助名单

如果您觉得本项目对您有帮助,欢迎赞助支持开发。 联系方式与赞助方式待补充...

| 赞助者 | 金额 / 方式 | 日期 | 留言 | |--------|------------|------|------| | 待填写 | — | — | — |


许可证

本项目采用 GNU Lesser General Public License v3.0 (LGPL-3.0) 开源许可。

  • 核心源码client/src/server/、配置文件及部署脚本)均已在文件头部添加 LGPL-3.0 标准声明
  • 允许商用、修改与再分发,但修改后的库文件需以相同许可证开源
  • larger work(调用本平台的应用程序)可独立使用不同许可证,无需强制开源
  • 完整许可证文本见仓库根目录 LICENSE 文件

法律说明:本项目为独立实现的 Git 仓库与 CI/CD 管理平台。功能接口与 DevOps 流程参考了开源社区(包括 GitHub、GitLab)的成熟实践,但全部代码由 H076lik 独立编写。

Copyright (C) 2025-2026 H076lik

CI/CD 完整指南

Git Panel 内置完整的持续集成/持续部署流水线,支持自动构建、部署和外部通知。

CI 流水线(自动构建)

推送代码后自动触发:

  1. 检出代码到 deploy/{repo}
  2. 执行配置的构建步骤(如 npm run buildcargo buildgo test
  3. 支持自动检测项目类型(Rust/Go/TypeScript/Python/C/C++/Java/Lua)
  4. 自动识别 .github/workflows/*.yml.gitlab-ci.yml
  5. CI 配置工作流化:手动配置的构建步骤保存为 .github/workflows/git-panel-ci.yml 并自动 git commit,配置与代码一起版本控制
  6. 自动发布起始版本号:Dev Release 支持设置起始版本号(如 2.0.0),自动递增 v2.0.1v2.0.2

CD 持续部署

构建成功后自动执行部署步骤:

  • 在 CI 配置中勾选「构建成功后自动部署」
  • 添加部署命令(如 cp target/release/app /opt/bin/
  • 支持手动触发 POST /api/repos/{name}/deploy

Webhook 通知

构建/部署完成后向局域网内其他设备/智能体发送 HTTP POST 通知:

# 配置 Webhook(前端 CI/CD → 配置 Webhook)
# 或使用 API
POST /api/repos/{name}/webhook
{
  "enabled": true,
  "url": "http://192.168.3.xxx:8080/webhook",
  "events": ["build.failed", "build.success", "deploy.failed", "deploy.success"]
}

推送内容示例:

{
  "event": "build.failed",
  "repo": "YouLiLong",
  "branch": "master",
  "commit": "c993fe94...",
  "commitMsg": "refactor(dap): ...",
  "runId": "1778663640",
  "status": "failed",
  "steps": [{"name": "Build release", "status": "failed"}],
  "timestamp": "2026-05-13T17:34:00",
  "server": "git-panel"
}

构建摘要 API(外部智能体查询)

GET /api/repos/{name}/build-summary

返回示例:

{
  "repo": "YouLiLong",
  "ci": {
    "status": "success",
    "runId": "1778665915",
    "branch": "master",
    "commit": "13aa0970...",
    "duration": 8,
    "steps": [{"name": "Build Client", "status": "success"}],
    "deployStatus": "success"
  },
  "deploy": {
    "status": "success",
    "runId": "1778665915"
  },
  "lastUpdated": "2026-05-13T17:52:03Z"
}

CI 日志折叠与 ANSI 颜色

  • 构建日志按步骤自动折叠(▶/▼ 切换)
  • ANSI 颜色转义码自动转换为 HTML 颜色(红/绿/黄等)
  • 实时轮询更新(3秒间隔)

Python 项目 UV 支持

检测到 uv.lockpyproject.toml 中包含 tool.uv 时自动使用 uv sync

{"steps": [
  {"name": "UV Sync", "command": "uv sync || uv pip install -e . || true"},
  {"name": "Test", "command": "uv run pytest || true"}
]}