Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Building Pastebin for text using Nginx and Lua (usamaejaz.com)
48 points by usamaejaz 4 days ago | hide | past | favorite | 25 comments





I use https://www.pastery.net/, which I think is the best pastebin (because I made it the way I wanted it). Private, no ads, no hassle, and the best part is the editor integration. Highlight some code, press F2, and the paste URL is in your clipboard.

I love it so much, and everyone that has used it likes it too, so I'm really happy about all this.


> Everything goes over an encrypted TLS connection, so nobody other than the intended recipient (and us. And probably CloudFlare, and maybe Google. But that's it.) can see what you're pasting.

This is funny. Liked the sense of humor over the irony. :) It does look pretty.


Thank you!

Lovely pastebin you made there! One nit to pick:

“With a default expiration time of one day”

But the default expiration time was one month when I clicked the button to create a new paste.

Nice work, though!


Oops, I changed that because a day was too short and forgot the docs, thanks!

What mechanism actually removes the content? I didn't see that in the lua or repo.

I don't know what the post here does, my pastebin has a script that removes content.

Ah my bad, I thought you were the author of the Pastebin this thread is about.

Oh, no, I shamelessly hijacked the post for my own nefarious self-promotion.

Also check out PrivateBin - this has some nice features: https://github.com/PrivateBin/PrivateBin

Ignorance is a bliss! Love it.

Using nginx.conf to host this looks like a great way to get around organisational boundaries to deploy applications you are not allowed to. "Well I'm just doing a quick config change, updating the nginx.conf sir..."

I pasted Japanese text and it turned into Mojibake.

Looks like the encoding can be improved

Can a pastebin client fit and function as a data: URI bookmarklet, and would it enable zero trust of web host?

I found this recently https://topaz.github.io/paste/ where the entirety of the paste is stored base64 encoded in the URL.

what's with nill typo'd in multiple places

That's basically why I dislike languages like this. I used to write World of Warcraft AddOns in lua. Refactoring was a pain. There'd often be some edge case I'd only notice days later where now a function argument was missing, was not passed in, or was mistyped for example.

Luacheck certainly helps, as would an editor with some syntax highlighting.

As long as you never assign to it, `nill == nil`!

Wow! No idea Nginx could do that!

It's not just nginx; openresty adds a lot of features that go way beyond what plain nginx can do.

openresty is really awesome!

It's like mod_perl, but with lua!

Yeah, IIRC originally the nginx/lua integration was more about dynamically extending the core features and configuration, like virtual hosts or proxies.

But that does get you a pretty high-speed interface, if you're willing to bet your money on both nginx and lua.

There are some higher-level abstractions available, like lapis[1], which powers itch.io.

[1]: https://leafo.net/lapis/




Applications are open for YC Winter 2021

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: