Skip to content

feat: add occ command to scan and delete orphaned keys - #55556

Merged
hamza221 merged 1 commit into
masterfrom
feat/occ/orphaned-keys
Nov 10, 2025
Merged

feat: add occ command to scan and delete orphaned keys#55556
hamza221 merged 1 commit into
masterfrom
feat/occ/orphaned-keys

Conversation

@hamza221

@hamza221hamza221 commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

Summary

As an administrator I want to be able to delete encryption Keys that are orphaned ( the encrypted file was deleted without the corresponding key)
encryption:clean-orphaned-keys scans all users' filesytems for default module encryption Keys and lists them with possibility to delete all of them or specific ones

TODO

  • ...

Checklist

@mrsakrano

This comment was marked as spam.

Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to use Node API intead of View.
Also it feels you took inspiration from EncryptAll which since got cleaned up: #55472

Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated
@hamza221hamza221 changed the title feat: add occ command to scan and selete orphaned keysfeat: add occ command to scan and delete orphaned keysOct 15, 2025
@hamza221
hamza221 marked this pull request as ready for review October 15, 2025 15:54
@hamza221
hamza221 requested review from a team and icewind1991 as code ownersOctober 15, 2025 15:54
@hamza221
hamza221 requested review from CarlSchwan and sorbaugh and removed request for a teamOctober 15, 2025 15:54
@hamza221

This comment was marked as outdated.

@hamza221hamza221 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 16, 2025
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated
Comment threadapps/encryption/lib/Command/CleanOrphanedKeys.php Outdated
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221
hamza221force-pushed the feat/occ/orphaned-keys branch from 9f3d73b to f1cdf68CompareNovember 4, 2025 15:56
@hamza221

Copy link
Copy Markdown
ContributorAuthor

/backport to stable30

@hamza221

Copy link
Copy Markdown
ContributorAuthor

/backport to stable31

@hamza221

Copy link
Copy Markdown
ContributorAuthor

/backport! to stable30

@hamza221

Copy link
Copy Markdown
ContributorAuthor

/backport to stable32

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to allow either printing/deleting on the go or limit to some users to avoid having to run on all the users in one go, which on some big instances will be an issue, but this can be improved in follow-ups, we should merge this as a first version.

@hamza221
hamza221 merged commit 3d7b3ad into masterNov 10, 2025
229 of 237 checks passed
@hamza221
hamza221 deleted the feat/occ/orphaned-keys branch November 10, 2025 15:00
@backportbot

Copy link
Copy Markdown

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/55556/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts, resolve them
git cherry-pick f1cdf688
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/55556/stable30

Error: Failed to create pull request: Validation Failed: {"resource":"PullRequest","code":"custom","message":"A pull request already exists for nextcloud:backport/55556/stable30."} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@hamza221

Copy link
Copy Markdown
ContributorAuthor

I think it would be better to allow either printing/deleting on the go or limit to some users to avoid having to run on all the users in one go, which on some big instances will be an issue, but this can be improved in follow-ups, we should merge this as a first version.

tracked here #56349

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@hamza221@mrsakrano@CarlSchwan@come-nc@AndyScherzinger