Skip to content

Commit

Permalink
Updates from clean install
Browse files Browse the repository at this point in the history
First batch of updates
  • Loading branch information
jrconlin committed Nov 2, 2011
1 parent 9470ed9 commit e06990c
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ env:
cd deps && hg clone http://hg.mozilla.org/services/server-core
cd deps/server-core && ../../$(PYTHON) setup.py install

install:
mkdir -p /etc/notifserver/
cp etc/notifserver/* /etc/notifserver/
echo "nginx NOT auto-configured."
echo "Please see etc/nginx/nginx.conf.diff for changes."

clean-env:
rm -rf bin build deps include lib lib64

Expand Down
6 changes: 6 additions & 0 deletions etc/nginx/conf.d/astatic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
location ^~ /s/ {
allow all;
alias /home/jconlin/src/moz_push/notifserver/static/;
}


18 changes: 18 additions & 0 deletions etc/nginx/conf.d/notifserver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#Admin interface
location /__admin__ {
allow 10.0.0.0/8;
deny all;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:8000;
}

# Main handler (for all other URLs)
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://localhost:8000;
}

21 changes: 21 additions & 0 deletions etc/nginx/nginx.conf.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
7c7
< error_log /var/logs/nginx/error.log info;
---
> #error_log logs/error.log info;
36c36
< listen 80 default;
---
> listen 80;
39,40d38
< include /etc/nginx/conf.d/*.conf;
<
45,48c43,46
< # location / {
< # root html;
< # index index.html index.htm;
< # }
---
> location / {
> root html;
> index index.html index.htm;
> }
6 changes: 5 additions & 1 deletion notifserver/auth/browserid.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def __init__(self, *args, **kw):
def authenticate_user(self, user_name, password, request = None):
""" Return a validated user id """
if password is None:
return None
# Perhaps the UI folks messed up. Try to get the
# assertion from the arguments.
if request.params.get('assertion', None) is None:
return None
password = request.params.get('assertion')
try:
if request:
self.environ = request.environ
Expand Down
3 changes: 2 additions & 1 deletion notifserver/controllers/uiagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def index(self, request, **kw):
# display login page
template = self.get_template("not_logged_in")
else:
self.client_agent.new_queue(request)
# Create the user queue if necessary.
self.client_agent.user_queue(request)
template = self.get_template("logged_in")
response['user_info'] = self.msg_backend.user_info(username)
response['subscriptions'] = self.msg_backend.get_queues(username)
Expand Down
4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#bin/gunicorn -w1 notifserver.run -t 3000 --log-file - --log-level info
bin/paster serve etc/notifserver/production.ini
bin/gunicorn -w1 notifserver.run -t 3000 --log-file - --log-level info
#bin/paster serve etc/notifserver/production.ini

0 comments on commit e06990c

Please sign in to comment.