Merge branch 'legacy/0.9'
Conflicts: CHANGES.rst isso/core.py setup.py
This commit is contained in:
commit
f7e51fd03d
25
CHANGES.rst
25
CHANGES.rst
@ -7,12 +7,35 @@ Changelog for Isso
|
||||
- Nothing changed yet.
|
||||
|
||||
|
||||
0.9.5 (unreleased)
|
||||
0.9.6 (unreleased)
|
||||
------------------
|
||||
|
||||
- Nothing changed yet.
|
||||
|
||||
|
||||
0.9.5 (2014-08-10)
|
||||
------------------
|
||||
|
||||
- prevent no-break space ( ) insertion to enable manual line breaks using
|
||||
two trailing spaces (as per Markdown convention), #112
|
||||
|
||||
- limit request size to 256 kb, #107
|
||||
|
||||
Previously unlimited or limited by proxy server). 256 kb is a rough
|
||||
approximation of the next database schema with comments limited to 65535
|
||||
characters and additional fields.
|
||||
|
||||
- add support for logging to file, #103
|
||||
|
||||
[general]
|
||||
log-file =
|
||||
|
||||
- show timestamp when hovering <time>, #104
|
||||
|
||||
- fix a regression when editing comments with multiple paragraphs introduced
|
||||
in 0.9.3 which would HTML escape manually inserted linebreaks.
|
||||
|
||||
|
||||
0.9.4 (2014-07-09)
|
||||
------------------
|
||||
|
||||
|
@ -44,6 +44,7 @@ session key and hostname. Here are the default values for this section:
|
||||
host =
|
||||
max-age = 15m
|
||||
notify = stdout
|
||||
log-file =
|
||||
|
||||
dbpath
|
||||
file location to the SQLite3 database, highly recommended to change this
|
||||
@ -86,6 +87,9 @@ notify
|
||||
Send notifications via SMTP on new comments with activation (if
|
||||
moderated) and deletion links.
|
||||
|
||||
log-file
|
||||
Log console messages to file instead of standard out.
|
||||
|
||||
|
||||
.. _CORS: https://developer.mozilla.org/en/docs/HTTP/Access_control_CORS
|
||||
|
||||
|
@ -139,6 +139,8 @@ Prebuilt Packages
|
||||
* Arch Linux: https://aur.archlinux.org/packages/isso/
|
||||
– install with `yaourt isso`.
|
||||
|
||||
* Docker Image: https://registry.hub.docker.com/u/bl4n/isso/
|
||||
|
||||
Install from Source
|
||||
-------------------
|
||||
|
||||
|
@ -70,7 +70,7 @@ from isso.views import comments
|
||||
|
||||
from isso.ext.notifications import Stdout, SMTP
|
||||
|
||||
logging.getLogger('werkzeug').setLevel(logging.ERROR)
|
||||
logging.getLogger('werkzeug').setLevel(logging.WARN)
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s %(levelname)s: %(message)s")
|
||||
@ -231,6 +231,15 @@ def main():
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
if conf.get("general", "log-file"):
|
||||
handler = logging.FileHandler(conf.get("general", "log-file"))
|
||||
|
||||
logger.addHandler(handler)
|
||||
logging.getLogger("werkzeug").addHandler(handler)
|
||||
|
||||
logger.propagate = False
|
||||
logging.getLogger("werkzeug").propagate = False
|
||||
|
||||
if not any(conf.getiter("general", "host")):
|
||||
logger.error("No website(s) configured, Isso won't work.")
|
||||
sys.exit(1)
|
||||
|
@ -17,7 +17,7 @@ define({
|
||||
"comment-queued": "Commentaire en attente de modération.",
|
||||
"comment-anonymous": "Anonyme",
|
||||
"comment-hidden": "1 caché\n{{ n }} cachés",
|
||||
"date-now": "À l'instant'",
|
||||
"date-now": "À l'instant",
|
||||
"date-minute": "Il y a une minute\nIl y a {{ n }} minutes",
|
||||
"date-hour": "Il y a une heure\nIl y a {{ n }} heures ",
|
||||
"date-day": "Hier\nIl y a {{ n }} jours",
|
||||
|
@ -101,7 +101,7 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n",
|
||||
|
||||
// update datetime every 60 seconds
|
||||
var refresh = function() {
|
||||
$(".permalink > date", el).textContent = utils.ago(
|
||||
$(".permalink > time", el).textContent = utils.ago(
|
||||
globals.offset.localTime(), new Date(parseInt(comment.created, 10) * 1000));
|
||||
setTimeout(refresh, 60*1000);
|
||||
};
|
||||
|
@ -21,6 +21,13 @@ define(["libjs-jade-runtime", "app/utils", "jade!app/text/postbox", "jade!app/te
|
||||
load("comment-loader", tt_comment_loader);
|
||||
|
||||
set("bool", function(arg) { return arg ? true : false; });
|
||||
set("humanize", function(date) {
|
||||
if (typeof date !== "object") {
|
||||
date = new Date(parseInt(date, 10) * 1000);
|
||||
}
|
||||
|
||||
return date.toString();
|
||||
});
|
||||
set("datetime", function(date) {
|
||||
if (typeof date !== "object") {
|
||||
date = new Date(parseInt(date, 10) * 1000);
|
||||
@ -30,7 +37,11 @@ define(["libjs-jade-runtime", "app/utils", "jade!app/text/postbox", "jade!app/te
|
||||
date.getUTCFullYear(),
|
||||
utils.pad(date.getUTCMonth(), 2),
|
||||
utils.pad(date.getUTCDay(), 2)
|
||||
].join("-");
|
||||
].join("-") + "T" + [
|
||||
utils.pad(date.getUTCHours(), 2),
|
||||
utils.pad(date.getUTCMinutes(), 2),
|
||||
utils.pad(date.getUTCSeconds(), 2)
|
||||
].join(":") + "Z";
|
||||
});
|
||||
|
||||
return {
|
||||
|
@ -12,7 +12,7 @@ div(class='isso-comment' id='isso-#{comment.id}')
|
||||
= bool(comment.author) ? comment.author : i18n('comment-anonymous')
|
||||
span(class="spacer") •
|
||||
a(class='permalink' href='#isso-#{comment.id}')
|
||||
date(datetime='#{datetime(comment.created)}')
|
||||
time(title='#{humanize(comment.created)}' datetime='#{datetime(comment.created)}')
|
||||
span(class='note')
|
||||
= comment.mode == 2 ? i18n('comment-queued') : comment.mode == 4 ? i18n('comment-deleted') : ''
|
||||
|
||||
|
@ -57,13 +57,15 @@ define(["app/i18n"], function(i18n) {
|
||||
var _ = document.createElement("div");
|
||||
_.innerHTML = html.replace(/<div><br><\/div>/gi, '<br>')
|
||||
.replace(/<div>/gi,'<br>')
|
||||
.replace(/<br>/gi, '\n');
|
||||
.replace(/<br>/gi, '\n')
|
||||
.replace(/ /gi, ' ');
|
||||
return _.textContent.trim();
|
||||
};
|
||||
|
||||
var detext = function(text) {
|
||||
return escape(text.replace(/\n\n/gi, '<br><div><br></div>')
|
||||
.replace(/\n/gi, '<br>'));
|
||||
text = escape(text);
|
||||
return text.replace(/\n\n/gi, '<br><div><br></div>')
|
||||
.replace(/\n/gi, '<br>');
|
||||
};
|
||||
|
||||
return {
|
||||
|
@ -8,9 +8,11 @@ werkzeug = pkg_resources.get_distribution("werkzeug")
|
||||
import json
|
||||
import hashlib
|
||||
|
||||
from werkzeug.wrappers import Request, Response
|
||||
from werkzeug.wrappers import Response
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
from isso.wsgi import Request
|
||||
|
||||
try:
|
||||
import ipaddress
|
||||
except ImportError:
|
||||
|
@ -126,6 +126,9 @@ class API(object):
|
||||
if len(comment["text"].rstrip()) < 3:
|
||||
return False, "text is too short (minimum length: 3)"
|
||||
|
||||
if len(comment["text"]) > 65535:
|
||||
return False, "text is too long (maximum length: 65535)"
|
||||
|
||||
if len(comment.get("email") or "") > 254:
|
||||
return False, "http://tools.ietf.org/html/rfc5321#section-4.5.3"
|
||||
|
||||
|
@ -17,6 +17,7 @@ except ImportError:
|
||||
from BaseHTTPServer import HTTPServer
|
||||
|
||||
from werkzeug.serving import WSGIRequestHandler
|
||||
from werkzeug.wrappers import Request as _Request
|
||||
from werkzeug.datastructures import Headers
|
||||
|
||||
from isso.compat import string_types
|
||||
@ -148,6 +149,14 @@ class CORSMiddleware(object):
|
||||
return self.app(environ, add_cors_headers)
|
||||
|
||||
|
||||
class Request(_Request):
|
||||
|
||||
# Assuming UTF-8, comments with 65536 characters would consume
|
||||
# 128 kb memory. The remaining 128 kb cover additional parameters
|
||||
# and WSGI headers.
|
||||
max_content_length = 256 * 1024
|
||||
|
||||
|
||||
class SocketWSGIRequestHandler(WSGIRequestHandler):
|
||||
|
||||
def run_wsgi(self):
|
||||
|
@ -43,6 +43,9 @@ max-age = 15m
|
||||
# moderated) and deletion links.
|
||||
notify = stdout
|
||||
|
||||
# Log console messages to file instead of standard out.
|
||||
log-file =
|
||||
|
||||
|
||||
[moderation]
|
||||
# enable comment moderation queue. This option only affects new comments.
|
||||
|
Loading…
Reference in New Issue
Block a user