[Feat] Gitea/GitLab Custom SSH Ports#1096
Open
RichardAnderson wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds configurable SSH clone ports for Gitea and GitLab source control providers and threads that configuration through backend provider data, clone script rendering, API resources, and the edit UI.
Changes:
- Adds provider-level SSH port validation, normalization, persistence, and clone-time usage.
- Introduces editable provider fields so the UI only renders whitelisted source-control settings.
- Updates TypeScript/OpenAPI schemas and feature tests for SSH port behavior.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/Feature/SourceControlsTest.php |
Adds coverage for SSH port create/edit/default behavior and clone script rendering. |
resources/views/ssh/git/clone.blade.php |
Adds SSH config and keyscan port handling. |
resources/js/types/source-control.d.ts |
Adds optional ssh_port to source control type. |
resources/js/types/index.d.ts |
Adds source-control provider editable_fields config typing. |
resources/js/pages/source-controls/components/columns.tsx |
Renders editable provider fields dynamically in the edit dialog. |
public/api-docs/openapi/schemas/SourceControl.yaml |
Documents ssh_port on source control responses. |
app/SSH/OS/Git.php |
Passes provider SSH port into the clone script. |
app/SourceControlProviders/SourceControlProvider.php |
Extends provider contract with SSH port/editability methods. |
app/SourceControlProviders/Gitlab.php |
Adds GitLab SSH port data/rules/edit handling. |
app/SourceControlProviders/Gitea.php |
Adds Gitea SSH port data/rules/edit handling. |
app/SourceControlProviders/AbstractSourceControlProvider.php |
Provides defaults for SSH port and editability methods. |
app/Providers/SourceControlServiceProvider.php |
Adds SSH port dynamic fields for GitLab and Gitea. |
app/Plugins/RegisterSourceControl.php |
Exposes provider editable fields in source-control config. |
app/Http/Resources/SourceControlResource.php |
Conditionally includes ssh_port in source control resources. |
app/Actions/SourceControl/EditSourceControl.php |
Validates and saves provider-specific editable data during edits. |
ff90a26 to
60d6255
Compare
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.
This pull request introduces support for configuring a custom SSH port for Gitea and GitLab source control providers, allowing users to specify which port should be used when cloning repositories. It also generalizes provider editability, so only safe, whitelisted fields can be edited, and ensures the UI and API reflect these changes. The most significant changes are grouped below.
Backend: SSH Port Support and Provider Editability
ssh_portas a configurable and editable field for Gitea and GitLab providers, including validation, normalization, and persistence logic in their respective provider classes (Gitea.php,Gitlab.php). The default is 22, but users can specify a different port if needed.getSshPort,editableFields,editRules, andeditDatamethods, ensuring only whitelisted fields can be edited and preventing unsafe mass assignment.UI/API: Dynamic Edit Forms and Schema Updates
ssh_portfield for providers that support it, with proper typing and documentation.Operational: SSH Clone Script and Usage
ssh-keyscanand SSH config generation accordingly.Provider Registration
These changes make SSH port configuration safer, more flexible, and more user-friendly for self-hosted source control integrations.
Resolves #1085