This post is a part of My Isso Style Series.
- Installation
- Configuration
- Inside the Database
Server Configuration
[general]
dbpath = /var/lib/isso/comments.db
host = https://snorl.ax
notify = smtp
log-file = /var/lib/isso/snorl.ax.log
gravatar = true
gravatar-url = https://www.gravatar.com/avatar/{}?d=https%%3A%%2F%%2Fstatic.snorl.ax%%2Ftheme%%2Fimages%%2Ficon_anonymous.png
reply-notifications=true
[moderation]
enabled = true
[guard]
enabled = true
ratelimit = 1
direct-reply = 3
reply-to-self = true
[smtp]
host = localhost
port = 25
security = none
to = sim@snorl.ax
from = "Simputer" <admin@snorl.ax>
timeout = 10
[admin]
enabled = false
For other options I haven't set u could check the official documentation1.
In
[general]:dbpathis the path of the sqlite database file where I store the data.hostis the url where I want the isso to be shown, for isso to be shown in both http and https version, it should be set as:host = http://snorl.ax https://snorl.axnotifyis the notification backend for new comments, I setnotify = smtpso I'll receive a new email when a new comment is successfully submitted to the server, it also make the reply notification possible.log-fileis the path of log showing the status of the isso.gravatar = trueenables the use of gravatar.gravatar-urldefines url for gravatar images. The “{}” is where the email hash will be placed. The value afterd=defines the defalut image to show if there is no image associated with the requested email hash. If you choose not to set this option, isso will automatically set the value to identicon, which is a geometric pattern based on an email hash.
To set my own default image for the situation, I need to urlencode the url for that image. Now for mehttps://static.snorl.ax/theme/images/icon_anonymous.pngis the url, so I do it with python2:$ python
Import the required library for it and do it:
>>> import urllib.parse >>> the = urllib.parse.quote_plus('https://static.snorl.ax/theme/images/icon_anonymous.png') >>> the.replace('%','%%')Then it'll return the required url-encoded string:
'https%%3A%%2F%%2Fstatic.snorl.ax%%2Ftheme%%2Fimages%%2Ficon_anonymous.png'Now I can set
gravatar-url = https://www.gravatar.com/avatar/{}?d=https%%3A%%2F%%2Fstatic.snorl.ax%%2Ftheme%%2Fimages%%2Ficon_anonymous.pngto see it working. Normally we don't need to replace%with%%, however in isso if I don't do so, the following error will happen:InterpolationSyntaxError: '%' must be followed by '%' or '(', found: u'%3A%2F%2Fstatic.snorl.ax%2Ftheme%2Fimages%2Ficon_anonymous.png'To know more about how to tango with Gravatar, see the documentation.
reply-notification=trueenables email notifications of replies to the commenters who have previously subcribed to email notification of replies.
In
[moderation]:enabledenables comment moderation queue and only affects new comments. Comments in moderation queue are not visible to other users until I activate them.
In
[guard]:enabledenable guard, for the rest of the section to take into effect.ratelimitis the number of comments each IP address can send in a thread per minute.direct-replyis the number of comments a thread can receive per minute.replt-to-selfallows a commenter to reply to his own comment.
In
[smtp]:host,port,security: the SMTP server, port and security used when a notification is sent through email. Since the isso is located in the same server as my email, the configuration works withoutpassword. If u want to set email service on ur server and haven't got a clue, u could check out my post.from: The sender address of the email notification.to: The receiver address of the email notification for every new comments(with their moderation address if moderation is enabled).timeout: Specify a timeout in seconds for blocking operations like the connection attempt.
In
[admin]:enabled=falsedisable the administration page inhttps://isso.snorl.ax/admin/. No need to open an admin page for that while u could look into the sqlite urself.
[server]block has been deleted 'cause it won't work with uwsgi.
Client Configuration
Current Configuration
Since I'm using nuxt now, I could easily play with isso API, you can see how I do it from my components in the source code.
Previous Configuration
<section id=comments data-title="{{ title }}" data-isso-id="/the/path/to/the/page/">
<script data-isso=https://isso.snorl.ax/ data-isso-gravatar=true data-isso-avatar=false data-isso-reply-notifications=true data-isso-reply-to-self=true data-isso-css=false src=https://static.snorl.ax/theme/js/embed.min.js data-isso-lang=en></script>
For other options I don't use, u can check the official documention.
- The id of the section is
comments, notisso-thread, 'cause I use the edited version ofembed.min.js, where I replace all the occurences ofisso-threadwithcomments. That's generally not a recommended practice. Each update of isso will get me busy replacing. So maybe one day I'll revert it back. Thedata-titleparses the title to the database as the title of the thread, not working on the thread existing in the database.data-isso-idresolves the problem when the same page has several urls. (For example, a soft link on a directory can cause the result.) - I set
data-issoin the script tag 'cause thesrcis not the original path of the isso. - To get Gravatar working on the site,
data-isso-gravatar=true data-isso-avatar=falseis a must. - To enable the reply notifications on the site,
data-isso-reply-notifications=trueshould be set. data-isso-reply-to-self=trueallows the commenter to reply to himself.data-isso-lang=enset the language to English. So the language of the running isso on the site won't vary based on the very language the viewer is using.- For my css style of isso to get into effect completely without being interfered,
data-isso-css=falseis a must.
Click here to seethe css code inside theembed.min.jsof the newest version of isso as of December 27, 2018. Before applying my own css style completely to the running isso, editing the style based on the original code is generally a recommended practice.