85 lines
2 KiB
Markdown
85 lines
2 KiB
Markdown
# tcpasters
|
|
|
|
A Simple tcp based terminal pastebin. Best used with [ncat](https://nmap.org/ncat/) or [socat](http://www.dest-unreach.org/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](https://www.gnu.org/licenses/agpl-3.0.txt)
|
|
|
|
[![Please don't upload to GitHub](https://static.betaco.de/badge.svg)](https://nogithub.codeberg.page)
|