From 65bbb3f1c1c9f20dd409dad7b786f01b16004cb2 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Tue, 13 May 2014 19:33:08 +0100 Subject: [PATCH 1/9] Add support for SNI and update requests. --- config/requirements.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/requirements.txt b/config/requirements.txt index 2cd2d51ea..a2cae33e3 100755 --- a/config/requirements.txt +++ b/config/requirements.txt @@ -37,9 +37,12 @@ raven==3.1.17 readline==6.2.4.1 redis==2.8.0 hiredis==0.1.1 -requests==1.1.0 +requests==2.2.1 seacucumber==1.5 South==0.7.6 stripe==1.12.2 django-oauth-toolkit==0.5.0 -django-cors-headers==0.12 \ No newline at end of file +django-cors-headers==0.12 +pyOpenSSL==0.14 +pyasn1==0.1.7 +ndg-httpsclient==0.3.2 From 4938b6cebfd8fc1fdc49f6c6dd059a3cef0a017f Mon Sep 17 00:00:00 2001 From: cyy5121212 <515822895@qq.com> Date: Sun, 18 May 2014 10:42:35 +0800 Subject: [PATCH 2/9] fix to compatible with Python2.6 total_seconds() method only for Python2.7 or later, so I change it to compatible with Python2.6. --- apps/rss_feeds/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/rss_feeds/models.py b/apps/rss_feeds/models.py index 1314e3baa..085b05d13 100644 --- a/apps/rss_feeds/models.py +++ b/apps/rss_feeds/models.py @@ -1506,7 +1506,7 @@ class Feed(models.Model): self.min_to_decay = total delta = self.next_scheduled_update - datetime.datetime.now() - minutes_to_next_fetch = delta.total_seconds() / 60 + minutes_to_next_fetch = (delta.seconds + (delta.days * 24 * 3600)) / 60 if minutes_to_next_fetch > self.min_to_decay or not skip_scheduling: self.next_scheduled_update = next_scheduled_update if self.active_subscribers >= 1: From 68c6e2d88e71a6b050b74d3bb991f1833d18bb52 Mon Sep 17 00:00:00 2001 From: dosiecki Date: Wed, 21 May 2014 10:42:17 -0700 Subject: [PATCH 3/9] Make single-story context actions always appear above multiple-story actions. (#541) --- clients/android/NewsBlur/res/menu/context_story.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/android/NewsBlur/res/menu/context_story.xml b/clients/android/NewsBlur/res/menu/context_story.xml index d5d0b2741..ea12774c7 100644 --- a/clients/android/NewsBlur/res/menu/context_story.xml +++ b/clients/android/NewsBlur/res/menu/context_story.xml @@ -4,15 +4,15 @@ + + - - From a0789646b37b1d33cc42552cc90701654b8b8a55 Mon Sep 17 00:00:00 2001 From: John Morahan Date: Wed, 21 May 2014 23:41:44 +0100 Subject: [PATCH 4/9] Make sure all folders are visible in the feed chooser dialog --- media/js/newsblur/reader/reader_feedchooser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/js/newsblur/reader/reader_feedchooser.js b/media/js/newsblur/reader/reader_feedchooser.js index 2acab2bf4..866565820 100644 --- a/media/js/newsblur/reader/reader_feedchooser.js +++ b/media/js/newsblur/reader/reader_feedchooser.js @@ -205,6 +205,9 @@ NEWSBLUR.ReaderFeedchooser.prototype = { // Pretend unfetched feeds are fine $('.NB-feed-unfetched', $feeds).removeClass('NB-feed-unfetched'); + + // Make sure all folders are visible + $('.NB-folder.NB-hidden', $feeds).removeClass('NB-hidden'); $('.unread_count_positive', $feeds).text('On'); $('.unread_count_negative', $feeds).text('Off'); @@ -554,4 +557,4 @@ NEWSBLUR.ReaderFeedchooser.prototype = { }); } -}; \ No newline at end of file +}; From f36e7ceae3ebf9cb9ddd0869c21eace4e93e62f7 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 22 May 2014 09:21:38 -0700 Subject: [PATCH 5/9] Adding RealIP to nginx/gunicorn. --- config/gunicorn_conf.py | 1 + config/nginx.conf | 4 ++++ config/nginx.newsblur.conf | 6 +++++- fabfile.py | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/gunicorn_conf.py b/config/gunicorn_conf.py index 4bb942ee2..198844cfd 100644 --- a/config/gunicorn_conf.py +++ b/config/gunicorn_conf.py @@ -14,6 +14,7 @@ name = "newsblur" timeout = 120 max_requests = 1000 x_forwarded_for_header = "X-Forwarded-For" +forwarded_allow_ips = "*" if GIGS_OF_MEMORY > NUM_CPUS: workers = NUM_CPUS diff --git a/config/nginx.conf b/config/nginx.conf index ad2f0dc54..cb2a49a4f 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -19,6 +19,10 @@ http { keepalive_timeout 2; client_max_body_size 4M; + set_real_ip_from 0.0.0.0/0; + real_ip_header X-Forwarded-For; + # real_ip_recursive on; + gzip on; gzip_static on; gzip_comp_level 2; diff --git a/config/nginx.newsblur.conf b/config/nginx.newsblur.conf index 7050bd766..94c25a2c7 100644 --- a/config/nginx.newsblur.conf +++ b/config/nginx.newsblur.conf @@ -19,7 +19,11 @@ server { client_max_body_size 4M; server_name www.newsblur.com newsblur.com dev.newsblur.com *.newsblur.com circularapp.com *.circularapp.com; add_header X-nginx-server nginx_none; - + + set_real_ip_from 0.0.0.0/0; + real_ip_header X-Forwarded-For; + real_ip_recursive on; + # if ($host = 'newsblur.com') { # rewrite ^/(.*)$ https://www.newsblur.com/$1 permanent; # } diff --git a/fabfile.py b/fabfile.py index 8ea284164..12008d490 100644 --- a/fabfile.py +++ b/fabfile.py @@ -596,7 +596,7 @@ def setup_nginx(): run('tar -xzf nginx-%s.tar.gz' % NGINX_VERSION) run('rm nginx-%s.tar.gz' % NGINX_VERSION) with cd('nginx-%s' % NGINX_VERSION): - run('./configure --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module') + run('./configure --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module ') run('make') sudo('make install') config_nginx() From 00b4b241acdd91a023e5097da76cb7c36fd359db Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 22 May 2014 09:32:42 -0700 Subject: [PATCH 6/9] Gunicorn x-forwarded-for --- config/gunicorn_conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gunicorn_conf.py b/config/gunicorn_conf.py index 198844cfd..f67b6d1c7 100644 --- a/config/gunicorn_conf.py +++ b/config/gunicorn_conf.py @@ -13,7 +13,7 @@ loglevel = "debug" name = "newsblur" timeout = 120 max_requests = 1000 -x_forwarded_for_header = "X-Forwarded-For" +x_forwarded_for_header = "X-FORWARDED-FOR" forwarded_allow_ips = "*" if GIGS_OF_MEMORY > NUM_CPUS: From 7d7db2b74301822a6bec604f717ad32a7ee82990 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 22 May 2014 10:50:45 -0700 Subject: [PATCH 7/9] Showing all feeds in feed chooser. --- media/css/reader.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/css/reader.css b/media/css/reader.css index 34474134e..b5dd7596c 100644 --- a/media/css/reader.css +++ b/media/css/reader.css @@ -8127,7 +8127,9 @@ form.opml_import_form input { width: auto; border: 1px solid #909090; } - +.NB-modal-feedchooser .NB-feedchooser .NB-hidden { + display: block; +} .NB-modal-feedchooser .NB-modal-submit.NB-modal-submit-paypal { border-radius: 12px; border: 1px solid #F6BD44; From d864331ebae8f8ba0424b4d1295215decd892f80 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 22 May 2014 11:12:03 -0700 Subject: [PATCH 8/9] Adding cutoff_timestamp and direction to API docs for marking a feed as read. Meant to address #542. --- templates/static/api.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/static/api.yml b/templates/static/api.yml index 70de8d65e..379f5b684 100644 --- a/templates/static/api.yml +++ b/templates/static/api.yml @@ -458,6 +458,14 @@ desc: "List of feed ids to mark as read." required: true example: "feed_id=12&feed_id=24" + - key: cutoff_timestamp + desc: "Timestamp for older/newer cutoff." + optional: true + example: "1400777921" + - key: direction + desc: "Older or newer stories should be marked as read. Use with `cutoff_timestamp`" + optional: true + example: "older" tips: - "To mark a folder as read, send the ids of each feed inside the folder." From d5d3bf151258716b6767b185c0bc83dfc35f994a Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 22 May 2014 11:28:45 -0700 Subject: [PATCH 9/9] Adding cryptography dependency. --- fabfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fabfile.py b/fabfile.py index 12008d490..f50a0ddc7 100644 --- a/fabfile.py +++ b/fabfile.py @@ -313,6 +313,7 @@ def setup_installs(): 'libncurses5-dev', 'libdbd-pg-perl', 'libssl-dev', + 'libffi-dev', 'make', 'pgbouncer', 'python-setuptools',