Medlar/README.md
2026-11-26 13:05:38 -06:00

81 lines
4.8 KiB
Markdown

# Medlar
A download manager for Linux, written in Rust with egui. Downloads are split into dynamic parts and can be paused, resumed
and continued from a new link. The interface follows Material You (M3 Expressive). Version 0.1.1 fixes names, copy and speed, and adds a snail button.
![Main window after a finished download](docs/img/main.png)
![Add dialog](docs/img/add.png)
Both pictures come from a real run of the release build in a hidden session (software rendering).
## What it does
- HTTP and HTTPS in up to 16 dynamic parts, resume after a crash or restart, error recovery, mirrors, checksums.
- FTP, FTPS and SFTP; HLS and DASH streams; Metalink.
- Speed limits (global and per download), priorities, queues, a schedule and "when done" actions.
- A local port, `127.0.0.1:17616`, that takes links from browsers (Nacre's JSON). See [docs/CONNECTOR.md](docs/CONNECTOR.md).
- Video sites through `yt-dlp` (with `ffmpeg`), if both are installed.
- Clipboard watcher, rules, tags and notes, tray icon, one running copy only.
The full list and its state: [docs/FEATURES.md](docs/FEATURES.md) and [docs/FEATURES-CHECK.md](docs/FEATURES-CHECK.md).
## Install
Needs a Linux x86_64 desktop with Wayland or X11, and glibc 2.44 or newer (see "Requirements").
**AppImage:** `chmod +x Medlar-0.1.1-x86_64.AppImage && ./Medlar-0.1.1-x86_64.AppImage`
**tar.gz:** `tar xzf Medlar-0.1.1-Linux-x86_64.tar.gz && cd medlar-0.1.1 && ./install.sh`
installs into `~/.local` (binary, desktop file, icon; no root). `./uninstall.sh` removes it; `./uninstall.sh --purge` also
removes settings and the download list (downloaded files stay).
**installer.sh:** `./installer.sh Medlar-0.1.1-Linux-x86_64.tar.gz` (or with no file: it uses a tar.gz or AppImage beside it).
`--user` (default, `~/.local`) or `--system` (`/usr/local`, sudo only for the copy); `--prefix DIR` picks another folder.
Checks `SHA256SUMS-*` beside the file and refuses glibc older than 2.44. Sets the `medlar:` link handler (user install).
`./installer.sh --uninstall [--purge]` removes it again (`--system` for a system install).
**Arch Linux:** `sudo pacman -U Medlar-0.1.1-arch-x86_64.pkg.tar.zst` (package `medlar-bin`). To build it yourself:
`cd packaging/arch && makepkg -si` (downloads the tar.gz) or `MEDLAR_TARBALL=file:///path/to/Medlar-0.1.1-Linux-x86_64.tar.gz makepkg -si`.
Check the download against `SHA256SUMS-0.1.1`: `sha256sum -c SHA256SUMS-0.1.1`.
**Portable mode:** put a file called `portable` beside `bin/medlar` (tar.gz) or beside the `.AppImage`. Everything is then
kept in a `medlar-data/` folder next to it. `MEDLAR_HOME=<dir>` sets the folder directly and wins over both.
## Requirements
- The binary links only `libc`, `libm` and `libgcc_s` (glibc). Nothing from the system is bundled.
- It was built on Arch Linux with glibc 2.44, and it uses math functions that glibc added in 2.43 and 2.44. **Lowest
supported glibc: 2.44.** It will not start on older distributions. A build for older systems needs an older build host.
It was not tested on any other system.
- Wayland or X11 and a GPU driver (OpenGL) or software rendering.
- Optional: `yt-dlp` and `ffmpeg` on `PATH` for video sites. Medlar does not bundle them (that would add tens of MB and
they go out of date quickly). Without them, everything else works and video links give a plain message.
## Browser steps
1. Start Medlar once and finish or skip the first-run pages. The port is `127.0.0.1:17616` (Settings, Browser).
2. In Nacre (or any program that can POST JSON), set the download-manager address to `http://127.0.0.1:17616/`.
3. Send a link. Medlar shows the Add dialog unless you turned that off.
4. Test by hand: `curl -s -H 'Content-Type: application/json' -d '{"url":"https://example.com/a.zip"}' http://127.0.0.1:17616/`
Requests with a web `Origin` or a foreign `Host` are refused, and no CORS headers are sent.
## Limits and known gaps
Honest state of 0.1.1. The engine is tested hard (unit, integration, fuzz, a 20-minute fault soak with 606 files and no
corrupt one). The interface is tested less.
- The hidden-window user journeys (pause, restart, expired link, schedule) were tested at engine level only, not by
clicking through the window.
- Many screen and motion checks were not run (the details panel, motion audit, drag and drop in the window).
- Video: `yt-dlp` was tested against a stub, not against a real site. Browser cookies and the global speed limit are
not passed to `yt-dlp`.
- The Control sheet is clipped at 480x360 (no scroll).
- The "when done" power call was not run against a fake logind.
- Not built or tested for other CPUs or other libc. No Windows or macOS version.
## Build from source
`cargo build --release -p medlar` (Rust 1.99, edition 2024). `tools/package.sh` makes the tar.gz, the AppImage and the
checksums in `dist/`. Tests: `cargo test --workspace -j 2`. Licence: MIT. Font: Rubik (OFL, `assets/Rubik-OFL.txt`).