Martin Zimmermann
9f2062a900
fix #35
...
Also add an option `direct-reply` to control the number of comments
on a thread without referencing a child (to avoid a simple while loop
that `curl -XPOST ...` the url).
Defaults to 3, that means a /24 (or /48 for IPv6) address can only post
3 direct responses on a thread at all.
11 years ago
Martin Zimmermann
5cbda11158
Merge branch 'fix/bloomfilter'
11 years ago
Martin Zimmermann
6178e93348
add database migration
...
Clear voters bloomfilter and initialize with an (almost) empty one.
11 years ago
Martin Zimmermann
58645ca945
do not reference bytearray in a method definition, fixes #5
...
This is a severe issue which makes the current voters bloomfilter
completely useless. Functions are first-class objects in Python, which
lead to interesting "issues" like:
>>> def foo(x=[]):
... x.append(1)
... print x
...
>>> foo()
[1]
>>> foo()
[1, 1]
For Isso, this means the bloomfilter, which is usually only initialized
with the author's IP address, is now initialized with pretty much all
ip addresses from previous authors, thus makes it impossible for the
author to vote on other's people comments.
11 years ago
Martin Zimmermann
dfed955f23
Merge branch 'feature/migration'
11 years ago
Martin Zimmermann
d4f2123b58
Merge branch 'tmp/refactorization'
...
Conflicts:
isso/utils/__init__.py
11 years ago
Martin Zimmermann
6e85c54a2e
refactor views and introduce an API for notifications
...
Keep Isso modular, not monolithic. Make it easy to integrate a
web interface or add XMPP notifications.
This refactorization includes minor bugfixes and changes:
* CORS middleware did not work properly due to wrong unit tests
* more type checks on JSON input
* new detection for origin and public url, closes #28
* new activation and delete url (no redirect for old urls, but you can
convert the old urls: copy hash after `/activate/` (or delete) and
open `/id/<id of comment>/activate/<hash>`
* move crypto.py to utils/
With this commit, SMTP is no longer automatically configured: add
`notify = smtp` to the `[general]` section to use SMTP.
11 years ago
Martin Zimmermann
162fe78aa6
ask to continue import if DB is not empty
11 years ago
Martin Zimmermann
5ca3137ddd
add --dry-run option to import command
11 years ago
Martin Zimmermann
a8cd418b5e
remove website todo, not a high priority
11 years ago
Martin Zimmermann
850b2b4bfb
set mode to 4 (deleted) when isDeleted is true
11 years ago
Martin Zimmermann
8c0af3b10f
show orphan comments after Disqus import (if any)
...
An orphan comment is exported by Disqus but its thread id is
non-existent (probably deleted, moved). Usually from the earlier
days (or WordPress migration).
It is not possible to get the thread without manual intervention (
aka SQLite insertions).
11 years ago
Federico Ceratto
68be70af24
Support Python2 ipaddr library.
11 years ago
Martin Zimmermann
a442b8e0ee
remove dead code
11 years ago
Martin Zimmermann
ab5d907172
move comments.requires to views package
11 years ago
Martin Zimmermann
1174259b27
mv comment -> comments
11 years ago
Martin Zimmermann
ac8d987392
don't monkeypatch if uwsgi is available
11 years ago
Martin Zimmermann
6f3a2d8072
add an option to prevent Isso from appending the default CSS, closes #29
11 years ago
Martin Zimmermann
c06c11aeca
api.js parses custom data attributes for client configuration, part of #29
...
All data-attributes beginning with `data-isso-` are stored in
`api.config` (without leading data-isso-). Isso tries to parse
the values with JSON (e.g. `-isso-foo="false"` returns false)
and falls back for a simple string value.
11 years ago
Martin Zimmermann
4bb6e91f61
Isso can now listen on unix domain sockets, closes #25
...
This also changes the server configuration from `host` and `port`
to `listen = http://localhost:8080 `.
11 years ago
Martin Zimmermann
6374d8a9e1
fix application profiling
11 years ago
Martin Zimmermann
0a247a7927
data-isso-prefix is now ony data-isso
11 years ago
Martin Zimmermann
33fb15e241
rename data-prefix to data-isso
11 years ago
Martin Zimmermann
af6695e935
lowercase MiddleWare and fix TypeError in Headers
11 years ago
Martin Zimmermann
4950e7dd4d
add unittest for CORS headers
11 years ago
Martin Zimmermann
aa6665c8f0
fix endpoint detection when using require.js
11 years ago
Martin Zimmermann
8d1171df29
improve request decoding and json parsing
11 years ago
Martin Zimmermann
6691810316
handle cross-origin cookies with a custom header X-Set-Cookie, fix #24
...
Cookies set from a different domain can not be read by JS executed in
the current domain. As a workaround, Isso sends both a Set-Cookie and
X-Set-Cookie header. The former is used by the browser to make the
HTTP request to the API, the latter is read by `embed.min.js` to
determine if a comment can be edited or deleted.
When a comment is deleted, the server sends an expired cookies in
Set-Cookie and X-Set-Cookie.
11 years ago
Martin Zimmermann
05c8b571e2
requirejs-text now uses CORS XHR requests to static files
11 years ago
Martin Zimmermann
6126f0ec6f
add CORS middleware to add CORS header to *all* requests
11 years ago
Martin Zimmermann
e14a04ab6c
support for werkzeug 0.8 (Python2-only)
11 years ago
Martin Zimmermann
312578457b
uwsgi can only cache bytes
11 years ago
Martin Zimmermann
cc2ac11850
inline CSS
11 years ago
Martin Zimmermann
d8a254c304
fix api endpoint detection
11 years ago
Martin Zimmermann
d59fc2ef8e
handle OPTIONS request and return CORS headers
11 years ago
Martin Zimmermann
c581e0f05a
cache email hash on comment creation
11 years ago
Martin Zimmermann
c567758d81
limit email length to 254 to avoid hash-DDoS
11 years ago
Martin Zimmermann
0473afe2db
add profiling option to server configuration
11 years ago
Martin Zimmermann
3c193bef27
request remote_addr only when using the comment form
11 years ago
Martin Zimmermann
7e73986667
remove trailing slash from API endpoint, appendum to 8da9d0b
11 years ago
Martin Zimmermann
375b32a151
Merge branch 'feature/data-attributes'
11 years ago
Martin Zimmermann
8da9d0b13b
override API location with `data-prefix="..."`
11 years ago
Martin Zimmermann
0d07515c18
override HTML title parsing with a `data-title="...` attribute
...
If you don't use a <h1> to markup your post's title (but h2), it
is no longer possible to reliable detect the site's title.
E.g. you have a single page with only one <h1> and that's the
*real* title of that page. But on the other hand, it is also
possible, that the <h1> tag is just your website's name and the
actual post title is marked up in <h2>.
11 years ago
Martin Zimmermann
fa496669e2
use lowercase [smtp] as written in the docs
11 years ago
Martin Zimmermann
54413dfcf3
add copyright header to embed.js (and it's MIT not BSD)
11 years ago
Martin Zimmermann
c5d52721c4
use cache.delete a) with an actual key and b) only on delete
11 years ago
Martin Zimmermann
2b7d263735
only create a reply box when needed
...
Previously this led to unnecessary object creation which impacted the
rendering time (on my machine 200 comments -> 1200ms) just to create
the postbox per comment (just the object initialization)).
11 years ago
Martin Zimmermann
cac4694f43
cache PBKDF2 hash, closes #18
...
Markdown conversion is not the reason for 2s per 100 comments response,
the hash function is. When using the email/remote_addr from cache, the
response time is pretty fast.
* when uWSGI is available, use their caching framework
* for multi-threaded environment (the default), use a simple cache
shipped with werkzeug
11 years ago
Martin Zimmermann
74ab58167e
replace abort(code) with proper exceptions and refactor request dispatch
11 years ago
Martin Zimmermann
2794734258
remove Jinja2 dependency
11 years ago
Martin Zimmermann
dea4c88162
remove admin interface fragments
11 years ago
Martin Zimmermann
2cac3f0567
detect Isso API endpoint when using *.dev.js script
11 years ago
Martin Zimmermann
e08e7be464
remove stale threads after all comments have been deleted
11 years ago
Martin Zimmermann
a658021f7e
fix unittest for 1358fac
and extend internal documentation
11 years ago
Martin Zimmermann
1358fac258
fix empty thread title due premature HTTP connection closing
11 years ago
Martin Zimmermann
55b6b283b8
use uWSGIs locking
11 years ago
Martin Zimmermann
9a8e0b524e
build notify mail with first hostname
11 years ago
Martin Zimmermann
0c7a4e44f9
disable werkzeug connection log
11 years ago
Martin Zimmermann
1518bae5ba
IE10 does not support classList on SVG elements m(
11 years ago
Martin Zimmermann
32f83160d6
config.js is not necessary in post.html
11 years ago
Martin Zimmermann
5689143c4a
remove button no longer resets after 1.5s, part of #17
11 years ago
Martin Zimmermann
bbccfe9def
include post.html in snapshot release and remove old css
11 years ago
Martin Zimmermann
876dd402a6
remove bootstrap
11 years ago
Martin Zimmermann
84da660ca9
update sample post
11 years ago
Martin Zimmermann
c3b6e0319e
use SVG to render identicon so the browser can auto-resize the image
...
Temporary fix for websites with small width, where the identicon
overlaps with the textarea field.
11 years ago
Martin Zimmermann
b672dae624
allow multiple hosts, e.g. HTTP and HTTPS sites
11 years ago
Martin Zimmermann
cb40c7ca42
improve doctests and refactor title extraction
11 years ago
Martin Zimmermann
89b1ca8846
doctests for utils.anonymize(remote_addr)
11 years ago
Martin Zimmermann
527b349fbe
use python's logging module
11 years ago
Martin Zimmermann
11293a504b
utils.parse now returns a triple (host, port, ssl)
11 years ago
Martin Zimmermann
acbf42f89d
fix SMTP connectivity test, appendum to a8d0670
11 years ago
Martin Zimmermann
94b1fef28e
rewrite CONFIGURATION.md in reST and extend document
11 years ago
Martin Zimmermann
2db98d0d34
move http utils in separate module
11 years ago
Martin Zimmermann
48b4c9f9a5
purge comments in moderation queue after given time, closes #13
11 years ago
Martin Zimmermann
a8d0670db7
fix PEP-8 minors
11 years ago
Martin Zimmermann
4f5b247ed1
delete comments via mail
11 years ago
Martin Zimmermann
5b52cbdfa6
skip empty Disqus threads
11 years ago
Martin Zimmermann
66ade6df14
remove semantic article, header and footer tags to avoid CSS collisions
11 years ago
Martin Zimmermann
b691579bad
test if #isso-thread exists
11 years ago
Martin Zimmermann
5d0cad4272
use proper email header encoding
11 years ago
Martin Zimmermann
e8d62e5db1
fix import regression from 11246f5
11 years ago
Martin Zimmermann
a2c3ecb131
remove behave.js
11 years ago
Martin Zimmermann
11246f51dc
support for moderated comments, part of #13
...
* add moderated = true to your configuration (defaults to false)
* comment activation via email to the Isso owner
11 years ago
Martin Zimmermann
79f8c1157e
show N days ago instead of previous week
11 years ago
Martin Zimmermann
61a486d2ea
support for Python 3.3
11 years ago
Martin Zimmermann
f9133b984e
use configparser backport to support python2.6 again
11 years ago
Martin Zimmermann
988d2032c5
replace blank identicon with ghosts
11 years ago
Martin Zimmermann
2557c02117
Merge branch 'feature/spam-guard'
11 years ago
Martin Zimmermann
1034d5016e
document app/dom.js
11 years ago
Martin Zimmermann
8967fd733e
hide reply button when it is not possible to reply
11 years ago
Martin Zimmermann
ab618ad898
add basic spam protection
11 years ago
Martin Zimmermann
6eab8ad5ca
support for uWSGI
...
* naive uWSGI fallback which spawns one thread per request and
one thread per mail notification
* uWSGI backend which utilize queues and spooling to handle
simultanous requests and mail notifications
This also fixes a bug where N concurrent POSTs on a new topic
failed for N-1 requests (db integrity error).
11 years ago
Martin Zimmermann
9ce965440a
toggle next state, when submit was succesful
11 years ago
Martin Zimmermann
0abb8ed658
remove edit and remove buttons when cookie is gone
11 years ago
Martin Zimmermann
0b8cac7f18
implement comment editing
11 years ago
Martin Zimmermann
6242d243c9
update cookie after editing a comment
11 years ago
Martin Zimmermann
75f172f4ae
textarea auto resize
11 years ago
Martin Zimmermann
80e8ce7e25
more i18n
11 years ago
Martin Zimmermann
57a16acff4
use promise lib correctly
11 years ago
Martin Zimmermann
e4f9b53668
minor CSS improvement to input and submit fields
11 years ago
Martin Zimmermann
2f6f4bc338
stylesheet injection
11 years ago
Martin Zimmermann
de25af5467
exclude svgs from count.min.js
11 years ago
Martin Zimmermann
fd18ea9eab
split i18n messages
11 years ago
Martin Zimmermann
ef463eb517
API endpoint detection for count.min.js
11 years ago
Martin Zimmermann
a7cc1cdf4d
move scss to isso/css/
11 years ago
Martin Zimmermann
b1e33bdce5
split 3rd-party packages to vendor and components
...
Then, use bower to fetch components and put libraries not
available as (web) component into vendor/.
Move crypto parts and identicon generation modules into app/lib.
11 years ago
Martin Zimmermann
b36e2fdb28
COMMIT ALL THE THINGS
...
* refactor JS (a lot)
* use a CSS framework (neat/bourbon), because CSS is hard
* up/downvote comments
* cleaner HTML
* HTML inclusion in JS
* SVG icons for reference, up and downvote
* basic i18n: english and german supported ootb
* lazy (because slow) client-side identicon generation (preview ability)
* removed website input field for no particular reason
* remove HTML.js in favour of a homebrew DOM manipulation tool
11 years ago
Martin Zimmermann
4f03b3faf9
re-license to MIT
11 years ago
Martin Zimmermann
560e73cc0a
rewrite db backend
11 years ago
Martin Zimmermann
52f64dd26f
improve url exists detection for new comment threads
11 years ago
Martin Zimmermann
30fa254023
connect to SMTP on-demand
11 years ago
Martin Zimmermann
98ab6d205a
anonymize IP if passed as ::ffff.1.2.3.4 correctly
11 years ago
Martin Zimmermann
88a7d40bea
send `null` instead of the empty string
11 years ago
Martin Zimmermann
b744e2fe39
use SSL for https://
11 years ago
Martin Zimmermann
3eeb686d5f
update stylesheet link
11 years ago
Martin Zimmermann
2ee47bd902
return 404 when creating a comment for a non-existing URI
11 years ago
Martin Zimmermann
021b672ee2
use only first 3 bytes from an IPv6 address
11 years ago
Martin Zimmermann
7ed5d6461e
add ProxyFix WSGI middleware for real IP and remove dead code
11 years ago
Martin Zimmermann
adb3d40c03
send notification for new comments
...
This commit also introduces a new db which maps path to thread title.
The title is read by parsing the HTML for a related <h1> tag using
`html5lib`.
You can set up SMTP in your configuration (here the defaults):
[SMTP]
host = localhost
port = 465
ssl = on
username =
password =
recipient =
sender =
In short, by default Isso uses a local SMTP server using SSL without
any authentication. An email is send on comment creation to "recipient"
from "Ich schrei sonst <sender>".
This commit also uses a simple ANSI colorization module from my static
blog compiler project.
On server startup, Isso will connect to the SMTP server and fall back to
a null mailer. It also tries to connect to your website, so if that
doesn't work, you probably can't comment on your website either.
11 years ago
Martin Zimmermann
9edd34d079
fix typos
11 years ago
Martin Zimmermann
0f7516edb4
always announce CORS, fix 3218e16
11 years ago
Martin Zimmermann
27022af1e6
update README, added docs/API.md draft
11 years ago
Martin Zimmermann
5759513fcd
remove old stuff and trim output from utils.heading
11 years ago
Martin Zimmermann
27ba6d795f
extend utils.ago to handle dates beyond 31 days
11 years ago
Martin Zimmermann
63f03e1111
disqus import now sets the comment creation date correctly
11 years ago
Martin Zimmermann
3218e16532
add CORS support
...
Isso can now run on a separate domain such as comments.example.org
and still serve for blog.example.org using CORS.
11 years ago
Martin Zimmermann
45d4e18aef
new /count?uri=path and count.js
...
A separate (minified) JS to load only the comment count for each
`<a href="...#isso-thread">...</a>` link. If there are no comments,
return a 404, otherwise return the number JSON formatted.
To built `count.ks`, run `r.js -o build.count.js`.
11 years ago
Martin Zimmermann
1105e3e016
don't shrink textarea on blur
11 years ago
Martin Zimmermann
10c65561ed
mv /client to /js
11 years ago
Martin Zimmermann
83f7c0201f
use almond.js for single file output
11 years ago
Martin Zimmermann
88b77ffa2d
show markdown by default
11 years ago
Martin Zimmermann
b65b86d664
fix german utils.ago strings
11 years ago
Martin Zimmermann
9484a8fa6f
add heading 'Kommentieren' etc.
11 years ago
Martin Zimmermann
18ebf6f95a
disable threading, use processes
11 years ago
Martin Zimmermann
3037f5926d
clean imports and remove old code
11 years ago
Martin Zimmermann
56ea90d7e0
JavaScript Identicons (awww), closes #8
11 years ago
Martin Zimmermann
bebda530b6
clear comment that still has references
11 years ago
Martin Zimmermann
413fb0c9a6
automatically update time(ago) every minute
11 years ago
Martin Zimmermann
fa277c98c1
disable scrollIntoView
11 years ago
Martin Zimmermann
20f82dcfcd
fix disqus import
11 years ago
Martin Zimmermann
aecab5cf01
scoll into view
11 years ago
Martin Zimmermann
f0c1574c15
remove stale comments from DB, closes #9
11 years ago
Martin Zimmermann
f1ffe444bc
don't remove root msg box on submit, but clear fields
11 years ago
Martin Zimmermann
449c838be3
REMOTE_ADDR is not unicode
11 years ago
Martin Zimmermann
5cad8fb8b5
clean db interface and comment model
11 years ago
Martin Zimmermann
c7ee35423b
implement db backend for votes/likes #5
11 years ago
Martin Zimmermann
11c6e4d720
remove email column
11 years ago
Martin Zimmermann
59706815e7
add comment.hash to recognize user by email or ip fallback
...
also: fixed test_comment json.dumps(json.loads(json.dumps(...)))
madness.
11 years ago
Martin Zimmermann
35926037a6
fix tests
11 years ago
Martin Zimmermann
f6271e5cf6
commit work in progress
...
completely revamp JS client because JS sucks^W^W^W to feature AMD,
require.js, promises and HTML.js.
The comment listing is now more like Disqus and for now comment
retrieval, comment creation and deletion works. Form validation is
rudimentary implemented as well.
replaced Mako with Jinja2 (because... I forgot.), admin interface will
use Bootstrap™ but is not functional yet.
features a progress indicator in case you're sqlite db performs *really*
bad
11 years ago
Martin Zimmermann
7e6fa0438b
use argparse and configparser
11 years ago
Martin Zimmermann
2d075f867a
move code around™
11 years ago
Martin Zimmermann
cb20f159fb
add bootstrap 2.3.2
11 years ago
Martin Zimmermann
dd4ba9263a
refactor all the things (use werkzeug instead of NIH to handle WSGI)
...
Also: use ?uri=%2Fpath%2F as path indicator.
11 years ago
Martin Zimmermann
76d6d46521
add progress bar to migration
11 years ago
Martin Zimmermann
57fa577e54
whatever I made there
11 years ago
posativ
26c74cb521
admin.js now used isso.js as API
...
JS is a horrible language. The more you try to modularize and DRY
it, the greater the LoC grows...
12 years ago
posativ
261f2fe18e
introduce namespaces for JS and trying to escape the pyramid of doom
12 years ago
posativ
525a2828c5
fix Makefile and move utilities to js/utils.js
12 years ago
posativ
a753045f8b
some documentation and move login to /admin/
12 years ago
posativ
588a8c306b
approved comments now move to recent comments
12 years ago
posativ
65c2fce636
better admin 'theme', 304 Not Modified support and minor improvements
12 years ago
posativ
eaaf1f4653
moar syntactic sugar
12 years ago
posativ
8e2e90ed4e
add threaded WSGI server mixin to check URL existence on same host :>
12 years ago
posativ
63b990838d
fix tests
12 years ago
posativ
a4514e1f91
rewrite using NIH
12 years ago
posativ
440787ff67
fix Augenkrebs in dashboard
12 years ago
posativ
28162d7ca9
edit comment works when comment is still pending
12 years ago
posativ
2e1831f609
show pending status, add some css
12 years ago
posativ
1bafe193ad
approve comments
12 years ago
posativ
23232d4f0e
fix admin.js
12 years ago
posativ
5d15ab0ea3
use highly sophisticated '2 weeks ago' dates including microformats
12 years ago
posativ
c7d4b5a071
use promise.js -> less code, less indentation, 2 kb less framework
12 years ago
posativ
6f4b02ab12
show deleted comments when they are referenced
12 years ago
posativ
35310300ac
add 'edit comment' functionality. Use with care.
12 years ago
posativ
b4708fb284
modify can return plain text and marked up content
12 years ago
posativ
db32d1c7f0
refactor JS and add YUI compression.
12 years ago
posativ
66cc7911f5
limit to 20 by default
12 years ago
posativ
6bb7b8c8d9
admin interface can delete comments :>
12 years ago
posativ
15ead12683
I can't still remember what ASC and DESC means
12 years ago
posativ
7420e6a130
add path to comment class
12 years ago
posativ
05b77f99fe
add db.recent(mode, limit) method
12 years ago
posativ
2bfbad39ca
begin dashboard using mako templates
12 years ago
posativ
39899dda81
/comment/ -> /1.0/
12 years ago
posativ
ac6d88f61e
`isso import FILE` can import Disqus export
12 years ago
posativ
ecd4c6b120
fix an edge case, where mallory can delete comments by bo
12 years ago
posativ
3459b7b9ee
delete comment works for non-referenced comments now
12 years ago
posativ
d9a9eaf8c5
zero-fill date and add cookie recognition
12 years ago
posativ
10b1b1b470
use unique cookie name
12 years ago
posativ
ae96122ea1
fix issues caused by @moschlar
12 years ago
posativ
d2bc2537a1
remove limit, introduced unnecessary complexity
12 years ago
posativ
3b197c4c3c
close form after reply
12 years ago
posativ
d6e4312e47
threaded comments :>
12 years ago
posativ
eee2e43588
refactor and re-indentation
12 years ago
posativ
63f3d6ff2f
add date formatting and link to website
12 years ago
posativ
a15338209b
basic XSS protection m)
12 years ago
posativ
443eb2bbe1
fix tests
12 years ago
posativ
487d76ba61
add API for different markup languages
12 years ago
posativ
9aeed1a47e
client-side draft using qwery, bean, bonzo and domReady
12 years ago
posativ
efa334de39
markdown support (using misaka)
12 years ago
posativ
d30c3c059b
sort in chronological order
12 years ago
posativ
f2eff22ff7
circumvent CGI 1.1 specs (PATH_INFO is quoted)
12 years ago
posativ
3cb623e7c2
check if url exists before creating a comment
12 years ago
posativ
2c8c97b2a8
add db.activate function and use UNIX-style permission bits for normal/activated/deleted comments
12 years ago
posativ
f1fb80f5ef
add license decoration
12 years ago
posativ
05336728f4
use itsdangerous
12 years ago
posativ
759b304cb5
refactor configuration variables
12 years ago
posativ
27801eef26
delete only when not referenced
12 years ago
posativ
af8fcdab19
most database operations now return Comment object
12 years ago
posativ
3d398341a3
update database requirements
12 years ago
posativ
e2198ed74a
add update and delete views
12 years ago
posativ
1b2b4da490
fix db update
12 years ago
posativ
27007547bb
return 404 if none found
12 years ago
posativ
5d23bff409
clean json fuckup and add create and get views
12 years ago
posativ
8301f0af78
replace db.initialize with db.__init__
12 years ago
posativ
98c4b6ccb2
move Comment class to isso.models
12 years ago
posativ
36add653a7
change modified timestamp after update
12 years ago
posativ
633b0bee33
add update, get and delete methods to SQLite adapter
12 years ago
posativ
48cff63d4c
add Comment.fromjson and update table definitions
12 years ago
posativ
3bb830e86c
add mode for comments (normal, pending, deleted)
12 years ago
posativ
54548d4bd5
docs and input sanitization
12 years ago
posativ
1199424a2b
add basic SQLite adapter + tests
12 years ago
posativ
0333f7efb0
first tests and general code layout
12 years ago
posativ
7d905ed4ea
initial commit
12 years ago