Isso on Ghost on Uberspace 7
Here's my guide on installing Isso on Uberspace 7 for comments als alternative to Disqus and Commento. See also my last posts on Installing Ghost and Installing Commento and my thoughts for choosing Isso over Commento on Comments on Ghost on Uberspace 7.
The official Install Guide of Isso suggests to use pip
, in our case with the --user
flag for a local install:
pip install --user isso
(If you like to support python3 you can also do a pip3 install --user isso
or even use pip3.6
)
As in the guide for Ghost we need to choose a port:
ISSOPORT=$(( $RANDOM % 4535 + 61000)); netstat -tulpen | grep $ISSOPORT && echo "versuch's nochmal"
We want notifications when someone comments on our blog. Therefore we create a mailuser to send the emails from and set a password (of course you can skip this if you don't need/want it):
uberspace mail user add comments
Now we create a config file in ~/etc/isso/
. We chose to configure Isso with smtp mail, therefore we add the [smtp]
section and notify = smtp
to our configuration. You can just copy the whole cat
command and paste it in the shell:
mkdir ~/etc/isso
cat <<__EOF__ >~/etc/isso/user.cfg
[general]
dbpath = $HOME/etc/isso/comments.db
host = https://yourdomain.tld/
log-file = /home/maxb/logs/isso_logfile
notify = smtp
[server]
listen = http://localhost:$ISSOPORT/
[smtp]
username = comments@$USER.uber.space
password = SECRETMAILBOXPASSWORD
to = yourmailadress@yourhoster.tld
from = comments@yourdomain.tld
host = $HOSTNAME
__EOF__
After executing don't forget to change yourdomain.tld
to your actual domain and to enter the password you chose earlier (~/etc/isso/user.cfg
). Https only is sufficient, because uberspace enforces https and redirects all unencrypted requests. Of course you omit the smtp and notify settings if you didn't create the mailuser. More on the server config in the Official Documentation.
To make isso available on the outside we need to add a subdomain. For example comments.yourdomain.tld
:
uberspace web domain add comments.yourdomain.tld
Now we need to tell Apache to proxy all requests to Isso. We do this by creating a directory for the subdomain and placing a .htaccess
file in there:
mkdir /var/www/virtual/$USER/comments.yourdomain.tld
cat <<__EOF__ >/var/www/virtual/$USER/comments.yourdomain.tld/.htaccess
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^(.*) http://localhost:$ISSOPORT/\$1 [P,L]
__EOF__
The first row prevents Apache from serving an index.html
when just accessing the domain. This would prevent the Isso client (i.e. your website) from reaching the right endpoint at the server.
The last line of the file redirects the traffic to the Isso server.
Lastly comes the service file. We need to create a service file again, like we did for Ghost:
cat <<__EOF__ >~/etc/services.d/isso.ini
[program:isso]
command = $HOME/.local/bin/isso -c $HOME/etc/isso/user.cfg run
autostart = true
autorestart = true
__EOF__
It's pretty self-explanatory. autostart
starts the isso server on startup and autorestart
restarts the server when it fails.
Now just reread the config and update it to start Isso!
supervisorctl reread
supervisorctl update
Lastly we need to add the comment section to the blog. Probably below every post, so we take a look at our theme, which is casper, and find the ~/ghost/content/themes/casper/post.hbs
. Some way down is already an commented part for Disqus. There we can add (obviously not inside the commented part) the following snippet:
<script data-isso="https://comments.yourdomain.tld/"
src="https://comments.yourdomain.tld/js/embed.min.js"></script>
<section id="isso-thread"></section>
Again, don't forget to change your domain!
That's almost it. Restart Ghost to see the comment section appear!
supervisorctl restart ghost
If you have questions, leave a comment below.
Yours,
Max