News for hackers. Stuff that matters.
Re:My Journey Away from the JAMstack by mehdix on Monday July 31, 2023 @01:23PM (#36945915)
I used to have my static website on Netlify. I was using their form submission API and webhooks to trigger AWS lambda functions to run some scripts and send emails to users upon replying their comments. The website would then be rebuilt using new comments.

I replaced all this crazy setup with vanilla tools. I moved my webpage (a bunch of html pages and other files) to my VPS. I modified nginx to submit incoming html form submissions to my CGI bash script which then in turn adds them to a sqlite database and emails me.

There is no automatic rebuild. I wrote makefiles to rebuild and publish my pages in a few seconds.

It turns out I didn't need anything else, and above all I didn't need to spend time learning someone else's APIs.

Re:My Journey Away from the JAMstack by hagg3n on Monday July 31, 2023 @01:30PM (#36946016)
But you did spend time learning unix, nginx, bash, CGI, SQLite, etc.

Sure I can agree these tools are worth learning, I'm just pointing out it's not the same thing. Netlify allows you to setup a static website with data collection, e-mail dispatch and whatnot all without code and much faster.

Re:My Journey Away from the JAMstack by efields on Monday July 31, 2023 @02:14PM (#36946615)
But the customer that needs that is arguably better off on Squarespace. Most modern point-and-click platforms let you build arbitrary forms with mail services.

Netlify wants developers to live and breathe microservices that they meter to developers. In order to get the benefits, you have to change DX, which the entire JAMstack community has been doing for a decade or so. The downside is now putting stuff on the web is often needlessly confusing and forces you to be dependent on a middle man.

Re:My Journey Away from the JAMstack by mehdix on Monday July 31, 2023 @02:32PM (#36946872)
> But you did spend time learning unix, nginx, bash, CGI, SQLite, etc.

True, and it's been a rewarding decision ever since. For a corporate or a community Netlify or similar JAMstack content management systems might make sense, but for a indie developer? I don't think so.

Re:My Journey Away from the JAMstack by cutler on Monday July 31, 2023 @08:28PM (#36950788)
But bash with CGI? Seriously, when there's Perl, Ruby, Python and PHP to choose from? 'Sounds like a security nightmare too.
Re:My Journey Away from the JAMstack by mehdix on Tuesday August 01, 2023 @08:50PM (#36965476)
Because I wanted to learn more about CGI. Below is the script, I'd appreciate pointing out any weaknesses in it.

https://raw.githubusercontent.com/mehdisadeghi/mehdix.ir/mas...

Re:My Journey Away from the JAMstack by cutler on Wednesday August 02, 2023 @08:00PM (#36979556)
Although it may work brilliant minds in the Perl community such as Lincoln Stein and Randall Schwartz spent a significant amount of their career in the late 90s hunting down all the edge cases you're probably unaware of and produced CGI.pm. You can still learn a lot about CGI from this module but your exposure to vulns will be that much lower with something tried and tested.
Re:My Journey Away from the JAMstack by cutler on Monday July 31, 2023 @08:25PM (#36950766)
> submit incoming html form submissions to my CGI bash script which then in turn adds them to a sqlite database and emails me.

'Sounds like something out of the pre-Perl era. Not saying you can't get it to work but .... why when there's a ton of micro-frameworks such as Roda (Ruby) and FastAPI (Python) which can handle this in a couple of lines of code?

Re:My Journey Away from the JAMstack by aitchnyu on Tuesday August 01, 2023 @02:55AM (#36953154)
I was making a static site and my boss asked me to find a free form submission and email service I can embed into the site. It was supposed to be in an nginx server so I proposed PHP like its 2005, but this had to be bikeshedded for weeks.