NodeBB / NodeBB/NodeBB

Refactor uploaded files to distinguish between post, chat, and group uploads

Open
#10,705 7 comments 4 reactions 1 assignee View on GitHub

@julianlam is already working on this.

Since Jun 15, 2022.

breaking change (plugins) enhancement
Dominant language
JavaScript
Stars
15.2k
Forks
3k
Avg merge
16h 19m
Merged PRs (30d)
167

Description

via #10659

  • When a picture is uploaded, save it to os.tmpdir() + '/nodebb/uploads/{post|chat}'
  • When the chat message is sent or the post is submitted, move the upload to the appropriate folder (probably as part of posts.uploads.sync())
  • Save post uploads to public/uploads/post
  • Save chat uploads to public/uploads/chat
  • Save group covers to public/uploads/group
  • Fix the client-side code (that shows post association) to reference the new path
  • Access Controls
    • For any given upload, check to see if it is in any pid or mid. If so, check access privilege. Otherwise 403.
    • Remove privateUploads config property
  • Migration
    • Move all non-orphaned post uploads to the new folder
    • Read through all sent messages and associate images with mids
    • Move chat uploads to the new folder
    • Archive remaining files into a separate folder (for manual deletion)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.