deb.li - the Debian ShortURL service
deb.li is a shortURL service for Debian related usage, hosted and developed by BerndZeimetz. The service is also available under the domain go.debian.net. To ensure that deb.li is not used by random spammers, adding new URLs is limited to a json-rpc web-interface for now, which is only accessible from a limited list of IPs.
FAQ
How do I use deb.li??
The easiest way to use deb.li is to use the following script. Just put it in your /usr/local/bin:
#!/bin/sh -e # call me 'deb.li' and use me as 'deb.li https://some/long/url', stdout is a cut-and-paste friendly URL echo "https://deb.li/$(ssh master.debian.org ~pollo/godebian-client/add_url "'$*'")"
Which hosts are allowed to access the json-rpc interface
- master.debian.org
I'd like to add new URLs from a different host
Just contact BerndZeimetz (bzed@debian.org) and let him know what you plan to do.
Is there a character limit for the made-up short URLs?
Yes, you have up to 10 characters to create a made-up short URL, (e.g. the link can be https://deb.li/myshortURL but cannot be https://deb.li/myshortURL2 ) .
Is it ok to add a huge amount of URLs automatically
Basically - yes. But please make sure it doesn't end up in DOSing the service. It is appreciated if you would contact BerndZeimetz (bzed@debian.org) before adding a huge amount of URLs, maybe there is a faster and/or better way than the json-rpc interface.
Will there be other ways to add URLs to the service?
- An email-gateway is planned, but not implemented yet. It will accept OpenPGP signed control mails, similar to db.debian.org.
Is there a bugtracker?
Not yet. Please use deb.li/bugs for now.
Is there a preview page of the short URLs available?
Yes, just use https://deb.li/p/<key> instead of https://deb.li/<key>.
Where is the code?
Where is the documentation in the code?
- Not yet written. Patches are welcome!
Is there an example JSON-RPC Client?
Yes, here: https://github.com/bzed/go.debian.net-client
- Use the python jsonrpc module from python3-jsonrpc
- Use curl:
curl -s -d '{"id":"json","method":"add_url","params":["https://debian.org"] }' https://deb.li/rpc/json | jq -r '"https://deb.li/" + .result'
How do I use the example Client?
Clone the git repository from https://github.com/bzed/go.debian.net-client and read the README. Also there is a checked out version on master.debian.org - have a look into ~pollo/godebian-client aka /home/users/pollo/godebian-client.
JSON-RPC API documentation
The json-rpc URL is https://deb.li/rpc/json. The following functions are provided:
add_url(url)
add_static_url(url, key)
update_static_url(url, key)
get_url(key)
url is the URL which should be shortened and key the key part of the short URL. Handles jsonrpc 2.0, but doesn't require the jsonrpc field in the request, so you can keep it short.