lus / pasty

pasty is a fast and lightweight code pasting server
https://pasty.lus.pm
MIT License
200 stars 28 forks source link

Startup Issues? #31

Closed davidnewhall closed 2 years ago

davidnewhall commented 2 years ago

I'm out looking for a self-hosted Pastebin service. I'm mostly doing:

I cloned this repo and moved into the pkg/pasty folder, then ran go run .

pasty/$ go run .
2022/01/08 01:02:53 Loading the application configuration...
2022/01/08 01:02:53 Loading the configured storage driver...
2022/01/08 01:02:53 Serving the web resources...

Then I went to http://localhost:8080 and got this. Screen Shot 2022-01-08 at 1 05 30 AM

Maybe this is expected, but it's certainly not user friendly. So I can back here and scanned through the README more, but found no mention of "how to use" this app. I can only assume what I'm getting from the web interface is not expected, and something is wrong here.

Then, on a whim I did cd ../.. ; go run ./cmd/pasty and got the same output, but this time the web server had actual content. So I looked in the README for the word log but found nothing. This app doesn't seem to log errors, or requests, or anything happening. Is that expected?

I finally tested it. My test is (always) paste a 5MB log file and hit save. Does it work? Nope, it just spins. Is it fast, or slow? Slow, and the line numbers seem to misalign with the paste lines while scrolling. Can it be "loaded" quickly after being saved? It never saved the 5MB paste, and never printed an error.

Small pastes seem to work OK. This is my feedback, hope it's helpful.

lus commented 2 years ago

Hello, thanks for your feedback. I'll explain some points you made.

Maybe this is expected, but it's certainly not user friendly.

Generally, running the app (or any app) using go run is never meant for production purposes. It's a command used by people who actively develop on a project to avoid rebuilding it every single time. If you want to run the app on a production system you definitely should build it. This said, the error you get when running the app while your CWD is cmd/pasty/ is due to a routing error. The app tries to serve the ./web/ directory which does not exist inside the cmd/pasty/ directory. These aspects are clearly stated in the README (see 'Building from source').

So I looked in the README for the word log but found nothing. This app doesn't seem to log errors, or requests, or anything happening. Is that expected?

I have to admit I did not implement that much logging when I initially started the project. Thanks for bringing this up, I will create an issue on this topic.

I finally tested it. My test is (always) paste a 5MB log file and hit save.

Jup, piping a 5MB string into pasty causes severe performance issues. I don't see the point in having such a huge(!) paste though as the most common use case is sharing small log or code snippets which is handled pretty well. For bigger payloads a file sharing platform (e.g. https://workupload.com) would be far more suitable in my opinion.

Again, thank you for your test and feedback ^^

lus commented 2 years ago

I will close this issue as I created separate issues for all the points you mentioned. Issues #32 and #37 could be of interest for you. Feel free to open another issue if you have further questions!