feat(coderepo): Add Gitea support and enhance repository configuration#164
Merged
therealbrad merged 2 commits intomainfrom Mar 28, 2026
Merged
Conversation
- Introduced Gitea as a supported code repository provider, including configuration options for personal access tokens and server URLs. - Updated documentation to reflect Gitea integration and provide clear instructions for users. - Enhanced SSRF protection by implementing DNS resolution checks for Gitea URLs. - Added tests for Gitea repository adapter to ensure proper functionality and integration. - Improved user interface to display Gitea options in the code repository settings.
Contributor
Author
|
This was coded to the spec, but i haven't fully tested since I don't have Gitea set up. I'll get to that and test it soon unless someone else has it set up and wants to help test for me. |
- Updated the logic for retrieving the tree SHA in the Gitea repository adapter to ensure compatibility with different commit structures. This change allows for fallback to the commit ID if the tree SHA is not available, improving robustness in handling Gitea responses.
Contributor
Author
|
I was able to set up a local Gitea repo and connect/pull files to use as context for QuickScript. |
Contributor
Author
|
🎉 This PR is included in version 0.19.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
clFaster
pushed a commit
to clFaster/testplanit
that referenced
this pull request
Mar 29, 2026
## [0.19.0](TestPlanIt/testplanit@v0.18.12...v0.19.0) (2026-03-28) ### Features * **coderepo:** Add Gitea support and enhance repository configuration ([TestPlanIt#164](TestPlanIt#164)) ([3e349de](TestPlanIt@3e349de)) ### Bug Fixes * **ci:** fix Docker latest tag not updating and harden semantic-release version detection ([5167980](TestPlanIt@5167980))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for connecting to self-hosted Git servers (Gitea, Forgejo, Gogs) as code repository providers for QuickScript code context. Also hardens SSRF protections across all existing providers by adding DNS resolution validation and redirect protection.
New provider:
GITEAenum value added toCodeRepositoryProviderGiteaRepoAdapterimplements the abstractGitRepoAdapterusing the/api/v1/REST API shared by Gitea, Forgejo, Gogs, and compatible serversSecurity hardening (all providers):
assertSsrfSafeResolved()— resolves DNS before every fetch and verifies the IP is not private, closing the DNS rebinding attack vector where a public hostname resolves to an internal IP (e.g.,evil.com → 169.254.169.254)redirect: "manual"on all fetch calls with single-hop redirect following that validates theLocationURL through SSRF checks before proceedingfe80::) added to blocked rangeshttp://instead ofhttps://Related Issue
Closes #157
Type of Change
How Has This Been Tested?
Describe the tests you ran to verify your changes:
New and updated test files:
GiteaRepoAdapter.test.ts— 15 tests covering constructor, getDefaultBranch, listAllFiles (pagination, truncation, SHA fallback, URL encoding), getFileContent, testConnection, auth headersssrf.test.ts— 9 new tests (32 total) forassertSsrfSafeResolved(DNS rebinding with loopback/10.x/192.168.x/AWS metadata, safe resolution, raw IP skip, DNS failure) plusfe80::link-local and Gitea URL allowlistGitRepoAdapter.test.ts— 4 new tests (11 total) for Gitea instantiation, redirect following with SSRF validation, missing Location header,redirect: "manual"enforcementAll 226 adapter tests and 58 SSRF/adapter-specific tests pass.
Test Configuration:
Checklist
Screenshots (if applicable)
Additional Notes
GITEAenum value is added toCodeRepositoryProvider. Runningpnpm generateupdates the Prisma schema;prisma db pushapplies it./api/v1/REST API, so a single adapter covers them. The help text and labels make this explicit. Other servers with a Gitea-compatible API will work on a best-effort basis.