karton/README.MD

67 lines
2.7 KiB
Text
Raw Normal View History

2022-04-11 13:41:28 +00:00
# MicroBin
![Screenshot](git/index.png)
2022-04-23 15:57:45 +00:00
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
2022-05-02 17:23:29 +00:00
- File uploads
- Raw pasta content (/raw/[animals])
- URL shortening and redirection
2022-04-23 15:57:45 +00:00
- Automatic dark mode (follows system preferences)
2022-05-02 17:23:29 +00:00
- Very simple database (json + files) for portability and easy backups
2022-04-23 15:57:45 +00:00
- Animal names instead of random numbers for pasta identifiers (64 animals)
- Automatically expiring pastas
- Never expiring pastas
- Listing and manually removing pastas (/pastalist)
- Very little CSS and absolutely no JS (see [water.css](https://github.com/kognise/water.css))
2022-04-11 13:41:28 +00:00
2022-04-11 13:48:11 +00:00
### Installation
2022-05-08 18:02:04 +00:00
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. For other arguments see [the Wiki](https://github.com/szabodanika/microbin/wiki).
2022-04-11 13:48:11 +00:00
2022-05-08 16:10:19 +00:00
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 `[username]` and `[path to installation directory]` replaced with the actual values.
2022-04-11 13:48:11 +00:00
```
[Unit]
Description=MicroBin
After=network.target
2022-05-08 16:10:19 +00:00
2022-04-11 13:48:11 +00:00
[Service]
Type=simple
Restart=always
2022-05-08 16:10:19 +00:00
User=[username]
RootDirectory=/
WorkingDirectory=[path to installation directory]
ExecStart=[path to installation directory]/target/release/microbin
2022-04-11 13:48:11 +00:00
[Install]
WantedBy=multi-user.target
```
Then start the service with `systemctl start microbin` and enable it on boot with `systemctl enable microbin`.
### Create Pasta with cURL
Simple text Pasta: `curl -d "expiration=10min&content=This is a test pasta" -X POST https://microbin.myserver.com/create`
2022-04-23 15:50:45 +00:00
File contents: `curl -d "expiration=10min&content=$( < mypastafile.txt )" -X POST https://microbin.myserver.com/create`
Available expiration options:
2022-05-08 16:10:19 +00:00
`1min`, `10min`, `1hour`, `24hour`, `1week`, `never`
2022-05-08 16:10:19 +00:00
Use cURL to read the pasta: `curl https://microbin.myserver.com/rawpasta/fish-pony-crow`,
2022-05-08 16:10:19 +00:00
or to download the pasta: `curl https://microbin.myserver.com/rawpasta/fish-pony-crow > output.txt` (use /file instead of /rawpasta to download attached file).
2022-04-11 13:41:28 +00:00
2022-04-11 13:48:11 +00:00
### Needed improvements
2022-05-02 17:23:29 +00:00
- ~~Persisting pastas on disk (currently they are lost on restart)~~ (added on 2 May 2022)
2022-05-08 16:10:19 +00:00
- ~~Configuration with command line arguments (ports, enable-disable pasta list, footer, etc)~~ (added on 7 May 2022)
2022-05-02 17:23:29 +00:00
- ~~File uploads~~ (added on 2 May 2022)
- ~~URL shortening~~ (added on 23 April 2022)
2022-05-08 16:10:19 +00:00
- Removing pasta after N reads
- CLI tool (beyond wget)
- Better instructions and documentation - on GitHub and built in