cloudreve / Cloudreve

🌩支持多家云存储的云盘系统 (Self-hosted file management and sharing system, supports multiple storage providers)
https://cloudreve.org
GNU General Public License v3.0
21.46k stars 3.38k forks source link

[Allow Custom CDN Host / Stream Download Filename Setting] #1785

Closed YUDONGLING closed 1 week ago

YUDONGLING commented 1 year ago

Describe the solution you'd like

  1. Allow custom CDN host for static files, such as /static, etc.
  2. Allow custom setting for the PDF.js and StreamDownload.js host for better user experience, such as bytedance ( https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/pdf.js/2.1.266/pdf.worker.js) or just all it to cloudreve itself.
  3. Allow custom setting for the stream download filename.
YUDONGLING commented 1 year ago

For Cloudreve 3.X, you can directly change the static files as steps below, without building the frontend yourself:

In file ./static/js/pdf.________.chunk.js, change i.pdfjs.GlobalWorkerOptions.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(i.pdfjs.version,"/pdf.worker.js"); to i.pdfjs.GlobalWorkerOptions.workerSrc="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/pdf.js/".concat(i.pdfjs.version,"/pdf.worker.js");. The CDN host is provided by bytedance and you can get it from cdn.bytedance.com.

In file ./static/js/6.________.chunk.js, change https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0 to {yourCDNHost}/mitm.html?version=2.0.0. You should download StreamSaver.js and upload it.

In file ./static/js/main.________.chunk.js, change p=u.a.createWriteStream("archive.zip") to p=u.a.createWriteStream("{yourCustomStreamDownloadFilename}.zip")

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.