Server for tiny-link server rewritten in rust
1.9K
Tiny-link-rust is a fast and private URL shortner written in rust with several different ways to shorten any URL. It is available as Firefox and Chrome Plugin.
For hosting your own tiny-link instance you only need docker installed. Here you find a short documentation how to install docker.
To persist the shortened links we mount the path where the links are saved to our local file system(with -v ).
docker run -d -p 8080:8080 -v /data/tiny-link:/var/lib/tiny-link/ 12abcloud/tiny-link-rust
Checkout the swagger documentation as well https://app.swaggerhub.com/apis-docs/aeggerd/tiny-link-rust/1.5.0#/
curl -X POST \
-H "Content-Type: application/json" \
http://localhost:8080/create \
-d '{"longurl":"https://example.com","duration":"1Y10m","selfdestruct":true}'
http://localhost:8080/l/e4f-e8
curl -X GET \
http://localhost:8080/l/526-e
curl -X DELETE \
http://localhost:8080/l/526-e
Environment variables can get set with the -e parameter, like docker run -e APP_DEBUG=true 12abcloud/tiny-link-rust
| Variable | Description | Default |
|---|---|---|
| APP_DEBUG | activate debug log level | false |
| APP_WORKERS | numbers of http workers | 16 |
| APP_HTTP_PROTO | protocol for the short link | http |
| APP_WORKDIR | directory for persisting the data | /var/lib/tiny-link/ |
| APP_OLDMAP | path to legacy filemap | /var/lib/tiny-link/tiny-link.map |
| APP_PHISHTANK | url of phishtank | https://phish.12ab.pw/scan |
| Path | Method | Response code | Response body | Explanation |
|---|---|---|---|---|
| /create | POST | 201 Created | http://localhost:8080/l/534-e | create new short URL |
| /create | POST | 418 I'm a teapot | Link is a phishing | request got blocked because of phishing |
| /l/* | GET | 308 Permanent Redirect | - | redirect to long URL |
| /l/* | GET | 404 Not Found | - | short hash not found/long URL is phishing |
| /l/* | DELETE | 200 OK | - | delete short URL |
| /health | GET | 200 OK | - | health check |
2. Open the Plug-in Settings
3. Enter your endpoint (e.g. https://example.com/create) and hit Save
Content type
Image
Digest
Size
48 MB
Last updated
over 5 years ago
docker pull 12abcloud/tiny-link-rust