Go to file
wangjing22e e4f37adf96 修改删除评论逻辑 2025-07-16 22:49:32 +08:00
.idea temp ok issue sync 2025-06-14 01:36:02 +08:00
browser-extension 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
doc init 2024-04-10 14:32:49 +08:00
extras/obfastapi 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
logs Add logs/sync.log 2024-04-10 14:43:09 +08:00
script init 2024-04-10 14:32:49 +08:00
sql 修改完善 2025-07-16 22:11:02 +08:00
src 修改删除评论逻辑 2025-07-16 22:49:32 +08:00
sync init 2024-04-10 14:32:49 +08:00
webhook_plugin 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
.gitignore 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
API.md clone时取消指定分支 & 添加强制同步 2024-05-10 15:09:50 +08:00
COMMENT_SYNC_ISSUE_ANALYSIS.md 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
Dockerfile add 配置 2025-07-16 22:23:51 +08:00
Documentation.md Update Documentation.md 2024-04-10 17:40:44 +08:00
ISSUE_SYNC_REFACTOR.md 'rebuild' 2025-06-15 13:35:06 +08:00
LICENSE init 2024-04-10 14:32:49 +08:00
Makefile init 2024-04-10 14:32:49 +08:00
PR_COMMENT_SYNC_README.md 实现pr请求的普通评论同步 2025-07-05 08:54:37 +08:00
README-CN.md update readme readme-cn 2025-06-16 08:21:16 +08:00
README.md update readme readme-cn 2025-06-16 08:21:16 +08:00
boot init 2024-04-10 14:32:49 +08:00
env.ini.example init 2024-04-10 14:32:49 +08:00
main.py 修改完善 2025-07-16 22:11:02 +08:00
query '修复缺陷1' 2025-06-16 14:39:27 +08:00
requirement.txt 补全配置 2025-07-16 22:35:20 +08:00
response.json 修复issue内容、title,评论的内容修改同步 2025-07-03 11:10:16 +08:00
sync.py init 2024-04-10 14:32:49 +08:00
test_comment_mapping.py 添加插件、修复代码缺陷 2025-07-14 14:59:53 +08:00
test_create_pr.py 实现pr请求的同步(不包含评论) 2025-07-03 21:48:43 +08:00
test_delete_issue_gitee.py webhook 2025-07-12 08:09:53 +08:00
test_delete_issue_github.py webhook 2025-07-12 08:09:53 +08:00
test_gitee_pr.py 实现pr请求的普通评论同步 2025-07-05 08:54:37 +08:00
test_github_pr.py 实现pr请求的普通评论同步 2025-07-05 08:54:37 +08:00
test_gitlink_pr.py 实现pr请求的普通评论同步 2025-07-05 08:54:37 +08:00

README.md

ob-repository-synchronize

Description

ob-repository-synchronize is a small tool which can help engineer to master their open source production's code synchronization between GitHub, Gitee, CodeChina, internal repository and so on.

Principle

Base on git rebase

Base on git diff

backend

requirement

name version necessity
python 3.9 True
uvicorn 0.14.0 True
SQLAlchemy 1.4.21 True
fastapi 0.66.0 True
aiohttp 3.7.4 True
pydantic 1.8.2 True
starlette 0.14.2 True
aiomysql 0.0.21 True
requests 2.25.1 True
loguru 0.6.0 True
typing-extensions 4.1.1 True
aiofiles 0.8.0 True

how to install

[!NOTE] Run the code in python 3.9

pip3 install -r requirement.txt

python3 main.py

run the sync script locally

python3 sync.py

frontend

Refer the web readme

docker

docker pull XXX:latest

docker run -p 8000:8000 -d XXX bash start.sh -s backend

How to use it

  1. Config your database
  • Run the table.sql script in sql folder
  • Config the database connection string in src/base/config.py
  1. Start the FastAPI server
python3 main.py

The server will start on http://localhost:8000. You can access the interactive API documentation at http://localhost:8000/docs (Swagger UI) or http://localhost:8000/redoc (ReDoc).

  1. Configure repositories and sync jobs through API

Use the FastAPI endpoints to:

  • Create and manage repository configurations
  • Set up sync jobs between different platforms (GitHub, Gitee, GitLab, etc.)
  • Monitor sync status and logs

For detailed API documentation, see API.md.

  1. Run sync scripts (Optional)

You can also run sync scripts directly:

python3 sync.py
  1. DIY Custom Features

The project is designed to be extensible. You can add custom synchronization features by:

  • Creating new API endpoints in src/api/ directory
  • Implementing custom sync logic in src/service/ directory
  • Adding new data models in src/dto/ directory

For example, you can add issue synchronization, comment synchronization, or other custom features by extending the existing API structure.

[!NOTE] The web frontend in the web/ directory is deprecated and not maintained. The main interface is through FastAPI APIs.