### CHANGELOG # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate - Fix suffix generation for pastes in non-HTTPS env [#1562](https://github.com/svenstaro/miniserve/pull/1562) (thanks @pzhlkj6612) ## [0.35.0] - 2026-04-08 - Add `--workers` to limit the number of workers and default to 4 [#1556](https://github.com/svenstaro/miniserve/issues/1556) ## [0.34.0] - 2026-04-07 - Add Ayu Dark theme [#1551](https://github.com/svenstaro/miniserve/pull/1551) (thanks @rysb-dev) - Add simple search/filter feature [#1505](https://github.com/svenstaro/miniserve/pull/1505) (thanks @7sDream) ## [0.33.0] - 2026-02-16 - Add `--log-color` to explicitly control when to print colors [#1529](https://github.com/svenstaro/miniserve/pull/1529) (thanks @MrCroxx) - Fix `--rm-files` not working with `--route-preifx` [#1531](https://github.com/svenstaro/miniserve/pull/1531) (thanks @Jianchi-Chen) - Add illumos builds [#1543](https://github.com/svenstaro/miniserve/pull/1543) - Ignore failure on file hash calculation during upload [#1542](https://github.com/svenstaro/miniserve/pull/1542) (thanks @outloudvi) - Add `--quiet` flag to reduce output and silence warnings [#1539](https://github.com/svenstaro/miniserve/pull/1539) (thanks @joshleeb) - Enable some markdown rendering extensions [#1545](https://github.com/svenstaro/miniserve/pull/1545) (thanks @duskmoon314) - Add `--pastebin` flag to enable pastebin form [#1546](https://github.com/svenstaro/miniserve/pull/1546) (thanks @rktjmp) - Always use forward slashes in zip files [#1534](https://github.com/svenstaro/miniserve/pull/1534) (thanks @pzhlkj6612) ## [0.32.0] - 2025-09-17 - Skip hash calculation when crypto.subtle is not available [#1507](https://github.com/svenstaro/miniserve/pull/1507) (thanks @outloudvi) - Fix hostname:port getting repeated in wget footer if TLS is used [#1515](https://github.com/svenstaro/miniserve/pull/1515) (thanks @xtay573269555) - Add `--chmod` to set file mode after upload on unix [#1506](https://github.com/svenstaro/miniserve/pull/1506) (thanks @lilydjwg) - Add `--rm-files` to allow file deletion [#1518](https://github.com/svenstaro/miniserve/pull/1518) (thanks @NOBLESSE and @cyqsimon) ## [0.31.0] - 2025-06-27 - Fix filtering symlinks when hosting WebDAV [#1502](https://github.com/svenstaro/miniserve/pull/1502) (thanks @ahti) - Enable renaming during file upload if duplicate exists [#1453](https://github.com/svenstaro/miniserve/pull/1453) (thanks @Atreyagaurav) ## [0.30.0] - 2025-06-26 - Add `--file-external-url` to generate links pointing to another server [#1492](https://github.com/svenstaro/miniserve/pull/1492) (thanks @jankeymeulen) - Add date pill and sort links for mobile views [#1473](https://github.com/svenstaro/miniserve/pull/1473) (thanks @Flat) - Add upload progress bar and allow for multiple concurrent file uploads [#1431](https://github.com/svenstaro/miniserve/pull/1431) (thanks @AlecDivito) - Add `--size-display` to allow for toggling file size display between `human` and `exact` [#1261](https://github.com/svenstaro/miniserve/pull/1261) (thanks @Lzzzzzt) - Add well-known healthcheck route at `/__miniserve_internal/healthcheck` (of `//__miniserve_internal/healthcheck` when using `--route-prefix`) - Add asynchronous recursive directory size counting [#1482](https://github.com/svenstaro/miniserve/pull/1482) - Add link to miniserve GitHub page to footer - Add `--directory-size` flag to enable directory size counting - Fix --no-symlinks not filtering files and dirs nested in symlinks [#1495](https://github.com/svenstaro/miniserve/pull/1495) (thanks @ahti) ## [0.29.0] - 2025-02-06 - Make URL encoding fully WHATWG-compliant [#1454](https://github.com/svenstaro/miniserve/pull/1454) (thanks @cyqsimon) - Fix `OVERWRITE_FILES` env var not being prefixed by `MINISERVE_` [#1457](https://github.com/svenstaro/miniserve/issues/1457) - Change `font-weight` of regular files to be `normal` to improve readability [#1471](https://github.com/svenstaro/miniserve/pull/1471) (thanks @shaicoleman) - Add webdav support [#1415](https://github.com/svenstaro/miniserve/pull/1415) (thanks @ahti) - Move favicon and css to stable, non-random routes [#1472](https://github.com/svenstaro/miniserve/pull/1472) (thanks @ahti) ## [0.28.0] - 2024-09-12 - Fix wrapping text in mobile view when the file name too long [#1379](https://github.com/svenstaro/miniserve/pull/1379) (thanks @chaibiq) - Fix missing drag-form when dragging file in to browser [#1390](https://github.com/svenstaro/miniserve/pull/1390) (thanks @chaibiq) - Improve documentation for the --header parameter [#1389](https://github.com/svenstaro/miniserve/pull/1389) (thanks @orwithout) - Don't show mkdir option when the directory is not upload allowed [#1442](https://github.com/svenstaro/miniserve/pull/1442) (thanks @Atreyagaurav) ## [0.27.1] - 2024-03-16 - Add `Add file and folder symbols` [#1365](https://github.com/svenstaro/miniserve/pull/1365) (thanks @chaibiq) ## [0.27.0] - 2024-03-16 - Add `-C/--compress-response` to enable response compression [1315](https://github.com/svenstaro/miniserve/pull/1315) (thanks @zuisong) - Refactor errors [#1331](https://github.com/svenstaro/miniserve/pull/1331) (thanks @cyqsimon) - Add `-I/--disable-inexing` [#1329](https://github.com/svenstaro/miniserve/pull/1329) (thanks @dyc3) ## [0.26.0] - 2024-01-13 - Properly handle read-only errors on Windows [#1310](https://github.com/svenstaro/miniserve/pull/1310) (thanks @ViRb3) - Use `tokio::fs` instead of `std::fs` to enable async file operations [#445](https://github.com/svenstaro/miniserve/issues/445) - Add `-S`/`--default-sorting-method` and `-O`/`--default-sorting-order` flags [#1308](https://github.com/svenstaro/miniserve/pull/1308) (thanks @ElliottLandsborough) ## [0.25.0] - 2024-01-07 - Add `--pretty-urls` [#1193](https://github.com/svenstaro/miniserve/pull/1193) (thanks @nlopes) - Fix single quote display with `--show-wget-footer` [#1191](https://github.com/svenstaro/miniserve/pull/1191) (thanks @d-air1) - Remove header Content-Encoding when archiving [#1290](https://github.com/svenstaro/miniserve/pull/1290) (thanks @5long) - Prevent illegal request path from crashing program [#1285](https://github.com/svenstaro/miniserve/pull/1285) (thanks @cyqsimon) - Fixed issue where serving files with a newline would fail [#1294](https://github.com/svenstaro/miniserve/issues/1294) ## [0.24.0] - 2023-07-06 - Fix ANSI color codes are printed when not a tty [#1095](https://github.com/svenstaro/miniserve/pull/1095) - Allow parameters to be provided via environment variables [#1160](https://github.com/svenstaro/miniserve/pull/1160) ## [0.23.2] - 2023-04-28 - Build Windows build with static CRT [#1107](https://github.com/svenstaro/miniserve/pull/1107) ## [0.23.1] - 2023-04-17 - Add EC key support [#1080](https://github.com/svenstaro/miniserve/issues/1080) ## [0.23.0] - 2023-03-01 - Update to clap v4 - Show localized datetime [#949](https://github.com/svenstaro/miniserve/pull/949) (thanks @IvkinStanislav) - Fix sorting breaks subdir downloading [#991](https://github.com/svenstaro/miniserve/pull/991) (thanks @Vam-Jam) - Fix wget footer [#1043](https://github.com/svenstaro/miniserve/pull/1043) (thanks @Yusuto) ## [0.22.0] - 2022-09-20 - Faster QR code generation [#848](https://github.com/svenstaro/miniserve/pull/848) (thanks @cyqsimon) - Make `--readme` support not only `README.md` but also `README` and `README.txt` rendered as plaintext [#911](https://github.com/svenstaro/miniserve/pull/911) (thanks @Atreyagaurav) - Change `-u/--upload-files` slightly in the sense that it can now either be provided by itself as before or receive a file path to restrict uploading to only that path. Can be provided multiple times for multiple allowed paths [#858](https://github.com/svenstaro/miniserve/pull/858) (thanks @jonasdiemer) ## [0.21.0] - 2022-09-15 - Fix bug where static files would be served incorrectly when using `--random-route` [#835](https://github.com/svenstaro/miniserve/pull/835) (thanks @solarknight) - Add `--readme` to render the README in the current directory after the file listing [#860](https://github.com/svenstaro/miniserve/pull/860) (thanks @Atreyagaurav) - Add more architectures (and also additional container images) ## [0.20.0] - 2022-06-26 - Fixed security issue where it was possible to upload files to locations pointed to by symlinks even when symlinks were disabled [#781](https://github.com/svenstaro/miniserve/pull/781) (thanks @sheepy0125) - Added `--hide-theme-selector` flag to hide the theme selector functionality in the frontend [#805](https://github.com/svenstaro/miniserve/pull/805https://github.com/svenstaro/miniserve/pull/805) (thanks @flamingoodev) - Added `--mkdir` flag to allow for uploading directories [#781](https://github.com/svenstaro/miniserve/pull/781) (thanks @sheepy0125) ## [0.19.5] - 2022-05-18 - Fix security issue where `--no-symlinks` would only hide symlinks from listing but it would still be possible to follow them if the path was known ## [0.19.4] - 2022-04-02 - Fix random route leaking on error pages [#764](https://github.com/svenstaro/miniserve/pull/764) (thanks @steffhip) ## [0.19.3] - 2022-03-15 - Allow to set the accept input attribute to arbitrary values using `-m` and `-M` [#755](https://github.com/svenstaro/miniserve/pull/755) (thanks @mayjs) ## [0.19.2] - 2022-02-21 - Add man page support via `--print-manpage` [#738](https://github.com/svenstaro/miniserve/pull/738) ## [0.19.1] - 2022-02-16 - Better MIME type guessing support due to updated mime_guess ## [0.19.0] - 2022-02-06 - Fix panic when using TLS in some instances [#670](https://github.com/svenstaro/miniserve/issues/670) (thanks @aliemjay) - Add `--route-prefix` to add a fixed route prefix [#728](https://github.com/svenstaro/miniserve/pull/728) (thanks @aliemjay and @Jikstra) - Allow tapping the whole row in mobile view [#729](https://github.com/svenstaro/miniserve/pull/729) ## [0.18.0] - 2021-10-26 - Add raw mode and raw mode footer display [#508](https://github.com/svenstaro/miniserve/pull/508) (thanks @Jikstra) - Add SPA mode [#515](https://github.com/svenstaro/miniserve/pull/515) (thanks @sinking-point) ## [0.17.0] - 2021-09-04 - Print QR codes on terminal [#524](https://github.com/svenstaro/miniserve/pull/524) (thanks @aliemjay) - Fix mobile layout info pills taking whole width [#591](https://github.com/svenstaro/miniserve/issues/591) - Fix security exploit when uploading is enabled [#590](https://github.com/svenstaro/miniserve/pull/590) [#518](https://github.com/svenstaro/miniserve/issues/518) (thanks @aliemjay) - Fix uploading to symlink directories [#590](https://github.com/svenstaro/miniserve/pull/590) [#466](https://github.com/svenstaro/miniserve/issues/466) (thanks @aliemjay) ## [0.16.0] - 2021-08-31 - Fix serving files with backslashes in their names [#578](https://github.com/svenstaro/miniserve/pull/578) (thanks @Jikstra) - Fix behavior of downloading symlinks by upgrading to actix-web 4 [#582](https://github.com/svenstaro/miniserve/pull/582) [#462](https://github.com/svenstaro/miniserve/issues/462) (thanks @aliemjay) - List directory if index file not found [#583](https://github.com/svenstaro/miniserve/pull/583) [#275](https://github.com/svenstaro/miniserve/pull/583) (thanks @aliemjay) - Add special colors for visited links [#521](https://github.com/svenstaro/miniserve/pull/521) (thanks @raffomania) - Switch from structopt to clap v3 [#587](https://github.com/svenstaro/miniserve/pull/587) This enables slightly nicer help output as well as much better completions. - Fix network interface handling [#500](https://github.com/svenstaro/miniserve/pull/500) [#470](https://github.com/svenstaro/miniserve/issues/470) [#405](https://github.com/svenstaro/miniserve/issues/405) [#422](https://github.com/svenstaro/miniserve/issues/422) (thanks @aliemjay) - Implement show symlink destination [#542](https://github.com/svenstaro/miniserve/pull/542) [#499](https://github.com/svenstaro/miniserve/issues/499) (thanks @deantvv) - Fix error page not being correctly themed [#529](https://github.com/svenstaro/miniserve/pull/529) [#588](https://github.com/svenstaro/miniserve/issues/588) (@aliemjay) ## [0.15.0] - 2021-08-27 - Add hardened systemd template unit file to `packaging/miniserve@.service` - Fix qrcodegen dependency problem [#568](https://github.com/svenstaro/miniserve/issues/568) - Remove animation on QR code hover (it was kind of annoying as it makes things less snappy) - Add TLS support [#576](https://github.com/svenstaro/miniserve/pull/576) ## [0.14.0] - 2021-04-18 - Fix breadcrumbs for right-to-left languages [#489](https://github.com/svenstaro/miniserve/pull/489) (thanks @aliemjay) - Fix URL percent encoding for special characters [#485](https://github.com/svenstaro/miniserve/pull/485) (thanks @aliemjay) - Wrap breadcrumbs at any char [#496](https://github.com/svenstaro/miniserve/pull/496) (thanks @aliemjay) - Add separate flags for compressed and uncompressed tar archives [#492](https://github.com/svenstaro/miniserve/pull/492) (thanks @deantvv) - Bump deps - Fix Firefox becoming confused when opening a `.gz` file directly [#160](https://github.com/svenstaro/miniserve/issues/160) - Prefer UTF8 for text responses [#263](https://github.com/svenstaro/miniserve/issues/263) - Resolve symlinks on directory listing [#479](https://github.com/svenstaro/miniserve/pull/479) (thanks @aliemjay) ## [0.13.0] - 2021-03-28 - Change default log level to `Warn` - Change some messages a bit to be more clear - Add `--print-completions` to print shell completions for various supported shells [#482](https://github.com/svenstaro/miniserve/pull/482) (thanks @rouge8) - Don't print some messages if not attached to an interactive terminal - Refuse to start if not attached to interactive terminal and no explicit path is provided This is a security consideration as you wouldn't want to run miniserve without an explicit path as a service. You could end up serving `/` or `/root` in case those working directories are set. ## [0.12.1] - 2021-03-27 - Fix QR code not showing when using both `--random-route` and `--qrcode` [#480](https://github.com/svenstaro/miniserve/pull/480) (thanks @rouge8) - Add FreeBSD binaries ## [0.12.0] - 2021-03-20 - Add option `-H`/`--hidden` to show hidden files - Start instantly in case an explicit index is chosen - Fix DoS issue when deliberately sending unconforming URL paths - Add footer [#456](https://github.com/svenstaro/miniserve/pull/456) (thanks @levaitamas) - Switched from failure to thiserror for error handling ## [0.11.0] - 2021-02-28 - Add binaries for more architectures - Upgrade lockfile which fixes some security issues - Allow multiple file upload [#434](https://github.com/svenstaro/miniserve/pull/434) (thanks @mhuesch) - Allow for setting custom headers via `--header` [#452](https://github.com/svenstaro/miniserve/pull/452) (thanks @deantvv) ## [0.10.4] - 2021-01-05 - Add `--dirs-first`/`-D` option to list directories first [#423](https://github.com/svenstaro/miniserve/pull/423) (thanks @levaitamas) ## [0.10.3] - 2020-11-09 - Actually fix publish workflow ## [0.10.2] - 2020-11-09 - Fix publish workflow ## [0.10.1] - 2020-11-09 - Now compiles on stable! :D ## [0.10.0] - 2020-10-02 - Add embedded favicon [#364](https://github.com/svenstaro/miniserve/issues/364) - Add `--title` option which can be used to set the page title [#378](https://github.com/svenstaro/miniserve/pull/378) (thanks @ahti) - Default title is now the same host received in the request [#378](https://github.com/svenstaro/miniserve/pull/378) (thanks @ahti) - Client-side color-scheme handling [#380](https://github.com/svenstaro/miniserve/pull/380) (thanks @ahti) ## [0.9.0] - 2020-09-16 - Added prebuilt binaries for AARCH64, ARMv7, and ARM [#350](https://github.com/svenstaro/miniserve/pull/350) - Remove percent-encoding in heading and title [#362](https://github.com/svenstaro/miniserve/pull/362) (thanks @ahti) - Make name ordering case-insensitive [#362](https://github.com/svenstaro/miniserve/pull/362) (thanks @ahti) - Give name column more space [#362](https://github.com/svenstaro/miniserve/pull/362) (thanks @ahti) - Fix double-escaping [#354](https://github.com/svenstaro/miniserve/issues/354) - Upgrade to actix-web 3.0 - Fix time display for files created "now" [#373](https://github.com/svenstaro/miniserve/pull/373) (thanks @imp and @KevCui) ## [0.8.0] - 2020-07-22 - Accept port 0 to find a random free port and use that [#327](https://github.com/svenstaro/miniserve/pull/327) (thanks @parrotmac) - Show QR code in interface [#330](https://github.com/svenstaro/miniserve/pull/330) (thanks @wyhaya) - Ported to actix-web 2 and futures 0.3 [#343](https://github.com/svenstaro/miniserve/pull/343) (thanks @equal-l2) ## [0.7.0] - 2020-05-14 - Add zip archiving [#297](https://github.com/svenstaro/miniserve/pull/297) (thanks @marawan31) ## [0.6.0] - 2020-03-14 - Add option to disable archives [#235](https://github.com/svenstaro/miniserve/pull/235) (thanks @DamianX) - Fix minor bug when using `--random-route` [#219](https://github.com/svenstaro/miniserve/pull/219) - Add a default index serving option [#189](https://github.com/svenstaro/miniserve/pull/189) ## [0.5.0] - 2019-06-24 - Add streaming download of tar archives (thanks @gyscos) - Add support for hashed passwords (thanks @KSXGitHub) - Add support for multiple auth flags (thanks @KSXGitHub) - Some theme related bug fixes (thanks @boastful-squirrel) [Unreleased]: https://github.com/svenstaro/miniserve/compare/v0.35.0...HEAD [0.35.0]: https://github.com/svenstaro/miniserve/compare/v0.34.0...v0.35.0 [0.34.0]: https://github.com/svenstaro/miniserve/compare/v0.33.0...v0.34.0 [0.33.0]: https://github.com/svenstaro/miniserve/compare/v0.32.0...v0.33.0 [0.32.0]: https://github.com/svenstaro/miniserve/compare/v0.31.0...v0.32.0 [0.31.0]: https://github.com/svenstaro/miniserve/compare/v0.30.0...v0.31.0 [0.30.0]: https://github.com/svenstaro/miniserve/compare/v0.29.0...v0.30.0 [0.29.0]: https://github.com/svenstaro/miniserve/compare/v0.28.0...v0.29.0 [0.28.0]: https://github.com/svenstaro/miniserve/compare/v0.27.1...v0.28.0 [0.27.1]: https://github.com/svenstaro/miniserve/compare/v0.27.0...v0.27.1 [0.27.0]: https://github.com/svenstaro/miniserve/compare/v0.26.0...v0.27.0 [0.26.0]: https://github.com/svenstaro/miniserve/compare/v0.25.0...v0.26.0 [0.25.0]: https://github.com/svenstaro/miniserve/compare/v0.24.0...v0.25.0 [0.24.0]: https://github.com/svenstaro/miniserve/compare/v0.23.2...v0.24.0 [0.23.2]: https://github.com/svenstaro/miniserve/compare/v0.23.1...v0.23.2 [0.23.1]: https://github.com/svenstaro/miniserve/compare/v0.23.0...v0.23.1 [0.23.0]: https://github.com/svenstaro/miniserve/compare/v0.22.0...v0.23.0 [0.22.0]: https://github.com/svenstaro/miniserve/compare/v0.21.0...v0.22.0 [0.21.0]: https://github.com/svenstaro/miniserve/compare/v0.20.0...v0.21.0 [0.20.0]: https://github.com/svenstaro/miniserve/compare/v0.19.5...v0.20.0 [0.19.5]: https://github.com/svenstaro/miniserve/compare/v0.19.4...v0.19.5 [0.19.4]: https://github.com/svenstaro/miniserve/compare/v0.19.3...v0.19.4 [0.19.3]: https://github.com/svenstaro/miniserve/compare/v0.19.2...v0.19.3 [0.19.2]: https://github.com/svenstaro/miniserve/compare/v0.19.1...v0.19.2 [0.19.1]: https://github.com/svenstaro/miniserve/compare/v0.19.0...v0.19.1 [0.19.0]: https://github.com/svenstaro/miniserve/compare/v0.18.0...v0.19.0 [0.18.0]: https://github.com/svenstaro/miniserve/compare/v0.17.0...v0.18.0 [0.17.0]: https://github.com/svenstaro/miniserve/compare/v0.16.0...v0.17.0 [0.16.0]: https://github.com/svenstaro/miniserve/compare/v0.15.0...v0.16.0 [0.15.0]: https://github.com/svenstaro/miniserve/compare/v0.14.0...v0.15.0 [0.14.0]: https://github.com/svenstaro/miniserve/compare/v0.13.0...v0.14.0 [0.13.0]: https://github.com/svenstaro/miniserve/compare/v0.12.1...v0.13.0 [0.12.1]: https://github.com/svenstaro/miniserve/compare/v0.12.0...v0.12.1 [0.12.0]: https://github.com/svenstaro/miniserve/compare/v0.11.0...v0.12.0 [0.11.0]: https://github.com/svenstaro/miniserve/compare/v0.10.4...v0.11.0 [0.10.4]: https://github.com/svenstaro/miniserve/compare/v0.10.3...v0.10.4 [0.10.3]: https://github.com/svenstaro/miniserve/compare/v0.10.2...v0.10.3 [0.10.2]: https://github.com/svenstaro/miniserve/compare/v0.10.1...v0.10.2 [0.10.1]: https://github.com/svenstaro/miniserve/compare/v0.10.0...v0.10.1 [0.10.0]: https://github.com/svenstaro/miniserve/compare/v0.9.0...v0.10.0 [0.9.0]: https://github.com/svenstaro/miniserve/compare/v0.8.0...v0.9.0 [0.8.0]: https://github.com/svenstaro/miniserve/compare/v0.7.0...v0.8.0 [0.7.0]: https://github.com/svenstaro/miniserve/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/svenstaro/miniserve/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/svenstaro/miniserve/compare/v0.4.0...v0.5.0 --- ### README

