Tags: mtlynch/logpaste
Tags
Add custom character limit to pastes (#196) # Background Recently I've been looking at alternatives to the service 0x0.st for pasting log files to. Logpaste seems like the perfect replacement, but it has limits on file size. Adding the ability for administrators to add custom file sizes would allow admins to make the file size the equivalent of 0x0's (512 MiB) or even larger. It would also allow them to set smaller limits as well if resources are limited or if the content being pasted doesn't warrant large sizes. # Changes - The default limit is now `2 * 1024 * 1024`, or 2 MiB instead of `2 * 1000 * 1000`, 2 MB - Add cli flag `-maxsize int` to allow admins to set an arbitrary limit on paste file sizes if they would like to - The argument is passed in by # of MiB (so for a 512MiB limit, `-maxsize 512`, or for the default 2MiB, `-maxsize 2`) - Add field `maxCharLimit` to the `defaultServer` struct for storing the given size - Add fields to `handlers/paste_test.go` to use the new struct field in order for tests to pass - Replace instances of `MaxPasteCharacters` with `s.maxCharLimit` --------- Co-authored-by: Michael Lynch <[email protected]>
PreviousNext