Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: An open-source alternative to Bitly (github.com/ccbikai)
51 points by ccbikai 9 months ago | hide | past | favorite | 32 comments
Sink is A Simple / Speedy / Secure Link Shortener with Analytics run on Cloudflare.



Looks great but why dependency and lock in to a specific cloud provider?


For individual KOLs, cost savings can be achieved.


That's only until CF decides to extort. It's the game they play.


Cool. Checking it out.

For those looking for more options, Dub[1] is a matured open-source[2] link shortener with Analytics.

For not-so-large volumes of links, say for friends-family, and the occasional public links, you can run something off Github Pages[3] with their built-in Jekyll + Redirect-From Plugin[4]. If you do not want to, you do not even need to have the code run locally, just edit on Github. I run one to easily share links for the family and relatives (photos, that document link, along with the Rick-Roll Video).

Tip: If one wants to run an indie or personal or family/friends shortlink for easy sharing, try to have it on your own domain. This allowed me to moved between tools that powers it.

1. https://dub.co

2. https://github.com/dubinc/dub

3. https://pages.github.com

4. https://github.com/jekyll/jekyll-redirect-from


Dub is a great URL shortening tool, but its deployment is more complicated and relies on multiple platforms.

So I simplified it. Currently only relying on one platform.


Yeah, their self hosting guide is ... something

https://dub.co/docs/self-hosting

At the scale of their SaaS service this makes sense, but for a typical user a Sqlite database (or as you did a Cloudflare Workers KV) is really all you need


PSA: Don't shorten URLs if you don't have to because if the shortener ceases working your link is dead.


Or should this be more specific in that you shouldn't shorten URLs using the provider's domain name, but bring your own domain. So if the provider goes away, you can in some way migrate the links.


I agree!

That's why I set up my own thing. I don't care about analytics at all, so I just wrote a simple build system doto generate some very basic HTML redirects.

It isn't perfect but it's very cheap to run!

https://github.com/lucienbill/lucien.run/


And if you use Netlify, you can just create a _redirects file like this:

  / https://example.com
  /cv https://example.net/cv.pdf
  /git https://github.com/octocat
Works good for me on ale.sh so far!


Yes, having control of your data is safer.

Even if the supplier disappears, it is possible to quickly switch to another platform


As a hypertext purist, I used to think this. But working for a large organization, shortlinks can be an invaluable way to actually maintain the integrity of links that have been deployed to unrevisable media (emails, print, pdfs, etc).

If a resource has been relocated off of a host/url, often part of that situation is that we don't have immediate access to implement a redirect from that host to the resource's new location.

Now I see a shortlink manager as a centralized redirect manager, which is so much more rational and stable than creating a tangle of redirect config across dozens of hosts or hundreds of content applications.

The caveat is that you don't need to use a 3rd party domain or service, you should definitely at least use your own domain. You also don't need to make them unreadable hashes, they can actually be more human-friendly.


https://www.golinks.io Interesting product that does this for internal links.


There is no real good use case for url shorteners. If the platform doesn't support hyperlinks, that platform is simply not up to the task.


Last big project at my old job was for an appointment notification service. In addition to making SMS messages longer and thus costing us more, counterintuitively the unshortened URLs got flagged as spam by automated systems and end users more than shortened. However, you can’t use bitly or other free/public shorteners; use one hosted on your own domain. I used shlink https://shlink.io/


Another advantage is that the redirect address of the sent link can be modified. If there are changes in operational requirements, the landing page address can be adjusted in a timely manner


There are many, perfectly valid non-marketing use cases for link shorteners. We send SMS's to people with a link in them. We shorten them so SMS is less annoying to read. Also, we print links in terminal sessions, same thing.


Who with a sane mind would click on a link sent by SMS?


When it comes from a vendor you signed up for and you configured the service to send you SMS's on certain events. For us that is when a site or app goes down. Think Pagerduty without the pager.


In some cases the size of the URL matters. No matter if that's a human who doesn't want their reading flow interrupted by a link that covers three lines in mobile view (hence why linkedin or printed magazines operate shorteners), a user who legitimately types in links in cases where copy-paste isn't an obvious solution (e.g. typing a link you see on a stranger's device, like a party game or the link on a bluescreen, or again links in print), or you want to create a QR code that's readable from a distance and doesn't have 8 alignment squares.

I would get behind the argument that there aren't good use cases for 3rd party url shorteners. A url shortener should preferably be operated by the target website (like youtu.be), and failing that be operated by the originator of the link (linked.in, t.co, time.com).


I've seen venues with long lines to buy tickets where they put a sign with a shortlink to buy online and skip a line.