miniserve - a CLI tool to serve files and dirs over HTTP

# miniserve - a CLI tool to serve files and dirs over HTTP [](https://github.com/svenstaro/miniserve/actions) [](https://cloud.docker.com/repository/docker/svenstaro/miniserve/) [](https://crates.io/crates/miniserve) [](https://github.com/svenstaro/miniserve/blob/master/LICENSE) [](https://github.com/svenstaro/miniserve/stargazers) [](https://github.com/svenstaro/miniserve/releases) [](https://github.com/svenstaro/miniserve) **For when you really just want to serve some files over HTTP right now!** **miniserve** is a small, self-contained cross-platform CLI tool that allows you to just grab the binary and serve some file(s) via HTTP. Sometimes this is just a more practical and quick way than doing things properly. ## Screenshot ## How to use ### Serve a directory: miniserve linux-distro-collection/ ### Serve a single file: miniserve linux-distro.iso ### Set a custom index file to serve instead of a file listing: miniserve --index test.html ### Serve an SPA (Single Page Application) so that non-existent paths are forwarded to the SPA's router instead miniserve --spa --index index.html ### Require username/password: miniserve --auth joe:123 unreleased-linux-distros/ ### Require username/password as hash: pw=$(echo -n "123" | sha256sum | cut -f 1 -d ' ') miniserve --auth joe:sha256:$pw unreleased-linux-distros/ ### Require username/password from file (separate logins with new lines): miniserve --auth-file auth.txt unreleased-linux-distros/ ### Generate random 6-hexdigit URL: miniserve -i 192.168.0.1 --random-route /tmp # Serving path /private/tmp at http://192.168.0.1/c789b6 ### Bind to multiple interfaces: miniserve -i 192.168.0.1 -i 10.13.37.10 -i ::1 /tmp/myshare ### Insert custom headers miniserve --header "Cache-Control:no-cache" --header "X-Custom-Header:custom-value" -p 8080 /tmp/myshare # Check headers in another terminal curl -I http://localhost:8080 If a header is already set or previously inserted, it will not be overwritten. ### Start with TLS: miniserve --tls-cert my.cert --tls-key my.key /tmp/myshare # Fullchain TLS and HTTP Strict Transport Security (HSTS) miniserve --tls-cert fullchain.pem --tls-key my.key --header "Strict-Transport-Security: max-age=31536000; includeSubDomains; preload" /tmp/myshare If the parameter value has spaces, be sure to wrap it in quotes. (To achieve an A+ rating at https://www.ssllabs.com/ssltest/, enabling both fullchain TLS and HSTS is necessary.) ### Upload a file using `curl`: # in one terminal miniserve -u -- . # in another terminal curl -F "path=@$FILE" http://localhost:8080/upload\?path\=/ (where `$FILE` is the path to the file. This uses miniserve's default port of 8080) Note that for uploading, we have to use `--` to disambiguate the argument to `-u`. This is because `-u` can also take a path (or multiple). If a path argument to `-u` is given, uploading will only be possible to the provided paths as opposed to every path. Another effect of this is that you can't just combine flags like this `-uv` when `-u` is used. In this example, you'd need to use `-u -v`. ### Create a directory using `curl`: # in one terminal miniserve --upload-files --mkdir . # in another terminal curl -F "mkdir=$DIR_NAME" http://localhost:8080/upload\?path=\/ (where `$DIR_NAME` is the name of the directory. This uses miniserve's default port of 8080.) ### Use the raw renderer for use with simple viewers You can pass `?raw=true` with requests where you only require minimal HTML output for CLI-based browsers such as `lynx` or `w3m`. This is enabled by default without any extra flags: miniserve . curl http://localhost:8080?raw=true You can enable a convenient copy-pastable footer for `wget` using `--show-wget-footer`: miniserve --show-wget-footer . Afterwards, check the bottom of any rendered page. It'll have a neat `wget` command you can easily copy-paste to recursively grab the current directory. ### Use query parameter to do a simple filter You can pass a `?search=` query parameter to only show files and directories whose name contains the ``, for example: miniserve . # Then visit http://127.0.0.1:8080/src/?search=file This filter feature is case insensitive. ### Take pictures and upload them from smartphones: miniserve -u -m image -q This uses the `--media-type` option, which sends a hint for the expected media type to the browser. Some mobile browsers like Firefox on Android will offer to open the camera app when seeing this. ## Features - Easy to use - Just works: Correct MIME types handling out of the box - Single binary drop-in with no extra dependencies required - Authentication support with username and password (and hashed password) - Mega fast and highly parallel (thanks to [Rust](https://www.rust-lang.org/) and [Actix](https://actix.rs/)) - Search/filter by file or directory name - Folder download (compressed on the fly as `.tar.gz` or `.zip`) - File uploading - Directory creation - Pretty themes (with light and dark theme support) - Scan QR code for quick access - Shell completions - Sane and secure defaults - TLS (for supported architectures) - Supports README.md rendering like on GitHub - Range requests - WebDAV support - Healthcheck route (at `/__miniserve_internal/healthcheck`) ## Usage ``` /* Detailed source-code truncated for AI context efficiency. */ ``` ## How to install Packaging status **On Linux**: Download `miniserve-linux` from [the releases page](https://github.com/svenstaro/miniserve/releases) and run chmod +x miniserve-linux ./miniserve-linux Alternatively, if you are on **Arch Linux**, you can do pacman -S miniserve On [Termux](https://termux.com/) pkg install miniserve **On OSX**: Download `miniserve-osx` from [the releases page](https://github.com/svenstaro/miniserve/releases) and run chmod +x miniserve-osx ./miniserve-osx Alternatively install with [Homebrew](https://brew.sh/): brew install miniserve miniserve **On Windows**: Download `miniserve-win.exe` from [the releases page](https://github.com/svenstaro/miniserve/releases) and run miniserve-win.exe Alternatively install with [Scoop](https://scoop.sh/): scoop install miniserve **With Cargo**: Make sure you have a recent version of Rust. Then you can run cargo install --locked miniserve miniserve **With Docker:** Make sure the Docker daemon is running and then run docker run -v /tmp:/tmp -p 8080:8080 --rm -it docker.io/svenstaro/miniserve /tmp **With Podman:** Just run podman run -v /tmp:/tmp -p 8080:8080 --rm -it docker.io/svenstaro/miniserve /tmp **With Helm:** See [this third-party Helm chart](https://codeberg.org/wrenix/helm-charts/src/branch/main/miniserve) by @wrenix. ## Shell completions If you'd like to make use of the built-in shell completion support, you need to run `miniserve --print-completions ` and put the completions in the correct place for your shell. A few examples with common paths are provided below: # For bash miniserve --print-completions bash > ~/.local/share/bash-completion/completions/miniserve # For zsh miniserve --print-completions zsh > /usr/local/share/zsh/site-functions/_miniserve # For fish miniserve --print-completions fish > ~/.config/fish/completions/miniserve.fish ## systemd A hardened systemd-compatible unit file can be found in `packaging/miniserve@.service`. You could install this to `/etc/systemd/system/miniserve@.service` and start and enable `miniserve` as a daemon on a specific serve path `/my/serve/path` like this: systemctl enable --now miniserve@-my-serve-path Keep in mind that you'll have to use `systemd-escape` to properly escape a path for this usage. In case you want to customize the particular flags that miniserve launches with, you can use systemctl edit miniserve@-my-serve-path and set the `[Service]` part in the resulting `override.conf` file. For instance: [Service] ExecStart= ExecStart=/usr/bin/miniserve --enable-tar --enable-zip --no-symlinks --verbose -i ::1 -p 1234 --title hello --color-scheme monokai --color-scheme-dark monokai -- %I Make sure to leave the `%I` at the very end in place or the wrong path might be served. Alternatively, you can configure the service via environment variables: [Service] Environment=MINISERVE_ENABLE_TAR=true Environment=MINISERVE_ENABLE_ZIP=true Environment="MINISERVE_TITLE=hello world" ... You might additionally have to override `IPAddressAllow` and `IPAddressDeny` if you plan on making miniserve directly available on a public interface. ## Binding behavior For convenience reasons, miniserve will try to bind on all interfaces by default (if no `-i` is provided). It will also do that if explicitly provided with `-i 0.0.0.0` or `-i ::`. In all of the aforementioned cases, it will bind on both IPv4 and IPv6. If provided with an explicit non-default interface, it will ONLY bind to that interface. You can provide `-i` multiple times to bind to multiple interfaces at the same time. ## Why use this over alternatives? - darkhttpd: Not easily available on Windows and it's not as easy as download-and-go. - Python built-in webserver: Need to have Python installed, it's low performance, and also doesn't do correct MIME type handling in some cases. - netcat: Not as convenient to use and sending directories is [somewhat involved](https://nakkaya.com/2009/04/15/using-netcat-for-file-transfers/). ## Releasing This is mostly a note for me on how to release this thing: - Make sure [CHANGELOG.md](./CHANGELOG.md) is up to date. - `cargo release ` - `cargo release --execute ` - Releases will automatically be deployed by GitHub Actions. - Update Arch package. ---