HNHacker News
TopNewBestAskShowJobs

mikelehen

71 karma · joined October 25, 2011

Human.
submissionscomments
mikelehen··on Show HN: Firepad, an open source collaborative text editor
Ooops. When the editor has focus, it tries to keep your cursor visible when it moves. And your cursor can end up moving due to other people's edits.

I tweaked the page to not auto-focus the editor. Thanks!

mikelehen··on Announcing Firepad — Our Open Source Collaborative Text Editor
This should be a pretty easy thing to add, and it's all open source... :-)
mikelehen··on Announcing Firepad — Our Open Source Collaborative Text Editor
Yes! His work is great. Made for a great starting point for building Firepad. :-)
mikelehen··on Show HN: Firepad, an open source collaborative text editor
Firepad will eventually support rich-text copy/paste and import/export as HTML (export is actually already supported through the API, but not exposed through the existing UI), as well as lists, paragraph indent, and all of the other features that you'd want. They just didn't make it in for the v1 release. :-)

As for similar projects that are already more HTML-friendly, maybe check out Etherpad[1]? It has HTML import / export, though I haven't tested it out.

1. http://etherpad.org/

mikelehen··on Show HN: Firepad, an open source collaborative text editor
We built it as a Firebase app, but we're releasing it as open source and are looking forward to seeing what the community does with it. :-) All of the OT work happens client-side, so it's certainly possible to adapt it to other backends.

Additionally, a lot of the OT code is based on ot.js[1], a fantastic open source OT implementation by Tim Baumann. He has a node.js backend as well as Haskell and Python. Of course then you have to run the server code somewhere and figure out how to persist the documents, etc. :-) Definitely worth checking out though.

1. https://github.com/Operational-Transformation/ot.js/

mikelehen··on Show HN: Firepad, an open source collaborative text editor
I'm biased, since I'm a Firebase dev, but honestly, Firebase is great for solving /all kinds/ of use cases. :-)

We've had people build everything from emergency response simulations synchronized across multiple devices to iOS apps for grandparents to read books with their grandkids over long distances.

Firebase is great any time you need real-time updates, collaboration, or you just want to get something up and running without having to spin up your own servers.

mikelehen··on Our Beta is Now Open to All Developers
Transactions have to be done at the common ancestor of the data being modified, so it's best to use them for data that's nearby in the Firebase data tree. You /can/ do a transaction on a large chunk of data (e.g. the entire user list), but the client would need to sync the entire data and there'd be a greater chance of contention.

If you need atomic bidirectional friendships though, you can do it if you structure your data a little differently. To turn a friendship between a pair of users on and off, you could set /friends/user1/user2 to true iff user1 and user2 are friends. Then you can write security rules that are based off of that to allow and deny access to the users' data.

mikelehen··on Our Beta is Now Open to All Developers
1. The API was designed pretty carefully to ensure we wouldn't box ourselves into any corners that would limit our real-time or scalability capabilities. So we've intentionally avoided advanced querying for now. You may see features along these lines in the future, but right now we recommend denormalizing your data during writes to match how you want to consume the data (which is a pretty common nosql practice). Firefeed is a good example of this, actually.

2. RequireJS is on our radar. I don't know too much about it, but if developers want it, we'll likely end up adding it. :-)

mikelehen··on Our Beta is Now Open to All Developers
Absolutely. Our Node.JS Library[1] and REST endpoints[2] are for exactly that. So you can still keep all the benefits of Firebase (real-time data synchronization between all clients of your app) while augmenting it with server-side code specific to your needs.

[1] https://www.firebase.com/docs/nodejs-quickstart.html

[2] https://www.firebase.com/docs/rest-api.html

mikelehen··on Our Beta is Now Open to All Developers
Great question! The key to our security model is our Security Rules system. Security rules are authored by the developer and stored as part of their Firebase. Firebase then executes them automatically to validate all reads and writes of data.

You can check out the rules for Firefeed here: https://github.com/firebase/firefeed/blob/master/rules.json

