Provide UI to enable periodical rake task to cleanup unused LFS files

Problem to solve

Users or admins run up against storage limits, and realize that they are using a lot of storage on LFS objects they no longer want or need. Then they find there is no way to remove them from the GitLab-managed LFS storage without deleting the project.

Current solution we used is as described in Create a rake task to cleanup unused LFS files (#36628 - closed), create rake task to clean up unused lfs file reference, and after some time, the lfs files will be deleted.

# Clean up unused lfs file reference 
## via project path
gitlab-rake gitlab:cleanup:orphan_lfs_file_references PROJECT_PATH="xxx/xxx" DRY_RUN=false
## via project id
gitlab-rake gitlab:cleanup:orphan_lfs_file_references PROJECT_ID="xxx" DRY_RUN=false

However, this is not known to many customers and tedious to operate such commands mannually.

Solution

Provide UI to enable periodical rake task to cleanup unused LFS files

  1. in Project Settings - Repository - Repository cleanup, add an UI option to enable this "LFS cleanup"