docs: update API docs for external repositories and git mounts
- Add GET /repositories endpoint documentation - Add POST /repositories endpoint for external repos - Update config-profiles.md with git mount details - Update repositories.md with external repo support
This commit is contained in:
@@ -8,6 +8,73 @@ All endpoints require authentication (session cookie).
|
||||
|
||||
---
|
||||
|
||||
## GET /repositories
|
||||
|
||||
**Description:** List all repositories owned by the user, including external repositories not tied to any project.
|
||||
|
||||
### Response
|
||||
|
||||
#### Success (200 OK)
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "uuid",
|
||||
"name": "my-external-repo",
|
||||
"remote_url": "https://github.com/user/repo.git",
|
||||
"is_mirror": false,
|
||||
"project_id": null,
|
||||
"owner_id": "uuid",
|
||||
"created_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## POST /repositories
|
||||
|
||||
**Description:** Create a new external repository (not tied to any project). External repositories can be used across all projects for config profile git mounts.
|
||||
|
||||
### Request
|
||||
|
||||
#### Request Body
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-external-repo",
|
||||
"remote_url": "https://github.com/user/repo.git",
|
||||
"ssh_key_id": "uuid"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `name` | `string` | Yes | Repository name (unique per user for external repos) |
|
||||
| `remote_url` | `string` | No | Remote URL to clone from |
|
||||
| `ssh_key_id` | `string` | No | SSH key ID for authentication |
|
||||
| `force_original_url` | `boolean` | No | Skip URL parsing (default: false) |
|
||||
|
||||
### Response
|
||||
|
||||
#### Success (201 Created)
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "uuid",
|
||||
"name": "my-external-repo",
|
||||
"path": "/data/repos/external/{user_id}/{repo_id}",
|
||||
"remote_url": "https://github.com/user/repo.git",
|
||||
"is_mirror": false,
|
||||
"project_id": null,
|
||||
"owner_id": "uuid",
|
||||
"ssh_key_id": "uuid",
|
||||
"created_at": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## GET /projects/{project_id}/repositories
|
||||
|
||||
**Description:** List repositories in a project.
|
||||
|
||||
Reference in New Issue
Block a user