Crates.io | toothpaste |
lib.rs | toothpaste |
version | 0.3.4 |
source | src |
created_at | 2021-11-23 07:47:54.720374 |
updated_at | 2022-01-12 15:39:56.104185 |
description | A pastebin written in Rust |
homepage | |
repository | |
max_upload_size | |
id | 486131 |
size | 398,501 |
A pastebin written in Rust.
Set a DATABASE_URL
environment variable (eg DATABASE_URL=sqlite://sqlite.db
). Then, init the database:
sqlx database create
sqlx migrate run
Build static assets:
yarn
yarn run build
Launch the http server:
toothpaste --ip 127.0.0.1 --port 8080 # default values
Finally, setup a cron every minute for paste expire cleanup:
* * * * * wget -q -O /dev/null "http(s)://your_host/paste/cleanup"
For easier development, use https://github.com/watchexec/cargo-watch to auto-compile on change:
cargo watch -x 'run'
Auto-compile static assets:
yarn run start