Store uploaded audio in GridFS instead of base64 inside the File document
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
Read src/pages/api/files/index.js, src/pages/api/files/[id].js, and src/models/File.js, then trace the upload in src/pages/apps/musicplayer.js and the existing cases in tests/files.api.test.js. Start by checking the current upload and download flows and how MongoDB's GridFSBucket is used in the project. Done means large uploads work, Range requests stream only requested bytes, protections remain in place, existing tests pass with streaming, and the migration is documented.
索引モデルが issue の本文から書いたものです。
説明
New here? Say hi on Discord first, it's the fastest way to get help: https://discord.gg/NW2YZACf4k
Right now an uploaded song is stored as a base64 data URL in the content field of a File document. That works, but it has real limits:
- MongoDB documents max out at 16 MB, so we cap uploads at 8 MB, and base64 makes files about 33% bigger.
- Every request that loads the full
Filedocument drags the whole song along. GET /api/files/:iddecodes the entire file into memory even when the browser asks for a small byte range to seek.
Proposal
- Store binary files (audio, images) in GridFS using the MongoDB driver's
GridFSBucket. TheFiledocument keeps metadata and a reference such asgridfsId. - Make the upload a streaming
multipart/form-datarequest instead of JSON.multeris already a dependency. - Make
GET /api/files/:idstream from GridFS and pass Range requests through toopenDownloadStream(id, { start, end }). - Keep the existing protections from #120: an allow-list of inline content types,
nosniff, the sandbox CSP, and owner/collaborator checks. - Write a one-off migration script that moves existing base64 audio into GridFS.
Where: src/pages/api/files/index.js, src/pages/api/files/[id].js, src/models/File.js, and the upload in src/pages/apps/musicplayer.js.
Done when
- Uploads of 30–50 MB work.
- Seeking only reads the requested bytes.
- The existing tests in
tests/files.api.test.jsstill pass (adjusted for streaming). - The migration is documented in the PR.
This one is meatier. Talk it through on Discord before starting.
Comment "I'd like to take this" and we'll assign you. Questions are welcome in Discord: https://discord.gg/NW2YZACf4k
- 主要言語
- JavaScript
- スター
- 16
- フォーク
- 8
- 平均マージ
- 4時間 24分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codehubbers/OrbitOS のほかの issue
-
difficulty: easy good first issue security
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
codehubbers/OrbitOS#129 ·
メンテナーはふだん 1 日以内に返信
-
ci difficulty: easy documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codehubbers/OrbitOS#80 ·
メンテナーはふだん 1 日以内に返信
-
difficulty: easy documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
codehubbers/OrbitOS#79 ·
メンテナーはふだん 1 日以内に返信
-
difficulty: easy good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
codehubbers/OrbitOS#78 ·
メンテナーはふだん 1 日以内に返信
-
🎨 Add 5+ new high-quality wallpapers to the Settings app対応中かも @anshumanjadiya1102 が 1 日前に担当しました。 オープンdesign difficulty: easy frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
codehubbers/OrbitOS#75 ·
メンテナーはふだん 1 日以内に返信
codehubbers/OrbitOS の issue をすべて見る
似ている issue
-
flex-flow: wrap-reverse gets a vertical, reversed 2009 box fallback対応中かも @goranai が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
postcss/autoprefixer#1577 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
PranshulGG/WeatherMaster#1266 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
FEATURE REQUEST
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
linuxmint/cinnamon-spices-applets#9356 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
opnsense/plugins#5976 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信