diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 275 |
1 files changed, 151 insertions, 124 deletions
@@ -47,6 +47,10 @@ Sometimes this is just a more practical and quick way than doing things properly 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: @@ -113,203 +117,226 @@ Some mobile browsers like Firefox on Android will offer to open the camera app w ## Usage - For when you really just want to serve some files over HTTP right now! +``` +For when you really just want to serve some files over HTTP right now! + +Usage: miniserve [OPTIONS] [PATH] + +Arguments: + [PATH] + Which path to serve + + [env: MINISERVE_PATH=] + +Options: + -v, --verbose + Be verbose, includes emitting access logs + + [env: MINISERVE_VERBOSE=] + + --index <INDEX> + The name of a directory index file to serve, like "index.html" + + Normally, when miniserve serves a directory, it creates a listing for that directory. However, if a directory + contains this file, miniserve will serve that file instead. + + [env: MINISERVE_INDEX=] + + --spa + Activate SPA (Single Page Application) mode - Usage: miniserve [OPTIONS] [PATH] + This will cause the file given by --index to be served for all non-existing file paths. In effect, this will serve + the index file whenever a 404 would otherwise occur in order to allow the SPA router to handle the request instead. - Arguments: - [PATH] - Which path to serve + [env: MINISERVE_SPA=] - [env: MINISERVE_PATH=] + --pretty-urls + Activate Pretty URLs mode - Options: - -v, --verbose - Be verbose, includes emitting access logs + This will cause the server to serve the equivalent `.html` file indicated by the path. - [env: MINISERVE_VERBOSE=] + `/about` will try to find `about.html` and serve it. - --index <INDEX> - The name of a directory index file to serve, like "index.html" + [env: MINISERVE_PRETTY_URLS=] - Normally, when miniserve serves a directory, it creates a listing for that directory. - However, if a directory contains this file, miniserve will serve that file instead. + -p, --port <PORT> + Port to use - [env: MINISERVE_INDEX=] + [env: MINISERVE_PORT=] + [default: 8080] - --spa - Activate SPA (Single Page Application) mode + -i, --interfaces <INTERFACES> + Interface to listen on - This will cause the file given by --index to be served for all non-existing file paths. In - effect, this will serve the index file whenever a 404 would otherwise occur in order to - allow the SPA router to handle the request instead. + [env: MINISERVE_INTERFACE=] - [env: MINISERVE_SPA=] + -a, --auth <AUTH> + Set authentication - -p, --port <PORT> - Port to use + Currently supported formats: + username:password, username:sha256:hash, username:sha512:hash + (e.g. joe:123, joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3) - [env: MINISERVE_PORT=] - [default: 8080] + [env: MINISERVE_AUTH=] - -i, --interfaces <INTERFACES> - Interface to listen on + --auth-file <AUTH_FILE> + Read authentication values from a file - [env: MINISERVE_INTERFACE=] + Example file content: - -a, --auth <AUTH> - Set authentication. Currently supported formats: username:password, username:sha256:hash, - username:sha512:hash (e.g. joe:123, - joe:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3) + joe:123 + bob:sha256:a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3 + bill: - [env: MINISERVE_AUTH=] + [env: MINISERVE_AUTH_FILE=] - --route-prefix <ROUTE_PREFIX> - Use a specific route prefix + --route-prefix <ROUTE_PREFIX> + Use a specific route prefix - [env: MINISERVE_ROUTE_PREFIX=] + [env: MINISERVE_ROUTE_PREFIX=] - --random-route - Generate a random 6-hexdigit route + --random-route + Generate a random 6-hexdigit route - [env: MINISERVE_RANDOM_ROUTE=] + [env: MINISERVE_RANDOM_ROUTE=] - -P, --no-symlinks - Hide symlinks in listing and prevent them from being followed + -P, --no-symlinks + Hide symlinks in listing and prevent them from being followed - [env: MINISERVE_NO_SYMLINKS=] + [env: MINISERVE_NO_SYMLINKS=] - -H, --hidden - Show hidden files + -H, --hidden + Show hidden files - [env: MINISERVE_HIDDEN=] + [env: MINISERVE_HIDDEN=] - -c, --color-scheme <COLOR_SCHEME> - Default color scheme + -c, --color-scheme <COLOR_SCHEME> + Default color scheme - [env: MINISERVE_COLOR_SCHEME=] - [default: squirrel] - [possible values: squirrel, archlinux, zenburn, monokai] + [env: MINISERVE_COLOR_SCHEME=] + [default: squirrel] + [possible values: squirrel, archlinux, zenburn, monokai] - -d, --color-scheme-dark <COLOR_SCHEME_DARK> - Default color scheme + -d, --color-scheme-dark <COLOR_SCHEME_DARK> + Default color scheme - [env: MINISERVE_COLOR_SCHEME_DARK=] - [default: archlinux] - [possible values: squirrel, archlinux, zenburn, monokai] + [env: MINISERVE_COLOR_SCHEME_DARK=] + [default: archlinux] + [possible values: squirrel, archlinux, zenburn, monokai] - -q, --qrcode - Enable QR code display + -q, --qrcode + Enable QR code display - [env: MINISERVE_QRCODE=] + [env: MINISERVE_QRCODE=] - -u, --upload-files [<ALLOWED_UPLOAD_DIR>] - Enable file uploading (and optionally specify for which directory) + -u, --upload-files [<ALLOWED_UPLOAD_DIR>] + Enable file uploading (and optionally specify for which directory) - [env: MINISERVE_ALLOWED_UPLOAD_DIR=] + [env: MINISERVE_ALLOWED_UPLOAD_DIR=] - -U, --mkdir - Enable creating directories + -U, --mkdir + Enable creating directories - [env: MINISERVE_MKDIR_ENABLED=] + [env: MINISERVE_MKDIR_ENABLED=] - -m, --media-type <MEDIA_TYPE> - Specify uploadable media types + -m, --media-type <MEDIA_TYPE> + Specify uploadable media types - [env: MINISERVE_MEDIA_TYPE=] - [possible values: image, audio, video] + [env: MINISERVE_MEDIA_TYPE=] + [possible values: image, audio, video] - -M, --raw-media-type <MEDIA_TYPE_RAW> - Directly specify the uploadable media type expression + -M, --raw-media-type <MEDIA_TYPE_RAW> + Directly specify the uploadable media type expression - [env: MINISERVE_RAW_MEDIA_TYPE=] + [env: MINISERVE_RAW_MEDIA_TYPE=] - -o, --overwrite-files - Enable overriding existing files during file upload + -o, --overwrite-files + Enable overriding existing files during file upload - [env: OVERWRITE_FILES=] + [env: OVERWRITE_FILES=] - -r, --enable-tar - Enable uncompressed tar archive generation + -r, --enable-tar + Enable uncompressed tar archive generation - [env: MINISERVE_ENABLE_TAR=] + [env: MINISERVE_ENABLE_TAR=] - -g, --enable-tar-gz - Enable gz-compressed tar archive generation + -g, --enable-tar-gz + Enable gz-compressed tar archive generation - [env: MINISERVE_ENABLE_TAR_GZ=] + [env: MINISERVE_ENABLE_TAR_GZ=] - -z, --enable-zip - Enable zip archive generation + -z, --enable-zip + Enable zip archive generation - WARNING: Zipping large directories can result in out-of-memory exception because zip - generation is done in memory and cannot be sent on the fly + WARNING: Zipping large directories can result in out-of-memory exception because zip generation is done in memory + and cannot be sent on the fly - [env: MINISERVE_ENABLE_ZIP=] + [env: MINISERVE_ENABLE_ZIP=] - -D, --dirs-first - List directories first + -D, --dirs-first + List directories first - [env: MINISERVE_DIRS_FIRST=] + [env: MINISERVE_DIRS_FIRST=] - -t, --title <TITLE> - Shown instead of host in page title and heading + -t, --title <TITLE> + Shown instead of host in page title and heading - [env: MINISERVE_TITLE=] + [env: MINISERVE_TITLE=] - --header <HEADER> - Set custom header for responses + --header <HEADER> + Set custom header for responses - [env: MINISERVE_HEADER=] + [env: MINISERVE_HEADER=] - -l, --show-symlink-info - Visualize symlinks in directory listing + -l, --show-symlink-info + Visualize symlinks in directory listing - [env: MINISERVE_SHOW_SYMLINK_INFO=] + [env: MINISERVE_SHOW_SYMLINK_INFO=] - -F, --hide-version-footer - Hide version footer + -F, --hide-version-footer + Hide version footer - [env: MINISERVE_HIDE_VERSION_FOOTER=] + [env: MINISERVE_HIDE_VERSION_FOOTER=] - --hide-theme-selector - Hide theme selector + --hide-theme-selector + Hide theme selector - [env: MINISERVE_HIDE_THEME_SELECTOR=] + [env: MINISERVE_HIDE_THEME_SELECTOR=] - -W, --show-wget-footer - If enabled, display a wget command to recursively download the current directory + -W, --show-wget-footer + If enabled, display a wget command to recursively download the current directory - [env: MINISERVE_SHOW_WGET_FOOTER=] + [env: MINISERVE_SHOW_WGET_FOOTER=] - --print-completions <shell> - Generate completion file for a shell + --print-completions <shell> + Generate completion file for a shell - [possible values: bash, elvish, fish, powershell, zsh] + [possible values: bash, elvish, fish, powershell, zsh] - --print-manpage - Generate man page + --print-manpage + Generate man page - --tls-cert <TLS_CERT> - TLS certificate to use + --tls-cert <TLS_CERT> + TLS certificate to use - [env: MINISERVE_TLS_CERT=] + [env: MINISERVE_TLS_CERT=] - --tls-key <TLS_KEY> - TLS private key to use + --tls-key <TLS_KEY> + TLS private key to use - [env: MINISERVE_TLS_KEY=] + [env: MINISERVE_TLS_KEY=] - --readme - Enable README.md rendering in directories + --readme + Enable README.md rendering in directories - [env: MINISERVE_README=] + [env: MINISERVE_README=] - -h, --help - Print help (see a summary with '-h') + -h, --help + Print help (see a summary with '-h') - -V, --version - Print version + -V, --version + Print version +``` ## How to install |