Git Repository Provisioning and Management
The Git Provider enables provisioning and management of bare Git repositories with SSH access. This provider integrates with the Enopax Resource API to offer Git repository hosting as a service.
✅ Production Ready - Fully implemented in Provider-API
The Git Provider allows users to:
- Create bare Git repositories
- Configure SSH access for repositories
- Organise repositories by organisation and project
- Manage repository lifecycle (create, update, delete)
- Soft delete with configurable retention periods
- Bare Repository Creation - Standard Git bare repositories
- SSH Access - Secure SSH access with user-provided keys
- Organisation/Project Hierarchy - Structured storage by org/project
- Soft Delete - 30-day retention period before permanent deletion
- Metrics - Repository size, commit count, branch information
- Resource API - Fully integrated with Enopax Resource API
- Platform Integration - Seamless provisioning from Enopax Platform
- SSH URL Generation - Automatic SSH access URLs
- Status Monitoring - Repository health and metadata
- Bash Scripts - Resource API integration scripts
- Git - Repository management
- SSH - Secure access
- File System - Local storage with organisation structure
The Git Provider follows the standard Enopax Resource API pattern:
Discovery:
GET /providers/info
# Returns Git provider metadata and configuration schemaProvision:
POST /v1/git
# Input: repository name, SSH keys, org/project identifiers
# Output: repository ID, SSH URL, statusList:
GET /v1/git?org=My%20Org&project=My%20Project
# Returns: all repositories for the specified org/projectStatus:
GET /v1/git/:id
# Returns: repository status, size, metadataMetrics:
GET /v1/git/:id/metrics
# Returns: storage size, commit count, branches, last activityUpdate:
PUT /v1/git/:id
# Update: repository name or configurationDelete:
DELETE /v1/git/:id
# Soft delete: moves to .deleted/ folder with 30-day retentionprovider-git/
├── README.md # This file
├── CLAUDE.md # AI assistant guidance
└── (scripts integrated in resource-api/scripts/git-repo/)
Note: The actual implementation scripts are located in the resource-api repository at scripts/git-repo/:
resource-api/scripts/git-repo/
├── config.json # Provider configuration
├── common.sh # Shared configuration
├── provision.sh # Create repository
├── list.sh # List repositories
├── status.sh # Get repository status
├── metrics.sh # Get repository metrics
├── update.sh # Update repository
└── deprovision.sh # Delete repository (soft delete)
Repositories are stored in a hierarchical structure:
/data/repos/
├── org_slug/
│ └── project_slug/
│ ├── repo1.git/ # Bare repository
│ ├── repo2.git/ # Bare repository
│ └── .deleted/ # Soft-deleted repositories
│ └── repo_old.git/ # Deleted, 30-day retention
Repository IDs follow the pattern: orgslug-projectslug-reponame-randomstring
Example: acme_corp-web_app-backend_api-abc123de
- Hyphens separate components (org, project, repo, random)
- Underscores allowed within slugs
- Random string ensures uniqueness (8 characters)
{
"typeId": "git-repository",
"displayName": "Git Repository",
"description": "Bare Git repository with SSH access",
"category": "VERSION_CONTROL",
"providerId": "git-provider",
"providerName": "Git Provider",
"version": "1.0.0",
"supportedRegions": ["local"],
"status": "operational",
"configSchema": {
"type": "object",
"properties": {
"repositoryName": {
"type": "string",
"title": "Repository Name"
}
},
"required": ["repositoryName"]
},
"estimatedProvisioningTime": 5
}# Repository storage base path
REPOS_BASE="/data/repos"
# SSH access configuration
SSH_HOST="git.enopax.io"
DEFAULT_BRANCH="main"
# Retention period for deleted repositories (days)
RETENTION_DAYS=30curl -X POST http://localhost:3001/v1/git \
-H "Content-Type: application/json" \
-d '{
"name": "backend-api",
"sshKeys": ["ssh-rsa AAAAB3..."],
"userId": "user_123",
"projectName": "Web App",
"organisationName": "ACME Corp"
}'Response:
{
"success": true,
"id": "acme_corp-web_app-backend_api-abc123de",
"name": "backend-api",
"status": "active",
"message": "Repository created successfully",
"access": "git@git.enopax.io:acme_corp/web_app/backend_api.git"
}curl "http://localhost:3001/v1/git?org=ACME%20Corp&project=Web%20App"git clone git@git.enopax.io:acme_corp/web_app/backend_api.gitcurl http://localhost:3001/v1/git/acme_corp-web_app-backend_api-abc123deResponse:
{
"success": true,
"id": "acme_corp-web_app-backend_api-abc123de",
"name": "backend-api",
"status": "active",
"size": "15.2 MB",
"branches": 3,
"commits": 142,
"lastActivity": "2025-10-09T14:30:00Z"
}- User-provided SSH keys are configured per repository
- No password access allowed
- Keys stored securely in repository configuration
- Repository access scoped to organisation/project
- List operations require both org and project parameters
- Prevents cross-organisation information leakage
- Each repository is isolated
- Organisation/project-based directory structure
- Soft delete prevents accidental data loss
- Repository moved to
.deleted/folder within project - Renamed with deletion timestamp
- Retained for 30 days
- Automatically purged after retention period
# Move repository back from .deleted/ folder
# Rename to remove deletion timestamp
# Repository becomes active again- Repository storage size
- Number of commits
- Number of branches
- Last activity timestamp
- Repository health status
- Repository integrity verification
- Disk space monitoring
- Access permission validation
- Users provision Git repositories through Enopax Platform UI
- Repository configuration via simple forms
- Real-time status display
- SSH URL provided for cloning
- Git provider registered in Resource API
config.json - Bash scripts handle repository lifecycle
- JSON input/output following provider API pattern
- Multi-provider support (runs alongside other providers)
# Test provision
echo '{"name":"test-repo","organizationId":"test_org","projectId":"test_project","sshKeys":[]}' | \
bash resource-api/scripts/git-repo/provision.sh
# Test status
echo '{"id":"test_org-test_project-test_repo-abc123de"}' | \
bash resource-api/scripts/git-repo/status.sh
# Test list
echo '{"org":"Test Org","project":"Test Project"}' | \
bash resource-api/scripts/git-repo/list.shTo add features:
- Update
resource-api/scripts/git-repo/common.shfor shared configuration - Modify relevant script (provision.sh, status.sh, etc.)
- Update
config.jsonif schema changes - Test manually before deploying
- Update this documentation
Repository creation fails:
- Check
/data/repos/directory exists and is writable - Verify organisation/project slugs are valid
- Check disk space availability
SSH access denied:
- Verify SSH keys are correctly formatted
- Check SSH server configuration
- Ensure SSH keys are added to repository
Repository not found:
- Check repository ID format
- Verify repository hasn't been deleted
- Check
.deleted/folder for soft-deleted repositories
- ✅ Bare repository creation
- ✅ SSH access configuration
- ✅ Organisation/project hierarchy
- ✅ Soft delete with retention
- ✅ Repository metrics
- ✅ Resource API integration
- 📋 Web-based repository browser
- 📋 Webhook support
- 📋 Repository permissions management
- 📋 Automated backups
- 📋 Repository mirroring
- 📋 Git LFS support
TBD
Repository: https://github.com/enopax/provider-git
Resource API: https://github.com/enopax/resource-api
Documentation: See resource-api/scripts/git-repo/ for implementation