[PR #2873] [MERGED] Hide add key button if SSH is disabled #16641

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

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2873
Author: @michaelkuhn
Created: 11/7/2017
Status: Merged
Merged: 11/21/2017
Merged by: @lunny

Base: masterHead: hide-add-ssh-key


📝 Commits (3)

  • ab979b9 Disable add key button if SSH is disabled
  • 716044d Merge branch 'master' into hide-add-ssh-key
  • 55fa973 Merge branch 'master' into hide-add-ssh-key

📊 Changes

8 files changed (+39 additions, -8 deletions)

View changed files

📝 models/error.go (+14 -0)
📝 models/ssh_key.go (+1 -1)
📝 options/locale/locale_en-US.ini (+1 -0)
📝 routers/api/v1/repo/key.go (+3 -1)
📝 routers/repo/setting.go (+6 -3)
📝 routers/user/setting.go (+6 -3)
📝 templates/repo/settings/deploy_keys.tmpl (+4 -0)
📝 templates/user/settings/keys_ssh.tmpl (+4 -0)

📄 Description

I have configured our Gitea instance with disabled SSH. However, the settings UI still shows an "Add Key" button but trying to add a key produces an error stating that SSH is disabled. A few users have already contacted me whether something is broken.

This PR simply hides the button if SSH is disabled. Alternatively, there could be some descriptive text stating that it is not possible to add SSH keys because SSH is disabled or the whole SSH key section could be hidden.


🔄 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/2873 **Author:** [@michaelkuhn](https://github.com/michaelkuhn) **Created:** 11/7/2017 **Status:** ✅ Merged **Merged:** 11/21/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `hide-add-ssh-key` --- ### 📝 Commits (3) - [`ab979b9`](https://github.com/go-gitea/gitea/commit/ab979b9606d8070d3e8ab1c5557ae47279c7a41b) Disable add key button if SSH is disabled - [`716044d`](https://github.com/go-gitea/gitea/commit/716044daa719ef5e375c07df1d1a707bba0d7370) Merge branch 'master' into hide-add-ssh-key - [`55fa973`](https://github.com/go-gitea/gitea/commit/55fa973293ca6fdea491088c9606907084df3947) Merge branch 'master' into hide-add-ssh-key ### 📊 Changes **8 files changed** (+39 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `models/error.go` (+14 -0) 📝 `models/ssh_key.go` (+1 -1) 📝 `options/locale/locale_en-US.ini` (+1 -0) 📝 `routers/api/v1/repo/key.go` (+3 -1) 📝 `routers/repo/setting.go` (+6 -3) 📝 `routers/user/setting.go` (+6 -3) 📝 `templates/repo/settings/deploy_keys.tmpl` (+4 -0) 📝 `templates/user/settings/keys_ssh.tmpl` (+4 -0) </details> ### 📄 Description I have configured our Gitea instance with disabled SSH. However, the settings UI still shows an "Add Key" button but trying to add a key produces an error stating that SSH is disabled. A few users have already contacted me whether something is broken. This PR simply hides the button if SSH is disabled. Alternatively, there could be some descriptive text stating that it is not possible to add SSH keys because SSH is disabled or the whole SSH key section could be hidden. --- <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:15:19 -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#16641