This commit is contained in:
Joseph Schorr 2013-12-18 23:03:32 -05:00
commit 5778076abb
6 changed files with 21 additions and 8 deletions

View file

@ -20,7 +20,7 @@ pip install -r requirements.txt
running:
```
sudo nginx -c `pwd`/nginx.conf
sudo mkdir -p /mnt/nginx/ && sudo nginx -c `pwd`/nginx.conf
STACK=prod gunicorn -D --workers 4 -b unix:/tmp/gunicorn.sock --worker-class gevent -t 2000 application:application
```

View file

@ -327,8 +327,11 @@ def create_confirm_email_code(user):
def confirm_user_email(code):
code = EmailConfirmation.get(EmailConfirmation.code == code,
EmailConfirmation.email_confirm == True)
try:
code = EmailConfirmation.get(EmailConfirmation.code == code,
EmailConfirmation.email_confirm == True)
except EmailConfirmation.DoesNotExist:
raise DataModelException('Invalid email confirmation code.')
user = code.user
user.verified = True
@ -544,7 +547,7 @@ def get_visible_repositories(username=None, include_public=True, limit=None,
where_clause = new_clause
if limit:
query.limit(limit)
query = query.limit(limit)
return query.where(where_clause)

View file

@ -226,7 +226,11 @@ def github_oauth_callback():
@app.route('/confirm', methods=['GET'])
def confirm_email():
code = request.values['code']
user = model.confirm_user_email(code)
try:
user = model.confirm_user_email(code)
except model.DataModelException as ex:
return redirect(url_for('signin'))
common_login(user)

View file

@ -1,8 +1,8 @@
worker_processes 1;
user root nogroup;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
pid /mnt/nginx/nginx.pid;
error_log /mnt/nginx/nginx.error.log;
events {
worker_connections 1024;
@ -14,7 +14,7 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /tmp/nginx.access.log combined;
access_log /mnt/nginx/nginx.access.log combined;
sendfile on;
root /root/quay/;
@ -43,6 +43,7 @@ http {
server {
listen 443 default;
client_max_body_size 8G;
client_body_temp_path /mnt/nginx/client_body 1 2;
server_name _;
keepalive_timeout 5;
@ -73,6 +74,7 @@ http {
proxy_pass http://app_server;
proxy_read_timeout 2000;
proxy_temp_path /mnt/nginx/proxy_temp 1 2;
}
}
}

View file

@ -41,6 +41,7 @@ http {
server {
listen 443 default;
client_max_body_size 8G;
client_body_temp_path /mnt/nginx/client_body 1 2;
server_name _;
keepalive_timeout 5;
@ -71,6 +72,7 @@ http {
proxy_pass http://app_server;
proxy_read_timeout 2000;
proxy_temp_path /mnt/nginx/proxy_temp 1 2;
}
}
}

View file

@ -123,6 +123,7 @@ var isProd = document.location.hostname === 'quay.io';
</div>
<!-- begin olark code -->
{% if request.host == 'quay.io' %}
<script data-cfasync="false" type='text/javascript'>/*<![CDATA[*/window.olark||(function(c){var f=window,d=document,l=f.location.protocol=="https:"?"https:":"http:",z=c.name,r="load";var nt=function(){
f[z]=function(){
(a.s=a.s||[]).push(arguments)};var a=f[z]._={
@ -141,6 +142,7 @@ var isProd = document.location.hostname === 'quay.io';
loader: "static.olark.com/jsclient/loader0.js",name:"olark",methods:["configure","extend","declare","identify"]});
/* custom configuration goes here (www.olark.com/documentation) */
olark.identify('1189-336-10-9918');/*]]>*/</script><noscript><a href="https://www.olark.com/site/1189-336-10-9918/contact" title="Contact us" target="_blank">Questions? Feedback?</a> powered by <a href="http://www.olark.com?welcome" title="Olark live chat software">Olark live chat software</a></noscript>
{% endif %}
<!-- end olark code -->
</body>