raw
current commit
261026.49 · README holds what www is, usage, install and a list of docs

Options and environment

www --help prints the options in short. Here is each in full.

Options follow GNU style. Short ones combine, as in -pa 127.31.1.2, and options may follow the directory. Optional values go joined, as in --share=192.168.1.5; with a space the address would be read as the directory, and www says so. -f and -n mean force and dry run in every tool of the author’s, so --foreground and --no-open have no short form. The help text is written in docopt notation, except that docopt has no way to write the optional =HOST.

--list and --kill print keyval: three lines per tree, sorted, with every index the same width. The binary line is missing for a server that started before www recorded it.

tree.0.binary /usr/bin/www
tree.0.dir /home/t/keep/notes
tree.0.url http://127.31.1.1/keep/notes/
tree.1.binary /home/t/scratch/github.com/unixfile/www/build/www
tree.1.dir /home/t/scratch/github.com/unixfile/www
tree.1.url http://127.31.1.1:8080/scratch/github.com/unixfile/www/

Two variables set the default addresses. --help shows each value and where it comes from, and an error from a bad value names its variable.

A third sets how a start opens its URL. WWW_OPEN holds the command, split at spaces, with %s where the URL goes, or the URL appended when no %s is given. WWW_OPEN='brave-browser --app=%s' opens a tree in an app window and WWW_OPEN=firefox in Firefox. It applies to loopback starts only; a share opens through xdg-open, as every start does without the variable.

A fourth holds a share’s token. WWW_SECRET gives --secret a token of letters, digits, - and _ instead of a random one. The token never goes on the command line, where ps shows it to every local user and the shell keeps it in its history, so --secret=token fails with E22. --help says whether the variable is set but never shows its value.