diff --git a/backend/server/server.go b/backend/server/server.go index 4dd4f30..452d9fc 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -100,7 +100,7 @@ func apiEBootstrapHandler(w http.ResponseWriter, r *http.Request) { func apiERegisterHandler(w http.ResponseWriter, r *http.Request) { userId := r.URL.Query().Get("user_id") deviceId := r.URL.Query().Get("device_id") - GLOBAL_DB.Create(&shared.Device{UserId: userId, DeviceId: deviceId}) + GLOBAL_DB.Create(&shared.Device{UserId: userId, DeviceId: deviceId, RegistrationIp: r.RemoteAddr, RegistrationDate: time.Now()}) } func apiBannerHandler(w http.ResponseWriter, r *http.Request) { diff --git a/shared/data.go b/shared/data.go index b5a2bcb..06974d0 100644 --- a/shared/data.go +++ b/shared/data.go @@ -17,6 +17,12 @@ type EncHistoryEntry struct { type Device struct { UserId string `json:"user_id"` DeviceId string `json:"device_id"` + // The IP address that was used to register the device. Recorded so + // that I can count how many people are using hishtory and roughly + // from where. If you would like this deleted, please email me at + // david@daviddworken.com and I can clear it from your device entries. + RegistrationIp string `json:"registration_ip"` + RegistrationDate time.Time `json:"registration_date"` } const (