Comments (79)

Hello everyone!
MicroBin is a super tiny, feature rich, configurable, self-contained and self-hosted paste bin web application. Imagine cloud storage, but simpler, and with cool features like URL redirection, automatic file expiry and raw file serving support.

Release announcement and notes

https://microbin.eu/v1.2.0/

GitHub Repository

https://github.com/szabodanika/microbin

Quick question. Is there an ETA on a potential public instance? Also, is Asciidoc/Markdown supported?

Thanks for sharing this. Always nice to see a Rust project.

I have one question, does Microbin have/plan to have the privacy features of PrivateBin? I mean in PrivateBin, the server has zero knowledge of the pasted data. Is that a thing in Microbin as well?

Hi there, this is a feature that has been requested a lot and will definitely be implemented, I would say in the upcoming version v1.3.0. MicroBin is meant to be mostly a personal utility and the way it handles everything as plaintext helps users come up with all sorts of creative and hacky use cases, but with a public MicroBin service on the way, I definitely want proper security added and the scalability looked at.

Reaction GIFs seem to be disabled but I'm doing the Jack Nicholson from Departed face right now.

How does that actually work since a server serving content it's unaware of doesn't make much sense to me.

How does that actually work

Client-side encryption and decryption.

Is there a preshared key in that example? Because even with client side encryption/decryption you need to know how to encrypt/descryot don't you?

Yes, so I would serve a javascript function to your browser that would ask you for a password, and then using whatever passsword you enter it will try to decrypt the encrypted content that the server sent to your browser. At no point does the server see the unencrypted content or your password. Essentially think of it as creating a password protected zip file and uploading that to microbin. Then getting that zip back and using your password to unlock it. Except here it will happen in your browser using JS :-)

you can do it in the URL too: https://micro.example/idhere#keyhere

why the downvote, i’m right lol

Because the server sees whatever URL you request, so if you put the key there then the server doesn’t know what’s in your file but they can decrypt it and find out since you just gave them the key

Edit: I was incorrect

