79ed58ee23ae147c5a17feb4f6400d43a079eed7
urls-txt
a really simple url shortener: less than 200 lines of Rust and one dependency (tokio).
usage
-
clone and install:
git clone https://git.alv.cx/alvierahman90/urls-txt.git cd urls-txt cargo install --path . -
create a list of links:
lines that don't start with a slash (/) are ignore (they're comments) shortlink followed by redirect link, separated by a space character / http://alv.cx everything after the link is ignored (they're comments) /urls-txt http://git.alv.cx/alvierahman90/urls-txt -
run:
urls-txt path/to/urls.txt
why?
all url shorteners i've come across are too complicated: they have account management and remote APIs and whatnot. too complicated.
this includes my own sus url shortener, which for some reason i decided should use redis for its database and have a HTTP API for updating it.
why not just configure your reverse proxy?
good question. i'm not sure, but i think i want to separate my concerns? you might just want to configure your reverse proxy instead.
caddy
pls.cx {
redir / http://alv.cx
redir /urls-txt https://git.alv.cx/alvierahman90/urls-txt
}
nginx
location / { return 301 http://alv.cx; }
location /urls-txt { return 301 https://git.alv.cx/alvierahman90/urls-txt; }
apache
there's probably a way ¯_(ツ)_/¯
Description
Languages
Rust
59.2%
Dockerfile
40.8%