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

Ability to enable/disable specific features via --config #284

Closed
4 tasks done
simonw opened this issue May 24, 2018 · 5 comments
Closed
4 tasks done

Ability to enable/disable specific features via --config #284

simonw opened this issue May 24, 2018 · 5 comments

Comments

@simonw
Copy link
Owner

simonw commented May 24, 2018

--config settings from #274 can currently only be integers.

I'd like them to be available as boooeans too. Then we can use them to have that are turned on by default but can be turned off.

First features to get this treatment:

  • allow_sql - whether or not the ?sql= parameter is allowed and form is displayed
  • allow_facet - is ?_facet= allowed or do we only run facets defined in metadata.json
  • allow_download - do we let users download the full SQLite database file?
  • suggest_facets - do we attempt to calculate suggested facets?

Refs #275

@simonw
Copy link
Owner Author

simonw commented May 24, 2018

I'm not crazy about the enable_ prefix on these.

@simonw
Copy link
Owner Author

simonw commented May 24, 2018

This will also give us a mechanism for turning on and off the cross-database joins feature from #283

@simonw
Copy link
Owner Author

simonw commented May 24, 2018

Maybe allow_sql, allow_facet and allow_download

@simonw simonw changed the title Ability to enable/disable specific feature via --config Ability to enable/disable specific features via --config May 24, 2018
@simonw
Copy link
Owner Author

simonw commented May 25, 2018

allow_sql should only affect the ?sql= parameter and whether or not the form is displayed. You should still be able to use and execute canned queries even if this option is turned off.

@simonw
Copy link
Owner Author

simonw commented May 25, 2018

Demo:

datasette publish now --branch=master fixtures.db \
    --source="#284 Demo" \
    --source_url="https://github.com/simonw/datasette/issues/284" \
    --extra-options "--config allow_sql:off --config allow_facet:off --config allow_download:off" \
    --name=datasette-demo-284

now alias https://datasette-demo-284-jogjwngegj.now.sh datasette-demo-284.now.sh

https://datasette-demo-284.now.sh/

Note the following:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant