Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: data-isso param for sub-uri setup (was: 'Isso doesn't work with Sub-URI multi-site / multiple website setup') #925

Open
3 tasks done
taoeffect opened this issue Sep 9, 2022 · 2 comments
Labels
docs Documentation of the project
Milestone

Comments

@taoeffect
Copy link

taoeffect commented Sep 9, 2022

Checklist

  • I am running the latest version. Installing Isso from GitHub from the master branch does not fix my issue
  • I have checked the troubleshooting guide
  • I have searched the open issues, but my issue has not already been reported

What is not working?

EDIT: I've figured out what the problem is! Even though I've solved it, I've modified the issue title to indicate that this is (I believe) something that should be more clearly documented and explained. See my followup comment below this post.

According to this documentation it is possible to setup ISSO so that everything gets routed through a /isso/ path: https://isso-comments.de/docs/reference/multi-site-sub-uri/#sub-uri

This doesn't work.

ISSO will still make multiple requests to the root domain that do not follow this path, and the documentation isn't clear on how to fix this.

For example, ISSO will try to connect to /?uri=..., /new?uri=..., /config, /css/isso.css, and possibly other paths.

This makes it impossible to run ISSO on the same website as the blog.

How can one reproduce this issue?

My nginx setup looks something like this:

server {
  server_name blog.domain.tld ;
  root /var/www/blog.domain.tld;
  listen 443 ssl;
  listen 80;
  ssl_certificate /etc/letsencrypt/live/blog.domain.tld/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/blog.domain.tld/privkey.pem;
  location / {
    try_files $uri $uri/;
    add_header Cache-Control "private, max-age=0, no-cache";
  }
  location /isso {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Script-Name /isso;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://isso:8081;
  }
}

My isso.cfg looks something like this:

[general]
name = isso
host = http://blog.domain.tld/
dbpath = /config/comments.db
gravatar = true

[guard]
enabled = true
ratelimit = 2

My docker-compose.yml has a service that looks something like this:

  isso:
    # https://github.com/isso-comments/placeholder/blob/master/Dockerfile
    image: ghcr.io/isso-comments/isso:0.13.0
    command: ${ISSO_CMD:-/isso/bin/gunicorn -b 0.0.0.0:8081 -w 4 --preload isso.run --worker-tmp-dir /dev/shm}
    depends_on:
      - logs
    logging:
      driver: fluentd
      options:
        tag: "{{.Name}}.log"
    expose:
      - "8081"
    extra_hosts:
      - "blog.domain.tld:192.168.1.17"
    volumes: # save config to vol/isso/isso.cfg
      - ./vol/isso:/config
      - ./cache/localtime:/etc/localtime:ro

For local development, I've also added an alias in /etc/hosts on the host machine for blog.domain.tld that points to 127.0.0.1 and have added a similar entry to the docker container via extra_hosts.

@taoeffect taoeffect changed the title Isso doesn't work with Sub-URI multi-site / multiple website setup [Documentation] Isso doesn't work with Sub-URI multi-site / multiple website setup Sep 9, 2022
@taoeffect
Copy link
Author

I figured it out!

Something that's not mentioned in the Sub-URI section is that in order for that to work you MUST modify the data-isso attribute on the included script to pass in /isso like so:

              <script data-isso="/isso"
                      data-isso-vote="false"
                      src="/isso/js/embed.min.js"></script>

The original documentation said it should be data-isso="//comments.example.tld/", and there was nothing saying to change it to /isso in the multi-site docs, so I didn't even think to look there. I just happened to stumble upon this setting while looking at the client configuration docs.

@ix5 ix5 added the docs Documentation of the project label Sep 9, 2022
@ix5 ix5 added this to the 0.14 milestone Sep 9, 2022
@ix5
Copy link
Member

ix5 commented Sep 9, 2022

Thank you for reporting and great that you managed to figure it out yourself.
Would you mind submitting a PR to the docs that helps others avoid your issue?

@ix5 ix5 changed the title [Documentation] Isso doesn't work with Sub-URI multi-site / multiple website setup docs: data-isso param for sub-uri setup (was: 'Isso doesn't work with Sub-URI multi-site / multiple website setup') Sep 10, 2022
@ix5 ix5 modified the milestones: 0.14, 0.13.1 May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation of the project
Projects
None yet
Development

No branches or pull requests

2 participants