Re: [dev] running a shortlink provider

2023-05-24 Thread Страхиња Радић
On 23/05/25 07:02AM, Marcel Plch wrote:
> 2) Pick favorite Web stack
[...]
> I personally would go for Python/Django, I'm not sure how suckless that's
> considered (probably not at all)
[...]
> Web is in a sad state so

You answered your own question. Web is bloat, in particular HTML itself as 
something derived from SGML.

Suckless way to have a URL shortener public service would probably be to create 
a CGI script in rc/shell or a program in C.

Perhaps the most minimal solution for keeping data would be TSV files, but they 
are not suitable for storing data entered from the web because of concurrency, 
so a "real" database would be needed.



signature.asc
Description: PGP signature


Re: [dev] running a shortlink provider

2023-05-24 Thread Marcel Plch
On Thu, May 25, 2023 at 12:47:20AM -0300, Spenser Truex wrote:
> Hello,
> 
> My internet friends and I have been wanting a shortlinks provider. How
> can I do this in a suckless way? I'd like to be able to host the
> shortlinks provider and easily let my friends point their own domains at
> my VPS.
> 
> I used to just upload a HTML file with a redirect to the desired
> location in my webserver root. This doesn't work for a shared service
> though.
> 
> There are a lot of bloated projects that I've found. Any suggestions?
> 
> 
> -- 
> CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
> Spenser Truexhttps://equwal.com

1) VPS
2) Pick favorite Web stack
3) Make a website that takes the specified URL, stores the URL and its
   hash as a key-value pair (possibly in a database if that's suckless
   enough for you, directory+file structure is probably okay as well.)
4) Store the hash value in base64


I personally would go for Python/Django, I'm not sure how suckless that's
considered (probably not at all) but I found Django to be about the
least bloated fully functional web framework. Web is in a sad state so
I'm sure Unix gods are gonna reward you even if you write a minimalistic
web in Django.

Django also uses sqlite by default as a database backend, so it's not even
a glass cannon. It knows that unless you bother to set something up, you
probably don't need something special.


I'm sure this suggestion is going to be either extremely helpful or
upsetting. Let me know what you picked. ^_^
-- 
# Marcel Plch


signature.asc
Description: PGP signature


[dev] running a shortlink provider

2023-05-24 Thread Spenser Truex
Hello,

My internet friends and I have been wanting a shortlinks provider. How
can I do this in a suckless way? I'd like to be able to host the
shortlinks provider and easily let my friends point their own domains at
my VPS.

I used to just upload a HTML file with a redirect to the desired
location in my webserver root. This doesn't work for a shared service
though.

There are a lot of bloated projects that I've found. Any suggestions?


-- 
CAEE B377 FC82 BAF9 102C  D22F C5CE D003 1AA8 E281
Spenser Truexhttps://equwal.com


signature.asc
Description: PGP signature