2 unstable releases
0.2.0 | Jul 30, 2021 |
---|---|
0.1.0 | Jul 28, 2021 |
#5 in #love
20KB
418 lines
T
eleport U
r L
ogs with L
ove
.----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. |
| | _________ | || | _____ _____ | || | _____ | || | _____ | |
| | | _ _ | | || ||_ _||_ _|| || | |_ _| | || | |_ _| | |
| | |_/ | | \_| | || | | | | | | || | | | | || | | | | |
| | | | | || | | ' ' | | || | | | _ | || | | | _ | |
| | _| |_ | || | \ `--' / | || | _| |__/ | | || | _| |__/ | | |
| | |_____| | || | `.__.' | || | |________| | || | |________| | |
| | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' |
'----------------' '----------------' '----------------' '----------------'
Whatever you pipe into tull
, will get a unique UUID and the data gets stored locally - accessible via a flask server with simple endpoints. You can use ngrok or localtunnel then to share it outside LAN as well. It won't break the console as it also redirects the stream transparently to stdout.
Installation
- clone the repo
- install Rust
- then run
cargo build
Usage
STDIN Test:
Execute tull web
and it will give you few urls. Open the one with TULL_WEB_URL in front.
For each session tull
generates a ID, and that ID is used to associate the data of that session.
Type anything into the active terminal. On the web also on the correponding ID page it will reflect.
Exit with Ctrl-D. (Currently Ctrl-C is causing the flask server to stop as well along with stream caputre, working on it)
Actual Use Case
Execute ps ax | tull
; you can see the output of your command but also the logs are saved with a unique id. Go to TULL_WEB_URL(found via tull web
earlier)
Outcome:
- you have your logs stored for future reference in an organized manner
- you can share the url to anyone having access to your server via http.
What I do generally is hook it up with the ngrok tunnel. ngrok is a tool which you can use to create secure tunnels from your local ports in one-liner. So just do ngrok http 17171
and you can share these logs with anyone on the other side of internet.
Disclaimer
This is a personal project, don't use this in production or anywhere where you are not sure of security impacts. Until a v1.0 everything is considered unstable. :)
Future Roadmap/Updates
- Security - add basic auth if needed
- HTTPS exposure
- add documentation and video --follow feature
- make --follow feature work over the network
- --expose-via=ngrok | --expose-via=localtunnel
- How to use --tutorial mode
- Better UI for /web interface - make it easier to search/navigage/organize logs
- / and /tull endpoints need to show something
- API pagination for /api interface
- Streaming for /raw interface - also, how to read last n lines fast!
- Make readme look professional
- add unit tests
- start creating tags with pip pushes on version bumps
- follow semantic versioning and freeze external api models
- add colors to terminal outputs
- add timestamps to logs
- allow multiple log streams to be merged
- allow paginated access to logs
- improve the art of readme page | add colors
- add build banner in readme
How it works
When you run this, it creates a folder .tull in your user home directory. Also, at the same time it starts a background process which runs the flask server with some simple apis if it is already not started. Then whenever any data is piped into it, or it is invoked from command line, it creates a unique ID, and starts storing the pipe stream data into that file and also transparently writing it to stdout. That way it doesn't break your existing flow, saves the logs with unique ID and allows you to browse them later. Not too fancy, but useful.
Release Notes
v0.8: added log follow capability and log listing capability
Dependencies
~17–29MB
~446K SLoC