mirror of
https://github.com/skidoodle/pastebin
synced 2026-04-28 03:07:40 +02:00
small refactor
This commit is contained in:
@@ -1,30 +1,44 @@
|
||||
# pastebin
|
||||
|
||||
a simple and lightweight pastebin service written in go and templ
|
||||
[](https://go.dev/)
|
||||
[](https://github.com/skidoodle/pastebin/pkgs/container/pastebin)
|
||||
|
||||
## Usage
|
||||
A minimalist, high-performance paste service written in Go.
|
||||
|
||||
```
|
||||
$ ./pastebin -help
|
||||
## Deployment
|
||||
|
||||
Usage of ./pastebin:
|
||||
-addr string
|
||||
socket address to bind to (default ":3000")
|
||||
-db-path string
|
||||
path to the database file (default "pastebin.db")
|
||||
-max-size int
|
||||
maximum size of a paste in bytes (default 32kB)
|
||||
-ttl duration
|
||||
time to live for pastes (e.g., 72h, 30m) (default 168h0m0s)
|
||||
### Docker Compose
|
||||
|
||||
```yaml
|
||||
services:
|
||||
pastebin:
|
||||
image: ghcr.io/skidoodle/pastebin:latest
|
||||
container_name: pastebin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./data:/app/database
|
||||
```
|
||||
|
||||
## Highlighting
|
||||
### Manual Installation
|
||||
|
||||
To get syntax highlighting, you must add the file extension at the end of your paste URL: `/<paste_id>.<extension>`
|
||||
Requires Go 1.25 or higher.
|
||||
|
||||
Supported languages can be found [here](https://github.com/alecthomas/chroma/tree/master?tab=readme-ov-file#supported-languages)
|
||||
```bash
|
||||
go build -o pastebin .
|
||||
./pastebin -addr :3000 -db-path pastebin.db
|
||||
```
|
||||
|
||||
### Themes
|
||||
Themes can be applied by specifying in the URL: `/<paste_id>.<extension>/<theme>`
|
||||
## Configuration
|
||||
|
||||
[List of available themes](https://github.com/alecthomas/chroma/tree/master/styles)
|
||||
| Flag | Description | Default |
|
||||
| :--- | :--- | :--- |
|
||||
| `-addr` | Socket address to bind to. | `:3000` |
|
||||
| `-db-path` | Path to the BoltDB database file. | `pastebin.db` |
|
||||
| `-max-size` | Maximum allowed paste size in bytes. | `10485760` |
|
||||
| `-ttl` | Time to live for pastes before expiration. | `168h0m0s` |
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [GNU General Public License v3.0](LICENSE).
|
||||
|
||||
Reference in New Issue
Block a user