Re: [dev] running a shortlink provider

From: Santtu Lakkala <inz_AT_inz.fi>
Date: Thu, 1 Jun 2023 15:06:18 +0300

On Wed, May 31, 2023 at 12:44:14PM +0300, Santtu Lakkala wrote:
> On 25.5.2023 6.47, Spenser Truex wrote:
> > There are a lot of bloated projects that I've found. Any suggestions?
>
> It uses symbolic links in a directory as a data backend. This should not
> have any race issues, as link creation should be an atomic operation. Note
> that the default is to have 4 character tokens, that are randomly generated,
> so expect collisions if you have a lot of links to shorten.

Tinkered with this a bit more, this "backend" is quite easy for a server,
and I was able to patch the OpenBSD httpd to server the symlinks as redirects
in about 20 lines of code, out of which 3/4 is for making it configurable.

-- 
BR,
  Santtu
Received on Thu Jun 01 2023 - 14:06:18 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 01 2023 - 16:00:09 CEST