everything including and after the anchor (#) isn’t sent to the server but it can be accessed in javascript just like any js password prompt that OP would offer

e.g. https://httpbin.org/anything#abcdpassword123 notice how “abcdpassword123” is nowhere to be found. you can try this on your own server and check the access logs as well!

I wasn’t aware of that. Thank you for sharing

This would be interesting opt in feature, as I would like to provide this as one of my public services and having 0 knowledge would help a lot in case of requests from certain organizations.

Doing God's work there mate.

Too many pastebin projects make that mandatory but for some of us that's an undesirable feature.

i can't help myself but every time I read "Rust project" i hear the rust sound of the "linux unplugged" podcast in my head...

Well done! Take my coins!

Thank you so much! Hope you'll give it a try, and if you want anything changed just open an Issue on GitHub. Most requests end up getting implemented :-)

Looks interesting! I haven't used Cargo before, so I don't know if this issue is related to some configuration I need to do after installing Cargo or whether it's MicroBin-related:

error: failed to download `microbin v1.2.0`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/home/userName/.cargo/registry/src/github.com-1ecc6299db9ec823/microbin-1.2.0/Cargo.toml`

Caused by:
  invalid type: unit variant, expected string only for key `profile.release.strip`

It worked okay for me. Try updating your rust with rustup update, or you can also just download the binaries from here: https://github.com/szabodanika/microbin/releases

I had installed Cargo using apt rather than rustup, so it might have been an issue with an older version in Debian.

Removing the Debian version and installing rustup did the trick!

[deleted]

I've been using Zipline for shareX images and text, its worked pretty well for me and it has a nice webui

[deleted]

I can upload text files just fine, both through the webui and through shareX, unless I'm misunderstanding you

This would be awesome!

XBackBone supports text files.

This looks great, thank you! Great documentation, and easily deployed in Kubernetes.

Some potential features and suggestions:

  • Allow setting file size limits so that people won't be tempted to share Linux ISOs using microbin
  • Add the option for pastas to be private by default (something like --private-by-default so that the "private" checkbox is ticked by default)
  • ~~Add the option to disable non-private pastas entirely (something like --force-private)~~ That's already possible by --no-listing, my bad.

This looks so much nicer than privatebin, are there plans for encryption or dark mode?

Hi there! Dark mode is supported, it automatically follows your system preferences. I should probably add screenshots showing this. Encryption is definitely one of the next things I will implement along with other security and persistence improvements in v1.3.0.

So it does! Wonderful! Nice to find a privatebin replacement. Look forward to your progress!

I’m OOL, what’s wrong with private bin?

PrivateBin is a public service that is self-hostable. MicroBin is a self-host first software that is aimed at enthusiast users who can customise it and use it in janky solutions as a file server or whatever they want from it. Also, PrivateBin written in PHP. Not that performance matters so much but Rust will definitely perform better with smaller memory footprint (when it's been properly optimised), but it will also be a little bit more difficult to set up. Microbin is literally a single executable file with no dependencies, you download it and run it, done. Although a lot of the users seem to prefer Docker. Is there anything wrong with PrivateBin? Objectively probably no. It's a cool thing. But personally I think it looks weird and it just doesn't align with my workflow that I wanted when using a pastebin. I wanted more freedom, more visibility, and a simpler UI

Thanks for your insight. I’m guilty of it as well and only run via Docker and never at the host level.

Lol. I have microbin running in a container.

I didn't mean anything was wrong with privatebin specifically.

Privatebin simply has changed much and offers a very simple toolset, sometimes you'd like more. Encryption aside, microbin looks modern and something I wouldn't mind having a team or client use.

I love this, been meaning to try so maybe I'll actually do it this time. Quick question, I would love it if I could put the storage backend on S3 and I don't see any mention of it in your documentation or your roadmap, is that something you might be interested in implementing or accept pull requests for? Because your design is so simple in architecture (in an elegant way), maybe making a s3 backend wouldn't be so hard to make a pull request for.

How do you set public-path using docker? Is there a environment variable that can be used? Or is this option not settable using the dockerhub image?

In case you havent found it yet, you can set environment variables through docker: https://github.com/szabodanika/microbin/blob/master/src/args.rs . I should probably document this properly.

https://github.com/szabodanika/microbin/blob/master/src/args.rs

Uhhh yeah, I was looking for this. Using docker-compose, but I have no luck setting environment variables. Can you provide an docker-compose.yml example?

see this issue for an example: https://github.com/szabodanika/microbin/issues/99

This post missed the chnacenfor an elevator speech where it briefly describes the project so we don't have to go searching for exactly what it doe--

Can i paste something via the terminal? Like ls -la | microbin an then it would display the url and copy it to the clipboard.

EDIT: just found the wiki :)

An example docker compose using variables.

https://snip.lol/KeRi8/QAkAtAba45.txt

Great little piece of Software. Works great with docker compose.

Documentation still seems a little bit incomplete, couldn't find docker environment vars. But got all of them with a little bit of guessing :-)

My biggest wish: rate limiting and max upload size.

Hi,
is it possible to force an expiry date, so every pasta disappears after a max of X days?

I found the answer. You cannot enforce a given date as an administrator, but you can disable eternal pastas. As such, users can choose between something from one minute to one week.

ran as microbin -p 12345, then accessed as http://127.0.0.1:12345, but it don't like me, I just typed a few abracadabras + added a png file to upload and hit Save and result is:

thread 'actix-rt|system:0|arbiter:0' panicked at 'attempt to divide by zero', src/util/animalnumbers.rs:20:21

Do you have more logs to show, or do you know what was the exact URL you got redirected to where it crashed? I would like to look into it. Sorry about that

Logs: `` $ ./microbin -p 12345 2022-11-08T12:21:35 [INFO] - MicroBin starting on http://0.0.0.0:12345 2022-11-08T12:21:35 [INFO] - Starting 1 workers 2022-11-08T12:21:35 [INFO] - Actix runtime found; starting in Actix runtime 2022-11-08T12:21:48 [INFO] - 127.0.0.1 "GET / HTTP/1.1" 200 4779 "-" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000082 2022-11-08T12:21:48 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://127.0.0.1:12345/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000092 2022-11-08T12:21:48 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://127.0.0.1:12345/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000077 thread 'actix-rt|system:0|arbiter:0' panicked at 'attempt to divide by zero', src/util/animalnumbers.rs:20:21 note: run withRUST_BACKTRACE=1environment variable to display a backtrace 2022-11-08T12:24:10 [INFO] - 127.0.0.1 "GET / HTTP/1.1" 200 4779 "-" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000061 2022-11-08T12:24:10 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://127.0.0.1:12345/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000066 2022-11-08T12:24:10 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://127.0.0.1:12345/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000108 2022-11-08T12:24:10 [INFO] - 127.0.0.1 "GET /static/favicon.svg HTTP/1.1" 200 2095 "http://127.0.0.1:12345/" "Mozilla/5.0 (Windows NT 10.0; rv:105.0) Gecko/20100101 Firefox/105.0" 0.000050 thread 'actix-rt|system:0|arbiter:0' panicked at 'calledResult::unwrap()on anErr` value: PoisonError { .. }', src/endpoints/create.rs:40:41

```

All I did is - typed abc and hit Save button, then browser forwarded to URL:
http://127.0.0.1:12345/upload

Where browser reported: ``` The connection was reset

The connection to the server was reset while the page was loading.

The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

```

I would like to look into it. Sorry about that

No sorry needed but tnx for sharing your project! Let me know if you need more details.

Version I run is: microbin-v1.2.0-i686-unknown-linux-musl.tar.gz downloaded form release page on github. Used it on MX-Linux x86-64 in user account

Nice, thanks for sharing. I'm deploying this RN on my homeserver.

On a side note... is that Ventura or a custom theme?

Have fun with it! It's water.css with a little custom inline styling. Or if you're asking about the browser, it's an open source browser called Min in the screenshots.

Nice! I've been using MicroBin for a few weeks now and really like it. One question - Can I map a volume for storing the files? I noticed that it deleted existing pastas with attached files and no expiration after the image was upgraded (On Unraid)

You can do it with Docker, yes. https://microbin.eu/quickstart/#docker

Awesome. thank you!

Any option to create paste url with curl?

Yes. If you upload a valid http or https URL, it will automatically become a redirection type paste, you don't even need to set any parameters in your request for this.

See: https://microbin.eu/documentation/#use-microbin-from-the-console-with-curl

Thanks I see you'll implement zero knowledge encryption. What to do when it happens. Privatebin asks to use some additional packages to generate link but curl is already on all servers or desktops so its better to generate urls for logs anywhere. Will curl stay and above doc work after encryption?

Weird.. I've been playing around with my docker implementation, and it keeps giving me a 404 when attempting to

curl -d "expiration=10min&content=This is a test pasta" -X POST https://microbin.<mydomain>.com/create

. Might be missing something, I'll keep futzing with it.

also running into this issue. slightly annoyed as i was hoping to use this mostly as a link shortener.

Love microbin. Is it possible to upload multiple files on one pasta in 1.2.0?

You will have to keep using a zip for now. Feel free to open a GitHub Issue for this though if you think it should be a feature!

Took me 5 minutes to deploy to my docker environment. With TLS and all functions enabled.

Thanks for the awesome job and the docs! Will enjoy the evolution on it although it suits me to about 85 % already.

[deleted]

Hi there, thanks and I am glad you enjoy MicroBin. I have been thinking about implementing a .env or something beyond the command line arguments, or perhaps even an option to configure during runtime from a web interface. I should probably create a GH issue for this just to properly get the conversation started. If you would like to support the project at one point, you can have a look here: https://microbin.eu/donate/.

Awesome app. Would be nice to have the ability to add description to a pasta. Currently, from the pasta list page, it is hard to tell which pasta I am looking for. Is that something that you considered? Thanks! and/or editable pasta name would be nice.

Good to see the update! I am already using this.

What a great project and wicked update. Thank you for implementing QR codes!! Saves me an extra step.

I love URL redirection and raw file support and am using both every day.

Keep up the great work OP 👍

Why would you use this to serve files over other alternatives? I could definitely see it’s use as a sort of pastebin type thing but for serving static files long term?

Maybe not long term but medium term. I used it to serve custom json instead of updating a real json on a CDN at one point. A bit easier than setting up a file server locally for development. Also for distribution or for having a file available everywhere you go. Sometimes when there is a very important thing I need to have access to even if my computer and phone dies, I have it on my MicroBin for a few days just in case. Honestly it's just nice having the option to do it. I haven't tried alternatives much except for PrivateBin but I didn't like the UI, the UX, I didn't like that they need database and another webserver and whatnot, they just felt bad to use. I really only built MicroBin for myself according to my own requirements at first, but as the userbase grows I implement all the features that others request without sacrificing the simplicity of the project. You will always be able to download a single executable and run it to get your MicroBin instance up and to use it as sort of a file server-pastebin-cloud storage multitool. But I have a lot of improvements in mind that will allow me to give you much more concrete examples of what features no other pastebins have. For now MicroBin just feels better than the rest, has smaller footprint for the same featureset, has more momentum and is easier to set up.

It looks like anyone can delete a paste as long as they have the link? Is there anyway to disable that?

hey! I was just looking around for Pastebin-like services I could self host, and happened to settle on MicroBin before seeing this post. It's exactly what I wanted, very simple, nice, fast. Great work. I requested that new feature you saw today, fingers crossed for that 🙂

A bit weird the documentation for building up with docker, don't seem to find a docker-compose file

great timing i was just looking for something like this. set it up and looking great, thank you! nice work it was really easy to set up with docker compose.

"pull access denied for microbin-docker, repository does not exist or may require 'docker login': denied"

danielszabo99/microbin instead.

sorry, did I post the wrong image name somewhere?

Szép kis projekt!:)

Koszi szepen! :D

Sorry to bump this: Is there a way to make Posting/Adding a paste require logging in, but sharing them to NOT require a user login? Seems I can't require login to create, then freely share?