{"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1013669543", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1013669543, "node_id": "IC_kwDOBm6k_c48a16n", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-15T11:56:59Z", "updated_at": "2022-01-15T11:56:59Z", "author_association": "OWNER", "body": "There's actually already a way to move regular Datasette `--setting` options to a `settings.json` file thanks to configuration directory mode: https://docs.datasette.io/en/stable/settings.html\r\n\r\nMaybe extending that mechanism to handle plugins would be a neat path forward here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1013668967", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1013668967, "node_id": "IC_kwDOBm6k_c48a1xn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-15T11:53:21Z", "updated_at": "2022-01-15T11:53:21Z", "author_association": "OWNER", "body": "The `datasette publish --plugin-secret name setting value` option already implements something a bit like this. https://docs.datasette.io/en/stable/plugins.html#secret-configuration-values\r\n\r\nIt's a bit of a messy hack to compensate for metadata being visible. Maybe I could replace that mechanism with the proposed plugin configuration rethink from this issue.\r\n\r\nI still like the debug benefits of making plugin settings public - perhaps add a rule that if a plugin setting has a `secret:` prefix it gets redacted on a new `/-/plugin-settings` page.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1012506595", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1012506595, "node_id": "IC_kwDOBm6k_c48WZ_j", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-13T20:52:56Z", "updated_at": "2022-01-13T20:52:56Z", "author_association": "OWNER", "body": "You can already run `datasette --help-settings` to see detailed help on available settings. Maybe `datasette --help-plugin-settings` could do the same thing for plugin settings?\r\n\r\nOr I could even have available plugin settings show up as a list at the bottom of the `datasette --help-settings` output - which currently looks like this:\r\n\r\n```\r\n% datasette --help-settings\r\nSettings:\r\n default_page_size Default page size for the table view\r\n (default=100)\r\n max_returned_rows Maximum rows that can be returned from a table\r\n or custom query (default=1000)\r\n num_sql_threads Number of threads in the thread pool for\r\n executing SQLite queries (default=3)\r\n sql_time_limit_ms Time limit for a SQL query in milliseconds\r\n (default=1000)\r\n default_facet_size Number of values to return for requested facets\r\n (default=30)\r\n facet_time_limit_ms Time limit for calculating a requested facet\r\n (default=200)\r\n facet_suggest_time_limit_ms Time limit for calculating a suggested facet\r\n (default=50)\r\n hash_urls Include DB file contents hash in URLs, for far-\r\n future caching (default=False)\r\n allow_facet Allow users to specify columns to facet using\r\n ?_facet= parameter (default=True)\r\n allow_download Allow users to download the original SQLite\r\n database files (default=True)\r\n suggest_facets Calculate and display suggested facets\r\n (default=True)\r\n default_cache_ttl Default HTTP cache TTL (used in Cache-Control:\r\n max-age= header) (default=5)\r\n default_cache_ttl_hashed Default HTTP cache TTL for hashed URL pages\r\n (default=31536000)\r\n cache_size_kb SQLite cache size in KB (0 == use SQLite\r\n default) (default=0)\r\n allow_csv_stream Allow .csv?_stream=1 to download all rows\r\n (ignoring max_returned_rows) (default=True)\r\n max_csv_mb Maximum size allowed for CSV export in MB - set\r\n 0 to disable this limit (default=100)\r\n truncate_cells_html Truncate cells longer than this in HTML table\r\n view - set 0 to disable (default=2048)\r\n force_https_urls Force URLs in API output to always use https://\r\n protocol (default=False)\r\n template_debug Allow display of template debug information\r\n with ?_context=1 (default=False)\r\n trace_debug Allow display of SQL trace debug information\r\n with ?_trace=1 (default=False)\r\n base_url Datasette URLs should use this base path\r\n (default=/)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1012505706", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1012505706, "node_id": "IC_kwDOBm6k_c48WZxq", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-13T20:51:30Z", "updated_at": "2022-01-13T20:51:30Z", "author_association": "OWNER", "body": "Another option: if I make plugin settings a higher level concept in Datasette than they are at the moment, I could allow them to be set either using `--options` OR using the existing `metadata.yml/json` mechanism. https://docs.datasette.io/en/stable/plugins.html#plugin-configuration\r\n\r\nI want to make changes to that anyway, because I'm increasingly uncomfortable with plugin settings ending up in the \"metadata\" mechanism.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1012504251", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1012504251, "node_id": "IC_kwDOBm6k_c48WZa7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-13T20:49:19Z", "updated_at": "2022-01-13T20:49:59Z", "author_association": "OWNER", "body": "I try to stick pretty closely to what [Click](https://click.palletsprojects.com/en/8.0.x/) supports, and Click likes you to define options explicitly so that it can display them in the output of `--help`.\r\n\r\nBut... that makes me think that actually showing these options in `--help` is likely a better idea. My `--plugin-setting` concept would have help that looks something like this:\r\n```\r\n% datasette serve --help\r\n ...\r\n --plugin-setting ... Setting for a specified plugin.\r\n```\r\nThat's not great help!\r\n\r\nThe alternative would be to allow plugins to register their extra options with the command - which would mean the help output could look like this instead:\r\n```\r\n% datasette serve --help\r\n ...\r\n --tiddlywiki-db Name of database to use for datasette-tiddlywiki\r\n```\r\nThis feels like a good argument to me for plugins to explicitly register their settings. I'm not sure if I should enforce the `name-of-plugin-` prefix, or if I should allow plugins to define any setting they like. I'm still nervous about plugins over-riding existing or future default options to that command.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1010947634", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1010947634, "node_id": "IC_kwDOBm6k_c48QdYy", "user": {"value": 82988, "label": "psychemedia"}, "created_at": "2022-01-12T11:32:17Z", "updated_at": "2022-01-12T11:32:17Z", "author_association": "CONTRIBUTOR", "body": "Is it possible to parse things like `--ext-{plugin}-{arg} VALUE` ?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1591#issuecomment-1010764036", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1591", "id": 1010764036, "node_id": "IC_kwDOBm6k_c48PwkE", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-12T08:22:16Z", "updated_at": "2022-01-12T08:22:32Z", "author_association": "OWNER", "body": "The challenge here is avoiding clashes. What if a plugin adds an option that I later want to use for a new Datasette core feature? Or what if two plugins define the same option?\r\n\r\nMaybe the solution is to make them use namespaces defined by the plugin name.\r\n\r\nHow about this:\r\n\r\n datasette t.db --plugin-setting datasette-tiddlywiki db t.db\r\n\r\nIt's a bit verbose having an option that itself then takes THREE strings: plugin name, setting name, setting value - but it would work.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1100015398, "label": "Maybe let plugins define custom serve options?"}, "performed_via_github_app": null}