|Neil 5789115ce4||5 days ago|
|assets||6 months ago|
|db||5 months ago|
|migrations||6 months ago|
|src||5 days ago|
|templates||5 days ago|
|.gitignore||5 days ago|
|Cargo.toml||5 days ago|
|LICENSE||6 months ago|
|README.md||5 days ago|
|banned_url_from.list||5 days ago|
|banned_url_to.list||5 days ago|
|config.toml.sample||5 days ago|
|lang.json||5 days ago|
Link shortener in Rust.
Developed to be as minimalist and lightweight as possible.
Powered by the Rocket framework using (server-side) Handlebars templates.
Official instance: https://s.42l.fr/
git clone https://git.42l.fr/42l/rs-short.git
Edit what you need. You might want to change the following files:
assets/hoster-logo.png: replace with the logo of your organization
assets/logo.svg: the software logo
assets/background.jpg: the default background
config.toml and edit its values to suit your needs.
Create a file named
Rocket.toml at the project root, containing the following:
[global] address = "<ADDRESS>" template_dir = "templates" secret_key = "<SECRET KEY>" [global.databases.sqlite_database] url = "db/db.sqlite"
<ADDRESS> by the address to listen on
<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.
Edit blacklists at your convenience.
banned_url_from.list: Any client that submits a link name fully matching one of the elements in this list will get a 403 Forbidden HTTP status code.
banned_url_to.list: Any client that submits an URL containing one of the elements in this list will get a 403 Forbidden HTTP status code.
You can configure a
fail2ban instance to watch your favourite reverse-proxy logs to see which IPs are getting a 403 and ban accordingly for the duration of your choice.
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:
templates.rsand add your language in the ValidLanguages structure.
main.rsto something more readable
If you like the work done on this project, please consider to donate or join the association. Thank you!