Permalink
Browse files

switch to argon2 authentication, SNR view fixes, use SQLite DB, not p…

…aram.py

for parameters and authentication
  • Loading branch information...
Fazal Majid
Fazal Majid committed Feb 26, 2017
1 parent f03ae33 commit 9038f4afb9ac469775acb541c08d7cffe63220b5
Showing with 706 additions and 750 deletions.
  1. +4 −0 Makefile
  2. +593 −8 me.opml
  3. +0 −75 pages/catch_up.tmpl
  4. +0 −89 pages/feed_debug.tmpl
  5. +0 −46 pages/hard_purge.tmpl
  6. +0 −20 pages/maintenance.tmpl
  7. +0 −414 pages/settings.tmpl
  8. +2 −11 temboz
  9. +2 −3 tembozapp/bootstrap.py
  10. +54 −26 tembozapp/dbop.py
  11. +18 −19 { → tembozapp}/opml.py
  12. +1 −10 { → tembozapp}/param.py
  13. +32 −14 tembozapp/server.py
  14. +0 −15 tembozapp/update.py
View
@@ -57,6 +57,10 @@ cvsdist disttar:: distclean changelog
dist: disttar
-$${EDITOR} ../mylos/data/stories/2004/03/29/temboz.html
opml:
wget -c https://majid.info/temboz/temboz.opml
mv temboz.opml me.opml
distclean:
-rm -f core *.pyc *~ pages/*~ *.old pages/*.py pages/*.pyc ChangeLog*
-find . -name .\#\* -exec rm {} \;
View
601 me.opml

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,75 +0,0 @@
#extends TembozTemplate
#implements respond
<html>
<head>
#set $reload = $getVar("reload", 'N')
#if $reload == 'Y'
<title>Purge and reload</title>
#else
<title>Catch up</title>
#end if
<link rel="stylesheet" type="text/css" href="temboz_css">
#import update
#silent title, url = update.title_url($feed_uid)
########################################################################
##
## Find out which page to get back to
##
########################################################################
#set $referrer = $getVar("referrer", '')
#if not $referrer
#if not $referer or 'http://' not in $referer
#set $referrer = '/feeds'
#else
#set $referrer = $referer
#end if
#end if
########################################################################
##
## Check if confirmation is required
##
########################################################################
#import param
#if not getattr(param, 'catch_up_confirm', True) or $getVar("confirm", None)
#if $reload == 'Y'
#set $status = update.purge_reload($feed_uid)
#else
#set $status = update.catch_up($feed_uid)
#end if
#if $status
</head>
<body>
Error: $status
#else
<meta http-equiv="refresh" content="0; URL=$referrer">
</head>
<body>
#if $reload == 'Y'
<b>Purged and reloaded unread articles in <a href="$url">$title</a></b>
#else
<b>Caught up with <a href="$url">$title</a></b>
#end if
#end if
#else
</head>
<body class="unpadded">
<div class="menu"><a href="view">All unread</a>&nbsp;&nbsp;<a
href="feeds">All feeds</a></div>
<form method="POST">
#echo self.regurgitate_except()
<input type="hidden" name="referrer" value="$referrer">
<input type="hidden" name="confirm" value="yes">
#if $reload == 'Y':
<p>This function is useful if you want to test changes to filters or
transforms.</p>
<p>Keep in mind for heavy traffic websites the entry you are trying
to test may no longer be present in the RSS/Atom feed file.</p>
<p>Please confirm you want to purge and reload unread articles in
#else
Please confirm you want to catch up with
#end if
<a href="$url">$title</a> <input type="submit" value="Confirm">
</form>
#end if
</body>
</html>
View
@@ -1,89 +0,0 @@
#extends TembozTemplate
#implements respond
<html>
<head><title>Temboz - Feed details</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="stylesheet" type="text/css" href="temboz_css">
</head>
<body class="unpadded">
<div class="menu"><a href="view">All unread</a>&nbsp;&nbsp;<a href="add">Add
feed</a>&nbsp;&nbsp;<a href="feeds">All feeds</a> <span class="help"><a
href="http://www.temboz.com/temboz/wiki?p=FeedDebugPage"
target="_blank">Help</a></span></div>
#set $feed_uid = $getVar('feed_uid')
#from singleton import db
#import time, pprint
#set c = db.cursor()
#silent c.execute("""select feed_title, feed_desc, feed_html, feed_xml,
min(last_modified) as last_modified,
sum(case when item_rating=1 then cnt else 0 end) as interesting,
sum(case when item_rating=0 then cnt else 0 end) as unread,
sum(case when item_rating=-1 then cnt else 0 end) as uninteresting,
sum(case when item_rating=-2 then cnt else 0 end) as filtered,
sum(cnt) as total,
feed_status, feed_private, feed_dupcheck, feed_errors
from fm_feeds, (
select item_rating, item_feed_uid, count(*) as cnt,
julianday('now') - max(
ifnull(
julianday(item_modified),
julianday(item_created)
)
) as last_modified
from fm_items
where item_feed_uid=""" + $feed_uid + """
group by item_rating, item_feed_uid
)
where item_feed_uid=feed_uid
group by feed_uid, feed_title, feed_html, feed_xml
""")
#silent feed_title, feed_desc, feed_html, feed_xml, delta_t, interesting, unread, uninteresting, filtered, total, status, private, dupcheck, feed_errors = c.fetchone()
#set since = self.since(delta_t)
#set unread = int(unread)
#set interesting = int(interesting)
#set uninteresting = int(uninteresting)
#set filtered = int(filtered)
#set total = int(total)
#if interesting + uninteresting > 0
#set ratio = interesting*100/(interesting + uninteresting)
#else
#set ratio = 0
#end if
#silent assert interesting + uninteresting + unread + filtered == total, feed_title
#set uninteresting = total - unread - filtered - interesting
<h1><a href="<%=feed_html%>"><%=feed_title%></a></h2>
<a href="<%=feed_xml%>"><%=feed_xml%></a><br>
<%=feed_desc%><br>
<a href="feed_info?feed_uid=$feed_uid">feed details</a>
########################################################################
##
## Do a real-time fetch of the feed to show variables available for
## filtering
##
########################################################################
<h2>Feed variables</h2>
#import feedparser, normalize
#set f = feedparser.parse(feed_xml)
#silent normalize.normalize_all(f)
#for var in f.feed
feed_$var<br>
#end for
<h2>Item variables</h2>
#if 'items' in f and f['items']
#for var in f['items'][0]
$var<br>
#end for
#end if
<h2>Feed dump (normalized)</h2>
<pre>
#echo pprint.pformat(f).replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
</pre>
</body></html>
View
@@ -1,46 +0,0 @@
#extends TembozTemplate
#implements respond
<html>
<head>
<title>Hard purge</title>
<link rel="stylesheet" type="text/css" href="temboz_css">
#from singleton import db
#set c = db.cursor()
#silent c.execute("""select feed_title, feed_html from fm_feeds
where feed_uid=""" + $feed_uid)
#silent tup = c.fetchone()
#set title = tup[0]
#set url = tup[1]
#silent c.close()
########################################################################
##
## Check if confirmation is required
##
########################################################################
#import param
#if not getattr(param, 'hard_purge_confirm', True) or $getVar("confirm", None)
#import update
#set $status = update.hard_purge($feed_uid)
#if $status
</head>
<body class="unpadded">
Error: $status
#else
<meta http-equiv="refresh" content="0; URL=/feeds">
</head>
<body>
<b>Deleted <a href="$url">$title</a></b>
#end if
#else
</head>
<body class="unpadded">
<div class="menu"><a href="view">All unread</a>&nbsp;&nbsp;<a
href="feeds">All feeds</a></div>
<form action="hard_purge?feed_uid=$feed_uid" method="POST">
<input type="hidden" name="confirm" value="yes">
Please confirm you want to completely delete all articles and the feed itself
<a href="$url">$title</a> <input type="submit" value="Confirm">
</form>
#end if
</body>
</html>
View
@@ -1,20 +0,0 @@
#extends TembozTemplate
#implements respond
<html>
<head><title>Temboz - Maintenance</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link rel="stylesheet" type="text/css" href="temboz_css">
</head>
<body class="unpadded">
<div class="menu"><a href="view">All unread</a>&nbsp;&nbsp;<a href="add">Add
feed</a>&nbsp;&nbsp;<a href="opml">as OPML</a>&nbsp;&nbsp;<a
href="rules">Filtering</a> <span class="help"><a
href="http://www.temboz.com/temboz/wiki?p=AllFeedsPage"
target="_blank">Help</a></span></div>
## #from singleton import db
## #set c = db.cursor()
#import update
## #silent update.snr_mv(db, c)
#silent update.cleanup()
</body></html>
Oops, something went wrong.

0 comments on commit 9038f4a

Please sign in to comment.