diff --git a/frontend/indieconfig.js b/frontend/indieconfig.js index dedce86..ab6372c 100644 --- a/frontend/indieconfig.js +++ b/frontend/indieconfig.js @@ -5,7 +5,7 @@ window.loadIndieConfig = (function () { // Indie-Config Loading script // by Pelle Wessman, voxpelli.com // MIT-licensed - // http://indiewebcamp.com/indie-config + // https://indieweb.org/indie-config var config, configFrame, configTimeout, callbacks = [], diff --git a/requirements.txt b/requirements.txt index 16fedde..f6613b4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ asyncio-redis==0.14.2 -beautifulsoup4==4.4.1 -bleach==1.4.3 +beautifulsoup4==4.6.0 +bleach==2.0.0 blinker==1.4 certifi==2015.04.28 # rq.filter: <=2015.04.28 cffi==1.6.0 @@ -12,7 +12,7 @@ Flask-DebugToolbar==0.10.0 Flask-Login==0.3.2 Flask-Micropub==0.2.6 Flask-SQLAlchemy==2.1 -html5lib==0.9999999 +html5lib==0.999999999 idna==2.1 itsdangerous==0.24 Jinja2==2.8 @@ -31,7 +31,8 @@ rq==0.5.6 sgmllib3k==1.0.0 six==1.10.0 SQLAlchemy==1.0.13 -uWSGI==2.0.12 # rq.filter: <=2.0.12 +uWSGI==2.0.15 websockets==3.1 Werkzeug==0.11.9 wheel==0.29.0 +raven==6.1.0 diff --git a/setup.py b/setup.py index 11432e2..2c7ed2f 100644 --- a/setup.py +++ b/setup.py @@ -7,5 +7,5 @@ setup(name='Woodwind', description='Stream-style indieweb reader', author='Kyle Mahan', author_email='kyle@kylewm.com', - url='https://indiewebcamp.com/Woodwind', + url='https://indieweb.org/Woodwind', packages=['woodwind']) diff --git a/vacuum.sql b/vacuum.sql new file mode 100644 index 0000000..841fe1f --- /dev/null +++ b/vacuum.sql @@ -0,0 +1,9 @@ +DELETE FROM entry +USING ( + SELECT + id, + ROW_NUMBER() OVER (PARTITION BY feed_id ORDER BY retrieved DESC) AS row + FROM entry +) AS numbered +WHERE entry.id = numbered.id + AND (row > 2000 OR retrieved < CURRENT_DATE - INTERVAL '365 days'); diff --git a/woodwind/app.py b/woodwind/app.py index 4e12cb8..a0b8e4d 100644 --- a/woodwind/app.py +++ b/woodwind/app.py @@ -1,3 +1,4 @@ +from raven.contrib.flask import Sentry from woodwind import extensions from woodwind.api import api from woodwind.push import push @@ -20,6 +21,8 @@ Message: %(message)s ''' +sentry = Sentry() + def create_app(config_path='../woodwind.cfg'): app = flask.Flask('woodwind') @@ -38,6 +41,8 @@ def configure_logging(app): app.logger.setLevel(logging.DEBUG) + sentry.init_app(app, dsn=app.config.get('SENTRY_DSN'), logging=True, level=logging.WARNING) + handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) diff --git a/woodwind/static/indieconfig.js b/woodwind/static/indieconfig.js index dedce86..ab6372c 100644 --- a/woodwind/static/indieconfig.js +++ b/woodwind/static/indieconfig.js @@ -5,7 +5,7 @@ window.loadIndieConfig = (function () { // Indie-Config Loading script // by Pelle Wessman, voxpelli.com // MIT-licensed - // http://indiewebcamp.com/indie-config + // https://indieweb.org/indie-config var config, configFrame, configTimeout, callbacks = [], diff --git a/woodwind/tasks.py b/woodwind/tasks.py index fdaeaa5..ff697c6 100644 --- a/woodwind/tasks.py +++ b/woodwind/tasks.py @@ -397,14 +397,21 @@ def process_xml_feed_for_new_entries(feed, content, backfill, now): continue if 'updated_parsed' in p_entry and p_entry.updated_parsed: - updated = datetime.datetime.fromtimestamp( - time.mktime(p_entry.updated_parsed)) + try: + updated = datetime.datetime.fromtimestamp( + time.mktime(p_entry.updated_parsed)) + except: + current_app.logger.debug('mktime failed with updated timestamp: %v', p_entry.updated_parsed) else: updated = None if 'published_parsed' in p_entry and p_entry.published_parsed: - published = datetime.datetime.fromtimestamp( - time.mktime(p_entry.published_parsed)) + try: + published = datetime.datetime.fromtimestamp( + time.mktime(p_entry.published_parsed)) + except: + current_app.logger.debug('mktime failed with published timestamp: %v', p_entry.published_parsed) + published = updated else: published = updated @@ -526,6 +533,13 @@ def hentry_to_entry(hentry, feed, backfill, now): author_photo = author.get('photo') author_url = author.get('url') + if author_name and len(author_name) > Entry.author_name.property.columns[0].type.length: + author_name = None + if author_photo and len(author_photo) > Entry.author_photo.property.columns[0].type.length: + author_photo = None + if author_url and len(author_url) > Entry.author_url.property.columns[0].type.length: + author_url = None + entry = Entry( uid=uid, retrieved=retrieved, diff --git a/woodwind/templates/base.jinja2 b/woodwind/templates/base.jinja2 index 1a14162..6ae6ec1 100644 --- a/woodwind/templates/base.jinja2 +++ b/woodwind/templates/base.jinja2 @@ -10,7 +10,7 @@ - + @@ -62,7 +62,7 @@ - Your Woodwind account is tied to your personal domain name. Check out IndieWebCamp's Getting Started page for details. + Your Woodwind account is tied to your personal domain name. Check out the IndieWeb's Getting Started page for details. {% endif %} {% endblock login %} @@ -77,7 +77,7 @@ {% block foot %}{% endblock %}