libmagic is too buggy to be used in Pleroma
Environment
- Installation type (OTP or From Source): sauce
- Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE): latest dev
- Elixir version (
elixir -v
for from source installations, N/A for OTP): 1.10.4 (Erlang OTP 23) - Operating system: Ubuntu 20.04
- PostgreSQL version (
psql -V
): 12.4
Bug description
On some common media files that I mostly encounter reposted from Telegram, libmagic gives wrong MIME type.
Example file: http://share.mentality.rip/test.bin
It's actually an AVC1 stream inside of MP4 container and can be detected with ffprobe. But Pleroma, thanks to libmagic, sets wrong media type in the API and renames file from .mp4 to .bin.
libmagic version 5.38-4 from Ubuntu repos.
Edited by a1batross