-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UseCompatSSHURI setting #2356
Conversation
conf/app.ini
Outdated
@@ -23,6 +23,8 @@ PULL_REQUEST_QUEUE_LENGTH = 1000 | |||
PREFERRED_LICENSES = Apache License 2.0,MIT License | |||
; Disable ability to interact with repositories by HTTP protocol | |||
DISABLE_HTTP_GIT = false | |||
; Force ssh:// clone url instead of scp-style uri when default SSH port is used | |||
FORCE_CLONE_SSH_URL = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FORCE_CLONE_SSH_URL
might be a little bit misleading because it could also mean that the entered url is the forced clone ssh url. I would use USE_COMPAT_SSH_URI
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or FORCE_COMPAT_SSH_URI
(since it is a compat scheme)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not FORCE
better USE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules/setting/setting.go
Outdated
@@ -161,6 +161,7 @@ var ( | |||
PullRequestQueueLength int | |||
PreferredLicenses []string | |||
DisableHTTPGit bool | |||
ForceCloneSSHURL bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property name is misleading too because it could also be the forced clone ssh url (developers who are not involved in this issue may have problems with this). I would use UseCompatSSHURI
.
Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com> (+1 squashed commits) Squashed commits: [dda2dc79] Add ForceCloneSSHURL setting Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
dda2dc7
to
6216a90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -792,7 +793,11 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink { | |||
if setting.SSH.Port != 22 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier 🙂
if setting.Repository.UseCompatSSHURI || setting.SSH.Port != 22 {
...
else {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely correct tho, this would produce ssh://user@server:22/path URL when the standard port is used. Would work, but not super pretty in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this one?
if setting.SSH.POrt != 22 {
...
} else if setting.Repository.UseCompatSSHURI {
...
} else {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, ☝️ looks nicer though 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, made the change with commit a34402f
Signed-off-by: Manuel Kroeber <manuel.kroeber@gmail.com>
LGTM |
LGTM |
Please do not merge PR where there are unapproved reviews |
@tboerger yeah. really there are two unapproved reviews. |
There was a single change request by @bkcsoft and this single change request have been resolved exactly like it have been commented. |
Agree with @tboerger. I had a change request that stated "otherwise LGTM" and had been implemented to the letter, so I'm fine with this merge 🙂 |
@bkcsoft I'm not against this merge as per principle to not merge while reviewers have not approved their review |
If there are open requests I'm on your side, but for me this pr was pretty clear. |
I know that why also gave my LG-TM but I thought we have rule not to merge with unapproved reviews |
@lafriks I had approved it, since the requested changes had been implemented almost verbatim and I gave my LGTM given that condition. |
This adds the Repository.UseCompatSSHURI boolean setting.
It forces the clone URL box of a repo to always show
ssh://user@server/path
URL instead of the scp-style URIuser@server:path
when the default SSH port 22 is used.I tried to keep it as simple as possible and the changes minimal.
Feedback appreciated.