Add App git-sync

This commit is contained in:
arch3rPro
2025-07-03 21:26:22 +08:00
parent e8f132a1fa
commit 1a0c383eb5
7 changed files with 227 additions and 0 deletions

50
apps/git-sync/README.md Normal file
View File

@@ -0,0 +1,50 @@
# Git-Sync
Git-Sync 是一款支持多平台的 Git 仓库自动同步与备份工具支持定时任务、Docker 快速部署,适合个人和团队代码备份。
## 主要功能
- **多仓库同步**:支持同步多个 Git 仓库,自动拉取、推送。
- **定时任务**:内置 cron 功能,支持定时自动同步。
- **备份管理**:可将仓库备份到本地指定目录。
- **配置灵活**:支持自定义配置文件路径、备份目录、用户权限。
- **Docker 部署**:一键部署,环境隔离,易于管理。
## 快速部署Docker 示例)
```yaml
version: "3"
services:
git-sync:
image: akashrajpuroh1t/git-sync:latest
container_name: git-sync
environment:
- PUID=1000
- PGID=1000
volumes:
- /你的/config.yaml:/git-sync/config.yaml
- /你的/备份目录:/backups
restart: unless-stopped
```
> 建议将 config.yaml 和备份目录挂载到主机,便于持久化和管理。
## 变量说明
- **GITSYNC_CONFIG_PATH**:配置文件路径(如 /git-sync/config.yaml
- **GITSYNC_BACKUP_PATH**:备份目录(如 /backups
- **PUID/PGID**:容器内运行用户及组(建议与主机一致,常用 1000
## 常见问题 FAQ
- **Q: 如何定时同步?**
A: 在 config.yaml 中配置 cron 规则,容器会自动定时同步。
- **Q: 配置文件如何写?**
A: 详见 [官方文档](https://github.com/AkashRajpurohit/git-sync/wiki/Installation#with-docker)。
- **Q: 支持哪些平台?**
A: 支持 Docker、Linux、Windows 等主流平台。
## 官方文档与支持
- GitHub: https://github.com/AkashRajpurohit/git-sync
- 安装文档: https://github.com/AkashRajpurohit/git-sync/wiki/Installation#with-docker

View File

@@ -0,0 +1,51 @@
# Git-Sync
Git-Sync is a cross-platform tool for automatic synchronization and backup of Git repositories. It supports cron jobs, easy Docker deployment, and is suitable for both personal and team code backup.
## Main Features
- **Multi-repo sync**: Sync multiple Git repositories, auto pull and push.
- **Cron jobs**: Built-in cron support for scheduled sync.
- **Backup management**: Backup repositories to a specified local directory.
- **Flexible config**: Custom config file path, backup directory, user permissions.
- **Docker deployment**: One-click deployment, isolated environment, easy management.
## Quick Deployment (Docker Example)
```yaml
version: "3"
services:
git-sync:
image: akashrajpuroh1t/git-sync:latest
container_name: git-sync
environment:
- PUID=1000
- PGID=1000
volumes:
- /your/config.yaml:/git-sync/config.yaml
- /your/backup:/backups
restart: unless-stopped
```
> It is recommended to mount config.yaml and backup directory to the host for persistence and management.
## Variable Description
- **GITSYNC_CONFIG_PATH**: Config file path (e.g. /git-sync/config.yaml).
- **GITSYNC_BACKUP_PATH**: Backup directory (e.g. /backups).
- **PUID/PGID**: User and group ID inside the container (should match host, usually 1000).
## FAQ
- **Q: How to schedule sync?**
A: Configure cron rules in config.yaml, the container will sync automatically.
- **Q: How to write the config file?**
A: See [official docs](https://github.com/AkashRajpurohit/git-sync/wiki/Installation#with-docker).
- **Q: Which platforms are supported?**
A: Docker, Linux, Windows, etc.
## Official Docs & Support
- GitHub: https://github.com/AkashRajpurohit/git-sync
- Install Guide: https://github.com/AkashRajpurohit/git-sync/wiki/Installation#with-docker

43
apps/git-sync/data.yml Normal file
View File

@@ -0,0 +1,43 @@
name: Git-Sync
tags:
- Git
- 同步
- 备份
- Docker
- 自动化
- 持久化
- 代码
- 定时
- 跨平台
title: Git 仓库自动同步与备份工具
description: Git-Sync 是一款支持多平台的 Git 仓库自动同步与备份工具支持定时任务、Docker 快速部署,适合个人和团队代码备份。
additionalProperties:
key: git-sync
name: Git-Sync
tags:
- Git
- Sync
- Backup
- Automation
- Docker
- Cron
- Code
- CrossPlatform
shortDescZh: Git 仓库自动同步与备份工具,支持定时任务和多平台。
shortDescEn: Git repository auto sync and backup tool, supports cron and multi-platform.
description:
en: Git repository auto sync and backup tool. Supports Docker, cron jobs, and multi-platform deployment. Easy to use and highly customizable.
zh: Git-Sync 是一款支持多平台的 Git 仓库自动同步与备份工具支持定时任务、Docker 快速部署,适合个人和团队代码备份。
type: tools
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://github.com/AkashRajpurohit/git-sync
github: https://github.com/AkashRajpurohit/git-sync
document: https://github.com/AkashRajpurohit/git-sync/wiki/Installation#with-docker
architectures:
- amd64
- arm64

View File

@@ -0,0 +1,41 @@
# Git Sync Configuration
# Repository settings
include_forks: false # Include forked repositories
include_wiki: true # Include wiki's
include_repos: [] # Include specific repositories
exclude_repos: [] # Exclude specific repositories
include_orgs: [] # Include repositories from specific organizations
exclude_orgs: [] # Exclude repositories from specific organizations
raw_git_urls: [] # Raw valid git URLs
# Authentication
username: <username>
tokens: [<token 1>]
# Server settings
backup_dir: /path/to/backup
clone_type: bare # Clone type: bare, shallow, mirror or full. Default: bare
cron: 0 0 * * * # run every 24 hours at 00:00
concurrency: 5
retry:
count: 3
delay: 10 # in seconds
platform: github
server:
domain: github.com
protocol: https
notification:
enabled: true
only_failures: false
ntfy:
topic: 'backup'
server: 'https://ntfy.sh' # Optional
username: 'akash' # Optional
password: 'password' # Optional
priority: 4 # Optional (1-5)
tags: ['backup'] # Optional
gotify:
url: 'http://localhost:2444'
app_token: 'your_app_token'
priority: 4 # Optional (1-5)

View File

@@ -0,0 +1,30 @@
additionalProperties:
formFields:
- default: ./config.yaml
edit: true
envKey: GITSYNC_CONFIG_PATH
labelEn: Config Path
labelZh: 配置文件路径
required: true
type: text
- default: ./backups
edit: true
envKey: GITSYNC_BACKUP_PATH
labelEn: Backup Path
labelZh: 备份目录
required: true
type: text
- default: 1000
edit: true
envKey: PUID
labelEn: PUID
labelZh: 用户ID(PUID)
required: true
type: number
- default: 1000
edit: true
envKey: PGID
labelEn: PGID
labelZh: 用户组ID(PGID)
required: true
type: number

View File

@@ -0,0 +1,12 @@
services:
git-sync:
image: akashrajpuroh1t/git-sync:latest
container_name: git-sync
environment:
- PUID=${PUID}
- PGID=${PGID}
volumes:
- ${GITSYNC_CONFIG_PATH}:/git-sync/config.yaml
- ${GITSYNC_BACKUP_PATH}:/backups
restart: unless-stopped

BIN
apps/git-sync/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB