[PR #2170] [MERGED] Only show SSH clone URL if signed in (#2169) #16269

Closed
opened 2025-11-02 12:06:22 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2170
Author: @stklcode
Created: 7/15/2017
Status: Merged
Merged: 7/15/2017
Merged by: @lunny

Base: masterHead: master


📝 Commits (4)

  • 24109f4 Add configuration flag SSH_EXPOSE_ANONYMOUS
  • 3d08a4e Default SSH exposure set to false
  • 37ab58f Add integration tests
  • a49ac74 Hide clone button neither HTTP and SSH is enabled

📊 Changes

7 files changed (+61 additions, -13 deletions)

View changed files

📝 conf/app.ini (+2 -0)
📝 integrations/repo_test.go (+37 -0)
📝 modules/context/repo.go (+1 -0)
📝 modules/setting/setting.go (+2 -0)
📝 templates/repo/bare.tmpl (+5 -3)
📝 templates/repo/home.tmpl (+7 -5)
📝 templates/repo/wiki/view.tmpl (+7 -5)

📄 Description

This PR targets issue #2169

For cloning via SSH a user needs to provide a public key. If this is the case, this user has an account or is added by a member. Anonymous visitors hence do not need to see the SSH URL.

This is a hard-coded soliton (as voted by @lafriks), equivalent to GitHub's behavior. If a configurable solution is desired instead, I got another diofferent branch (stklcode/gitea@d7cbf5d72e) ready.

This solution introduces a config flag SSH_EXPOSE_ANONYMOUS (default false) to hide by default and opt-in to the old behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2170 **Author:** [@stklcode](https://github.com/stklcode) **Created:** 7/15/2017 **Status:** ✅ Merged **Merged:** 7/15/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (4) - [`24109f4`](https://github.com/go-gitea/gitea/commit/24109f4093603a6b4dbcf0735a7506e24ef1e289) Add configuration flag SSH_EXPOSE_ANONYMOUS - [`3d08a4e`](https://github.com/go-gitea/gitea/commit/3d08a4e9c1f6f09882c86326301052ef14f967ec) Default SSH exposure set to false - [`37ab58f`](https://github.com/go-gitea/gitea/commit/37ab58fbd190e4b86cf38350b5391d5ef5466a13) Add integration tests - [`a49ac74`](https://github.com/go-gitea/gitea/commit/a49ac743f2f82cf98ea921c09d9dc3d2af9dd80e) Hide clone button neither HTTP and SSH is enabled ### 📊 Changes **7 files changed** (+61 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `conf/app.ini` (+2 -0) 📝 `integrations/repo_test.go` (+37 -0) 📝 `modules/context/repo.go` (+1 -0) 📝 `modules/setting/setting.go` (+2 -0) 📝 `templates/repo/bare.tmpl` (+5 -3) 📝 `templates/repo/home.tmpl` (+7 -5) 📝 `templates/repo/wiki/view.tmpl` (+7 -5) </details> ### 📄 Description This PR targets issue #2169 For cloning via SSH a user needs to provide a public key. If this is the case, this user has an account or is added by a member. Anonymous visitors hence do not need to see the SSH URL. ~~This is a hard-coded soliton (as voted by @lafriks), equivalent to GitHub's behavior. If a configurable solution is desired instead, I got another diofferent branch (stklcode/gitea@d7cbf5d72e15a7411ec1648037fd94872e5ed2a3) ready.~~ This solution introduces a config flag `SSH_EXPOSE_ANONYMOUS` (default `false`) to hide by default and opt-in to the old behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:06:22 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16269