Web tail
- display last part of a file. This is a io-redirect of the OS native spawn implementation of the GNU tool tail
. It provides an express server to wrap an .io socket. SSL/TLS, authentication, and custom CSS handlers can be used.
npm install -g shadowbq-node-tail
Create your own private key and certificate for the server, read more.
The server will attempt to use TLS/SSL if cert and key are made available. Alternatively, you can use --skip_tls
to use http.
Indicate your private key and certificate paths with the command parameters --cert
and --key
.
Usage: node-tail [options] file
Options:
-h, --help output usage information
-V, --version output the version number
-n, --lines <lines> output the last NUM lines, instead of the last 10
--retry keep trying to open a file if it is inaccessible
-H, --host <host> custom Hostname
-p, --port <port> custom port
--cert <cert> https server cert file path
--key <key> https server key file path
--skip_tls use http instead of https
--rotatable use new files if rotatable
-m, --mode <mode> log display mode
-s, --secret <secret> string used for signing cookies
--user <user> auth user name
--pass <password> auth password
--css <file> custom css file for server
Example:
node-tail -p 4000 --cert cert.pem --key key.pem ~/file.log
Open in browser: https://localhost:4000/
There are two log display modes: scrollBottom
and scrollTop
. Default mode is scrollBottom
.
scrollBottom
will scroll the document to the bottom automatically when tail receives new input data. Tail data will be accumulated in the document.
scrollTop
will set new tail input data to the document from the top.
Basic user authentication is provided with the parameters --user
and --pass
.
Login form will appear after accessing the server.
Provide your custom secret string to sign the cookies with parameter --secret
.
node-tail -p 4000 --cert cert.pem --key key.pem --user hello --pass world --secret helloworld ~/file.log