mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
Adding dev role, updating hosts, and checking for wp-cron in broken wordpress plugin PuSH pings.
This commit is contained in:
parent
a44189ced4
commit
f49f5ebc04
4 changed files with 22 additions and 7 deletions
|
@ -116,8 +116,10 @@ class PushSubscription(models.Model):
|
||||||
hub_url = self.hub
|
hub_url = self.hub
|
||||||
self_url = self.topic
|
self_url = self.topic
|
||||||
for link in parsed.feed.links:
|
for link in parsed.feed.links:
|
||||||
if 'wp-admin' in link['href']:
|
href = link.get('href', '')
|
||||||
|
if any(w in href for w in ['wp-admin', 'wp-cron']):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if link['rel'] == 'hub':
|
if link['rel'] == 'hub':
|
||||||
hub_url = link['href']
|
hub_url = link['href']
|
||||||
elif link['rel'] == 'self':
|
elif link['rel'] == 'self':
|
||||||
|
|
|
@ -31,12 +31,14 @@ def push_callback(request, push_id):
|
||||||
return HttpResponse(challenge, content_type='text/plain')
|
return HttpResponse(challenge, content_type='text/plain')
|
||||||
elif request.method == 'POST':
|
elif request.method == 'POST':
|
||||||
subscription = get_object_or_404(PushSubscription, pk=push_id)
|
subscription = get_object_or_404(PushSubscription, pk=push_id)
|
||||||
|
# XXX TODO: Optimize this by removing feedparser. It just needs to find out
|
||||||
|
# the hub_url or topic has changed. ElementTree could do it.
|
||||||
parsed = feedparser.parse(request.raw_post_data)
|
parsed = feedparser.parse(request.raw_post_data)
|
||||||
subscription.check_urls_against_pushed_data(parsed)
|
subscription.check_urls_against_pushed_data(parsed)
|
||||||
updated.send(sender=subscription, update=parsed)
|
updated.send(sender=subscription, update=parsed)
|
||||||
|
|
||||||
# subscription.feed.queue_pushed_feed_xml(request.raw_post_data)
|
|
||||||
# Don't give fat ping, just fetch.
|
# Don't give fat ping, just fetch.
|
||||||
|
# subscription.feed.queue_pushed_feed_xml(request.raw_post_data)
|
||||||
subscription.feed.queue_pushed_feed_xml("Fetch me")
|
subscription.feed.queue_pushed_feed_xml("Fetch me")
|
||||||
|
|
||||||
return HttpResponse('')
|
return HttpResponse('')
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
199.15.250.228 app01 app01.newsblur.com
|
199.15.250.228 app01 app01.newsblur.com
|
||||||
199.15.250.229 app02 app02.newsblur.com
|
199.15.250.229 app02 app02.newsblur.com
|
||||||
|
199.15.252.156 app03 app03.newsblur.com
|
||||||
|
199.15.252.156 dev dev.newsblur.com
|
||||||
199.15.253.218 db01 db01.newsblur.com
|
199.15.253.218 db01 db01.newsblur.com
|
||||||
199.15.252.50 db02 db02.newsblur.com
|
199.15.252.50 db02 db02.newsblur.com
|
||||||
199.15.253.226 db03 db03.newsblur.com
|
199.15.253.226 db03 db03.newsblur.com
|
||||||
|
|
19
fabfile.py
vendored
19
fabfile.py
vendored
|
@ -31,14 +31,19 @@ env.VENDOR_PATH = "~/projects/code"
|
||||||
env.user = 'sclay'
|
env.user = 'sclay'
|
||||||
env.roledefs ={
|
env.roledefs ={
|
||||||
'local': ['localhost'],
|
'local': ['localhost'],
|
||||||
'app': ['app01.newsblur.com', 'app02.newsblur.com'],
|
'app': ['app01.newsblur.com',
|
||||||
'web': ['www.newsblur.com', 'app02.newsblur.com'],
|
'app02.newsblur.com'],
|
||||||
'db': ['db01.newsblur.com', 'db02.newsblur.com', 'db03.newsblur.com'],
|
'dev': ['dev.newsblur.com'],
|
||||||
|
'web': ['www.newsblur.com',
|
||||||
|
'app02.newsblur.com'],
|
||||||
|
'db': ['db01.newsblur.com',
|
||||||
|
'db02.newsblur.com',
|
||||||
|
'db03.newsblur.com',
|
||||||
|
'db04.newsblur.com'],
|
||||||
'task': ['task01.newsblur.com',
|
'task': ['task01.newsblur.com',
|
||||||
'task02.newsblur.com',
|
'task02.newsblur.com',
|
||||||
'task03.newsblur.com',
|
'task03.newsblur.com',
|
||||||
'task04.newsblur.com',
|
'task04.newsblur.com'],
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ================
|
# ================
|
||||||
|
@ -53,6 +58,10 @@ def app():
|
||||||
server()
|
server()
|
||||||
env.roles = ['app']
|
env.roles = ['app']
|
||||||
|
|
||||||
|
def dev():
|
||||||
|
server()
|
||||||
|
env.roles = ['dev']
|
||||||
|
|
||||||
def web():
|
def web():
|
||||||
server()
|
server()
|
||||||
env.roles = ['web']
|
env.roles = ['web']
|
||||||
|
|
Loading…
Add table
Reference in a new issue