home / github

Menu
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

8 rows where issue = 935930820

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: user, author_association, reactions, created_at (date), updated_at (date)

id ▼ html_url issue_url node_id user created_at updated_at author_association body reactions issue performed_via_github_app
873134866 https://github.com/simonw/datasette/issues/1387#issuecomment-873134866 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzEzNDg2Ng== simonw 9599 2021-07-02T16:58:52Z 2021-07-02T16:58:52Z OWNER What's weird here is that the URL itself is correct - it starts with `/collection-analysis/` as expected - but the hostname is wrong. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873136440 https://github.com/simonw/datasette/issues/1387#issuecomment-873136440 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzEzNjQ0MA== simonw 9599 2021-07-02T17:01:48Z 2021-07-02T17:01:48Z OWNER Here's what's happening: https://github.com/simonw/datasette/blob/d23a2671386187f61872b9f6b58e0f80ac61f8fe/datasette/views/table.py#L827-L829 This is being run through `absolute_url()` - defined here: https://github.com/simonw/datasette/blob/d23a2671386187f61872b9f6b58e0f80ac61f8fe/datasette/app.py#L633-L637 That's because the `next_url` in the JSON needs to be a full URL that a client can retrieve - as opposed to the other links on that page which are all relative links that start with `/`: https://github.com/simonw/datasette/blob/ea627baccf980d7d8ebc9e1ffff1fe34d556e56f/datasette/templates/_table.html#L11-L15 {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873137935 https://github.com/simonw/datasette/issues/1387#issuecomment-873137935 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzEzNzkzNQ== simonw 9599 2021-07-02T17:03:36Z 2021-07-02T17:03:36Z OWNER And the links to apply a facet value are broken too! https://ilsweb.cincinnatilibrary.org/collection-analysis/current_collection-3d4a4b7/bib?_facet=bib_level_callnumber ```json { "value": "g l fiction", "label": "g l fiction", "count": 212, "toggle_url": "https://127.0.0.1:8010/collection-analysis/current_collection-3d4a4b7/bib.json?_facet=bib_level_callnumber&bib_level_callnumber=g+l+fiction", "selected": false } ``` Same problem: https://github.com/simonw/datasette/blob/ea627baccf980d7d8ebc9e1ffff1fe34d556e56f/datasette/facets.py#L251-L261 {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873139138 https://github.com/simonw/datasette/issues/1387#issuecomment-873139138 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzEzOTEzOA== simonw 9599 2021-07-02T17:05:47Z 2021-07-02T17:05:47Z OWNER In this case the proxy is Apache. So there are a couple of potential fixes: - Configure Apache to pass the original HTTP request `Host:` header through to the proxied application. This should then be documented. - Add a new optional feature to Datasette called something like `base_host` which, if set, is always used in place of the host in `request.url` when constructing new URLs. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873140742 https://github.com/simonw/datasette/issues/1387#issuecomment-873140742 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzE0MDc0Mg== simonw 9599 2021-07-02T17:08:40Z 2021-07-02T17:08:40Z OWNER `ProxyPreserveHost On` is the Apache setting - it defaults to `Off`: https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypreservehost {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873141222 https://github.com/simonw/datasette/issues/1387#issuecomment-873141222 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzE0MTIyMg== simonw 9599 2021-07-02T17:09:32Z 2021-07-02T17:09:32Z OWNER I'm going to add this to the suggested Apache configuration at https://docs.datasette.io/en/stable/deploying.html#apache-proxy-configuration {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873156408 https://github.com/simonw/datasette/issues/1387#issuecomment-873156408 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzE1NjQwOA== simonw 9599 2021-07-02T17:37:30Z 2021-07-02T17:37:30Z OWNER Updated documentation is here: https://docs.datasette.io/en/latest/deploying.html#apache-proxy-configuration {"total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  
873166836 https://github.com/simonw/datasette/issues/1387#issuecomment-873166836 https://api.github.com/repos/simonw/datasette/issues/1387 MDEyOklzc3VlQ29tbWVudDg3MzE2NjgzNg== rayvoelker 9308268 2021-07-02T17:58:23Z 2021-07-02T17:58:23Z NONE Thanks Simon for nailing that one down! It does seem a little confusing that the ProxyPreservehost option is set to Off By default, but this config totally did the trick and fixed the issue ``` <Location /collection-analysis/> ProxyPass http://127.0.0.1:8010/collection-analysis/ ProxyPreservehost On </Location> ``` {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} absolute_url() behind a proxy assembles incorrect http://127.0.0.1:8001/ URLs 935930820  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 35.568ms · About: simonw/datasette-graphql