Monday, 5 Nov 2007—At ISRI, we periodically have to
deliver some kind of file, be they software, reports, or just blobs
of data.
Handing a CD-ROM to FedFex is probably the default method—and is
required by some projects—but it’s always bugged me to do
something that annoying and slow when we have the Internet, like,
right there. Isn’t that what it’s for?
Email is a possibility, except for being broken; you never know what
crazy filter policy or just stupid Windows “enhancement” your code
is going to have to penetrate to get to it’s intended recipient.
There are fancy services now that make fetching some big file over
the web look a lot like email to the various parties. What do you
think a client that requires a CD-ROM, with a double-wrapper, baring
appropriate notices such as “Official Use Only” and “To be opened by
addressee only” is going to say about such a service? Yeah, me too.
So as expected, we’re back to our home web server; at least there we
have baked-in encryption and authentication. First pass: Use our
main web server. Put files somewhere with a .htaccess requiring a
password and HTTPS. It’s not only too heavy, but unmaintainable.
And you have to remember to remove everything after the recipient
has grabbed the files. Second pass: Look at various ad hoc web
servers. None of them are really that ad hoc; they usually serve
entire directories and are intended for more than single-shot.
Third pass: https-file-dist.
[~]0% ./https-file-dist -h
usage: https-file-dist [options] files...
Network options:
-a, --address SPEC Address and port to bind.
(default=0.0.0.0:8443)
Authentication options:
-u, --username USER Require username
-p, --password PASS Require password
--realm REALM Name of realm to send with Basic Auth req
(default=dexter.isri.unlv.edu)
Common options:
-h, -?, --help Show this message.
-v, --verbose [N] Set log level (0(fatal)<=N<=5(debug))
-V, --version Print program version and exit
It can:
- take a list of files instead of assuming you want everything under
some directory, - create an ad hoc self-signed certificate,
- require a username and password, which are specified on the
command line, encouraging you to pick different ones each time, - present a directory index (showing only the files you specified,
not the entire directory where they are), and - die when you hit
^C
Originally, I had a feature that it would automatically die after
every file was successfully fetched, but I realized that it was just
asking for trouble. Just sit on the phone and watch the log while
your other party fetches the files, then kill it. Redirect the log
to a file and you have a kind of pseudo-accounting even.