Saturday, July 11, 2015

geom.nz revision

[status] geom.nz 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 http://geom.nz:

  • user authentication beginnings using OAuth login on api.github.com 
  • webdav file system for mounting geom.nz 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 github.com system as a response to a client request.

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

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

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

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

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

< connection #1 > client , geom.nz
[geom.nz] No cookies my trusted friend! 
[client] OK, please build the project 
[geom.nz] 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 agar.io 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...