From 1c7b4f4b3a9a2975582f3200b74db3ac7a4917f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Szab=C3=B3?= <25702868+szabodanika@users.noreply.github.com> Date: Sat, 23 Apr 2022 16:50:45 +0100 Subject: [PATCH 1/3] Update README.MD --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 2c7ac6c..24c688b 100644 --- a/README.MD +++ b/README.MD @@ -27,7 +27,7 @@ Then start the service with `systemctl start microbin` and enable it on boot wit Simple text Pasta: `curl -d "expiration=10min&content=This is a test pasta" -X POST https://microbin.myserver.com/create` -Simple text Pasta: `curl -d "expiration=10min&content=$( < mypastafile.txt )" -X POST https://microbin.myserver.com/create` +File contents: `curl -d "expiration=10min&content=$( < mypastafile.txt )" -X POST https://microbin.myserver.com/create` Available expiration options: - 1min From dd9648cd2e32a7150efe7c335f8f7406b68c5503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Szab=C3=B3?= <25702868+szabodanika@users.noreply.github.com> Date: Sat, 23 Apr 2022 16:57:45 +0100 Subject: [PATCH 2/3] Update README.MD --- README.MD | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.MD b/README.MD index 24c688b..1035c2a 100644 --- a/README.MD +++ b/README.MD @@ -2,10 +2,21 @@ ![Screenshot](git/index.png) -MicroBin is a super tiny and simple self hosted pastebin app written in Rust. The executable is around 6MB and it uses 2MB memory (plus your pastas). +MicroBin is a super tiny and simple self hosted pastebin app written in Rust. The executable is around 6MB and it uses 2MB memory (plus your pastas, because they are all stored in the memory at the moment). + +### Features +- Is very small +- Automatic dark mode (follows system preferences) +- Animal names instead of random numbers for pasta identifiers (64 animals) +- Automatically expiring pastas +- Never expiring pastas +- Listing and manually removing pastas (/pastalist) +- Raw pasta content (/raw/[animals]) +- URL shortening and redirection +- Very little CSS and absolutely no JS (see [water.css](https://github.com/kognise/water.css)) ### Installation -Simply clone the repository, build it with `cargo build --release` and run the `microbin` executable in the created `target/release/` directory. It will start on port 8080. +Simply clone the repository, build it with `cargo build --release` and run the `microbin` executable in the created `target/release/` directory. It will start on port 8080. You can change the port with `-p` or `--port` CL arguments. To install it as a service on your Linux machine, create a file called `/etc/systemd/system/microbin.service`, paste this into it with the value of `ExecStart` replaced with the actual path to microbin on your machine. @@ -41,13 +52,6 @@ Use cURL to read the pasta: `curl https://microbin.myserver.com/rawpasta/fish-po or to download the pasta: `curl https://microbin.myserver.com/rawpasta/fish-pony-crow > output.txt` -### Features -- Very little CSS and no JS, super lightweight and simple (see [water.css](https://github.com/kognise/water.css)) -- Animal names instead of random numbers for pasta identifiers -- Automatically expiring pastas -- Never expiring pastas -- Listing and manually removing pastas -- URL shortening and redirection ### Needed improvements - Persisting pastas on disk (currently they are lost on restart) @@ -56,4 +60,3 @@ or to download the pasta: `curl https://microbin.myserver.com/rawpasta/fish-pony - ~~URL shortening~~ (added on 23 April 2022) - CLI tool - Configuration with command line arguments (ports, enable-disable pasta list, footer, etc) - From 6e6a9bfe9eba4ac892b7e17f44bb03b94c0f491f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Szab=C3=B3?= <25702868+szabodanika@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:05:29 +0100 Subject: [PATCH 3/3] Removed old regex import --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d76ce71..6d39676 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use askama::Template; use clap::Parser; use linkify::{LinkFinder, LinkKind}; use rand::Rng; -use regex::Regex; use std::path::PathBuf; use std::sync::Mutex; use std::time::{SystemTime, UNIX_EPOCH};