https://github.com/rhee876527/chiyogami
Yet another pastebin
https://github.com/rhee876527/chiyogami
golang javascript pastebin self-hosted sqlite tailwindcss webcrypto
Last synced: about 1 month ago
JSON representation
Yet another pastebin
- Host: GitHub
- URL: https://github.com/rhee876527/chiyogami
- Owner: rhee876527
- License: bsd-3-clause
- Created: 2025-01-31T10:13:50.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-04-05T09:18:03.000Z (about 1 month ago)
- Last Synced: 2025-04-05T09:26:23.076Z (about 1 month ago)
- Topics: golang, javascript, pastebin, self-hosted, sqlite, tailwindcss, webcrypto
- Language: HTML
- Homepage: https://chiyogami.myaddr.dev
- Size: 233 KB
- Stars: 27
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Chiyogami
#### Chiyogami is a sleek, modern pastebin with encryption, customizable expiry, private pastes, user accounts and an API for developers. ๐
### Screenshots:


โจ **Features**
- โ Beautiful & Responsive UI โ Built with TailwindCSS & DaisyUI for a clean and modern look.
- ๐ Syntax Highlighting โ Automatic formatting with HighlightJS.
- ๐ Markdown Rendering โ Automatic formatting with Marked.
- โณ Configurable Expiry โ Set custom expiration times with API.
- ๐ Secure & Private โ Client-side encryption with WebCryptoAPI for encrypted pastes. No password saved in server.
- ๐ก Powerful API โ Create and fetch pastes without leaving the terminal.
- ๐ Public Pastes โ List & search all public pastes.
- ๐ Private Pastes โ Only accessible via a unique, unguessable link for enhanced privacy (use encryption on web UI for ultimate privacy).
- ๐ Local Storage โ Uses SQLite for a lightweight, self-hostable database.
- ๐ค User Accounts โ Create & manage your pastes with authentication.
- ๐ Easy Sharing โ Share paste links or scan a QR code for instant access.
- ๐ก Built-in Rate Limiting โ Protects against spam and abuse with smart request throttling.
- ๐ Easy self-host with docker.## Installation
Docker. Build it or check [docker-compose](https://github.com/rhee876527/chiyogami/blob/main/docker-compose.yml) file for example with pre-built images.### Quick run
```
docker run -d \
-v "$(pwd)/pastes:/pastes" \
-p 127.0.0.1:8000:8000 \
--restart unless-stopped \
ghcr.io/rhee876527/chiyogami:latest
```## Usage
Web UI is simple & straightforward. Or use the `API`.#### Create paste
```
curl -X POST \
http://localhost:8000/paste \
-H 'Content-Type: application/json' \
-d '{"content":"Test paste"}'
```**response:** `{"title":"OkxI"}`
Note: Pastes are created by default with `Public` `visibility`. They can be accessed from api or website.
Change this to `Private` or `Unlisted` to make the paste undiscoverable. Pastes are also set to expire within 24hrs if expiry is not specified.You can set a default expiry for new pastes with `PASTE_DEFAULT_EXPIRATION`. Valid time units are โnsโ, โusโ (or โยตsโ), โmsโ, โsโ, โmโ, โhโ or `"Never"`
#### Create private paste with 48h expiry
```
curl -X POST \
http://localhost:8000/paste \
-H 'Content-Type: application/json' \
-d '{"content":"Test", "visibility":"Private", "expiration":"48h"}'
```
**response:** `{"title":"euVa"}`#### Fetch created paste
```
curl -X GET http://localhost:8000/paste/bZTR -H "Accept: application/json"
```**response:**
``
{"ID":22,"CreatedAt":"2025-02-04T19:48:06.747679947Z","UpdatedAt":"2025-02-04T19:48:06.747679947Z","DeletedAt":null,"Title":"bZTR","Content":"test private","Visibility":"Private","expiration":"2025-02-05T19:48:06.747635027Z","IsEncrypted":false,"UserID":0,"IsUserPaste":false}
``#### Create paste from file
```
f=insert*file*name; \
jq -Rs '{content: .}' < "$f" | \
curl -X POST http://localhost:8000/paste \
-H 'Content-Type: application/json' \
-d @-
```**response:** `{"title":"awDI"}`
#### Delete owner paste using session (from cookies)
```
curl -X DELETE http://localhost:8000/paste/EIKq \
-b "session=MTczNzA2NDI5NXxEWDhFQVFMX2dBQUJFQUVRQUFBZl80QUFBUVp6ZEhKcGJtY01DUUFIZFhObGNsOXBaQVIxYVc1MEJnSUFEQT09fLnhi2OxsN6coY5ZmmBeA0tPXUcsKiii6ECOoJ7yrqNC"
```**response:** `{"message":"Paste deleted successfully"}`
##### COPYRIGHT
This software is free to use in accordance with the [license](https://github.com/rhee876527/chiyogami/blob/main/LICENSE).