Using this new plugin: https://github.com/simonw/datasette-auth-passwords
Create your database as usual, then create a metadata.json
file that looks like this:
{
"allow": {
"id": "root"
}
}
This specifies that only the root
user can access the instance.
Create yourself a root password hash. You can do that by running the plugin locally (see its README) or you can use this online hosted version of the password tool instead: https://datasette-auth-passwords-demo.datasette.io/-/password-tool
Now publish to Heroku like this:
datasette publish heroku mydb.db \
-m metadata.json \
--install datasette-auth-passwords \
--plugin-secret datasette-auth-passwords root_password_hash 'pbkdf2_sha256$...' \
--name my-heroku-app
Now visit https://my-heroku-app.herokuapp.com/-/login
to login.