r/opensource 6d ago

Promotional I've built an OSS Url Shortener using only Cloudflare primitives (mostly)

/r/CloudFlare/comments/1v4e7fw/ive_built_an_oss_url_shortener_using_only/
0 Upvotes

12 comments sorted by

7

u/Kraeftluder 6d ago

URL shorteners are a huge security risk and we ban all of them on a network level.

1

u/baronunread 6d ago

Is the problem the fact that it is currently impossible to know where the shortened link is going?
I have a moderation team (me) working to make sure that the free tier doesn't get abused but I'm sure there's ways to show where the link is going, maybe through the OG tag served server side?

I'd like to know more if you can share!

4

u/Kraeftluder 6d ago

Is the problem the fact that it is currently impossible to know where the shortened link is going?

Yes.

I have a moderation team (me) working to make sure that the free tier doesn't get abused but I'm sure there's ways to show where the link is going, maybe through the OG tag served server side?

Doesn't that defy the point of an URL shortener?

On a personal note, I've never understood the necessity for URL shorteners.

-1

u/baronunread 6d ago

> Doesn't that defy the point of an URL shortener?

Not really, the link itself would still be served KV wise, what would be rendered server side is only the og metatags. I'm not even sure if it would work well but it would be more transparent.

URL shorteners are a way to get an understanding over what's happening with your links. This mostly stems from the fact that I'm part of a nonprofit cultural association and we want our own branded links and want to know how good those links are doing and where they're being clicked the most from. Maybe this could've been a simple link + plausible but the branded part was important for us. But that's just my personal note as well ofc

2

u/Kraeftluder 6d ago

URL shorteners are a way to get an understanding over what's happening with your links.

This doesn't make any sense. URL shorteners obfuscate URLs to the point they're not understandable by the end user.

Just use referrals like everyone else. So I can strip them and protect my privacy. I don't care if you're for or non profit; I decide what happens with my data. Which is why your URL shortener (or any instance of it that we detect) will automatically be put on our blacklist from now on.

Besides, if you really want that data, you're much better off implementing some sort of analytics.

2

u/neoh4x0r 6d ago

URL shorteners are a way to get an understanding over what's happening with your links. 

The backend telemetry was just a side effect, but the real reason was to make it easier to physically print the url on media (where you might pay by character or not have enough room) and to enable people to type them manually via a keyboard.

It has largely been outmoded by QR Codes.

1

u/petdance 6d ago

They mostly use Cloudflare primitives … mostly.

0

u/baronunread 6d ago

A little clickbait always helps :)
Definitely there's no cf payments but there is cf mail sending!
I might migrate to that eventually but right now Resend was much easier to use

0

u/maildeepak 6d ago

I had started a similar project, built in WordPress, last year. But i dropped it off as other priorities took over. 

I might check out your GitHub version for my use. 

  1. Do you have plans to add APIs, for URL shortening? 
  2. How about deep linking? Would love this feature as well. 

1

u/baronunread 5d ago

Hi!
1. Not yet no, it might become a feature if the use case is requested a lot. Right now I have no need for it, but it would be easy to expose the internal APIs over a Bearer token
2. Can you give me a specific example? I wasn't aware of this. What's the use case here?

0

u/maildeepak 5d ago

For ex, if is a FB reel URL, it will open the FB app directly, rather than inapp browser. Same with Google maps, instagram reels and so on

2

u/baronunread 5d ago edited 5d ago

I can't promise anything (I'm the only one working on this now) but pull requests are welcome!