docs.rs
docs.rs copied to clipboard
Filtering uploaded files
When dealing with crates, the site should check that they are a sane size, and file type before uploading them. Ex: 100gb video should be blocked.
Relevant code: https://github.com/rust-lang/docs.rs/blob/master/src/db/file.rs#L190
What seems like a reasonable file size limit @jyn514?
From what I understand, a 100 GB video file could only end up in docs.rs, if it was previously uploaded to crates.io too, which I assume has reasonable limits.
I could imagine that macro generated docs could reach sizes that are bigger (megabytes?), so some limit is perhaps helpful to releave the server.