Long links are not convenient when people have to type them into devices with no physical keyboard.


Hasen't this use case been replaced by QR code use a decade ago already?


If the link is too long, the generated QR code will be difficult to recognize.

There may be a need to change the links after printing, and this is where the advantages come into play


The main use case of url shorteners is tracking and being able to block spam urls.


How does one block spam URLs using a link shortener? I've only ever seen shorteners used to bypass blocks

And for tracking, as you say. This would be understandable when the person sharing the link doesn't run the web server and can't simply look in access logs to find click rates, but then what they end up doing is giving everyone a unique link using marketing software and it can be tracked exactly who opened which link at what time on an individual level, as if that's necessary


The tracking is the real reason for it in the majority of cases it is used IMHO. The other rationalizations are things that humans do to help convince themselves that there's more nuance so what they're doing isn't nearly as naked self-interest as it seems. I'm thinking of Twitter's shortener for example. Self-hosted/small stuff used for SMS reasons for example (on a domain owned by the same org) are a different bag.


Not really.

People who track link usage use links to a tracking service which redirects to the target, or embeds tracking metadata in the URL. You could have a tracker which produces shortened links, or try to hide your tracking metadata by putting the already tracked link through a shortener, but that's all without consequence as a shortened URL looks no less suspicious than a URL with kilobytes of metadata. I suppose some trackers might try to (mis)brand themselves more positively as shorteners though.

Nothing about a shortener helps you block spam URLs - quite the contrary, they tend to be used to hide spam URLs.

The main legitimate use-case I can think of for shortened URLs are those used in advertisements or manuals, where the user might need to type it manually.


> People who track link usage use links to a tracking service which redirects to the target, or embeds tracking metadata in the URL

Link analytics is explicitly one of the stated use cases on Bitly, and you can even add UTM parameters automatically:

- https://support.bitly.com/hc/en-us/categories/360001889231-B...

- https://support.bitly.com/hc/en-us/articles/115003371927-How...

> Nothing about a shortener helps you block spam URLs - quite the contrary, they tend to be used to hide spam URLs.

It does, like on Twitter where ever url is behind a t.co shortener. If a spam url is identified you just have to kill the t.co url redirect.


> Link analytics is explicitly one of the stated use cases on Bitly, and you can even add UTM parameters automatically

This is against not in favour of your argument - it's a case of Bitly enabling users to still use other systems for tracking (UTM) while using a link shortener (as said by person you replied to), not evidence of tracking being the purpose of the link shortener.

Bitly does have their own basic analytics built in, so some people do use it for tracking, but that's still a secondary function for people who don't care enough to set up independent tracking. It's not a sale pitch of "if tracking is what you want, link shortening is the solution".

And the t.co example isn't actually useful for spam prevention, if Twitter decides that a certain URL is considered spam they can just as easily remove that link from any tweets trying to use it as they can disable a t.co. Meanwhile the t.co does add friction for users seeing whether the destination URL looks likely to be spam. I don't think I've ever heard anyone before argue that link shorteners are a good thing for fighting spam, only either bad or at best neutral.


> And the t.co example isn't actually useful for spam prevention

Don't take my word for it, that's how Twitter described it when they launched it here: https://blog.x.com/en_us/a/2012/shutting-down-spammers

From a scale perspective it also seems a lot easier to remove one redirect from happening vs. finding every Tweet that contains a certain url you want to remove.

> Additionally, we now use our link shortener (t.co) to analyze whether a tweeted link leads to malware or malicious content. This helps us prevent users from visiting malicious links and helps us shut down hundreds of thousands of abusive accounts.


You're misunderstanding the bit of that blog post that you've quoted - it only says that starting to analyse t.co links for malicious content is a good thing for reducing malicious content. It says nothing about whether that job is easier than if they started doing the analysing without having a link shortening system in place. And in fact it goes to show that spam prevention wasn't a motivating factor in their creating t.co shortener in the first place, since they only started analysing for malicious links later than they started shortening links.

It is possible that their task was made easier by having the t.co system in place - impossible to know without understanding engineering details of how Twitter and t.co work - but it's not a claim they've made publicly, nor a reason for their deciding to use shortened links.


[flagged]


> But you control the whole thing.

I think we have different ideas of "control," because in your scenario it sounds to me like Netlify controls at least some of it. Should Netlify go away, you still own the domain so there's a path to migration, but at that point I think you'll realize that 99% of the code that was doing the work was Netlify's, so you'll have some major work to do.

Of course if it's just a personal link shortener then that's perfectly fine, but if this was a "production" thing I'd be concerned about it




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: