Merge branch 'master' into saved_stories

* master:
  Adding cryptography dependency.
  Adding cutoff_timestamp and direction to API docs for marking a feed as read. Meant to address #542.
  Showing all feeds in feed chooser.
  Gunicorn x-forwarded-for
  Adding RealIP to nginx/gunicorn.
  Make sure all folders are visible in the feed chooser dialog
  Make single-story context actions always appear above multiple-story actions. (#541)
  fix to compatible with Python2.6
  Add support for SNI and update requests.
This commit is contained in:
Samuel Clay 2014-05-22 11:28:52 -07:00
commit d073971b8a
10 changed files with 37 additions and 11 deletions

View file

@ -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:

View file

@ -4,15 +4,15 @@
<item android:id="@+id/menu_shared"
android:title="@string/menu_share"/>
<item android:id="@+id/menu_mark_story_as_unread"
android:title="@string/menu_mark_unread" />
<item android:id="@+id/menu_mark_story_as_read"
android:title="@string/menu_mark_story_as_read" />
<item android:id="@+id/menu_mark_previous_stories_as_read"
android:title="@string/menu_mark_previous_stories_as_read" />
<item android:id="@+id/menu_mark_story_as_unread"
android:title="@string/menu_mark_unread" />
<item android:id="@+id/menu_save_story"
android:title="@string/menu_save_story" />

View file

@ -13,7 +13,8 @@ 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:
workers = NUM_CPUS

View file

@ -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;

View file

@ -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;
# }

View file

@ -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
django-cors-headers==0.12
pyOpenSSL==0.14
pyasn1==0.1.7
ndg-httpsclient==0.3.2

3
fabfile.py vendored
View file

@ -313,6 +313,7 @@ def setup_installs():
'libncurses5-dev',
'libdbd-pg-perl',
'libssl-dev',
'libffi-dev',
'make',
'pgbouncer',
'python-setuptools',
@ -596,7 +597,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()

View file

@ -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;

View file

@ -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 = {
});
}
};
};

View file

@ -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."