From c85c0653f548d0bdf1aba9673104ee7f3f33f418 Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Mon, 18 Nov 2024 00:07:44 +0000 Subject: [PATCH] added USAGE.md --- README.md | 67 +++++++++++++++++++++++++++++-------------------------- USAGE.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 32 deletions(-) create mode 100644 USAGE.md diff --git a/README.md b/README.md index ee44ea2..9f839d2 100644 --- a/README.md +++ b/README.md @@ -25,34 +25,28 @@ If you only want to access a single file, there is also a simplified Single File Mode. This can be especially useful if the web server does not present a HTTP directory listing. -## Installation - -Please note if you install HTTDirFS from a repository, it can be outdated. - -### Debian 12 "Bookworm" - -HTTPDirFS is available as a package in Debian 12 "Bookworm", If you are on -Debian Bookworm, you can simply run the following -command as ``root``: +## Usage +Basic usage: - apt install httpdirfs + ./httpdirfs -f --cache $URL $MOUNT_POINT -For more information on the status of HTTDirFS in Debian, please refer to -[Debian package tracker](https://tracker.debian.org/pkg/httpdirfs-fuse) +An example URL would be +[Debian CD Image Server](https://cdimage.debian.org/debian-cd/). The ``-f`` flag +keeps the program in the foreground, which is useful for monitoring which URL +the filesystem is visiting. -### Arch Linux +For more usage related help, run -HTTPDirFS is available in the -[Arch User Repository](https://aur.archlinux.org/packages/httpdirfs). + ./httpdirfs --help -### NixOS +or -HTTPDirFS is available as a [package](https://mynixos.com/nixpkgs/package/httpdirfs). + man httpdirfs -### FreeBSD +Please note that the man page only works if you have installed HTTPDirFS +properly. -HTTPDirFS is available in the -[FreeBSD Ports Collection](https://www.freshports.org/sysutils/fusefs-httpdirfs/). +The full usage flags is also documented in the [usage](USAGE.md) page. ## Compilation @@ -98,25 +92,34 @@ for these operating systems in the README for now. Please feel free to send me a pull request to add them back in. It is known that HTTPDirFS [does compile](https://github.com/fangfufu/httpdirfs/issues/165) on FreeBSD. -## Usage +## Installation - ./httpdirfs -f --cache $URL $MOUNT_POINT +Please note if you install HTTDirFS from a repository, it can be outdated. -An example URL would be -[Debian CD Image Server](https://cdimage.debian.org/debian-cd/). The ``-f`` flag -keeps the program in the foreground, which is useful for monitoring which URL -the filesystem is visiting. +### Debian 12 "Bookworm" -For more usage related help, run +HTTPDirFS is available as a package in Debian 12 "Bookworm", If you are on +Debian Bookworm, you can simply run the following +command as ``root``: - ./httpdirfs --help + apt install httpdirfs -or +For more information on the status of HTTDirFS in Debian, please refer to +[Debian package tracker](https://tracker.debian.org/pkg/httpdirfs-fuse) - man httpdirfs +### Arch Linux -Please note that the man page only works if you have installed HTTPDirFS -properly. +HTTPDirFS is available in the +[Arch User Repository](https://aur.archlinux.org/packages/httpdirfs). + +### NixOS + +HTTPDirFS is available as a [package](https://mynixos.com/nixpkgs/package/httpdirfs). + +### FreeBSD + +HTTPDirFS is available in the +[FreeBSD Ports Collection](https://www.freshports.org/sysutils/fusefs-httpdirfs/). ## Airsonic / Subsonic server support diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..b74698c --- /dev/null +++ b/USAGE.md @@ -0,0 +1,61 @@ +## HTTPDirFS Usage +As of commit +[9e750b9b0552bb7e072e97a9f29eba7656f77444](https://github.com/fangfufu/httpdirfs/commit/9e750b9b0552bb7e072e97a9f29eba7656f77444), +HTTPDirFS supports the following usage flags: + + usage: ./httpdirfs [options] URL mountpoint + + general options: + --config Specify a configuration file + -o opt,[opt...] Mount options + -h --help Print help + -V --version Print version + + HTTPDirFS options: + -u --username HTTP authentication username + -p --password HTTP authentication password + -P --proxy Proxy for libcurl, for more details refer to + https://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html + --proxy-username Username for the proxy + --proxy-password Password for the proxy + --proxy-cacert Certificate authority for the proxy + --cache Enable cache (default: off) + --cache-location Set a custom cache location + (default: "${XDG_CACHE_HOME}/httpdirfs") + --cache-clear Delete the cache directory or the custom location + specifid with `--cache-location`, if the option is + seen first. Then exit in either case. + --cacert Certificate authority for the server + --dl-seg-size Set cache download segment size, in MB (default: 8) + Note: this setting is ignored if previously + cached data is found for the requested file. + --http-header Set one or more HTTP headers + --max-seg-count Set maximum number of download segments a file + can have. (default: 128*1024) + With the default setting, the maximum memory usage + per file is 128KB. This allows caching files up + to 1TB in size using the default segment size. + --max-conns Set maximum number of network connections that + libcurl is allowed to make. (default: 10) + --refresh-timeout The directories are refreshed after the specified + time, in seconds (default: 3600) + --retry-wait Set delay in seconds before retrying an HTTP request + after encountering an error. (default: 5) + --user-agent Set user agent string (default: "HTTPDirFS") + --no-range-check Disable the built-in check for the server's support + for HTTP range requests + --zero-len-is-dir If a file has a zero length, treat it as a directory + --insecure-tls Disable licurl TLS certificate verification by + setting CURLOPT_SSL_VERIFYHOST to 0 + --single-file-mode Single file mode - rather than mounting a whole + directory, present a single file inside a virtual + directory. + + For mounting a Airsonic / Subsonic server: + --sonic-username The username for your Airsonic / Subsonic server + --sonic-password The password for your Airsonic / Subsonic server + --sonic-id3 Enable ID3 mode - this present the server content in + Artist/Album/Song layout + --sonic-insecure Authenticate against your Airsonic / Subsonic server + using the insecure username / hex encoded password + scheme