Powering https://unsha.re
Find a file
Thorsten Schubert fb3ba852d1
All checks were successful
/ build (push) Successful in 2m51s
Request correctly sized output from blake3 hasher
2024-08-16 12:27:45 +02:00
.forgejo/workflows Package updates, CI and styling 2024-08-10 13:45:10 +02:00
contrib Update dependencies and migrate code 2024-08-06 12:47:34 +02:00
oci Package updates, CI and styling 2024-08-10 13:45:10 +02:00
tcpaste Request correctly sized output from blake3 hasher 2024-08-16 12:27:45 +02:00
.gitignore Filter cli admin tool 2022-04-07 20:22:33 +00:00
Cargo.lock Request correctly sized output from blake3 hasher 2024-08-16 12:27:45 +02:00
Cargo.toml Rate limiting for creating pastes 2024-08-09 00:02:36 +02:00
clippy.toml Atomic database swap on write 2022-04-11 20:09:20 +00:00
LICENSE.md Add license and readme 2022-04-01 05:08:53 +00:00
README.md RateLimiter and efficiency improvements 2024-08-15 12:24:56 +02:00
rustfmt.toml Atomic database swap on write 2022-04-11 20:09:20 +00:00

tcpasters

A Simple tcp based terminal pastebin. Best used with ncat or socat.

Usage/Examples

$ echo foo | ncat localhost 9999
{
  "status": "success",
  "expires": "Wed, 21 Aug 2024 11:36:43 +0000",
  "secret": "dEc6WUtlb19YOWd5aGl2bmE=",
  "url": "https://localhost/tG"
}

$ echo foo | socat - tcp4:localhost:9999
{
  "status": "success",
  "expires": "Wed, 21 Aug 2024 11:40:54 +0000",
  "secret": "Snc6UkM1NXNSYy1WSWlUYm4=",
  "url": "https://localhost/Jw"
}
$ dd if=/dev/urandom status=none bs=512 count=1 | tee >(sha256sum -b >&2) | ncat localhost 9999
75f18a1d18bc258870100d203e730b4c216e6ad3d520fb9e9a0f0f912250c9a7 *-

{
  "status": "success",
  "expires": "Wed, 21 Aug 2024 11:37:39 +0000",
  "secret": "THQ6MmNDelJjamFvQmxZMlk=",
  "url": "https://localhost/Lt"
}

$ curl -s 'https://localhost/VWK' | sha256sum -b
75f18a1d18bc258870100d203e730b4c216e6ad3d520fb9e9a0f0f912250c9a7 *-
$ echo THQ6MmNDelJjamFvQmxZMlk= | ncat localhost 10000   
{
  "status": "success",
  "id": "Lt",
  "message": "Removed paste"
}

FAQ

How is the data stored?

As a file on the file system.

Is there a database?

No.

How can paste ownership be determined?

Each paste action creates the file with extended attributes containing the expiration date and secret.

Are all filesystems supported?

It needs to support extended attributes (xattr).

How does the server know what type of data it is?

It doesn't, there is no insecure mime sniffing. You need to specify the format when retrieving the paste, e.g.: https://unsha.re/xyz/jpg in order for the browser to get the correct headers.

Can I download the file with my browser?

Yes, append /dl or /dl/<filename>.

Used By

https://unsha.re

Licence

AGPL-3.0-or-later

Please don't upload to GitHub