I implemented static HTML comments on my website by tail'ing the /var/logs/nginx/access.log with a perl script. No CGI, no database, just the actual text of the comments stored as a single comment per line in a .html file.
To comment a visitor takes any url on the domain and appends "/@say/". Like http://notmyurl.com/somepage.html/@say/Some response to somepage. Or "...lakephoto.jpg/@say/Cool fish! How long was it?"
The perl script sees the /@say/ in the logs and adds the parsed out and sanitized comment to an .html file. There's some nginx location hijinks for matching /@say/ URLs that goes to a confirmation page and redirects to the comment listing page.
Minor pet peeve, but it is so much nicer when people use https://example.com for example links.
I clicked on your link expecting a real site (my monkey mind having skipped over the actual URL contents) and I was redirected to some other odd Chinese (?) URL with spammy ads and NSFW content.
what executes the perl script? the POST doing a CGI type thingy i have so forgotten how to utilize from not using it since the 90s? on first read, i missed that you're modifying the contents of the html and was concerned about log rotation before realizing that was just dumb to be concerned about.
I have it start when my OS starts. It runs continuously thereafter (~5MB ram). The webserver does not know or care about it. The script leans heavily on perl's POE::Wheel::FollowTail module to get updates to nginx's access.log automagically then I abuse regexes to note log entries with /@say/, extract what URL-file-path commented on, what the comment is, and prepend the line to the algorithmically appropriate .html file with some html mark-up. The webserver serves the static html as it would any html.
I've used this comment system on my tor onion services sites for the last decade. I get plenty of people trying to exploit it. It's kind of fun. If the Tor folk haven't pwned it I doubt the HN folk will. Not for lack of skill but mostly a lack of motivation relative to the tor folk.
To comment a visitor takes any url on the domain and appends "/@say/". Like http://notmyurl.com/somepage.html/@say/Some response to somepage. Or "...lakephoto.jpg/@say/Cool fish! How long was it?"
The perl script sees the /@say/ in the logs and adds the parsed out and sanitized comment to an .html file. There's some nginx location hijinks for matching /@say/ URLs that goes to a confirmation page and redirects to the comment listing page.