Show HN: Mogo Chat – open-source team chat app written in Elixir and Ember.js
getmogochat.com
getmogochat.com
The problem I see with message apps is that it's like email; you really wished you could host it yourself and fine tune things (as well as make sure nobody is eavesdropping). But you can't have it down or (worse) performing at half capacity. It needs to be up all the time with almost perfect quality.
Sure you can set something up yourself, but you'll probably struggle with maintaining a decent QoS, and if your team is any good, they probably won't allow that to go on very long.
It looks a little something like this: http://i.imgur.com/djnd0Uk.png
It's still in it's infancy, currently working on a big update that includes a REST api and other stuff.
The only reason I don't host my own e-mail is I haven't found an open source project that can truly compete with gmail's functionality and the fact I don't really care if Google reads my e-mail since none of it is sensitive.
I have high hopes for https://www.mailpile.is/ since if my Desktop is down, I'm screwed /anyway/.
Just my two cents.
You sure can maintain your own IRC server, the same way you can maintain your own Git server. But it's probably a waste of time when you know that you have free or cheap alternatives (Gmail, GitHub, Mailchimp): stuff breaks, and even if you can fix it doesn't mean you should.
I outsource stuff that I depend on and don't want to waste time maintaining: email, online storage, some collaboration tools...
If you're into mailpile, you should support them for the Knight Foundation News Challenge: https://www.newschallenge.org/challenge/2014/feedback-review.... Personally, I assume that I wouldn't be able to do a better job at securing stuff up on my own, but it is an interesting project nonetheless.
And if you still have 5 minutes to kill, check out Carbon Folder, my team's entry: https://www.newschallenge.org/challenge/2014/submissions/car...
I'll take a look at yours, I already did the Mailpile bit.
EDIT: Looks like it's CSS, not JS. In case it helps, here's what I'm seeing [1], and here's the code from the message:
<style>* { float: left; display: block }</style>
[1] http://imgur.com/BoZ6lrFEDIT 2: Yup, style tags don't seem to be escaped. Tried changing colors of the room a few times, and it worked:
<style>* { color: green; }</style>
EDIT 3: Issue filed here: https://github.com/HashNuke/mogo-chat/issues/2You don't make an app/website secure by deciding on a list of things you need to sanitise.
You sanitise everything to start with.
A very common rookie error.
I agree
> You sanitise everything to start with.
So you need to list everything you need to sanitise...
A better approach is to ban "innerHTML" from your code. You should always display user generated text in text nodes.
var t = document.createTextNode(msg);
content.appendChild(t);
That code sanitises all possible content in msg. I don't need to list out HTML tags, script/style tags, do special case for unicode exploits, etc.You need to list what variables are "unsafe", but you don't need to list out the ways they might be unsafe. If it's got the potential to be unsafe, assume it's completely unsafe in every conceivable way, and don't use it in any context apart from as an unsafe text string.
The rookie code is something like:
msg.replace("something I think is unsafe", "something safer");
content.innerHTML+=msg;
And agreed. InnerHTML should be removed from browsers.So it is a bit more complex than that if they want to enable user markup. https://code.google.com/p/pagedown/source/browse/Markdown.Sa... https://code.google.com/p/pagedown/wiki/PageDown
It is [message] -> [parse] -> [sanitize], generally.
A) It was not as simple as you suggested if there was markup involved in the message.
B) They'd have to use a parser and I linked to a parser that sanitizes that was once used in a pretty big network of sites.
I'm uncertain if you misunderstood or are simply agreeing with me in a tone of writing that makes it sound like you disagree.
The safety of widely-deployed Markdown + sanitizer libraries is largely thanks to testing at scale and a history of patches for XSS vulnerabilities.
While it's still the fastest method for changing the page DOM it shouldn't be. When used outside of user inputted scenarios it's fine.
It would be great if I didn't have to use any Off-the-Shelf code at all, or if I must, if I actually had the time and knowledge to review it for serious vulnerabilities. But posts like this are why I come to HN.
EDIT: Should be fixed now.
Thanks JangoSteve for reporting this.
Error on startup
No route matches get to ["%3Ca%20target=%27_blank%27%20href=%27http:", "pierregoutheraud.fr"]I'm curious why you decided to implement this with a poller instead of with a Websocket. There's actually a reasonably detailed answer about how to do this sort of thing with Ember Data in the emberjs.com guides: http://emberjs.com/guides/models/frequently-asked-questions/...
Either way, how did you find working with Ember Data in general? What were the main sticking points?
* Message loss * Latency * Authentication has to be done again over websockets - on every connect and reconnect. That means it is going to make the app resource hungry.
This is my first time with Ember. Experience was pleasant. The codebase is fast-changing, so StackOverflow replies become quickly outdated. You'll have to refer to the CHANGELOG.md file in their repos. And the Ember IRC channel is super-helpful.
Right, except that WebSockets only connect once in normal operation. You'd be surprised how resource hungry WebSockets aren't when compared to constant HTTP connections. Waiting 2.5 seconds for messages to arrive to all clients feels a little imperfect.
Websockets disconnects for me frequently. So during reconnection, I'll have to reauth in my case.
MogoChat is right now a one-man project, so supporting websockets and then polling seemed tedious, especially with something like Faye or SocketIO missing in Elixir. Phoenix Framework will soon have a high level abstraction over websockets (with Faye-like features). Once that's in, I'll be able to use it.
So quality of the app aside (I haven't looked) everyone should give Elixir a go.
Thanks for an example in Elixir, though:)
But if it's an Ember app, why don't the different rooms present as different URLs?
IMHO, chat apps usually push the limits of any frontend framework.
I have written an Ember app that maintains a persistent websocket connection as it transitions around through many URLs.
I approve of this kind of API documentation.
That said, the full service is $5/month and so not for everybody. Also, you mention security and I'm not sure whether you'd consider a cloud service permissible in that sense or not.
Make sure the last command is run when you copy-paste the commands. That is what creates the admin user and the sample room. admin@example.com and password is "password".
Also, I've now disabled editing the account details on the demo app (the password was being changed frequently). So it should be fine from now on.
Put your money where your mouth is.