   hostname: String
   os: String
   remoteAddress: String
+  platform: String
 
 # associations
 DeploySchema.method 'team', (callback) ->


# validations
DeploySchema.path('remoteAddress').validate (v) ->
  switch v
    when /72\.2\.12[67]\.\d+/ # 72.2.126.0/23 - joyent
      true
    else
      false
, 'not production'

# callbacks

    team.save()

Deploy = mongoose.model 'Deploy', DeploySchema

toBytes = (ip) ->
  [ a, b, c, d ] = ip.split '.'
  (a << 24 | b << 16 | c << 8 | d)

inNetwork = (ip, networks...) ->
  for network in networks
    [ network, netmask ] = network.split '/'
    netmask = 0x100000000 - (1 << 32 - netmask)
    return true if (toBytes(ip) & netmask) == (toBytes(network) & netmask)
  false
