Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] -- location-based ip blocking #2509

Closed
wants to merge 1 commit into from

Conversation

ali123
Copy link
Contributor

@ali123 ali123 commented Feb 7, 2014

@jbau please take a look

@jbau
Copy link

jbau commented Feb 7, 2014

will do.
To any community members watching this: nothing is imminent about blocking, especially at edx.org. This is just backup code for just-in-case, at Stanford

@jbau
Copy link

jbau commented Feb 7, 2014

looking now. first you should add "pygeoip==0.3.0"
to requirements/edx/base.txt

@jbau
Copy link

jbau commented Feb 7, 2014

License for pygeoip is License: LGPLv3+

"""
simple middlware to block IP addresses
"""
gi = pygeoip.GeoIP(settings.GEOIP_DAT_LOCATION, pygeoip.MEMORY_CACHE)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would making this a part of the module, instead of part of the class, be more efficient?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I think this is okay. it's in the class prototype.

@carsongee
Copy link
Contributor

Just my2cents, but why not just do the blocking with nginx or apache? It seems simpler and more configurable than adding it inside the platform. http://nginxlibrary.com/ip-based-country-blocking/ for nginx example.

@jbau
Copy link

jbau commented Feb 7, 2014

that approach has merits for sure--do we need to compile our own nginx to do that?

@carsongee
Copy link
Contributor

nginx -V on my vanilla sandbox install it has the geo_ip module baked in.

@jbau
Copy link

jbau commented Feb 7, 2014

Nice!

On Feb 7, 2014, at 9:29 AM, Carson Gee notifications@github.com wrote:

nginx -V on my vanilla sandbox install it has the geo_ip module baked in.


Reply to this email directly or view it on GitHub.

@jbau
Copy link

jbau commented Feb 7, 2014

@ali123 it also looks like you need to do a similar envs setup for cms

@jbau
Copy link

jbau commented Feb 7, 2014

can you also move the middleware into its own file? some import sequences used by the "gather-assets" step of prod install load util.requests and actually instantiates the middleware class, but the files and settings referred to by that class aren't always there.

@jbau
Copy link

jbau commented Feb 8, 2014

@singingwolfboy
Copy link
Contributor

This pull request hasn't been touched in a month, it needs a rebase, and the title is marked "DO NOT MERGE". Can this pull request be closed, or is it still being used for something?

@ali123
Copy link
Contributor Author

ali123 commented Mar 18, 2014

@singingwolfboy I'm closing this PR. We've implemented it at nginx level.

@ali123 ali123 closed this Mar 18, 2014
@benpatterson benpatterson deleted the ali123/ip-blocking branch January 21, 2015 13:12
KristinAoki pushed a commit that referenced this pull request Mar 12, 2024
* feat: XBlock's children API as DRF

* fix: 500 error appears if user adds a Content Experiment

* fix: wrap into try/except block getting icon for xblock (#2509)

* fix: wrap into try/except block getting icon for xblock

* fix: revision after review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants