[keyserver] Factor out importJSON
Summary: I was using copy-pasted code in several places, which is an anti-pattern. This diff should be a pure refactor.
Test Plan:
Here's my plan:
- Test backup: create keyservers/facts/backups.json, update cronjob schedule to run right now, and make sure backup is created:
- Test GeoIP update: create keyservers/secrets/geoip_license.json, and then run cd keyserver && yarn update-geoip
- Test push notifs on both iOS and Android (see @palys-swm's instructions in a comment below)
- Test URLs (make sure keyserver works)
Reviewers: palys-swm, atul
Reviewed By: palys-swm, atul
Subscribers: Adrian, yayabosh, palys-swm
Differential Revision: https://phabricator.ashoat.com/D4024