upgrade gunicorn 19.0

This commit is contained in:
nadeemshahzad
2018-11-15 13:28:16 +00:00
parent c992edc83d
commit 9d95c2e632
12 changed files with 52 additions and 26 deletions

View File

@@ -468,7 +468,7 @@ XQUEUE_INTERFACE = {
################################# Middleware ###################################
MIDDLEWARE_CLASSES = [
'x_forwarded_for.middleware.XForwardedForMiddleware',
'openedx.core.lib.x_forwarded_for.middleware.XForwardedForMiddleware',
'crum.CurrentRequestUserMiddleware',

View File

@@ -1210,7 +1210,7 @@ CREDIT_NOTIFICATION_CACHE_TIMEOUT = 5 * 60 * 60
################################# Middleware ###################################
MIDDLEWARE_CLASSES = [
'x_forwarded_for.middleware.XForwardedForMiddleware',
'openedx.core.lib.x_forwarded_for.middleware.XForwardedForMiddleware',
'crum.CurrentRequestUserMiddleware',

View File

@@ -0,0 +1,30 @@
"""
Middleware to use the X-Forwarded-For header as the request IP.
Updated the libray to use HTTP_HOST and X-Forwarded-Port as
SERVER_NAME and SERVER_PORT.
"""
class XForwardedForMiddleware(object):
"""
Gunicorn 19.0 has breaking changes for REMOTE_ADDR, SERVER_* headers
that can not override with forwarded and host headers.
This middleware can be used to update these headers set by proxy configuration.
"""
def process_request(self, request):
"""
Process the given request, update the value of REMOTE_ADDR, SERVER_NAME and SERVER_PORT based
on X-Forwarded-For, HTTP_HOST and X-Forwarded-Port headers
"""
for field, header in [("HTTP_X_FORWARDED_FOR", "REMOTE_ADDR"), ("HTTP_HOST", "SERVER_NAME"),
("HTTP_X_FORWARDED_PORT", "SERVER_PORT")]:
if field in request.META:
if ',' in request.META[field]:
request.META[header] = request.META[field].split(",")[0].strip()
else:
request.META[header] = request.META[field]
return None

View File

@@ -17,7 +17,7 @@ futures==3.2.0 # via tornado
idna==2.7
ipaddress==1.0.22
lxml==3.8.0
markupsafe==1.0
markupsafe==1.1.0
matplotlib==1.3.1
networkx==1.7
nltk==3.3.0

View File

@@ -15,7 +15,7 @@ enum34==1.1.6 # via cryptography
idna==2.7 # via cryptography
ipaddress==1.0.22 # via cryptography
lxml==3.8.0
markupsafe==1.0
markupsafe==1.1.0
networkx==1.7
nltk==3.3.0
numpy==1.6.2

View File

@@ -62,7 +62,6 @@ django-user-tasks
django-waffle==0.12.0
django-webpack-loader # Used to wire webpack bundles into the django asset pipeline
djangorestframework-jwt
django-xforwardedfor-middleware==2.0 # Middleware to use the X-Forwarded-For header as the request IP
dogapi==1.2.1 # Python bindings to Datadog's API, for metrics gathering
edx-ace==0.1.10
edx-analytics-data-api-client
@@ -92,7 +91,7 @@ fs==2.0.18
fs-s3fs==0.1.8
futures ; python_version == "2.7" # via django-pipeline, python-swift-client, s3transfer
glob2==0.3 # Enhanced glob module, used in openedx.core.lib.rooted_paths
gunicorn==17.5
gunicorn==19.0
help-tokens
html5lib # HTML parser, used for capa problems
ipaddr==2.1.11 # Ip network support for Embargo feature

View File

@@ -101,7 +101,6 @@ django-storages==1.4.1
django-user-tasks==0.1.5
django-waffle==0.12.0
django-webpack-loader==0.6.0
django-xforwardedfor-middleware==2.0
django==1.11.16
djangorestframework-jwt==1.11.0
djangorestframework-xml==1.3.0 # via edx-enterprise
@@ -126,7 +125,7 @@ edx-oauth2-provider==1.2.2
edx-opaque-keys[django]==0.4.4
edx-organizations==1.0.0
edx-proctoring==1.4.0
edx-rest-api-client==1.9
edx-rest-api-client==1.9.1
edx-search==1.2.1
edx-submissions==2.0.12
edx-user-state-client==1.0.4
@@ -141,7 +140,7 @@ fs==2.0.18
future==0.17.1 # via pyjwkest
futures==3.2.0 ; python_version == "2.7"
glob2==0.3
gunicorn==17.5
gunicorn==19.0
hash-ring==1.3.1 # via django-memcached-hashring
help-tokens==1.0.3
html5lib==1.0.1
@@ -165,7 +164,7 @@ mailsnake==1.6.2
mako==1.0.2
markdown==2.6.11
markey==0.8 # via django-babel-underscore
markupsafe==1.0
markupsafe==1.1.0
mock==1.0.1
mongoengine==0.10.0
mysql-python==1.2.5
@@ -180,7 +179,7 @@ openapi-codec==1.3.2 # via django-rest-swagger
path.py==8.2.1
pathtools==0.1.2
paver==1.3.4
pbr==5.1.0
pbr==5.1.1
pdfminer==20140328
piexif==1.0.2
pillow==5.3.0

View File

@@ -9,6 +9,6 @@ diff-cover==0.9.8
inflect==1.0.1 # via jinja2-pluralize
jinja2-pluralize==0.3.0 # via diff-cover
jinja2==2.10 # via diff-cover, jinja2-pluralize
markupsafe==1.0 # via jinja2
markupsafe==1.1.0 # via jinja2
pygments==2.2.0 # via diff-cover
six==1.11.0 # via diff-cover

View File

@@ -120,7 +120,6 @@ django-storages==1.4.1
django-user-tasks==0.1.5
django-waffle==0.12.0
django-webpack-loader==0.6.0
django-xforwardedfor-middleware==2.0
django==1.11.16
djangorestframework-jwt==1.11.0
djangorestframework-xml==1.3.0
@@ -146,7 +145,7 @@ edx-oauth2-provider==1.2.2
edx-opaque-keys[django]==0.4.4
edx-organizations==1.0.0
edx-proctoring==1.4.0
edx-rest-api-client==1.9
edx-rest-api-client==1.9.1
edx-search==1.2.1
edx-sphinx-theme==1.3.0
edx-submissions==2.0.12
@@ -175,12 +174,12 @@ future==0.17.1
futures==3.2.0 ; python_version == "2.7"
fuzzywuzzy==0.17.0
glob2==0.3
gunicorn==17.5
gunicorn==19.0
hash-ring==1.3.1
help-tokens==1.0.3
html5lib==1.0.1
httplib2==0.11.3
httpretty==0.9.5
httpretty==0.9.6
idna==2.7
imagesize==1.1.0 # via sphinx
incremental==17.5.0
@@ -209,7 +208,7 @@ mako==1.0.2
mando==0.6.4
markdown==2.6.11
markey==0.8
markupsafe==1.0
markupsafe==1.1.0
mccabe==0.6.1
mock==1.0.1
modernize==0.6.1
@@ -231,7 +230,7 @@ parsel==1.5.1
path.py==8.2.1
pathtools==0.1.2
paver==1.3.4
pbr==5.1.0
pbr==5.1.1
pdfminer==20140328
piexif==1.0.2
pillow==5.3.0

View File

@@ -12,12 +12,12 @@ edx-opaque-keys==0.4.4
idna==2.7 # via requests
lazy==1.1
libsass==0.10.0
markupsafe==1.0
markupsafe==1.1.0
mock==1.0.1
path.py==8.2.1
pathtools==0.1.2 # via watchdog
paver==1.3.4
pbr==5.1.0 # via stevedore
pbr==5.1.1 # via stevedore
psutil==1.2.1
pymongo==2.9.1
python-memcached==1.48

View File

@@ -116,7 +116,6 @@ django-storages==1.4.1
django-user-tasks==0.1.5
django-waffle==0.12.0
django-webpack-loader==0.6.0
django-xforwardedfor-middleware==2.0
djangorestframework-jwt==1.11.0
djangorestframework-xml==1.3.0
dm.xmlsec.binding==1.3.3
@@ -141,7 +140,7 @@ edx-oauth2-provider==1.2.2
edx-opaque-keys[django]==0.4.4
edx-organizations==1.0.0
edx-proctoring==1.4.0
edx-rest-api-client==1.9
edx-rest-api-client==1.9.1
edx-search==1.2.1
edx-submissions==2.0.12
edx-user-state-client==1.0.4
@@ -169,12 +168,12 @@ future==0.17.1
futures==3.2.0 ; python_version == "2.7"
fuzzywuzzy==0.17.0
glob2==0.3
gunicorn==17.5
gunicorn==19.0
hash-ring==1.3.1
help-tokens==1.0.3
html5lib==1.0.1
httplib2==0.11.3
httpretty==0.9.5
httpretty==0.9.6
idna==2.7
incremental==17.5.0 # via twisted
inflect==1.0.1
@@ -202,7 +201,7 @@ mako==1.0.2
mando==0.6.4 # via radon
markdown==2.6.11
markey==0.8
markupsafe==1.0
markupsafe==1.1.0
mccabe==0.6.1 # via flake8, pylint
mock==1.0.1
mongoengine==0.10.0
@@ -222,7 +221,7 @@ parsel==1.5.1 # via scrapy
path.py==8.2.1
pathtools==0.1.2
paver==1.3.4
pbr==5.1.0
pbr==5.1.1
pdfminer==20140328
piexif==1.0.2
pillow==5.3.0