add-comment

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

The view binary links to this binary, passing the filename as the query string. The binary stores the filename in a file at <data>/tmp/<ip>, to use later. <- TODO Requesting that link will return a response asking for input. That's where the user enters their username and comment. Their username is just the first word of their comment. It checks for name re-use, and if that IP has already hit the max comments amount. It knows what file the comment is for by looking at the tmp file from earlier Comment is stored and the tmp file is deleted. Usernames are stored in this file, one per line: <data>/comments/<file>/<ip> All comments are stored by time in <data>/comments/<file>/comments Lines alternate between username, id, timestamp, and comment. The id is a truncated hash of the user's IP address, and the timestamp is in RFC1123 format.

Colons are replaced with underscores for IPv6 IPs.

Issues: Filenames and comments are both used as query strings here. Currently the only way to tell the difference is to just assume that an invalid filename is a username. This is a hack.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL