skills/pastebin/references/wastebin.md

32 lines
916 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Wastebin — 自架 Pastebin 軟體(Rust)
**URL**: https://github.com/matze/wastebin
**License**: MIT | **Version**: 3.6.2(2026-05-01)
---
bin.xlion.tw 底層用的 pastebin 軟體。Rust + axum + SQLite3,單一 binary 低記憶體,支援語法高亮(170+ 語言)、zstd 壓縮、Markdown 渲染。
## API
### 建立 Paste
```
POST /
Content-Type: application/json
{
"text": "<paste content>",
"extension": "<副檔名,選填>",
"title": "<標題,選填>",
"expires": <秒數,選填>,
"burn_after_reading": <true/false,選填>,
"password": "<加密密碼,選填>"
}
```
Response: `{"path": "/Ibv9Fa.rs"}`
### 其他端點
- `GET /raw/:id` — 取得原始內容
- `GET /md/:id` — Markdown 渲染(`.md` / `.markdown` 副檔名)
- `DELETE /:id` — 刪除(需攜帶 Cookie;注意:JSON API `POST /` 不設定 Cookie,僅網頁表單 `POST /new` 會設定)