And be sure to check out our Security Quickstart Screencast, walking you through the system: https://www.firebase.com/docs/security-quickstart.html

mikelehen··on The New Firebase Security API
The Candle Plan is and will continue to be free! (All of the pricing on the website is just to give people an idea of what the pricing will be when we leave beta. It's not being enforced right now.)
mikelehen··on The New Firebase Security API
Firebase doesn't use cookies for authentication so CSRF isn't an issue. You have to explicitly call auth() on our JavaScript SDK with valid credentials, or include valid credentials in the querystring of a REST request.
mikelehen··on The New Firebase Security API
During the design process, we solicited feedback from several security experts (security firms and ad-hoc hackers alike). It hasn't gone through a formal outside audit at this point though. (And please do keep in mind that we're still a beta product. We're pretty confident in what we've built, but we're not making promises at this point.)
mikelehen··on The New Firebase Security API
Thanks! We're certainly grateful for all of the input and feedback we received while designing this thing (especially from our beta users who came through time and time again, giving us countless security use cases and providing feedback on our prototype implementations).

I will point out though that what you described looks like an ACL system with groups (akin to unix permissions), and we think our Security Rules system is actually quite a bit more powerful than that (you could easily build ACL / groups on top of it, but you can build lots of other models too). :-)

mikelehen··on The New Firebase Security API
Fay looks neat! I'll have to play with it.

Since the whole rules language is custom, we're not using any off-the-shelf projects presently, and to be honest, we've only scratched the surface of what's possible.

Most of what we have in place right now is at the level of type-checking and other expression-correctness checks (we're intentionally more strict about a number of things than JavaScript).

But given the nature of the rules we can do a lot of cooler analysis, like detect redundant or conflicting rules. We should also be able to do interesting analysis for the developer like answer questions like "What parts of my Firebase data can an unauthenticated client read or write?", "What parts can a user authenticated as 'joe' read or write?"

This sort of analysis should help developers reason about their rules and verify their correctness. Honestly, I'm pretty excited about the possibilities. :-)

mikelehen··on The New Firebase Security API
Here's a little secret. The security rules you, as a Firebase developer, write for your Firebase, are actually server-side validation code. It just doesn't look like typical code, and we've carefully designed them to have a lot of good properties regarding performance, correctness, and analyzability. And we (Firebase) take care of enforcing them for you.

But it /is/ server-side validation, that you as a developer get to specify.

(That said, we're definitely happy to get feedback on our approach from any security experts out there that want to take a look!)

mikelehen··on The New Firebase Security API
This is where Security Rules shine over ACL's or other more rigid security models. As the application developer, you have complete control over that sort of functionality since the rules are quite flexible and have direct access to your Firebase data.

So you could store a 'public' flag on every picture in your Firebase data, and then write a single rule that checks the value of that flag, and if it's true, allows anonymous access (and if it's not true, checks that the accessing user is in the picture owner's friends/family list).

Assuming your rules let the picture owner edit the 'public' flag, they'll be able to flip it on and off, granting or revoking access to non-friends/family. And since everything in Firebase is real-time, the change will instantly take effect.

mikelehen··on The New Firebase Security API
Yeah. That bugs us too. :-) We might support a non-JSON format for easier authoring at some point, but we thought JSON was the right starting point since people are familiar with it and it has a lot of good tooling and interoperability advantages.
mikelehen··on The New Firebase Security API
Michael from Firebase here. By using declarative rules instead of arbitrary code to enforce Security, we can do lots of optimization and guarantee predictable execution time (arbitrary code can take an arbitrarily long time to execute). It also lets us do various static analysis on your rules to catch common mistakes.

Having rule expressions attached directly to data locations also ends up being much more concise (which means less boilerplate code and less opportunities for mistakes), which we think is important for a security API.

mikelehen··on ‘Firebase’ Does for Apps What Dropbox Did for Docs
Hey. Yeah, we have an ACL system for specifying who can read/write data at each location. So you can lock down your application data to keep it secure. The API for this is still in flux though, so it's not documented. Coming soon though! :-)
← PreviousPage 2 of 2