Deploy keys will not be deleted at repo delete #2947

Closed
opened 2025-11-02 04:55:00 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @xoxys on GitHub (Feb 20, 2019).

  • Gitea version (or commit ref): v1.7.1
  • Git version:
  • Operating system: CentOS7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

If you add a deploy key to a repository and delete the repo, the deploy key will persist in deploy_key table and reference a repo which does not exist anymore. The key also stays included in authorized_keys and can be result in problems if the key is used for other repositorys but in a different mode (read/write).

Originally created by @xoxys on GitHub (Feb 20, 2019). - Gitea version (or commit ref): v1.7.1 - Git version: - Operating system: CentOS7 - Database (use `[x]`): - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description If you add a deploy key to a repository and delete the repo, the deploy key will persist in deploy_key table and reference a repo which does not exist anymore. The key also stays included in authorized_keys and can be result in problems if the key is used for other repositorys but in a different mode (read/write).
Author
Owner

@jolheiser commented on GitHub (Feb 20, 2019):

I believe this was fixed in #5939
Updating to 1.7.2 should fix this issue.

@jolheiser commented on GitHub (Feb 20, 2019): I believe this was fixed in #5939 Updating to 1.7.2 should fix this issue.
Author
Owner

@xoxys commented on GitHub (Feb 20, 2019):

@jolheiser thanks, I will upgrade and report back

@xoxys commented on GitHub (Feb 20, 2019): @jolheiser thanks, I will upgrade and report back
Author
Owner

@xoxys commented on GitHub (Feb 21, 2019):

Fixed. But I have to clean up my database by my own.

@xoxys commented on GitHub (Feb 21, 2019): Fixed. But I have to clean up my database by my own.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2947