mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-08 20:46:44 +03:00
Major fixes for Docker environment variable issues and cleanup functionality: 🔧 **Duration Parser & Scheduler Fixes** - Add comprehensive duration parser supporting "8h", "30m", "24h" formats - Fix GITEA_MIRROR_INTERVAL environment variable mapping to scheduler - Auto-enable scheduler when GITEA_MIRROR_INTERVAL is set - Improve scheduler logging to clarify timing behavior (from last run, not startup) 🧹 **Repository Cleanup Service** - Complete repository cleanup service for orphaned repos (unstarred, deleted) - Fix cleanup configuration logic - now works with CLEANUP_DELETE_IF_NOT_IN_GITHUB=true - Auto-enable cleanup when deleteIfNotInGitHub is enabled - Add manual cleanup trigger API endpoint (/api/cleanup/trigger) - Support archive/delete actions with dry-run mode and protected repos 🐛 **Environment Variable Integration** - Fix scheduler not recognizing GITEA_MIRROR_INTERVAL=8h - Fix cleanup requiring both CLEANUP_DELETE_FROM_GITEA and CLEANUP_DELETE_IF_NOT_IN_GITHUB - Auto-enable services when relevant environment variables are set - Better error logging and debugging information 📚 **Documentation Updates** - Update .env.example with auto-enabling behavior notes - Update ENVIRONMENT_VARIABLES.md with clarified functionality - Add comprehensive tests for duration parsing This resolves the core issues where: 1. GITEA_MIRROR_INTERVAL=8h was not working for automatic mirroring 2. Repository cleanup was not working despite CLEANUP_DELETE_IF_NOT_IN_GITHUB=true 3. Users had no visibility into why scheduling/cleanup wasn't working 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Gitea Mirror Documentation
Welcome to the Gitea Mirror documentation. This guide covers everything you need to know about developing, building, and deploying the open-source version of Gitea Mirror.
Documentation Overview
Getting Started
- Development Workflow - Set up your development environment and start contributing
- Build Guide - Build Gitea Mirror from source
- Configuration Guide - Configure all available options
Deployment
- Deployment Guide - Deploy to production environments
- Docker Guide - Container-based deployment
- Reverse Proxy Setup - Configure with nginx/Caddy
Features
- SSO/OIDC Setup - Configure authentication providers
- Sponsor Integration - GitHub Sponsors integration
- Webhook Configuration - Set up GitHub webhooks
Architecture
- Architecture Overview - System design and components
- API Documentation - REST API endpoints
- Database Schema - SQLite structure
Maintenance
- Migration Guide - Upgrade from previous versions
- Better Auth Migration - Migrate authentication system
- Troubleshooting - Common issues and solutions
- Backup & Restore - Data management
Quick Start
- Clone and install:
git clone https://github.com/yourusername/gitea-mirror.git
cd gitea-mirror
bun install
- Configure:
cp .env.example .env
# Edit .env with your GitHub and Gitea tokens
- Initialize and run:
bun run init-db
bun run dev
- Access: Open http://localhost:4321
Key Features
- 🔄 Automatic Mirroring - Keep repositories synchronized
- 🗂️ Organization Support - Mirror entire organizations
- ⭐ Starred Repos - Mirror your starred repositories
- 🔐 Self-Hosted - Full control over your data
- 🚀 Fast - Built with Bun for optimal performance
- 🔒 Secure - JWT authentication, encrypted tokens
Technology Stack
- Runtime: Bun
- Framework: Astro with React
- Database: SQLite with Drizzle ORM
- Styling: Tailwind CSS v4
- Authentication: Better Auth
System Requirements
- Bun >= 1.2.9
- Node.js >= 20 (optional, for compatibility)
- SQLite 3
- 512MB RAM minimum
- 1GB disk space
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Code of Conduct
Please read our Code of Conduct before contributing.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: GitHub Wiki
Security
For security issues, please see SECURITY.md.
License
Gitea Mirror is open source software licensed under the MIT License.
For detailed information on any topic, please refer to the specific documentation guides listed above.