Rustpaste
Pastebin service in Rust
Install / Use
/learn @tansly/RustpasteREADME
rustpaste
A private pastebin server written in Rust, using actix-web framework. Aiming to be very simple.
This is a work in progress.
REST API
-
To upload a paste, send a
POSTrequest to/withapplication/x-www-form-urlencodeddata. This requires authentication (HTTP basic authentication). If the request is successful, response contains the URL of the paste.Note that urlencoded data is not the best approach for this because of some limitations (for example the max file size imposed by actix-web, extra overhead for non-ASCII data). I'm planning to change this to use
multipart/form-data. Dealing with urlencoded data is so much easier in actix-web; that's why I chose to do it this way initially.You can use
curlas follows to upload the contents of a file namedfilename:curl <domain> --basic -u "user:pass" --data-urlencode "data@filename"You should definitely use HTTPS or you'll get owned. Since
rustpastedoes not have SSL support, put it behind some reverse proxy (such as nginx) with SSL support. -
To get a paste, send a
GETrequest to the URL returned by thePOST. To get the paste with syntax highlighting, add the file extension for the file as a separate path parameter in theGETrequest. For example, to highlight a paste with nameQDRASC3was Rust source code, send a request to/QDRASC3w/rs. -
TODO: To delete a paste, send a
DELETErequest to the paste URL. This requires authentication.
Configuration
TODO: Things like where to store the pastes, username and password to be used by HTTP authentication,
base URL to prepend to the POST responses will be configured using a config file.
Planned features
After implementing a very basic API with GET and POST requests, I'm planning to add the following features.
- [x] HTTP basic authentication for posting/deleting pastes.
- [x] Syntax highlighting with syntect.
- [ ]
DELETEmethod to delete pastes. - [ ] Configuration via a config file.
Related Skills
himalaya
347.2kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
taskflow
347.2kname: taskflow description: Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layer
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
