From 8686f8ad7833bfde2f6d038a572de6e70e567537 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sat, 7 Jan 2023 18:47:22 +0100 Subject: Rant about CGI Underachieving Hobbyist Laments How Hard It Is Nowadays To Let The Internet Run Arbitrary Commands On His Server. --- guides/cloud/vps.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'guides/cloud') diff --git a/guides/cloud/vps.org b/guides/cloud/vps.org index 4315c44..1fcf1ca 100644 --- a/guides/cloud/vps.org +++ b/guides/cloud/vps.org @@ -170,3 +170,19 @@ $ sudo systemctl restart nginx # Make fail2ban notice the new log file. $ sudo systemctl restart fail2ban #+end_src + +** CGI +I like the idea of [[https://en.wikipedia.org/wiki/Common_Gateway_Interface#Using_CGI_scripts][CGI "scripts"]], i.e. having the web server fire a +program to handle requests: + +- URI bits are passed through environment variables and stdin; +- the program spits the page on stdout. + +Had some fun toying with Python's ~cgi~ module; sadly though the +project has [[https://peps.python.org/pep-0594/#cgi][decided to deprecate it]]. The docs [[https://docs.python.org/3.11/library/cgi.html][suggest some migration +paths]], and there's a [[https://pypi.org/project/legacy-cgi/][legacy-cgi package on PyPI]] if I really want to +keep using it I guess. + +Also nginx has no support for CGI either, though their documentation +explains how to combine their FastCGI support with ~fcgiwrap~ to +enable CGI scripts. -- cgit v1.2.3