Saturday, July 11, 2015 revision

[status] server is down - (rebuilding node) - try again tomorrow

Several evenings and some new node.js skills later I have made the following progress on my development server at

  • user authentication beginnings using OAuth login on 
  • webdav file system for mounting storage on local machine
  • node 0.13.0-pre 0.12.7 update and rebuild 

login authentication

The login involves an https session between my server and system as a response to a client request.

In my mind current authentication is like watching IRC between bots:

< connection #1 > client ,
[client] Hi!
[] Hi! Go and get a token from github, tell them I sent you.

< connection #2 > client ,
[client] Hi github, told me to pick up a token
[] Hi, as you are logged in, please OK permission for 
[client] OK
[] Good, here is freshly baked token with mixture of secret ingredients.

< connection #1 > client ,
[client] Hey, git hub gave me a token!
[] Give me that, now forget that, this id is all you need for this session.
[client] Nice, so no cookies?

< connection #3 >,
[] hey github, please confirm this is valid token and advise user github id
[] for sure, your login is authentic github user #12345

< connection #1 > client ,
[] No cookies my trusted friend! 
[client] OK, please build the project 
[] I will do that now. ....

I may modify logging style to reflect this in future.

version pain

A few snags using jsDAV were due to bitrot in the version of node I had built on my ec2 server many moons ago.

Bitrot is due to programmers continually tweaking shit with API changes to reflect what ever is the new black.

In this instance node's package manager reports that both jsDAV and gnu-tools that it uses were released when path.exists() instead of fs.exists() was the order of the day.

As a C++ user I am used to link time errors being reported at build time, not at the random time a random user invokes a particular API that is no longer present.

From the point of view of every working release of every project affected by fickle / knuckle head changes to API that don't appear to fail until actually invoked I am sad to say my days with node.js are possibly numbered.

Go or Monkey2 being likely replacement candidates for this particular stack. The webDAV spec is a significant undertaking of engineering, unfortunately the Go package looks to be a work in progress.

[edit] Admittedly there were warnings when I was installing the packages so I should have known which versions of which tool would work and that is expectation this node.js developer hadn't entirely grokked.

language style

Although I would certainly like to change to a statically linked language in future node.js has it's good points.

The package manager is very inspiring, if you give it a github url as project name to install it just adapts, nice.

The single threaded V8 based interrupt handler from hell aka node encourages you to get knee-deep in callbacks. Using Microsoft code editor on Mac still feels a little weird but besides code completion idiocrity it be pretty sweet.

It sure is a nice break from daytime code conventions where an indent of 4 tabs indicates you have broken the complexity barrier and will need to refactor before code review.

cloud storage

The WebDAV module allows me to mount storage space from my server locally.

Previous attempts had been with samba / netfs  shares which even with low ping times and great bandwidth were hideously slow.

The paranoid are welcome to suggest compromised network connections. I'm always looking for evidence of Godwin's Law so will post some comparison speed tests.

next steps

It seems like everyone has played and the addictive drop in nature has me very pleased as it's simple but effective implementation does make for some fine twitch based entertainment.

That and creating a new home for all my projects now Google has foreclosed on all the projects with a home at googlecode.

And a remote build server for my raspberry pi monkey distribution the cross compiler for which I already have installed in the cloud waiting for service...