# Palette Palette is a fast, self-hosted pastebin. One Go binary, a SQLite database, and a web UI for sharing text and small files ## Features - Multiple files in one paste - Password protected pastes - Expir after a specified time - Burn after a number of views - Custom URLs - Syntax highlighting with language auto-detection (go-enry) - Local cookie based submission history ## Screenshots | | | |---|---| | ![Editor in midnight](docs/palette-previews/midnight-new.png) | ![Paste view in pastel-peach](docs/palette-previews/pastel-peach-paste.png) | | ![History in pastel-lavender](docs/palette-previews/pastel-lavender-history.png) | ![Saved in pastel-cloud](docs/palette-previews/pastel-cloud-mine.png) | ## Get Started ### Docker ```bash docker run -p 8080:8080 -v palette-data:/data git.archfox.org/poslop/palette ``` The SQLite database lives in the `/data` volume inside the container. ## Docker Compose See [docker-compose.yml](docker-compose.yml) for a ready-to-use example with every environment variable documented, including which are required (only the /data volume) and which are optional. ### Build from source Requires Go 1.21+. ```bash go build -o palette . ./palette # open http://localhost:8080 ``` ## Configuration | Setting | Default | Description | |---|---|---| | `PALETTE_ADDR` | `:8080` | Listen address | | `PALETTE_DB` | `palette.db` | SQLite database path | | `PALETTE_MAX_TEXT` | `5242880` | Max paste size in bytes (5 MB) | | `PALETTE_MAX_ITEM` | `26214400` | Max can item size in bytes (25 MB) | | `PALETTE_ADMIN_KEY` | generated | Admin key; if unset a 32-char hex key is generated and persisted to `/admin-key` (0600) | An `/admin` page exists for runtime settings, protected by a key set at install (`PALETTE_ADMIN_KEY` env var) and resettable locally — see [docs/API.md](docs/API.md) and [docs/design/](docs/design/) for details. ## API Full REST API: [docs/API.md](docs/API.md). One example: ```bash curl -X POST http://localhost:8080/api/pastes -d '{"content":"hello"}' ``` Design docs: [docs/design/](docs/design/). ## License Palette is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only). See [LICENSE](LICENSE). The software is provided AS IS, without warranty of any kind, express or implied, including merchantability and fitness for a particular purpose. In no event shall the authors be liable for any claim, damages, or other liability, including without limitation any security vulnerabilities, data loss, or legal issues arising from use of the software. You use it at your own risk. If you run a modified version of Palette as a network service, the AGPL requires you to offer your modified source code to its users.