hastebin/about.md

109 lines
4.2 KiB
Markdown

# About Hastebin - haste.nixc.us
Welcome to our Hastebin instance at [haste.nixc.us](http://haste.nixc.us). This site offers a simple, easy-to-use Pastebin where you can store text for a certain period. This service helps share snippets of code or text with others.
## Data Expiry and Handling
By default, pastes stored on haste.nixc.us have an expiry time of 90 days from the last access. After this period, the data is deleted from our database. Please note that this deletion process is not forensics-proof. Still, it effectively removes the data for most intents and purposes.
It's important to understand that this service is purely plain text-based. Data is only encrypted during transit (using HTTPS), and we do not guarantee privacy, stability, or consistent uptime. While we aim to avoid data resets, they may occur under certain circumstances.
## Repository
The source code for this Hastebin instance is available at our Git repository: [Nixius/hastebin](https://git.nixc.us/Nixius/hastebin.git). Feel free to explore, contribute, or use it to set up your own instance.
## Linkback
Haste was originally created by [Colin Knapp](https://colinknapp.com/?utm_source=haste.nixc.us&utm_medium=about&utm_campaign=linkback).
## Static Pages
Hastebin supports static documents that are permanently stored and never expire. These documents are loaded at server startup and can be accessed like regular pastes. Currently, the following static documents are available:
- **About page**: Accessible at `/about` (this page)
Static documents are configured in the server configuration and are useful for hosting documentation, help pages, or other content that should persist indefinitely. Unlike regular pastes, static documents do not expire and are always available.
## MCP (Model Context Protocol) Support
Hastebin provides an MCP discovery endpoint for AI assistants and tools that support the Model Context Protocol. You can discover Hastebin's capabilities by accessing:
```
/.well-known/mcp.json
```
This endpoint returns information about:
- Available API endpoints (create, read, read raw)
- Service capabilities
- Base URL and protocol information
- List of static documents
The MCP endpoint allows AI assistants to automatically discover and interact with Hastebin's paste creation and retrieval functionality.
## Tools for Uploading
### haste CLI Tool
We are ostensibly updating the original `haste` CLI tools, providing a convenient way to upload content directly from your terminal. Stay tuned for updates on this tool.
### Using `curl`
In the meantime, you can still use `curl` to upload content to Hastebin. Here's a quick guide on how to do it:
- To upload a file:
```bash
curl -X POST -s --data-binary @filename.txt https://haste.nixc.us/documents
```
- To upload text directly:
```bash
curl -X POST -s --data-binary "Your text here" https://haste.nixc.us/documents
```
After uploading, you will receive a URL with your uploaded content, which you can share with others.
### Examples of Using `curl` with Pipes and Redirection
1. **Sending File Content with `cat`**:
```bash
cat filename.txt | curl -X POST -s --data-binary @- https://haste.nixc.us/documents
```
2. **Sending Command Output**:
For example, sending the output of `ls -l`:
```bash
ls -l | curl -X POST -s --data-binary @- https://haste.nixc.us/documents
```
3. **Directly Writing and Sending Text**:
```bash
echo "Your text here" | curl -X POST -s --data-binary @- https://haste.nixc.us/documents
```
In these examples, the `@-` tells `curl` to read from stdin.
### Adding Aliases to `.bashrc` and `.zshrc`
To simplify this process, you can add an alias to your `.bashrc` or `.zshrc` file. Here's an example alias:
```bash
alias haste='curl -X POST -s --data-binary @- https://haste.nixc.us/documents'
```
After adding this alias, you can use `haste` in your terminal like this:
- **For files**:
```bash
cat filename.txt | haste
```
- **For command outputs**:
```bash
ls -l | haste
```
- **For direct text**:
```bash
echo "Your text here" | haste
```
To make these changes effective, you must reload your shell configuration with the command `source ~/.bashrc` or `source ~/.zshrc`, depending on which shell you use.