How to integrate ISSO comments on Ghost Blog?

January 20, 2019 495 views
Ghost Docker Nginx Ubuntu 18.04

I'm running a Ghost blog on Ubuntu 18.04 droplet (using one-click installation).

Ghost blog is running at: dev.mydomain.com
(dev.mydomain.com routes to this droplet's IP)

I'd like to integrate ISSO comments to this using their Docker installation.

To do this, I am running an ISSO Docker container and updating the Nginx proxy settings to route requests to it

ISSO Docker setup and test

Installed Docker based on instructions here.

Ran the following command:

docker run -d --name=isso -p 127.0.0.1:8080:8080 -v /var/lib/isso/config:/config -v /var/lib/isso/db:/db wonderfall/isso:latest

Updated the /var/lib/isso/config/isso.conf to:

[general]
dbpath = /db/comments.db
host = http://dev.mydomain.com/
max-age=15d
[moderation]
enabled = false
[guard]
enabled = false
[server]
listen = http://0.0.0.0:8080/
reload = off
profile = off

Test if ISSO is up and running or not using:

docker exec isso isso -c /var/lib/isso/config/isso.conf run

This returns an error:

ERROR: No website(s) configured, Isso won't work.

Nginx configs for dev.mydomain.com and dev-comments.mydomain.com

Nginx configs:

/etc/nginx/sites-available/ 

dev.mydomain.com.conf

server {
    listen 80;
    listen [::]:80;

    server_name dev.mydomain.com;
    root /var/www/ghost/system/nginx-root;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;

}

dev-comments.mydomain.com.conf

server {
    listen 80;
    listen [::]:80;

    server_name dev-comments.mydomain.com;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:8080;

    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;

}

Problems/ questions:

  1. Running ISSO within the Docker container throws an error
  2. Nginx proxy setup

I need help understanding this and setting it up. What is wrong with the above and how do I address it?

Thanks in advance!

1 Answer

Hey friend,

Seems fairly straight forward, but I've never used this comment system before. I assume the reverse proxy works fine if you solve the first issue with running the app. What error do you get when starting up the docker container?

Jarland

  • @jarland
    Here’s how I test if ISSO is up and running or not using:

    docker exec isso isso -c /var/lib/isso/config/isso.conf run

    This returns an error:
    ERROR: No website(s) configured, Isso won't work.

    (I’m following steps to test ISSO from their QuickStart section here: https://posativ.org/isso/docs/quickstart/)

    As for the reverse proxy, when accessing dev-comments.mydomain.com, it Gives me an error: Bad request missing uri query

    Thanks for looking into this!

    • Thanks for that info. I just spun up the docker container on a test server and had a look at the documentation. I think the results we're seeing there are intentional. The only actual failure here seems to be this command:

      docker exec isso isso -c /var/lib/isso/config/isso.conf run

      This makes sense because we've mapped /var/lib/isso/config to /config inside the container, so that file path is actually the external file path, where internally it's simply "/config" instead. Regardless you shouldn't have to run that command in the container, as it should be starting up fine. This should be confirmed by receiving the error you noticed when visiting the URL for the subdomain, which does confirm the reverse proxy as working as well.

      When visiting it directly, the 400 Bad Request seems to be intended. It looks like the only thing that remains is to properly integrate it into the site, which means adding this code to your website after adjusting it to your domain:

      <script data-isso="//comments.example.tld/"
              src="//comments.example.tld/js/embed.min.js"></script>
      <section id="isso-thread"></section> 
      

      You should be able to add that into your theme's code and, if all goes well, you should be all set. Confirm that you're ready for this step by visiting /js/embed.min.js on the subdomain that you have set up to reverse proxy to the container exposing port 8080.

      Jarland

      • You’re right! I can access that file through the sub domain for comments.

        Thanks so much for validating this!

        I’ll update the Ghost theme next.

Have another answer? Share your knowledge.