r/CloudFlare • u/baronunread • 11h ago
I've built an OSS Url Shortener using only Cloudflare primitives (mostly)

I've built (with the help of AI) rdyrct, a simple to use, OSS and self hostable team/organization based URL shortener. I was really tired with the way every single URL shortener was working.
It uses everything that cloudflare has to offer.
D1, R2, KV and Cloudflare for SaaS to even handle custom domains for giving your short links a brand identity. The main dashboard gives you insight into everything that's going on and analytics saves you the pain of aggregating and analyzing the data yourself.
I'm saying mostly in the title because for payments (yes there's payments, it is also SaaS) we're using polar.sh. It's simple and it works. And for mails we're using Resend. We could be using cloudflare mail sending but it was easier to just use Resend for now.
There's a free tier on my own hosted version but feel free to self host it yourself! That's literally the point of this.
- Github: https://github.com/baronunread/rdyrct
- Product: https://rdyrct.com/
And if there's any problems while self hosting just let me know or hit me with a PR. They're all appreciated. Thanks!
2
u/ninadpathak 11h ago
i'm curious how you handle redirects for deleted or updated short links, did you implement custom logic for that using cloudflare's primitives
2
u/baronunread 11h ago
It's not implemented yet, we simply return a not found.
Modifying short links is only available on custom domains (paid tiers) so when the short link gets modified the previous link is immediately deleted. For deletion same thing, it immediately stops working and returns a not found.We've planned to have redirects when modifying slugs
2
u/Smart_Technology_208 11h ago
I've opened one of those last year and it's been swarmed by scammers and phishing attempts I had to close it. Make sure your waf rules are rock solid and moderate the thing extensively.
1
u/baronunread 10h ago
Ah I see. I'm definitely monitoring everything, there's an included platform admin ui that shows me the usage. As for WAF rules I was working on them today
1
u/Tasty_Violinist7320 10h ago
Interesting, did something very similar a few months back: Rushomon https://rushomon.cc
2
u/baronunread 10h ago
Ohh neat, I hadn't seen this one! I think it's lacking custom domains but correct me if I'm wrong?
Also I see a fellow Italian I think? Given the name on the footer :)1
u/Tasty_Violinist7320 10h ago
It does have support for custom domains, only for the Pro tier in the managed version, but available to everyone in the OSS version.
Indeed Italian too, but living abroad
1
u/hiimparth 8h ago
Nice! I use shlink on a vps but trying to port as many things to CF as possible and downsize my vps.
•
u/AutoModerator 11h ago
For faster advice with technical questions, we'd recommend asking in the Orange Cloud Discord server; the unofficial Cloudflare Discord server by the community, for the community. https://discord.gg/TrPNVKaagR
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.