
Show HN: Building Pastebin for text using Nginx and Lua - usamaejaz
https://usamaejaz.com/nginx-lua-pastebin/
======
StavrosK
I use [https://www.pastery.net/](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.

~~~
webwanderings
> 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.

~~~
StavrosK
Thank you!

------
FerretFred
Also check out PrivateBin - this has some nice features:
[https://github.com/PrivateBin/PrivateBin](https://github.com/PrivateBin/PrivateBin)

~~~
mro_name
Ignorance is a bliss! Love it.

------
eska
I pasted Japanese text and it turned into Mojibake.

~~~
usamaejaz
Looks like the encoding can be improved

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

~~~
cwmartin
I found this recently
[https://topaz.github.io/paste/](https://topaz.github.io/paste/) where the
entirety of the paste is stored base64 encoded in the URL.

------
quickthrower2
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..."

------
VWWHFSfQ
what's with nill typo'd in multiple places

~~~
eska
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.

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

------
op00to
Wow! No idea Nginx could do that!

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

~~~
usamaejaz
openresty is really awesome!

------
xorcist
It's like mod_perl, but with lua!

~~~
mhd
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/](https://leafo.net/lapis/)

