A lightweight Git server supporting both HTTP and SSH protocols with multiple storage backends.
-
HTTP Git Server: Full Git Smart HTTP protocol support
- Clone, push, pull operations via HTTP/HTTPS
- REST API for repository management
- Graceful shutdown handling
-
SSH Git Server: Custom SSH implementation for Git operations
- Clone, push, pull operations via SSH
- Public key and password authentication
- Git protocol over SSH (git-upload-pack, git-receive-pack)
-
Storage Backends:
- Local: File system storage for repositories
- S3: Amazon S3 compatible storage (tested and working)
-
Configuration:
- YAML configuration files
- Command-line flags
- Environment variable support
-
Authentication:
- Demo mode (password: "demo", accepts any SSH key)
- Extensible authentication framework
-
Logging: Structured logging with zerolog
- Parallel Servers: HTTP and SSH servers run concurrently
- Graceful Shutdown: CTRL+C handling with 30-second timeout
- Storage Abstraction: Pluggable storage backend system
- Transport Abstraction: Unified Git transport layer
Copy the example configuration:
cp config-example.yaml config.yaml
Edit config.yaml
to configure your storage backend and server settings.
# Build the application
make build
# Run with default configuration
./main
# Or run with custom config
./main --config ./config.yaml
HTTP Access:
# Clone via HTTP
git clone http://localhost:8080/your-repo.git
# Push to HTTP
git push origin main
SSH Access: Not stable
# Clone via SSH (demo password: "demo")
git clone ssh://demo@localhost:2022/your-repo.git
# Push via SSH
git push origin main
server.http.enabled
: Enable/disable HTTP serverserver.http.port
: HTTP server port (default: 8080)server.ssh.enabled
: Enable/disable SSH serverserver.ssh.port
: SSH server port (default: 2022)server.ssh.hostkey
: Path to SSH host key file
storage.type
: Storage backend ("local" or "s3")storage.local.path
: Local storage directorystorage.s3.*
: S3 configuration options
- Client Warning: Git clients may show "remote end hung up unexpectedly" message
- Impact: Cosmetic only - all operations complete successfully
- Status: Under investigation - server-side operations work perfectly
- Workaround: Message can be safely ignored
- S3 Storage: Slower than local storage due to network latency
- Expected: Normal behavior for remote storage
- Optimization: Consider using S3 transfer acceleration
- Multi-user authentication system
- Role-based access control (RBAC)
- JWT token authentication
- LDAP/Active Directory integration
- Rate limiting and DDoS protection
- Azure Blob Storage backend
- Google Cloud Storage backend
- Redis caching layer
- Repository compression and deduplication
- Web UI for repository browsing
- Webhook support for CI/CD integration
- Branch protection rules
- Repository mirroring
- Git LFS (Large File Storage) support
- Metrics and monitoring (Prometheus)
- Health check endpoints
- Docker containerization
- Kubernetes deployment manifests
- Backup and restore tools
- Git protocol v2 support
- HTTP/2 support
- TLS certificate management
- SSH key management interface
make build
make test
make test-coverage
See LICENSE file for details.