This commit is contained in:
2025-10-25 20:11:21 +02:00
commit fd37421245
700 changed files with 211892 additions and 0 deletions

View File

@@ -0,0 +1,193 @@
# Git Server Options for TrueNAS
## Overview
Options for self-hosting a git server on TrueNAS, with considerations for features, complexity, and resource requirements.
---
## Option 1: Gitea
**Type:** Lightweight, self-hosted Git service
**Pros:**
- Lightweight and fast (written in Go)
- GitHub-like web interface
- Easy installation via Docker/jail
- Built-in CI/CD (Gitea Actions)
- User management, organizations, teams
- Issue tracking, wiki, pull requests
- Low resource usage (~100-200 MB RAM)
- Active development and community
**Cons:**
- Fewer features than GitLab
- Smaller plugin ecosystem
**Installation:**
- TrueNAS Scale: Deploy via TrueCharts or Docker
- TrueNAS Core: Install in FreeBSD jail
**Best For:** Most home users wanting a full-featured Git platform with minimal overhead
---
## Option 2: GitLab CE (Community Edition)
**Type:** Full-featured DevOps platform
**Pros:**
- Complete DevOps lifecycle (CI/CD, container registry, etc.)
- Professional features (protected branches, merge requests)
- Excellent documentation
- Industry-standard platform
- Built-in runners for automation
**Cons:**
- Resource-heavy (minimum 4GB RAM, recommend 8GB+)
- Slower performance on modest hardware
- More complex to maintain
- Overkill for simple git hosting
**Installation:**
- TrueNAS Scale: Docker container or VM
- Requires dedicated resources
**Best For:** Users who want enterprise features and have hardware to spare
---
## Option 3: Plain Git Server (SSH-based)
**Type:** Bare-bones git via SSH
**Pros:**
- Minimal resource usage
- Simple and reliable
- No web interface complexity
- Uses native TrueNAS SSH access
- Maximum control
**Cons:**
- No web UI
- No pull requests, issues, or collaboration features
- Manual user/permission management
- Command-line only workflow
**Setup:**
```bash
# Create git user and repos directory
# Set up SSH keys
# Initialize bare repos
```
**Best For:** Solo users or small teams comfortable with CLI-only workflow
---
## Option 4: Gogs
**Type:** Painless self-hosted Git service (Gitea's predecessor)
**Pros:**
- Even lighter than Gitea
- Simple and stable
- Easy to set up
- Web interface for basic operations
**Cons:**
- Less actively developed (Gitea forked from it)
- Fewer features than Gitea
- Smaller community
**Best For:** Users wanting minimal resource usage with basic web UI
---
## Option 5: cgit + gitolite
**Type:** Lightweight web viewer + access control
**Pros:**
- Extremely lightweight
- Fast repository browsing (cgit)
- Fine-grained access control (gitolite)
- Battle-tested and stable
**Cons:**
- More complex initial setup
- No modern collaboration features
- Basic web interface (read-only)
- Steeper learning curve
**Best For:** Advanced users prioritizing performance and control
---
## Comparison Matrix
| Feature | Gitea | GitLab CE | Plain Git | Gogs | cgit+gitolite |
|---------|-------|-----------|-----------|------|---------------|
| Resource Usage | Low | High | Minimal | Very Low | Minimal |
| Web UI | Excellent | Excellent | None | Good | Basic |
| Pull Requests | Yes | Yes | No | Yes | No |
| CI/CD | Yes | Yes | No | No | No |
| Setup Complexity | Easy | Medium | Easy | Easy | Hard |
| Active Development | High | High | N/A | Low | Low |
---
## Recommendation
**For most home users: Gitea**
Reasons:
- Best balance of features and resource usage
- Modern, intuitive interface
- Easy to maintain
- Supports collaboration features (PRs, issues)
- Works well on modest hardware
- Can grow with your needs
**Installation on TrueNAS Scale:**
1. Use TrueCharts app or custom Docker container
2. Allocate dataset for persistent storage
3. Configure reverse proxy (optional, for HTTPS)
4. Set up backups of git repositories
---
## Additional Considerations
### Backup Strategy
- Git repositories are already distributed backups
- Still recommended to backup Gitea database and repos
- TrueNAS snapshots + replication to another location
### Access Methods
- SSH: Direct git operations
- HTTPS: Web interface + git operations
- Consider reverse proxy (Nginx/Traefik) for SSL
### Storage Requirements
- Minimal for code repos (MBs to low GBs)
- LFS (Large File Storage) if storing binaries/media
- Plan for growth if hosting many repos
### Security
- Keep software updated
- Use SSH keys or strong passwords
- Consider VPN for external access
- Regular backups
---
## Next Steps
- [ ] Decide on git server solution
- [ ] Plan resource allocation (RAM, CPU, storage)
- [ ] Choose access method (local only vs. external)
- [ ] Set up TrueNAS dataset for git storage
- [ ] Install and configure chosen solution
- [ ] Configure backup strategy
- [ ] Migrate existing repositories (if any)