fossasia / open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
https://api.eventyay.com
GNU General Public License v3.0
2.97k stars 1.89k forks source link

Search Function: Location incorrect based on user's IP address #2722

Closed GabrielLee22 closed 7 years ago

GabrielLee22 commented 7 years ago

Following up from issue #2714 - the search function does not accurately reflect the country a user is in based on his or her IP address. For instance, I was shown search results for the United States instead of Singapore - although I live in Singapore.

2a5eb670-ca39-11e6-862d-432549c1184a

shubham-padia commented 7 years ago

This bug is on eventyay only as Google app engine does not allow python modules with extensions written in c. (refer https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27 ) while heroku allows it and geoip2 module uses an extension written in c.

To solve this we could use a pure python module like https://github.com/appliedsec/pygeoip or we could check for headers specific to Google App Engine (which work pretty good by the way, check here ) by checking the header keys like "X-AppEngine-Country"

@niranjan94 @SaptakS What are your views on this?

niranjan94 commented 7 years ago

@shubham-padia we're not using app engine for eventyay. It uses Google Container Engine & Compute Engine. And extensions written with C work on eventyay

niranjan94 commented 7 years ago

I believe the problem exists with the Nginx Ingress Controller. It has to be configured such that the client Ip is visible to the final web service in some form.

shubham-padia commented 7 years ago

@niranjan94 Ohh...sorry, I always thought eventyay ran on app engine :smile:

niranjan94 commented 7 years ago

@shubham-padia Nope. We use Kubernetes and google container engine ... Do check it out :smile: It's awesome !

Our configuration files are at https://github.com/fossasia/open-event-orga-server/tree/development/kubernetes

abishekvashok commented 7 years ago

Guys I have a suggestion we could integrate the geo locator which is a project of FOSSASIA currently for this, the project is at: github.com/fossasia/geo_locator it currently works for the gci16 site only we could improve it's reach. Suggestions please @niranjan94

niranjan94 commented 7 years ago

@Abhi2424shek I don't think that could be used here ... And this issue is related the wrong IP address of the user being passed on to the app

abishekvashok commented 7 years ago

Hah @niranjan94 i interpreted it the other way, reading through.

niranjan94 commented 7 years ago

Finally resolved by 8922ce1b5336213a65436500738660f04c59c34e :)