From b4228aa74f6ef4720167236cb072b84d94aa6d2a Mon Sep 17 00:00:00 2001 From: murilo ijanc Date: Fri, 27 Mar 2026 21:54:25 -0300 Subject: Add chunked paste support for content up to 1.44 MB Large pastes are split into 8 KiB chunks on the client side, each stored separately in a dedicated chunks/ directory. A version-2 manifest paste lists the chunk hashes and is announced to the DHT; chunks replicate via periodic republish with per-put throttling to avoid rate-limit bans. - New PUTC/PUTM protocol commands for chunks and manifests - Client-side chunking avoids O(n^2) base58 on large content - HTTP handler reassembles chunks directly from store - DHT sync routes incoming chunks to chunks/ directory - Republish interval reduced to 5 min with 200ms throttle - tp.1 updated with new 1.44 MB limit --- tp.1 | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'tp.1') diff --git a/tp.1 b/tp.1 index 729e603..7d8c6c1 100644 --- a/tp.1 +++ b/tp.1 @@ -47,7 +47,7 @@ and the raw response received. .Pp The following commands are available: .Bl -tag -width Ds -.It Cm put Oo Fl t Ar ttl Oc Op Fl p +.It Cm put Oo Fl t Ar ttl Oc Oo Fl p Oc Op Fl l Ar label Read standard input and store it as a paste. On success, print the paste key to standard output. .Pp @@ -66,6 +66,15 @@ The default is .Pp .Fl p stores the paste in public mode without encryption. +.Pp +The maximum input size is 1.44 MB. +Pastes larger than 8 KiB are automatically split into chunks +and reassembled transparently on retrieval. +.Pp +.Fl l Ar label +attaches a label to the paste for later identification. +Labels are stored locally in +.Pa ~/.config/tp/labels . .It Cm get Ar key Retrieve the paste identified by .Ar key @@ -73,10 +82,18 @@ and write its contents to standard output. .It Cm del Ar key Delete the paste identified by .Ar key . +If the paste has a label, the label is also removed. .It Cm pin Ar key Pin the paste so it never expires. .It Cm unpin Ar key Remove the pin from a paste, allowing it to expire normally. +.It Cm list +List all labeled pastes. +Each line shows the paste key and its label, separated by a tab. +.It Cm label Ar key Ar text +Add or update the label for the paste identified by +.Ar key . +All remaining arguments are joined as the label text. .It Cm status Display the daemon status. .El @@ -84,6 +101,10 @@ Display the daemon status. .Bl -tag -width "/var/tesseras-paste/daemon.sock" -compact .It Pa /var/tesseras-paste/daemon.sock Default Unix domain socket. +.It Pa ~/.config/tp/labels +Local paste labels, one per line in +.Dq key\etlabel +format. .El .Sh EXIT STATUS .Ex -std @@ -96,9 +117,21 @@ Retrieve a paste: .Pp .Dl $ tp get Ar key .Pp +Store a paste with a label: +.Pp +.Dl $ echo \&"hello\&" | tp put -l \&"dmesg openbsd 7.9\&" +.Pp Store a public paste with a 1-hour TTL: .Pp .Dl $ echo \&"public data\&" | tp put -t 1h -p +.Pp +List labeled pastes: +.Pp +.Dl $ tp list +.Pp +Label an existing paste: +.Pp +.Dl $ tp label Ar key my zine ep 1 .Sh SEE ALSO .Xr tpd 1 .Sh AUTHORS -- cgit v1.2.3