Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding redis cache. Returning favicon server.

  • Loading branch information...
commit bc6b5a025bcb360551c4a46589d239a5bf48305a 1 parent b21ea88
@samuelclay authored
View
13 config/nginx.newsblur.conf
@@ -2,6 +2,12 @@ upstream app_server {
server 127.0.0.1:8000 fail_timeout=10 max_fails=3 ;
}
+upstream icon_server {
+ server 127.0.0.1:3030 fail_timeout=2 max_fails=3;
+ server 127.0.0.1:8000 backup;
+}
+
+
server {
listen 80;
# listen 443 default_server ssl;
@@ -99,7 +105,12 @@ server {
}
location ^~ /rss_feeds/icon/ {
- rewrite ^(.*)$ /media/img/icons/silk/world.png;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $http_host;
+ proxy_redirect off;
+
+ proxy_pass http://icon_server;
}
location / {
View
1  config/requirements.txt
@@ -34,6 +34,7 @@ PyYAML==3.10
raven==3.1.17
readline==6.2.4.1
redis==2.7.2
+hiredis==0.1.1
requests==1.1.0
seacucumber==1.5
South==0.7.6
View
4 fabfile.py
@@ -154,7 +154,7 @@ def deploy_node():
with cd(env.NEWSBLUR_PATH):
run('sudo supervisorctl restart node_unread')
run('sudo supervisorctl restart node_unread_ssl')
- # run('sudo supervisorctl restart node_favicons')
+ run('sudo supervisorctl restart node_favicons')
def gunicorn_restart():
restart_gunicorn()
@@ -637,7 +637,7 @@ def configure_node():
sudo('rm -fr /etc/supervisor/conf.d/node.conf')
put('config/supervisor_node_unread.conf', '/etc/supervisor/conf.d/node_unread.conf', use_sudo=True)
put('config/supervisor_node_unread_ssl.conf', '/etc/supervisor/conf.d/node_unread_ssl.conf', use_sudo=True)
- # put('config/supervisor_node_favicons.conf', '/etc/supervisor/conf.d/node_favicons.conf', use_sudo=True)
+ put('config/supervisor_node_favicons.conf', '/etc/supervisor/conf.d/node_favicons.conf', use_sudo=True)
sudo('supervisorctl reload')
@parallel
View
13 local_settings.py.template
@@ -23,10 +23,21 @@ DEBUG_ASSETS = DEBUG
MEDIA_URL = '/media/'
SECRET_KEY = 'YOUR SECRET KEY'
-CACHE_BACKEND = 'dummy:///'
+# CACHE_BACKEND = 'dummy:///'
# CACHE_BACKEND = 'locmem:///'
# CACHE_BACKEND = 'memcached://127.0.0.1:11211'
+CACHES = {
+ 'default': {
+ 'BACKEND': 'redis_cache.RedisCache',
+ 'LOCATION': '127.0.0.1:6379',
+ 'OPTIONS': {
+ 'DB': 6,
+ 'PARSER_CLASS': 'redis.connection.HiredisParser'
+ },
+ },
+}
+
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Set this to the username that is shown on the homepage to unauthenticated users.
View
2  node/favicons.coffee
@@ -2,7 +2,7 @@ express = require 'express'
mongo = require 'mongodb'
DEV = process.env.NODE_ENV == 'development'
-MONGODB_SERVER = if DEV then 'localhost' else 'db04'
+MONGODB_SERVER = if DEV then 'localhost' else 'db24'
MONGODB_PORT = parseInt(process.env.MONGODB_PORT or 27017, 10)
if DEV
View
2  node/favicons.js
@@ -9,7 +9,7 @@
DEV = process.env.NODE_ENV === 'development';
- MONGODB_SERVER = DEV ? 'localhost' : 'db04';
+ MONGODB_SERVER = DEV ? 'localhost' : 'db24';
MONGODB_PORT = parseInt(process.env.MONGODB_PORT || 27017, 10);
Please sign in to comment.
Something went wrong with that request. Please try again.