Create isso user
First we create a new user with its own home directory, for easy backing up of data files and security:
Install packages
Install relevant packages:
Now:
Note: Had to create this file for pip installs to work:
Add /home/isso/.local/bin
to path.
Create a server configuration file from here.
Example from here:
vim /home/isso/isso.conf
:
[general]
dbpath = /home/isso/comments.db
host = https://MYDOMAIN.com/
max-age = 5m
notify = smtp
log-file = /home/isso/isso.log
admin_password = ADMINPASSWORD
[moderation]
enabled = false
[server]
listen = http://localhost:8080
reload = off
profile = off
public-endpoint = https://isso.MYDOMAIN.com/
[guard]
enabled = true
ratelimit = 2
direct-reply = 3
reply-to-self = false
require-author = true
require-email = false
[smtp]
username =
password =
host =
port = 587
security = starttls
to =
from =
timeout = 10
Test the installation:
Nginx reverse proxy
Configure an isso subdomain. For me: isso.vectorspace.xyz
. I did this by first
making a simple site config in /etc/nginx/sites-available
and making sure
nginx correctly routes to it. It was only after this that I attempted to
implement HTTPs. Look at my notes on nginx for further elaboration.
The Final nginx configuration looks like this. I adapted it from here.
/etc/nginx/sites-available/comments
server {
listen 443 http2;
listen [::]:80 http2;
server_name isso.vectorspace.xyz;
ssl on;
ssl_certificate /etc/letsencrypt/live/isso.vectorspace.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/isso.vectorspace.xyz/privkey.pem;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8080;
}
}
server {
listen 80;
listen [::]:80;
server_name isso.vectorspace.xyz;
return 301 https://isso.vectorspace.xyz$request_uri;
access_log /dev/null;
error_log /dev/null;
}
Restart nginx with sudo systemctl restart nginx.service
and make sure it
works.
Test isso
Run isso as isso user:
Mkdocs: replace disqus with isso (OLD WAY)
I adapted instructions from here, but modded so as that we can still disable comments in pages that don't need it.
cd to site direcotry and create overrides.
Create main.html: vim main.html
with contents:
{% extends "base.html" %}
{% block disqus %}
{% if page and page.meta and page.meta.isso is boolean %}
{% set isso = page.meta.isso %}
{% else %}
{% set isso = true %}
{% endif %}
{% if not page.is_homepage and isso %}
<!-- replace disqus with isso -->
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
<div id="disqus_thread"></div>
<script
data-isso="https://isso.vectorspace.xyz/"
data-isso-css="true"
data-isso-require-author="true"
data-isso-require-email="true"
data-isso-reply-to-self="false"
src="https://isso.vectorspace.xyz/js/embed.min.js">
</script>
{% endif %}
<section id="isso-thread"></section>
{% endblock %}
According to the above code, if you set isso: false
like:
, the comments will get disabled for the page, otherwise its enabled by default.
Rebuild site and upload to server.
Mkdocs : NEW Way to add isso to mkdocs-material:
vector@resonyze ~/vectorspacexyz.github.io (git)-[main] % cat docs/overrides/partials/comments.html
{% if page and page.meta and page.meta.isso is boolean %}
{% set isso = page.meta.isso %}
{% else %}
{% set isso = true %}
{% endif %}
{% if not page.is_homepage and isso %}
<!-- replace disqus with isso -->
<br>
<h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
<div id="disqus_thread"></div>
<script
data-isso="https://isso.vectorspace.xyz/"
data-isso-css="true"
data-isso-require-author="true"
data-isso-require-email="true"
data-isso-reply-to-self="false"
src="https://isso.vectorspace.xyz/js/embed.min.js">
</script>
{% endif %}
<section id="isso-thread"></section>
Patching comments.py
In my case, I had to patch comments.py
to get Isso working. Details here.
cd ~/.local/lib/python3.8/site-packages
wget 'https://patch-diff.githubusercontent.com/raw/posativ/isso/pull/600.diff'
patch -p1 <600.diff
Incase you want to reverse the patch
Test to see if isso works now isso -c isso.conf
Enable admin page
vim /home/isso/isso.conf
# In admin block set admin = true and password
[admin]
enabled = true
password = set_strong_password
You can access the admin page at https://your-isso-site/admin
Setup systemd service
Adapted from this site
vim /etc/systemd/system/isso.service
[Unit]
Description=Isso Commenting Server
After=network.target
[Service]
Type=simple
User=isso
WorkingDirectory=/home/isso
ExecStart=/home/isso/.local/bin/isso -c /home/isso/isso.conf
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Reload systemctl dameon.
Start isso.service
If status shows its working fine, enable it: