diff --git a/Cargo.lock b/Cargo.lock index 207b042..67e8272 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -452,7 +452,7 @@ dependencies = [ [[package]] name = "guestbook" -version = "0.1.2" +version = "0.2.0" dependencies = [ "axum", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 28315ae..95b5f86 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guestbook" -version = "0.1.2" +version = "0.2.0" edition = "2021" description = "A configurable web guestbook made to be easy to use, with entries in plain text files, options for honeypots and captchas to deter spam, and moderation via Telegram bot." license = "MIT" diff --git a/README.md b/README.md index 4d9af81..f6ce03c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +[![Crates.io Version](https://img.shields.io/crates/v/guestbook)](https://crates.io/crates/guestbook) +[![Crates.io License](https://img.shields.io/crates/l/guestbook)](./LICENSE) + `guestbook` is a self-hosted guestbook web service with: - entries stored in plaintext, - notifications and moderation via [Telegram](#telegram), @@ -25,12 +28,19 @@ Aesthetically, essentially all of the HTML and CSS can be configured. There's a #### Build -`guestbook` is written in [Rust](https://www.rust-lang.org). The easiest way to install it is via `cargo`. +`guestbook` is written in [Rust](https://www.rust-lang.org). Clone the repo and build with `cargo`. ```bash -cargo install guestbook +git clone https://git.ily.rs/lew/guestbook +cd guestbook +cp .env.example .env # edit with your values +cargo run --release ``` +Alternatively, install directly from [crates.io](https://crates.io/crates/guestbook) with `cargo install guestbook`. The binary uses the current working directory for its `.env` and data, so run it from whichever directory you want it to operate out of. + +This will run the site on localhost on the port you've configured, or `8123` by default. I'll leave exposing it to the web to you, but personally I run [my guestbook](https://ily.rs/g) through a reverse proxy with [Caddy](https://caddyserver.com). + #### NixOS [NixOS](https://nixos.org) users can use the included flake, which builds the binary via [crane](https://github.com/ipetkov/crane) and exports a module that sets up the systemd service, user, and optionally a [Caddy](https://caddyserver.com) reverse proxy. @@ -236,9 +246,9 @@ services.guestbook = { ### Telegram -To enable Telegram moderation, create a bot via [@BotFather](https://t.me/BotFather) and set `BOOK_TELEGRAM_BOT_TOKEN` to the token it gives you. Set `BOOK_TELEGRAM_CHAT_ID` to the chat ID where you want notifications sent — the easiest way to find this is to message the bot and check the [getUpdates](https://api.telegram.org/bot/getUpdates) endpoint. +To enable Telegram moderation, create a bot via [@BotFather](https://t.me/BotFather) and set `BOOK_TELEGRAM_BOT_TOKEN` to the token it gives you. Set `BOOK_TELEGRAM_CHAT_ID` to the chat ID where you want notifications sent: the easiest way to find this is to message the bot and check the [getUpdates](https://api.telegram.org/bot/getUpdates) endpoint. -When a visitor submits an entry, the bot sends a message with the entry details and `/allow_` and `/deny_` commands. Tap either to approve or deny. +When a visitor submits an entry, the bot sends a message with the entry details and `/allow_` and `/deny_` commands. Tap either to approve or deny. If you approve something and later want to deny it, or vice versa, just hit the opposite option and it'll work as expected. --- @@ -337,3 +347,31 @@ entries .entry-body {} .entry-separator {} ``` + +--- + +### License + +``` +MIT License + +Copyright (c) 2026 Lewis Wynne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +```