solusipse / fiche

Command line pastebin for sharing terminal output.
http://termbin.com
MIT License
1.42k stars 169 forks source link

[Feature Request] human readable url #88

Open egoarka opened 6 years ago

egoarka commented 6 years ago

for instance http://hru.termbin.com/this-is-can-be-readed-easily-12

hru - stands for human readable url

solusipse commented 5 years ago

How would that url be created? Using first few characters from the uploaded paste?

egoarka commented 5 years ago

@solusipse no, that would be inflexible

change manually by sending existed name of endpoint and preferred one delimited by a colon would be way better

# derive *new* formed name of endpoint
old=$(echo 123 | nc termbin.com 9999 | cut -d/ -f4)
# set prefered
new="hope you can read it"
echo $old:$new | nc hru.termbin.com 9999
# response: "http://hru.termbin.com/hope-you-can-read-it"

hru can be shortened to just h, likewise l beautification subdomain

if there's existing endpoint with the same name then old can be overridden or deleted

solusipse commented 5 years ago

Implementing this would require adding some kind of authentication mechanism, otherwise the service would be heavily abused. And adding authentication is probably out of the scope of this project.

I was thinking about doing something similar for removing pastes that were pushed to the server by mistake. I thought that maybe we could give users 30 seconds to remove last paste they posted, but that would require storing their IP addresses (that's all we know about our users) in some database. Since this application is a basic tool, is written in C, and is dependency-free, I wanted to avoid making it too complex. Maybe we could create another service that would fullfill our fantasies 😄

Btw, that solution also opens up a possibility to abuse the service - if multiple users are posting from the same IP address. In the real world that's unlikely so maybe we'll get back to these ideas some day