summaryrefslogtreecommitdiffstats
path: root/src/journal/2-comments.rst
blob: e98324991975ad84c438f308bca37dc9cde06253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.. frontmatter
   title: comments
   date: 2014-10-15
   author: Johannes Löthberg
   author_link: /~kyrias/about.html

Finally set it up so that each journal entry gets a separate page generated for
itself too in addition to being on the `journal index`_. Each entry gets a file
in the ``/~kyrias/journal/`` subdirectory named after the entry source file but
with the extension changed to ``.html`` instead of ``.rst``.

My first thought for which commenting system to use was disqus, but I don't
really like using it at all in practice so I quickly decided against it. I do
quite like discourse_ though and thought about setting it up, but that would
require me setting up PostgreSQL and Redis, neither of which I feel like
setting up nor that I would have any other use for, and both would use up quite
a bit of resources for basically nothing, so discourse was out.

After looking around for a bit and finding a few disqus clones I finally found
isso_, which is named after either a German abbreviation or after the 360th_
Pokémon’s name in German. While it’s probably the first alternative, the second
sounds more fun so I’ll just go with that.

Isso is a rather simple commenting server written in python, uses Markdown for
stylinx (hopefully I can get it to do reStructuredText too maybe), and using
SQLite for storage which is a plus since it means I don't have to set up some
big bulky SQL server. All you need to do to try it out is on the `quickstart
page`_, but it roughly comes down to first installing isso (it’s installable
through ``pip``), then writing a really short config file that tells isso where
to store the SQLite database for comments and which hosts isso will be used on
for CORS_. After that you just start isso up pointing it at the config file and
it’s up and running. The client-side of isso is just ``script`` and ``section``
tag away, and then you’re done setting it up.

Isso has support for simple moderation where new comments end up in a queue and
has to be manually activated by going through a URL that can be emailed to you
if you want, and things like rate limiting new comments. All of it is
documented on the `server configuration`_ and `client configuration`_ pages,
and there's also some info on the isso API and things like a comment counter. I
could continue rambling about what it supports, but that would be rather
pointless since it’s written so nicely on their website.

Where I had some issues was getting it run properly under uWSGI_ and using
NGINX_ as a reverse proxy, but it turned out after an hour of testing that I
had installed uWSGI but not the python plugin. D’oh. Once I had that installed
and added ``plugins = python`` to the uWSGI config file and adjusted my NGINX
config file slightly since I run isso under a sub URI instead of on a separate
domain it worked perfectly though.

Here’s the config files I’m currently using:

.. raw:: html

    <script src="https://gist.github.com/kyrias/f7ec681e1c8c2effdb7e.js"></script>

As far as I know the ``uwsgi_param HTTP_X_SCRIPT_NAME /isso;`` line is only
needed if you’re running isso under a sub URI and I think it isn’t needed if
you aren’t, but don’t quite me on that.

I have yet to set up the moderation part of isso though, and that’s probably
what I’m going to play with next.

geros ilas.

.. _journal index: https://theos.kyriasis.com/~kyrias/journal.html
.. _discourse: http://www.discourse.org/
.. _isso: https://posativ.org/isso/
.. _360th: http://bulbapedia.bulbagarden.net/wiki/Wynaut_(Pok%C3%A9mon)
.. _quickstart page: https://posativ.org/isso/docs/quickstart/
.. _CORS: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
.. _server configuration: https://posativ.org/isso/docs/configuration/server/
.. _client configuration: https://posativ.org/isso/docs/configuration/client/
.. _uWSGI: http://projects.unbit.it/uwsgi
.. _NGINX: http://nginx.org/