{"html_url": "https://github.com/simonw/datasette/issues/1026#issuecomment-709636372", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1026", "id": 709636372, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzNjM3Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:09:34Z", "updated_at": "2020-10-15T23:09:34Z", "author_association": "OWNER", "body": "I'm inclined to say that internal requests should ignore `base_url` - since that seems like the right thing for plugins that need to access default Datasette APIs.\r\n\r\nThe one catch here is plugins that might want to proxy the current incoming URL for some reason - where that incoming `request.path` could include the `base_url`.\r\n\r\nActually those should be fine - because it will have been stripped off earlier:\r\n\r\nhttps://github.com/simonw/datasette/blob/4f7c0ebd85ccd8c1853d7aa0147628f7c1b749cc/datasette/app.py#L963-L968", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722738988, "label": "How should datasette.client interact with base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-709635276", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 709635276, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzNTI3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:05:54Z", "updated_at": "2020-10-15T23:05:54Z", "author_association": "OWNER", "body": "Could have `instance_url()` take an optional path argument which is then turned into the correct path.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-709635021", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 709635021, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzNTAyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:05:11Z", "updated_at": "2020-10-15T23:05:11Z", "author_association": "OWNER", "body": "I think this should be a family of functions:\r\n\r\n- `instance_url()` - the root URL of the instance (usually `/` unless `base_url` is set)\r\n- `database_url(database_name)` - already got this\r\n- `table_url(database_name, table_name)`\r\n- `row_url(database_name, table_name, row)` - not sure about this one. The idea would be for `row` to be correctly turned into a URL by introspecting the primary keys for that table, then pulling those values out of the SQLite `row` object. Might not be necessary though.\r\n\r\nI also need a way for plugins to link to e.g. `/-/configure-fts` - or even `/-/configure-fts/database-name/table-name`. What should that look like?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-709634261", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 709634261, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzNDI2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:02:43Z", "updated_at": "2020-10-15T23:02:43Z", "author_association": "OWNER", "body": "Here's the current implementation of `database_url` - on the `BaseView` class, but only because it needs access to a `datasette` instance (to read `base_url`):\r\nhttps://github.com/simonw/datasette/blob/8f97b9b58e77f82fef1f10e9c9f6754b993544b6/datasette/views/base.py#L102-L108", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-709633823", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 709633823, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMzgyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:01:13Z", "updated_at": "2020-10-15T23:01:13Z", "author_association": "OWNER", "body": "Tracking ticket: #1023", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/988#issuecomment-709633762", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/988", "id": 709633762, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMzc2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:01:01Z", "updated_at": "2020-10-15T23:01:01Z", "author_association": "OWNER", "body": "This is a dupe of https://github.com/simonw/datasette/issues/904", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 713209404, "label": "Mechanism for plugins to construct URLs that respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/865#issuecomment-709633080", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/865", "id": 709633080, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMzA4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:58:51Z", "updated_at": "2020-10-15T22:58:51Z", "author_association": "OWNER", "body": "It looks like there are places where Datasette might return a redirect that doesn't take `base_url` into account - I'm planning on fixing those here, after which I think `ProxyPassReverse` should no longer be necessary. https://github.com/simonw/datasette/issues/1025#issuecomment-709632136", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 1, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644582921, "label": "base_url doesn't seem to work when adding criteria and clicking \"apply\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/900#issuecomment-709632765", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/900", "id": 709632765, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMjc2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:57:55Z", "updated_at": "2020-10-15T22:57:55Z", "author_association": "OWNER", "body": "I believe this particular bug has been fixed, based on my testing here: https://github.com/simonw/datasette/issues/1024#issuecomment-709622973\r\n\r\nPlease re-open the ticket if you are still experiencing it.\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 661605489, "label": "Some links don't honor base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1025#issuecomment-709632314", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1025", "id": 709632314, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMjMxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:56:25Z", "updated_at": "2020-10-15T22:56:34Z", "author_association": "OWNER", "body": "That `utils/asgi.py` line is the default path for setting cookies. That should likely take `base_url` into account too:\r\nhttps://github.com/simonw/datasette/blob/4f7c0ebd85ccd8c1853d7aa0147628f7c1b749cc/datasette/utils/asgi.py#L331-L342", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722724086, "label": "Fix last remaining links to \"/\" that do not respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1025#issuecomment-709632136", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1025", "id": 709632136, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYzMjEzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:55:44Z", "updated_at": "2020-10-15T22:55:44Z", "author_association": "OWNER", "body": "It looks like there are also some generated redirect responses that don't take `base_url` into account:\r\n```\r\ndatasette % git grep '\"/' -- '*.py' ':(exclude)*test_*.py' ':(exclude)datasette/app.py'\r\ndatasette/_version.py: for i in cfg.versionfile_source.split(\"/\"):\r\ndatasette/utils/asgi.py: path=\"/\",\r\ndatasette/views/base.py: should_redirect = \"/{}-{}\".format(name, expected)\r\ndatasette/views/base.py: should_redirect += \"/\" + urllib.parse.quote_plus(kwargs[\"table\"])\r\ndatasette/views/base.py: should_redirect += \"/\" + kwargs[\"pk_path\"]\r\ndatasette/views/special.py: response = Response.redirect(\"/\")\r\ndatasette/views/special.py: return Response.redirect(\"/\")\r\ndatasette/views/special.py: response = Response.redirect(\"/\")\r\ndatasette/views/special.py: return Response.redirect(\"/\")\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722724086, "label": "Fix last remaining links to \"/\" that do not respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1025#issuecomment-709629920", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1025", "id": 709629920, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYyOTkyMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:48:20Z", "updated_at": "2020-10-15T22:48:20Z", "author_association": "OWNER", "body": "Also these:\r\n```\r\ndatasette % git grep '\"/' -- '*.html' ':(exclude)*/patterns.html'\r\ndatasette/templates/allow_debug.html:
\r\ndatasette/templates/base.html: \r\ndatasette/templates/error.html: home\r\ndatasette/templates/logout.html:\r\ndatasette/templates/messages_debug.html:\r\ndatasette/templates/query.html: home /\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722724086, "label": "Fix last remaining links to \"/\" that do not respect base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/865#issuecomment-709626786", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/865", "id": 709626786, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYyNjc4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:38:38Z", "updated_at": "2020-10-15T22:38:38Z", "author_association": "OWNER", "body": "I managed to recreate proxying using `nginx` in #1024 - but I could not replicate this bug. I did NOT use `ProxyPassReverse` though. I think that may be what caused the problem.\r\n\r\nI'll add a section to the documentation about this shortly.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 644582921, "label": "base_url doesn't seem to work when adding criteria and clicking \"apply\""}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1024#issuecomment-709625063", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1024", "id": 709625063, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYyNTA2Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:33:22Z", "updated_at": "2020-10-15T22:33:22Z", "author_association": "OWNER", "body": "Of those errors...\r\n\r\n`http://localhost:8000/robots.txt` 404 is fine.\r\n\r\n`http://localhost:8000/datasette/%5C%22https://www.openstreetmap.org/copyright%5C%22` looks to me like a `wget` parsing bug where it got confused by this JavaScript:\r\n\r\n```\r\nwindow.DATASETTE_CLUSTER_MAP_TILE_LAYER_OPTIONS = {\"maxZoom\": 19, \"detectRetina\": true, \"attribution\": \"© OpenStreetMap contributors\"};\r\n```\r\n\r\n`http://localhost:8000/-/static-plugins/datasette_cluster_map/datasette-cluster-map.js` is a real bug. It's a bug in `datasette-cluster-map` but also requires me to solve #988 - mechanism for plugins to construct URLs that obey `base_url`.\r\n\r\nI'm not sure why I'm getting a hit to `http://localhost:8000/` since I wouldn't expect to link to `/` anywhere.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722674708, "label": "Figure out how to run an environment that exercises the base_url proxy setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1024#issuecomment-709622973", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1024", "id": 709622973, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYyMjk3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T22:27:31Z", "updated_at": "2020-10-15T22:27:31Z", "author_association": "OWNER", "body": "Here's how I tested it:\r\n```\r\ntime wget -r 'http://localhost:8000/datasette/' 2>&1 | grep -i -C 5 \"failed\\|error\" > /tmp/errors.txt\r\n```\r\nThis wrote out any errors (plus context) to the `errors.txt` log - and reported that the full crawl took 33s.\r\n\r\nHere's what I got in `errors.txt`:\r\n```\r\n\r\n 0K . 71.6M=0s\r\n\r\n2020-10-15 15:23:09 (71.6 MB/s) - \u2018localhost:8000/datasette/index.html\u2019 saved [1276]\r\n\r\nLoading robots.txt; please ignore errors.\r\n--2020-10-15 15:23:09-- http://localhost:8000/robots.txt\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n--\r\n--2020-10-15 15:23:09-- http://localhost:8000/robots.txt\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n2020-10-15 15:23:09 ERROR 404: Not Found.\r\n\r\n--2020-10-15 15:23:09-- http://localhost:8000/datasette/-/static/app.css?b576be\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: 8563 (8.4K) [text/css]\r\n--\r\n--\r\n2020-10-15 15:23:13 (7.90 MB/s) - \u2018localhost:8000/datasette/fixtures/primary_key_multiple_columns_explicit_label.json?_shape=object\u2019 saved [58]\r\n\r\n--2020-10-15 15:23:13-- http://localhost:8000/-/static-plugins/datasette_cluster_map/datasette-cluster-map.js\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n2020-10-15 15:23:13 ERROR 404: Not Found.\r\n\r\n--2020-10-15 15:23:13-- http://localhost:8000/datasette/fixtures?sql=select+pk%2C+name%2C+address%2C+latitude%2C+longitude+from+roadside_attractions+order+by+pk+limit+101\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: unspecified [text/html]\r\n--\r\n--\r\n2020-10-15 15:23:13 (84.3 MB/s) - \u2018localhost:8000/datasette/fixtures/roadside_attractions.json?_shape=object\u2019 saved [619]\r\n\r\n--2020-10-15 15:23:13-- http://localhost:8000/datasette/fixtures/%5C%22https://www.openstreetmap.org/copyright%5C%22\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n2020-10-15 15:23:13 ERROR 404: Not Found.\r\n\r\n--2020-10-15 15:23:13-- http://localhost:8000/datasette/fixtures?sql=select+pk%2C+text1%2C+text2%2C+%5Bname+with+.+and+spaces%5D+from+searchable+order+by+pk+limit+101\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: unspecified [text/html]\r\n--\r\n--\r\n2020-10-15 15:23:14 (28.6 MB/s) - \u2018localhost:8000/datasette/fixtures/searchable_view_configured_by_metadata.json?_shape=array&_nl=on\u2019 saved [180]\r\n\r\n--2020-10-15 15:23:14-- http://localhost:8000/\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n2020-10-15 15:23:14 ERROR 404: Not Found.\r\n\r\n--2020-10-15 15:23:14-- http://localhost:8000/datasette/fixtures?sql=select+pk1%2C+pk2%2C+pk3%2C+content+from+compound_three_primary_keys+order+by+pk1%2C+pk2%2C+pk3+limit+101&_hide_sql=1\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: unspecified [text/html]\r\n--\r\n--\r\n2020-10-15 15:23:21 (64.1 MB/s) - \u2018localhost:8000/datasette/fixtures.csv?sql=select+pk,+name,+address,+latitude,+longitude+from+roadside_attractions+order+by+pk+limit+101&_size=max\u2019 saved [403]\r\n\r\n--2020-10-15 15:23:21-- http://localhost:8000/datasette/%5C%22https://www.openstreetmap.org/copyright%5C%22\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 404 Not Found\r\n2020-10-15 15:23:21 ERROR 404: Not Found.\r\n\r\n--2020-10-15 15:23:21-- http://localhost:8000/datasette/fixtures?sql=select+pk%2C+name%2C+address%2C+latitude%2C+longitude+from+roadside_attractions+order+by+pk+desc+limit+101\r\nReusing existing connection to localhost:8000.\r\nHTTP request sent, awaiting response... 200 OK\r\nLength: unspecified [text/html]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722674708, "label": "Figure out how to run an environment that exercises the base_url proxy setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1024#issuecomment-709600335", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1024", "id": 709600335, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTYwMDMzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T21:28:02Z", "updated_at": "2020-10-15T22:25:43Z", "author_association": "OWNER", "body": "This is working OK so far:\r\n\r\n\"fixtures__compound_three_primary_keys__1_001_rows_where_sorted_by_pk2\"\r\n\r\nI'll try crawling it with `wget -r` to see if I get any errors.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722674708, "label": "Figure out how to run an environment that exercises the base_url proxy setting"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1027#issuecomment-709647525", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1027", "id": 709647525, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTY0NzUyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:49:51Z", "updated_at": "2020-10-15T23:51:39Z", "author_association": "OWNER", "body": "I'll install Apache on macOS to figure this out using https://formulae.brew.sh/formula/httpd\r\n\r\n`brew install httpd` output this at the end:\r\n\r\n```\r\n==> httpd\r\nDocumentRoot is /usr/local/var/www.\r\n\r\nThe default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in\r\n/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.\r\n\r\nTo have launchd start httpd now and restart at login:\r\n brew services start httpd\r\nOr, if you don't want/need a background service you can just run:\r\n apachectl start\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722758132, "label": "Add documentation on serving Datasette behind a proxy using base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1027#issuecomment-709646865", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1027", "id": 709646865, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTY0Njg2NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T23:47:08Z", "updated_at": "2020-10-15T23:47:08Z", "author_association": "OWNER", "body": "It should cover both nginx and Apache. nginx config is here: https://github.com/simonw/datasette/issues/1024#issuecomment-709598324", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722758132, "label": "Add documentation on serving Datasette behind a proxy using base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709539257", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709539257, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzOTI1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:19:29Z", "updated_at": "2020-10-15T19:34:07Z", "author_association": "OWNER", "body": "Urgh this isn't going to work. `%7E~%7E` gets decoded as `~~~` so I wouldn't be able to tell the difference.\r\n\r\nI could use double-percentage-encoding here instead. I feel like there's a simpler solution that I'm missing (and that may well be in use within Datasette already, I'm not doing great thinking this morning).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709534197", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709534197, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzNDE5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:08:53Z", "updated_at": "2020-10-15T19:17:55Z", "author_association": "OWNER", "body": "Even better solution: use URL encoding in the parameter details. This is consistent with how `?_next=` tokens work, e.g. `?_next=0.291861560261786%2Ce%2Cj`.\r\n\r\nSo the format can be:\r\n\r\n- `mycolumn`\r\n- `urlencoded-mycolumn$castname`\r\n\r\nFor most columns this will look like: `?_sort=score$numeric`\r\n\r\nFor columns with a `$` in their name it will be `?_sort=score%24hasdollar$numeric`\r\n\r\nProblem: both `$` and `,` are usually URL encoded anyway. I need a character which isn't encoded by default, so that I can use its encoded form to show it is part of the column name and its un-encoded form to split the cast indicator.\r\n\r\n`_` is a candidate here - not encoded by default, but can be encoded as `%5F`.\r\n\r\nThe other unreserved non-alphanumeric characters are `-`, `.`, `_`, `~`.\r\n\r\nOf these, `~` is least likely to show up in a column name. So I'll use that.\r\n\r\n- `mycolumn`\r\n- `mycolumn~numeric`\r\n- `mycolumn%7Ewith%7Etildes~numeric`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709532369", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709532369, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzMjM2OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:05:07Z", "updated_at": "2020-10-15T19:07:35Z", "author_association": "OWNER", "body": "Simpler option: `?_sort=` column values look like this:\r\n\r\n- `mycolumn` - for sort by column\r\n- `mycolumn$numeric` - for sort by column after cast to float\r\n- `mycolumn$morename$default` - for the edge case where the column name itself contains a $ symbol", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 657572753, "label": "?sort=colname~numeric to sort by by column cast to real"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/894#issuecomment-709531343", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/894", "id": 709531343, "node_id": "MDEyOklzc3VlQ29tbWVudDcwOTUzMTM0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-15T19:03:12Z", "updated_at": "2020-10-15T19:03:12Z", "author_association": "OWNER", "body": "The Sort by `