Updated Docs

This commit is contained in:
Arunavo Ray
2025-06-17 09:47:46 +05:30
parent 51e536c317
commit eb78f959c7
4 changed files with 111 additions and 3 deletions

View File

@@ -5,6 +5,18 @@ All notable changes to the Gitea Mirror project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Mirror strategies now properly route repositories based on selected strategy
- Starred repositories now correctly go to the designated starred repos organization
- Organization routing for single-org and flat-user strategies
### Improved
- Documentation now explains all three mirror strategies (preserve, single-org, flat-user)
- Added detailed mirror strategy configuration guide
- Updated CLAUDE.md with mirror strategy architecture information
## [2.13.2] - 2025-06-15
### Improved

View File

@@ -79,6 +79,13 @@ export async function POST({ request }: APIContext) {
- Tracks status in database
- Supports scheduled automatic mirroring
6. **Mirror Strategies**: Three ways to organize repositories in Gitea:
- **preserve**: Maintains GitHub structure (default)
- **single-org**: All repos go to one organization
- **flat-user**: All repos go under user account
- Starred repos always go to separate organization (starredReposOrg)
- Routing logic in `getGiteaRepoOwner()` function
### Database Schema (SQLite)
- `users` - User accounts and authentication
- `configs` - GitHub/Gitea connection settings

View File

@@ -36,9 +36,9 @@ See the [LXC Container Deployment Guide](scripts/README-lxc.md).
## ✨ Features
- 🔁 Sync public, private, or starred GitHub repos to Gitea
- 🏢 Mirror entire organizations with structure preservation
- 🏢 Mirror entire organizations with flexible organization strategies
- 🐞 Optional mirroring of issues and labels
- 🌟 Mirror your starred repositories
- 🌟 Mirror your starred repositories to a dedicated organization
- 🕹️ Modern user interface with toast notifications and smooth experience
- 🧠 Smart filtering and job queue with detailed logs
- 🛠️ Works with personal access tokens (GitHub + Gitea)
@@ -317,6 +317,28 @@ Key configuration options include:
> [!IMPORTANT]
> **SQLite is the only database required for Gitea Mirror**, handling both data storage and real-time event notifications.
### Mirror Strategies
Gitea Mirror offers three flexible strategies for organizing your repositories in Gitea:
#### 1. **Preserve GitHub Structure** (Default)
- Personal repositories → Your Gitea username
- Organization repositories → Same organization name in Gitea
- Maintains the exact structure from GitHub
#### 2. **Single Organization**
- All repositories → One designated organization
- Simplifies management by consolidating everything
- Requires specifying a destination organization name
#### 3. **Flat User Structure**
- All repositories → Your Gitea user account
- No organizations needed
- Simplest approach for personal use
> [!NOTE]
> **Starred Repositories**: Regardless of the chosen strategy, starred repositories are always mirrored to a separate organization (default: "starred") to keep them organized separately from your own repositories.
## 🚀 Development
### Local Development Setup

View File

@@ -18,7 +18,6 @@ const githubOptions = [
{ name: 'Mirror Wiki', desc: 'Mirror wiki pages from GitHub to Gitea', default: 'false' },
{ name: 'Mirror Organizations', desc: 'Mirror organization repositories', default: 'false' },
{ name: 'Only Mirror Orgs', desc: 'Only mirror organization repositories', default: 'false' },
{ name: 'Preserve Org Structure', desc: 'Maintain organization structure in Gitea', default: 'false' },
{ name: 'Skip Forks', desc: 'Exclude repositories that are forks', default: 'false' },
{ name: 'Skip Starred Issues', desc: 'Skip issues for starred repositories', default: 'false' }
];
@@ -249,6 +248,74 @@ const giteaOptions = [
</table>
</div>
<!-- Mirror Strategies -->
<div class="bg-gradient-to-r from-primary/5 to-transparent rounded-lg p-6 border-l-4 border-primary mb-6">
<h4 class="font-semibold text-lg mb-4">Mirror Strategies</h4>
<p class="text-sm text-muted-foreground mb-4">Choose how your repositories will be organized in Gitea:</p>
<div class="space-y-4">
<div class="bg-card rounded-lg border border-border p-4">
<h5 class="font-semibold text-base mb-2 flex items-center gap-2">
<span class="text-blue-600 dark:text-blue-500">📁</span>
Preserve GitHub Structure
</h5>
<p class="text-sm text-muted-foreground mb-2">Maintains the exact structure from GitHub:</p>
<ul class="space-y-1 text-sm ml-4">
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>Personal repos → Your Gitea username</span>
</li>
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>Organization repos → Same organization name in Gitea</span>
</li>
</ul>
</div>
<div class="bg-card rounded-lg border border-border p-4">
<h5 class="font-semibold text-base mb-2 flex items-center gap-2">
<span class="text-purple-600 dark:text-purple-500">🏢</span>
Single Organization
</h5>
<p class="text-sm text-muted-foreground mb-2">Consolidates all repositories into one organization:</p>
<ul class="space-y-1 text-sm ml-4">
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>All repos → One designated organization</span>
</li>
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>Requires setting "Organization" field</span>
</li>
</ul>
</div>
<div class="bg-card rounded-lg border border-border p-4">
<h5 class="font-semibold text-base mb-2 flex items-center gap-2">
<span class="text-green-600 dark:text-green-500">👤</span>
Flat User Structure
</h5>
<p class="text-sm text-muted-foreground mb-2">Mirrors all repositories under your user account:</p>
<ul class="space-y-1 text-sm ml-4">
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>All repos → Your Gitea username</span>
</li>
<li class="flex gap-2">
<span class="text-muted-foreground">•</span>
<span>No organizations needed</span>
</li>
</ul>
</div>
</div>
<div class="bg-amber-500/10 border border-amber-500/20 rounded-lg p-3 mt-4">
<p class="text-sm">
<span class="font-semibold">Note:</span> Starred repositories are always mirrored to the "Starred Repos Org" (default: "starred") regardless of the chosen strategy.
</p>
</div>
</div>
<div class="pl-4 border-l-2 border-primary/20">
<h5 class="font-semibold mb-3">To create a Gitea access token:</h5>
<ol class="space-y-2 text-sm">