Skip to content

Latest commit

 

History

History
299 lines (224 loc) · 6.34 KB

File metadata and controls

299 lines (224 loc) · 6.34 KB

🚀 GitHub 发布指南

📋 发布前最后确认

运行检查脚本:

python check_sensitive_info.py

预期结果:应该显示73处"潜在问题",但这些都是正常的字段名和常量,不是真实敏感信息。


🎯 发布步骤

方式1:创建新的干净仓库(推荐)⭐

# 1. 在当前目录初始化新仓库
git init

# 2. 添加所有文件
git add .

# 3. 创建首次提交
git commit -m "Initial commit: Enterprise Text-to-SQL System

Features:
- Two-stage LLM architecture (Planner + Generator)
- Multi-layer security validation
- Semantic schema retrieval
- SQL injection protection
- Enterprise-grade EDR scenario support"

# 4. 在GitHub上创建新仓库(通过Web界面)
# 访问: https://github.com/new
# 仓库名建议: text-to-sql-enterprise

# 5. 连接到远程仓库
git remote add origin https://github.com/你的用户名/text-to-sql-enterprise.git

# 6. 推送到GitHub
git branch -M main
git push -u origin main

方式2:使用现有仓库(如果Git历史干净)

# 1. 检查当前分支
git branch

# 2. 查看状态
git status

# 3. 添加新文件
git add .

# 4. 提交更改
git commit -m "Prepare for open source: Remove sensitive data and add documentation"

# 5. 推送
git push origin main

🏷️ GitHub 仓库设置建议

基本信息

  • Repository name: text-to-sql-enterprisenl2sql-system
  • Description:
    Enterprise-grade Text-to-SQL system with two-stage LLM architecture 
    (Planner + Generator) and multi-layer security validation for EDR scenarios
    
  • Website: 可选,如果有文档站点
  • Visibility: Public ✅

Topics (标签)

添加以下标签以提高可见性:

text-to-sql
natural-language-processing
llm
sql-generation
mysql
enterprise
security
python
nlp
database
ai
deep-learning

Features

  • ✅ Issues
  • ✅ Projects (可选)
  • ✅ Wiki (可选,用于详细文档)
  • ✅ Discussions (可选,用于社区讨论)

Settings 设置

  1. General

    • ✅ Template repository (可选,如果想让别人基于此创建)
    • ✅ Require contributors to sign off on web-based commits
  2. Branches

    • 设置 main 为默认分支
    • 可选:添加分支保护规则
  3. About

    • 添加描述
    • 添加网站链接
    • 添加Topics标签

📄 README 徽章建议

在 README.md 顶部添加(如果还没有):

# Text-to-SQL Enterprise System

![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)
![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)

🎨 可选增强

1. 添加 GitHub Actions (CI/CD)

创建 .github/workflows/lint.yml:

name: Lint

on: [push, pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.8'
      - name: Install dependencies
        run: |
          pip install flake8
      - name: Lint with flake8
        run: |
          flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

2. 添加 CHANGELOG.md

# Changelog

All notable changes to this project will be documented in this file.

## [1.0.0] - 2025-10-05

### Added
- Two-stage LLM architecture (Planner + Generator)
- Multi-layer security validation
- Semantic schema retrieval
- SQL injection protection
- Comprehensive documentation
- MIT License

### Security
- Removed all sensitive business data
- Implemented SQL guard system
- Added AST validation

3. 准备示例数据集(可选)

创建一个公开的示例数据库:

-- example_data/sample_database.sql
CREATE DATABASE demo_edr;
USE demo_edr;

CREATE TABLE node (
    id INT PRIMARY KEY AUTO_INCREMENT,
    host VARCHAR(255),
    ip VARCHAR(50),
    os_type VARCHAR(50),
    status VARCHAR(10)
);

-- 插入示例数据
INSERT INTO node (host, ip, os_type, status) VALUES
('server-001', '192.168.1.10', 'Ubuntu 20.04', '1'),
('server-002', '192.168.1.11', 'CentOS 7', '1'),
('server-003', '192.168.1.12', 'Windows Server 2019', '0');

✅ 发布后检查清单

立即检查

  • README 显示正常
  • LICENSE 文件可见
  • 代码语法高亮正确
  • 链接都能正常访问
  • Issues 功能已启用

24小时内

  • 检查是否有人提出问题
  • 准备回复第一个Issue/PR(展示项目活跃度)
  • 分享到相关技术社区(可选)

持续维护

  • 定期查看Issues和PRs
  • 更新文档
  • 修复Bug
  • 考虑添加更多示例

🌟 推广建议(可选)

技术社区

  • 知乎:写一篇技术文章介绍架构设计
  • 掘金:分享实现细节和踩坑经验
  • CSDN:发布使用教程
  • V2EX:在程序员板块分享

社交媒体

  • Twitter/X:使用 #OpenSource #NLP #TextToSQL 标签
  • LinkedIn:分享到技术群组
  • Reddit:发到 r/Python, r/MachineLearning

学术相关

  • 如果有论文,添加到README的Citation部分
  • 提交到 Papers with Code(如果适用)

⚠️ 注意事项

安全提醒

  1. 再次确认没有推送 .env 文件
  2. 再次确认没有真实数据库凭证
  3. 设置 GitHub Secret如果需要CI/CD
  4. 定期运行检查脚本,防止后续提交引入敏感信息

法律提醒

  1. 确保已获得公司授权(如适用)
  2. 确认不侵犯第三方知识产权
  3. 理解MIT License的含义
  4. 保留原始作者信息

🎉 完成!

发布成功后,你的项目将:

  • ✅ 对全世界开发者可见
  • ✅ 可以接收Issues和PRs
  • ✅ 显示在你的GitHub Profile
  • ✅ 可被搜索引擎索引

记得在README中添加你的联系方式,方便其他开发者联系你!


📞 遇到问题?

如果发布后发现问题:

发现了敏感信息

  1. 立即删除包含敏感信息的文件
  2. 提交新的commit覆盖
  3. 如果在历史中,考虑重写历史或重建仓库

收到负面反馈

  1. 保持冷静和专业
  2. 仔细评估反馈的合理性
  3. 及时回复和修复

想要撤回

  1. 可以将仓库设为Private
  2. 或者直接删除仓库(无法恢复Fork)

祝你的开源项目成功! 🚀✨