Improved installation process

This commit is contained in:
2018-04-07 14:17:33 +02:00
parent 27264d691a
commit c5c05aea04
6 changed files with 44 additions and 71 deletions

View File

@ -68,6 +68,15 @@ func updateUserInfo(ctx *aero.Context, user *arn.User) {
// Updates the location of the user.
func updateUserLocation(user *arn.User, newIP string) {
user.IP = newIP
if arn.APIKeys.IPInfoDB.ID == "" {
if arn.IsProduction() {
color.Red("IPInfoDB key not defined")
}
return
}
locationAPI := "https://api.ipinfodb.com/v3/ip-city/?key=" + arn.APIKeys.IPInfoDB.ID + "&ip=" + user.IP + "&format=json"
response, err := client.Get(locationAPI).End()