magic-wormhole-mailbox-server icon indicating copy to clipboard operation
magic-wormhole-mailbox-server copied to clipboard

collect very coarse client location in usage DB

Open warner opened this issue 6 years ago • 0 comments

We don't record IP addresses in the mailbox server (except for error cases, for which I haven't found an easy way to filter them from the exception messages), but I'd kind of like to know roughly how many users we have coming from different countries. At some point I'll probably move the mailbox server from it's current location (a Linode box, probably in texas somewhere), and it'd be good to choose a hosting provider that minimizes mediam round-trip latency to clients.

I don't think we could measure this directly: clients don't include any timestamps in their server messages, and their clocks could be horribly skewed anyways, and there aren't any server messages that clients react to right away (they respond to the other client's PAKE message with an encrypted VERSION message, but they also run the entire PAKE calculation inbetween, which takes a while and would bias the results pretty badly). And besides I don't want that level of detail.

So I'm thinking of feeding the client's IP address into one of those offline geolocation tables (looks like the MaxMind DB might work), and storing the country code in the Usage record.

warner avatar Apr 04 '18 00:04 warner