mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Upgrading nginx, adding secure_image_urls to all stories.
This commit is contained in:
parent
800d56bb0b
commit
da969804fb
3 changed files with 12 additions and 1 deletions
|
@ -46,6 +46,7 @@ from utils.feed_functions import relative_timesince
|
|||
from utils.feed_functions import seconds_timesince
|
||||
from utils.story_functions import strip_tags, htmldiff, strip_comments, strip_comments__lxml
|
||||
from utils.story_functions import prep_for_search
|
||||
from utils.story_functions import create_signed_url
|
||||
|
||||
ENTRY_NEW, ENTRY_UPDATED, ENTRY_SAME, ENTRY_ERR = range(4)
|
||||
|
||||
|
@ -1869,6 +1870,7 @@ class Feed(models.Model):
|
|||
story['story_content'] = story_content
|
||||
story['story_permalink'] = story_db.story_permalink
|
||||
story['image_urls'] = story_db.image_urls
|
||||
story['secure_image_urls']= cls.secure_image_urls(story_db.image_urls)
|
||||
story['story_feed_id'] = feed_id or story_db.story_feed_id
|
||||
story['has_modifications']= has_changes
|
||||
story['comment_count'] = story_db.comment_count if hasattr(story_db, 'comment_count') else 0
|
||||
|
@ -1900,6 +1902,13 @@ class Feed(models.Model):
|
|||
|
||||
return story
|
||||
|
||||
@classmethod
|
||||
def secure_image_urls(cls, urls):
|
||||
signed_urls = [create_signed_url(settings.IMAGES_URL,
|
||||
settings.IMAGES_SECRET_KEY,
|
||||
url) for url in urls]
|
||||
return dict(zip(urls, signed_urls))
|
||||
|
||||
def get_tags(self, entry):
|
||||
fcat = []
|
||||
if entry.has_key('tags'):
|
||||
|
|
2
fabfile.py
vendored
2
fabfile.py
vendored
|
@ -715,7 +715,7 @@ def setup_sudoers(user=None):
|
|||
sudo('chmod 0440 /etc/sudoers.d/sclay')
|
||||
|
||||
def setup_nginx():
|
||||
NGINX_VERSION = '1.11.8'
|
||||
NGINX_VERSION = '1.15.8'
|
||||
with cd(env.VENDOR_PATH), settings(warn_only=True):
|
||||
sudo("groupadd nginx")
|
||||
sudo("useradd -g nginx -d /var/www/htdocs -s /bin/false nginx")
|
||||
|
|
|
@ -48,7 +48,9 @@ SERVER_NAME = 'newsblur'
|
|||
SERVER_EMAIL = 'server@newsblur.com'
|
||||
HELLO_EMAIL = 'hello@newsblur.com'
|
||||
NEWSBLUR_URL = 'http://www.newsblur.com'
|
||||
IMAGES_URL = 'https://images.newsblur.com'
|
||||
SECRET_KEY = 'YOUR_SECRET_KEY'
|
||||
IMAGES_SECRET_KEY = "YOUR_SECRET_IMAGE_KEY"
|
||||
|
||||
# ===================
|
||||
# = Global Settings =
|
||||
|
|
Loading…
Add table
Reference in a new issue