diff --git a/conf/syncserver.ini b/conf/syncserver.ini index 95ec708..fd5ffa3 100644 --- a/conf/syncserver.ini +++ b/conf/syncserver.ini @@ -1,9 +1,9 @@ [server:main] use = egg:gunicorn -host = 127.0.0.1 +host = 0.0.0.0 port = 5000 -workers = 2 -timeout = 60 +workers = 1 +timeout = 30 [app:main] use = egg:syncserver @@ -29,8 +29,16 @@ secret = changesecret # Only request by existing accounts will be honoured. allow_new_users = true +# Set this to "true" to work around a mismatch between public_url and +# the application URL as seen by python, which can happen in certain reverse- +# proxy hosting setups. It will overwrite the WSGI environ dict with the +# details from public_url. This could have security implications if e.g. +# you tell the app that it's on HTTPS but it's really on HTTP, so it should +# only be used as a last resort and after careful checking of server config. +force_wsgi_environ = true + # Uncomment and edit the following to use a local BrowserID verifier -# rather than posing assertions to the mozilla-hosted verifier. +# rather than posting assertions to the mozilla-hosted verifier. # Audiences should be set to your public_url without a trailing slash. #[browserid] #backend = tokenserver.verifiers.LocalVerifier diff --git a/sources/Makefile b/sources/Makefile index 5f0b0c9..2efa163 100644 --- a/sources/Makefile +++ b/sources/Makefile @@ -32,7 +32,7 @@ test: | $(TOOLS) # $(ENV)/bin/nosetests -s tokenserver.tests # Test against a running server - $(ENV)/bin/pserve syncserver/tests.ini 2> /dev/null & SERVER_PID=$$!; \ + $(ENV)/bin/gunicorn --paste syncserver/tests.ini 2> /dev/null & SERVER_PID=$$!; \ sleep 2; \ $(ENV)/bin/python -m syncstorage.tests.functional.test_storage \ --use-token-server http://localhost:5000/token/1.0/sync/1.5; \ @@ -43,7 +43,7 @@ $(TOOLS): | $(ENV)/COMPLETE .PHONY: serve serve: | $(ENV)/COMPLETE - $(ENV)/bin/pserve ./syncserver.ini + $(ENV)/bin/gunicorn --paste ./syncserver.ini .PHONY: clean clean: diff --git a/sources/requirements.txt b/sources/requirements.txt index c1a19f9..2980219 100644 --- a/sources/requirements.txt +++ b/sources/requirements.txt @@ -1,7 +1,7 @@ cornice==0.16.2 gunicorn==19.1.1 pyramid==1.5 -requests==2.2.1 +requests==2.7 simplejson==3.4 SQLAlchemy==0.9.4 unittest2==0.5.1 diff --git a/sources/setup.py b/sources/setup.py index 76d6405..8340912 100644 --- a/sources/setup.py +++ b/sources/setup.py @@ -10,7 +10,7 @@ main = syncserver:main setup( name='syncserver', - version="1.5.1", + version="1.5.2", packages=['syncserver'], entry_points=entry_points ) diff --git a/sources/syncserver.ini b/sources/syncserver.ini index aa7105f..7672182 100644 --- a/sources/syncserver.ini +++ b/sources/syncserver.ini @@ -1,7 +1,9 @@ [server:main] -use = egg:Paste#http +use = egg:gunicorn host = 0.0.0.0 port = 5000 +workers = 1 +timeout = 30 [app:main] use = egg:syncserver diff --git a/sources/syncserver/tests.ini b/sources/syncserver/tests.ini index 50b7776..fc9ea4b 100644 --- a/sources/syncserver/tests.ini +++ b/sources/syncserver/tests.ini @@ -1,7 +1,9 @@ [server:main] -use = egg:Paste#http +use = egg:gunicorn host = 0.0.0.0 port = 5000 +workers = 1 +timeout = 30 [app:main] use = egg:SyncServer