Tried ISSO and ......

My Isso Style
1. Installation
2. Configuration
3. Inside the Database

Well, looking back from 2018 and I have got to say, it's more than light-weight and keeps getting better.

Now with isso u could send reply notifications to the subcribed commenters and isso officially supports gravatar.

If u r following the things below, be sure to replace username, domain with ur own.

Installation

Don't install a python package as root, the python packages in the package manager might be outdated and it might interfere with your globally installed packages. (My server running Debian is an example). So it is recommended to use a virtualenv to do it as a non-root user.

I install isso using git below to make sure it's up to date so everything in the official documentation takes into effect.

  1. Switch to the non-root user if u aren't logged in as it now. For example, I'm logged in as root and want to switch to sim:

    $ su sim
    
  2. Get into the home directory:

    $ cd ~
    
  3. Install the relevant packages:

    $ sudo apt-get install python-setuptools python-virtualenv python-dev python-pip sqlite3 git build-essential
    
  4. Install Nvm.

    $ git clone https://github.com/creationix/nvm.git .nvm
    
  5. Open ~/.bashrc, ensure the following lines r included in it and save it:

    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

    Source it.

    $ source ~/.bashrc
    
  6. Install nodejs.

    $ nvm install node
    
  7. Install bower.

    $ npm install -g bower
    
  8. Set virtualenv in a place.

    $ virtualenv work
    
  9. Get into the environment:

    $ source work/bin/activate
    
  10. Fetch isso from source and install it.

    $ git clone https://github.com/posativ/isso.git
    $ cd isso
    $ python setup.py develop # or `install`
    $ make init
    $ npm install -g requirejs uglify-js jade
    $ make js
    
  11. Add a user to run isso exclusively:

    $ sudo useradd isso -d /usr/lib/isso
    
  12. Make a directory for isso and assign it to the user:

    $ sudo mkdir /usr/lib/isso
    $ sudo chown -R isso:isso /usr/lib/isso
    
  13. Now switch to the user:

    $ sudo su isso
    
  14. Get into the directory:

    $ cd ~
    

Configuration

  1. Create isso.conf, the host should be ur URL (I only run the blog in SSL version, so in my case, it's https://snorl.ax):

    [general]
    dbpath = /usr/lib/isso/comments.db
    host = https://snorl.ax/
    
    [server]
    listen = http://localhost:8001/
    

    For other things like SMTP, reply notification and gravatar, u can refer to my config

  2. Exit to come back as the previous user (In my case, sim):

    $ exit
    
  3. Create a symlink to a location in my PATH:

    $ sudo ln -s /home/sim/work/bin/isso /usr/local/bin/isso
    
  4. About Init Script, I'm using Debian which is using systemd, which is most Linux distributions' choice for service management. Take it for example:

    I. Create a service /etc/systemd/system/isso.service with the following lines:

    [Unit]
    Description=lightweight Disqus alternative
    
    [Service]
    User=isso
    ExecStart=/usr/local/bin/isso -c /usr/lib/isso/isso.conf run
    
    [Install]
    WantedBy=multi-user.target
    

    II. Run the thing and check the status

    $ sudo systemctl daemon-reload && sudo systemctl start isso && sudo systemctl status isso

    When it's active and running, enable it so it will start and run every time u reboot into the system:

    $ sudo systemctl enable isso
    

Integrate into the server

I'm using Nginx, and running it in the root of my subdomain isso.snorl.ax, so the relevant server block in /etc/nginx/conf.d/default.conf is like this:

server {
        ...
        server_name isso.snorl.ax;

       ...

       location / {
        proxy_pass http://localhost:8001;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
      }

      ...

}

The location / block is the things needed to be included.

Insert into the website

The https://isso.snorl.ax/js/embed.min.js should be available.
Time to insert the code to comment area (If u get a 404 error it's due to something like the cache settings of ur js files, delete certain lines of it will help):

<script data-isso="https://isso.snorl.ax/" src="https://isso.snorl.ax/js/embed.min.js"></script>

<section id="isso-thread"></section>

Now it's online. Try commenting in the browser. Troubleshoot if it fails.

CDN Integration

If u wanna implement CDN on it I suggest CloudFlare.

Whatever, there will always be a problem about IP with the default configuration. The mail notification about a comment will show the IP of the CDN's instead of the client's.

CloudFlare Tutorial about solution: Nginx | Apache

I'm using Nginx currently, isso has got the variable X-Forwarded-For for showing true IP, thus there's no need in editing files of isso.

  1. Edit /etc/nginx/nginx.conf, make sure the http section contains set_real_ip_from field with the IPs of Cloudflare and real_ip_header is set to X-Forwarded-For, just like this:

    http {
    ...
    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 131.0.72.0/22;
    set_real_ip_from 141.101.64.0/18;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 172.64.0.0/13;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 190.93.240.0/20;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;
    
    real_ip_header X-Forwarded-For;
    ...
    }
    

    If ur Nginx supports ipv6, try the following:

    http {
    ...
    set_real_ip_from 103.21.244.0/22;
    set_real_ip_from 103.22.200.0/22;
    set_real_ip_from 103.31.4.0/22;
    set_real_ip_from 104.16.0.0/12;
    set_real_ip_from 108.162.192.0/18;
    set_real_ip_from 131.0.72.0/22;
    set_real_ip_from 141.101.64.0/18;
    set_real_ip_from 162.158.0.0/15;
    set_real_ip_from 172.64.0.0/13;
    set_real_ip_from 173.245.48.0/20;
    set_real_ip_from 188.114.96.0/20;
    set_real_ip_from 190.93.240.0/20;
    set_real_ip_from 197.234.240.0/22;
    set_real_ip_from 198.41.128.0/17;
    set_real_ip_from 2400:cb00::/32;
    set_real_ip_from 2606:4700::/32;
    set_real_ip_from 2803:f800::/32;
    set_real_ip_from 2405:b500::/32;
    set_real_ip_from 2405:8100::/32;
    set_real_ip_from 2c0f:f248::/32;
    set_real_ip_from 2a06:98c0::/29;
    
    real_ip_header X-Forwarded-For;
    ...
    }
    

    Notes that the CloudFlare IPs above were up to date when I modified the article, check for urself. If u use another CDN or find that any of the CloudFlare IPs outdated, replace the IPs with the correct ones.

  2. Refresh and try commenting. The IP in the mail turns out to be the true IP of the commenter.


References:

  1. Isso Official Documentation
  2. Why you should not use Python’s easy_install carelessly on Debian
  3. How to install Npm