@ -115,8 +115,7 @@ These are not part of any NIP but are used by this application:
@@ -115,8 +115,7 @@ These are not part of any NIP but are used by this application:
- When found, server:
- Creates a bare git repository at `/repos/{npub}/{repo-name}.git`
- Fetches the self-transfer event for ownership verification
- Creates initial commit with `.nostr-ownership-transfer` file containing the self-transfer event
- Creates `.nostr-announcement` file with the full signed announcement event JSON
- Creates initial commit with README.md and saves announcement/transfer events to `nostr/repo-events.jsonl` for offline papertrail
- If repository has `clone` tags pointing to other remotes, syncs from those remotes
3. **Repository Access**:
@ -155,12 +154,18 @@ These are not part of any NIP but are used by this application:
@@ -155,12 +154,18 @@ These are not part of any NIP but are used by this application:
- Transfer event is saved to repository in `nostr/repo-events.jsonl` for offline papertrail
2. **Server Processes Transfer**:
2. **New Owner Completes Transfer**:
- New owner is notified when logging into GitRepublic web
- New owner publishes a new repository announcement (kind 30617) to complete the transfer
- New announcement is saved to repository for verification
3. **Server Processes Transfer**:
- Server fetches all ownership transfer events for repository
- Validates chain of ownership chronologically
- Updates current owner for all permission checks
@ -327,7 +332,7 @@ npm run dev
@@ -327,7 +332,7 @@ npm run dev
**Note**: This repository uses npm workspaces. The CLI (`gitrepublic-cli`) is included as a workspace package but can also be published independently. See `gitrepublic-cli/SYNC.md` for details on syncing to a separate repository.
### Security Features
## Security Features
### Lightweight Mode (Single Container)
- **Resource Limits**: Per-user repository count and disk quota limits
**Note**: Use `/api/git/` or `/repos/` paths to ensure proper detection by the commit signing hook and to distinguish from GRASP servers.
**Note**: Use `/api/git/` or `/repos/` paths to ensure proper detection by the commit signing hook and to distinguish from GRASP servers. All three paths work for cloning, but `/api/git/` is recommended for best compatibility.
### Pushing to a Repository
@ -549,11 +554,9 @@ The credential helper will automatically generate NIP-98 authentication tokens f
@@ -549,11 +554,9 @@ The credential helper will automatically generate NIP-98 authentication tokens f
- **Resource Quotas**: Per-tenant CPU, memory, and storage limits
- **Separate Volumes**: Each tenant has their own PersistentVolume
See `docs/SECURITY.md` and `docs/SECURITY_IMPLEMENTATION.md` for detailed information.
## Security Considerations
### Security Considerations
- **Path Traversal**: All file paths are validated and sanitized
- **Path Traversal Protection**: All file paths are validated and sanitized
- **Input Validation**: Commit messages, author info, and file paths are validated
- **Size Limits**: 2 GB per repository, 500 MB per file
- **Authentication**: All write operations require NIP-98 authentication
@ -563,6 +566,8 @@ See `docs/SECURITY.md` and `docs/SECURITY_IMPLEMENTATION.md` for detailed inform
@@ -563,6 +566,8 @@ See `docs/SECURITY.md` and `docs/SECURITY_IMPLEMENTATION.md` for detailed inform
- **Rate Limiting**: Per-IP and per-user rate limiting (configurable)
- **Audit Logging**: All security-relevant events are logged
See `docs/SECURITY.md` and `docs/SECURITY_IMPLEMENTATION.md` for detailed information.
@ -136,26 +140,39 @@ Private repositories require authentication. You'll need to set up NIP-98 authen
@@ -136,26 +140,39 @@ Private repositories require authentication. You'll need to set up NIP-98 authen
#### Setting Up NIP-98 Authentication
1. **Install a git credential helper** (if not already installed):
For command-line git operations, you need to install the [GitRepublic CLI](https://github.com/your-org/gitrepublic-cli) which provides:
When prompted, the credential helper will automatically generate and use a NIP-98 authentication token.
**Note**: For command-line git operations, you'll need to install the [GitRepublic CLI](https://github.com/your-org/gitrepublic-cli) and set up the credential helper. See the README for complete setup instructions.
### Cloning from Multiple Remotes
If a repository has multiple clone URLs configured, GitRepublic will automatically sync changes to all remotes when you push. You can see all clone URLs on the repository page.
@ -262,7 +279,7 @@ Pull requests (PRs) allow you to propose changes to a repository. They're create
@@ -262,7 +279,7 @@ Pull requests (PRs) allow you to propose changes to a repository. They're create
@ -380,7 +397,7 @@ To keep your fork up to date with the original repository:
@@ -380,7 +397,7 @@ To keep your fork up to date with the original repository:
@ -450,13 +467,13 @@ Transfer repository ownership to another user using the transfer workflow:
@@ -450,13 +467,13 @@ Transfer repository ownership to another user using the transfer workflow:
1. **Initiate Transfer**: On your repository page, click "Transfer Ownership"
2. **Enter New Owner**: Provide the new owner's npub
3. **Sign and Publish**: The transfer event is signed and published to Nostr relays
4. **Save to Repository**: The transfer event is saved to your repository for offline papertrail
3. **Sign and Publish**: The transfer event (kind 1641) is signed and published to Nostr relays
4. **Save to Repository**: The transfer event is saved to `nostr/repo-events.jsonl` in your repository for offline papertrail
5. **New Owner Notification**: The new owner will be notified when they log into GitRepublic web
6. **Complete Transfer**: The new owner completes the transfer by publishing a new repository announcement
7. **Verification**: The transfer is complete and the repository is verified
6. **Complete Transfer**: The new owner completes the transfer by publishing a new repository announcement (kind 30617)
7. **Verification**: The new announcement is saved to the repository, and the transfer is complete
**Important**: Ownership transfers are permanent and create a chain of ownership events. The new owner will have full control. Both the transfer event and the new repository announcement are published to relays and saved to the repository for both online and offline papertrail.
**Important**: Ownership transfers are permanent and create a chain of ownership events. The new owner will have full control. Both the transfer event and the new repository announcement are published to relays and saved to `nostr/repo-events.jsonl` in the repository for both online and offline papertrail.
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771615631,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","handle new repo creation"]],"content":"Signed commit: handle new repo creation","id":"59bc1c664590bcbe3e05c4151154590aa1ca4399e2a48d64e94bb960e6056265","sig":"ae666597fc46256915abeec93be97c5d9559eaef90aa65208740f32fe4b00531a51ba432ed9a2089a7ec860ac1dc9a7a4a5d8e84db2a7ae433dd5c668f0b5035"}
{"kind":1640,"pubkey":"573634b648634cbad10f2451776089ea21090d9407f715e83c577b4611ae6edc","created_at":1771618298,"tags":[["author","Silberengel","silberengel7@protonmail.com"],["message","restrict repos to announced events"]],"content":"Signed commit: restrict repos to announced events","id":"d7ee36680a38fac493b27fba26d6e1c496dee9a3099db68a4352f7709a41e860","sig":"071cc8031940590785e5566a45159e5324e36e8a06023282ab1d50b608902d3b06d95efc03d0a4da861a88f12381f7b64999c09a49dfe5f36fbd8ec6aefd8aeb"}