Link shortener in Rust.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
neil 730be29377 Updating instructions and contributing guide 2 years ago
assets way lighter background, 1.3MB -> 0.38MB 2 years ago
db Don't delete the db folder; don't push blacklists 2 years ago
migrations Initial commit, version 1.0.0 2 years ago
src 1.1.0 release 2 years ago
templates Initial commit, version 1.0.0 2 years ago
.gitignore Don't delete the db folder; don't push blacklists 2 years ago
Cargo.toml 1.1.0 release 2 years ago
LICENSE Initial commit, version 1.0.0 2 years ago Updating instructions and contributing guide 2 years ago
lang.json 1.1.0 release 2 years ago


Link shortener in Rust.

Developed to be as minimalist and lightweight as possible.

Powered by the Rocket framework using (server-side) Handlebars templates.

  • Less than 1000 lines of code, including 20% of comments
  • Consumes between 5MB and 20MB of RAM
  • No JS
  • No CSS framework ; CSS is handmade and all rules are prefixed to avoid rule conflicts
  • No tracking features at all
  • No unsafe block


  • Includes a captcha as a minimal protection against spamming
  • Easily customizable assets
  • Only needs a SQLite database to work
  • Localization (available in French and English)
  • Counting clicks
  • Allows shortcut deletion

Official instance:

Running an instance

First, you must install Cargo and the latest stable version of Rust by following the instructions on this website. Alternatively, you can use the liuchong/rustup Docker image.

  • Clone the project:
git clone
  • Edit what you need. You might want to change the following elements:

    • constant INSTANCE_HOSTNAME in replace with your instance hostname
    • constant HOSTER_HOSTNAME in replace with the hostname of the organization hosting the project
    • assets/hoster-logo.png: replace with the logo of your organization
    • assets/logo.svg: the software logo
    • assets/background.jpg: the default background
  • Create a file named Rocket.toml at the project root, containing the following:

address = "<ADDRESS>"
template_dir = "templates"
secret_key = "<SECRET KEY>"

url = "db/db.sqlite"
  • Replace <ADDRESS> by the address to listen on

  • Replace <SECRET KEY> by the result of the command openssl rand -base64 32

  • Eventually change the database storage path. You can specify more parameters following the Rocket documentation.

  • Create the banned_url_to.list file and enter keywords that causes IPs submitting links to get a 403 Forbidden if their links contain those keywords. Example:


You can configure a fail2ban instance to watch your favourite reverse-proxy logs to see which IPs are getting a 403 and ban accordingly.

  • cargo run --release


The initial version of the software has been developed in one week ; there's still a lot to do.

Here are many ways to contribute:

  • Translate!
    • Add your entries in the lang.json file.
    • Once you're done, edit and add your language in the ValidLanguages structure.
  • Improve the software modularity
    • Add a configuration file
    • Configure instance and hoster's hostname from the configuration file
    • Toggle captcha
  • Add postgresql compatibility
  • Add different CSS themes (a dark theme would be a great start!)
  • Develop a more resilient protection to spambots
    • Improve hostname blacklisting ?
    • Blacklist shortcut names ?
    • Integrate a ban / ratelimiting system ? (the current system relies entirely on a separate fail2ban instance)
  • Clean up the code
    • Restructure the rocket routes in to something more readable
    • Make a better usage of template contexts
    • Improve the forms if you're knowledgeable in Rocket forms
    • Separate the code into more files if necessary

This software is mainly developed and maintained by Neil for the Association 42l.

If you like the work done on this project, please consider to donate or join the association. Thank you!

Graphical credits