News for hackers. Stuff that matters.
Re:Show HN: CMS Server written in Go (alpha) by mappu on Saturday June 01, 2013 @06:52AM (#5803502)
> Password must be composed of only alpha-numeric characters.

Okay, why?

This caught my eye so i had a look through auth.go. Passwords are salted sha1... okay, but why not bcrypt? No PBKDF2? No field for hash format versioning if you want to backwards-compatible upgrade to bcrypt in future? Guess you could always go by the salt length or something.

It looks like your code to hash the password and salt is copy-pasted and appears twice, don't do that.

Your salts are 16 random bytes, okay.. but why base64 encode the salt before hashing? Now some structure of the content is known that might expose a weakness.

Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @07:10AM (#5803534)
:-) put me on the spot! thanks for going through the code though.

security layer definitely needs more work. my choices were mostly limited by my haste to get a working prototype and not very well thought through.

Re:Show HN: CMS Server written in Go (alpha) by mappu on Saturday June 01, 2013 @07:30AM (#5803572)
No problem, thanks for sharing your project with everyone! Just people definitely like to use symbols in passwords.

Your fundamentals are fine, i don't think those are very serious problems compared to the average custom web app in the wild (most of which probably use plaintext passwords with no concern for sqli or xss...)

Re:Show HN: CMS Server written in Go (alpha) by ryalfalpha on Saturday June 01, 2013 @01:19PM (#5804908)
Haven't done much golang and don't have it installed on this laptop, but are string comparisons constant time?

If not, I think there is potential for a timing attack here?

if usr == _admin_usr && pw == _admin_pw { return RootMode, nil }

Re:Show HN: CMS Server written in Go (alpha) by omra on Saturday June 01, 2013 @01:47PM (#5805039)
Go does not have constant time string comparisons by default. The crypto/subtle package supplies constant time comparisons.
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @03:00PM (#5805405)
Thanks for pointing that out. Will look into it
Re:Show HN: CMS Server written in Go (alpha) by reedlaw on Saturday June 01, 2013 @07:54AM (#5803624)
I'm having trouble understanding the motivation or use case. The documentation gives examples of logging in, creating filesystem-like structures, and uploading files. How is this an improvement upon a regular filesystem and scp/sftp? I do like the web console though.
Re:Show HN: CMS Server written in Go (alpha) by dualogy on Saturday June 01, 2013 @07:57AM (#5803632)
Well, from the docs:

--

Therefore, instead of dealing with key-values, objects ids and primary keys, you can access your data using file paths just as you would with a regular file system. Bytengine’s file system is modelled on the linux file system where you have a root directory ‘/’ and file paths separated by a forward slash ‘/’. Bytengine stores your content in Files that can further be organised in Directories.

--

So there you have it! Wait...

Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @08:02AM (#5803644)
Appart from being able to access your content as you would a regular file system, you can also query and modify your content metadata.

So you could upload pictures, tag them in JSON and later run live queries based on the tags from your client app (to sort them based on location for example).

I'll be adding more/better docs in the coming days.

cheers

Re:Show HN: CMS Server written in Go (alpha) by ams6110 on Saturday June 01, 2013 @01:09PM (#5804830)
How is this an improvement upon a regular filesystem and scp/sftp

scp/sftp is great, but if you've ever had to deal with large numbers of users trying to properly manage ssh key pairs you will know it's not an approach that will work at scale.

Re:Show HN: CMS Server written in Go (alpha) by shadowmint on Saturday June 01, 2013 @05:37AM (#5803381)
mongodb + redis instead of sql? ...because?
Re:Show HN: CMS Server written in Go (alpha) by pjmlp on Saturday June 01, 2013 @06:38AM (#5803481)
... because it is what the cool kids use instead of what the boring enterprise guys are using.
Re:Show HN: CMS Server written in Go (alpha) by ExpiredLink on Saturday June 01, 2013 @06:29AM (#5803465)
... because it's web scale.
Re:Show HN: CMS Server written in Go (alpha) by FraaJad on Saturday June 01, 2013 @09:25AM (#5803844)
because i don't care for errors on `random(x)/2` occasions.
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @05:46AM (#5803395)
IMO Mongodb makes it easier to add and query file metadata and Redis is really just for session info.
Re:Show HN: CMS Server written in Go (alpha) by dualogy on Saturday June 01, 2013 @07:54AM (#5803625)
Don't get it. You already have a Mongo, why also use Redis just for that? I mean your Mongo is in-memory too. Or do you anticipate a larger-than-RAM dataset for the MongoDB?
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @08:07AM (#5803654)
expiring keys makes session timeout easier. also array access in mongodb isn't as versatile as with redis.
Re:Show HN: CMS Server written in Go (alpha) by hendzen on Saturday June 01, 2013 @02:51PM (#5805361)
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @03:03PM (#5805424)
Thanks for the link. I'm of the view though that redis offers better and more convenient implementation.

cheers

Re:Show HN: CMS Server written in Go (alpha) by dualogy on Saturday June 01, 2013 @08:18AM (#5803676)
Interesting, thanks!
Re:Show HN: CMS Server written in Go (alpha) by xSwag on Saturday June 01, 2013 @07:07AM (#5803528)
Weird headers

The main page is active in the browser but the header says 404 Not Found, maybe it's a bug?

  ~$ curl -IL http://www.bytengine.com/    
  HTTP/1.1 404 Not Found
  Server: nginx/1.1.19

    
  ~$ curl -IL http://www.bytengine.com/should_404    
  HTTP/1.1 404 Not Found
  Server: nginx/1.1.19
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @07:12AM (#5803538)
must probably be an issue with my nginx config and the proxying. will have a look at it. thanks
Re:Show HN: CMS Server written in Go (alpha) by xSwag on Saturday June 01, 2013 @07:14AM (#5803544)
Yeah, just thought I'd point it out because it will cause issues with spiders.
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @07:45AM (#5803598)
actually nginx config is fine. I wasn't properly using "github.com/gorilla/mux". Sorting it out now. cheers
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @03:56AM (#5803194)
Still needs quite a bit more documentation, code comments, architecture revisions etc... your suggestions/comments/feedback are most welcome.

cheers

Re:Show HN: CMS Server written in Go (alpha) by garysweaver on Saturday June 01, 2013 @08:01AM (#5803642)
neat. is this a bug?

server.newuser

line[1]: expected string in New User; got EOF

Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @08:05AM (#5803649)
Hi! please run: 'help server.newuser' to check the syntax.

cheers

Re:Show HN: CMS Server written in Go (alpha) by the1 on Saturday June 01, 2013 @07:37AM (#5803586)
what's wrong with webdav?
Re:Show HN: CMS Server written in Go (alpha) by klibertp on Saturday June 01, 2013 @01:13PM (#5804853)
I think that all that's wrong with alternatives to this kind of projects is that they are not written by the author. It's ok actually, many people and many great technologies started as pet projects; it just means that asking questions like this makes no sense :)
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @08:08AM (#5803656)
can you elaborate further
Re:Show HN: CMS Server written in Go (alpha) by tuananh on Saturday June 01, 2013 @04:42AM (#5803260)
I read the domain as 'By tengine'. Does it has anything to do with tengine web server?
Re:Show HN: CMS Server written in Go (alpha) by ConceitedCode on Saturday June 01, 2013 @04:44AM (#5803267)
I read it as ByteEngine at first glance. Maybe it shares an E?
Re:Show HN: CMS Server written in Go (alpha) by wilsonfiifi on Saturday June 01, 2013 @04:46AM (#5803273)
yes the e from byte & engine are fused :-)