mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix escaping of ENV
This commit is contained in:
parent
c207453e03
commit
4e5f6b4d11
5 changed files with 76 additions and 65 deletions
|
|
@ -44,7 +44,8 @@ def add_common_publish_arguments_and_options(subcommand):
|
||||||
click.option(
|
click.option(
|
||||||
"--plugin-secret",
|
"--plugin-secret",
|
||||||
nargs=3,
|
nargs=3,
|
||||||
type=str,
|
type=(str, str, str),
|
||||||
|
callback=validate_plugin_secret,
|
||||||
multiple=True,
|
multiple=True,
|
||||||
help="Secrets to pass to plugins, e.g. --plugin-secret datasette-auth-github client_id xxx",
|
help="Secrets to pass to plugins, e.g. --plugin-secret datasette-auth-github client_id xxx",
|
||||||
),
|
),
|
||||||
|
|
@ -83,3 +84,10 @@ def fail_if_publish_binary_not_installed(binary, publish_target, install_link):
|
||||||
err=True,
|
err=True,
|
||||||
)
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
def validate_plugin_secret(ctx, param, value):
|
||||||
|
for plugin_name, plugin_setting, setting_value in value:
|
||||||
|
if "'" in setting_value:
|
||||||
|
raise click.BadParameter("--plugin-secret cannot contain single quotes")
|
||||||
|
return value
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ EXPOSE 8001
|
||||||
CMD {cmd}""".format(
|
CMD {cmd}""".format(
|
||||||
environment_variables="\n".join(
|
environment_variables="\n".join(
|
||||||
[
|
[
|
||||||
"ENV {} {}".format(key, value)
|
"ENV {} '{}'".format(key, value)
|
||||||
for key, value in (environment_variables or {}).items()
|
for key, value in (environment_variables or {}).items()
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -3,24 +3,25 @@ $ datasette publish cloudrun --help
|
||||||
Usage: datasette publish cloudrun [OPTIONS] [FILES]...
|
Usage: datasette publish cloudrun [OPTIONS] [FILES]...
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
||||||
--extra-options TEXT Extra options to pass to datasette serve
|
--extra-options TEXT Extra options to pass to datasette serve
|
||||||
--branch TEXT Install datasette from a GitHub branch e.g. master
|
--branch TEXT Install datasette from a GitHub branch e.g. master
|
||||||
--template-dir DIRECTORY Path to directory containing custom templates
|
--template-dir DIRECTORY Path to directory containing custom templates
|
||||||
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
||||||
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
||||||
--install TEXT Additional packages (e.g. plugins) to install
|
--install TEXT Additional packages (e.g. plugins) to install
|
||||||
--plugin-secret TEXT... Secrets to pass to plugins, e.g. --plugin-secret datasette-
|
--plugin-secret <TEXT TEXT TEXT>...
|
||||||
auth-github client_id xxx
|
Secrets to pass to plugins, e.g. --plugin-secret
|
||||||
--version-note TEXT Additional note to show on /-/versions
|
datasette-auth-github client_id xxx
|
||||||
--title TEXT Title for metadata
|
--version-note TEXT Additional note to show on /-/versions
|
||||||
--license TEXT License label for metadata
|
--title TEXT Title for metadata
|
||||||
--license_url TEXT License URL for metadata
|
--license TEXT License label for metadata
|
||||||
--source TEXT Source label for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source TEXT Source label for metadata
|
||||||
--about TEXT About label for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
--about_url TEXT About URL for metadata
|
--about TEXT About label for metadata
|
||||||
-n, --name TEXT Application name to use when building
|
--about_url TEXT About URL for metadata
|
||||||
--service TEXT Cloud Run service to deploy (or over-write)
|
-n, --name TEXT Application name to use when building
|
||||||
--spatialite Enable SpatialLite extension
|
--service TEXT Cloud Run service to deploy (or over-write)
|
||||||
--help Show this message and exit.
|
--spatialite Enable SpatialLite extension
|
||||||
|
--help Show this message and exit.
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,23 @@ $ datasette publish heroku --help
|
||||||
Usage: datasette publish heroku [OPTIONS] [FILES]...
|
Usage: datasette publish heroku [OPTIONS] [FILES]...
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
||||||
--extra-options TEXT Extra options to pass to datasette serve
|
--extra-options TEXT Extra options to pass to datasette serve
|
||||||
--branch TEXT Install datasette from a GitHub branch e.g. master
|
--branch TEXT Install datasette from a GitHub branch e.g. master
|
||||||
--template-dir DIRECTORY Path to directory containing custom templates
|
--template-dir DIRECTORY Path to directory containing custom templates
|
||||||
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
||||||
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
||||||
--install TEXT Additional packages (e.g. plugins) to install
|
--install TEXT Additional packages (e.g. plugins) to install
|
||||||
--plugin-secret TEXT... Secrets to pass to plugins, e.g. --plugin-secret datasette-
|
--plugin-secret <TEXT TEXT TEXT>...
|
||||||
auth-github client_id xxx
|
Secrets to pass to plugins, e.g. --plugin-secret
|
||||||
--version-note TEXT Additional note to show on /-/versions
|
datasette-auth-github client_id xxx
|
||||||
--title TEXT Title for metadata
|
--version-note TEXT Additional note to show on /-/versions
|
||||||
--license TEXT License label for metadata
|
--title TEXT Title for metadata
|
||||||
--license_url TEXT License URL for metadata
|
--license TEXT License label for metadata
|
||||||
--source TEXT Source label for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source TEXT Source label for metadata
|
||||||
--about TEXT About label for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
--about_url TEXT About URL for metadata
|
--about TEXT About label for metadata
|
||||||
-n, --name TEXT Application name to use when deploying
|
--about_url TEXT About URL for metadata
|
||||||
--help Show this message and exit.
|
-n, --name TEXT Application name to use when deploying
|
||||||
|
--help Show this message and exit.
|
||||||
|
|
|
||||||
|
|
@ -3,26 +3,27 @@ $ datasette publish nowv1 --help
|
||||||
Usage: datasette publish nowv1 [OPTIONS] [FILES]...
|
Usage: datasette publish nowv1 [OPTIONS] [FILES]...
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
-m, --metadata FILENAME Path to JSON file containing metadata to publish
|
||||||
--extra-options TEXT Extra options to pass to datasette serve
|
--extra-options TEXT Extra options to pass to datasette serve
|
||||||
--branch TEXT Install datasette from a GitHub branch e.g. master
|
--branch TEXT Install datasette from a GitHub branch e.g. master
|
||||||
--template-dir DIRECTORY Path to directory containing custom templates
|
--template-dir DIRECTORY Path to directory containing custom templates
|
||||||
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
--plugins-dir DIRECTORY Path to directory containing custom plugins
|
||||||
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
--static STATIC MOUNT mountpoint:path-to-directory for serving static files
|
||||||
--install TEXT Additional packages (e.g. plugins) to install
|
--install TEXT Additional packages (e.g. plugins) to install
|
||||||
--plugin-secret TEXT... Secrets to pass to plugins, e.g. --plugin-secret datasette-
|
--plugin-secret <TEXT TEXT TEXT>...
|
||||||
auth-github client_id xxx
|
Secrets to pass to plugins, e.g. --plugin-secret
|
||||||
--version-note TEXT Additional note to show on /-/versions
|
datasette-auth-github client_id xxx
|
||||||
--title TEXT Title for metadata
|
--version-note TEXT Additional note to show on /-/versions
|
||||||
--license TEXT License label for metadata
|
--title TEXT Title for metadata
|
||||||
--license_url TEXT License URL for metadata
|
--license TEXT License label for metadata
|
||||||
--source TEXT Source label for metadata
|
--license_url TEXT License URL for metadata
|
||||||
--source_url TEXT Source URL for metadata
|
--source TEXT Source label for metadata
|
||||||
--about TEXT About label for metadata
|
--source_url TEXT Source URL for metadata
|
||||||
--about_url TEXT About URL for metadata
|
--about TEXT About label for metadata
|
||||||
-n, --name TEXT Application name to use when deploying
|
--about_url TEXT About URL for metadata
|
||||||
--force Pass --force option to now
|
-n, --name TEXT Application name to use when deploying
|
||||||
--token TEXT Auth token to use for deploy
|
--force Pass --force option to now
|
||||||
--alias TEXT Desired alias e.g. yoursite.now.sh
|
--token TEXT Auth token to use for deploy
|
||||||
--spatialite Enable SpatialLite extension
|
--alias TEXT Desired alias e.g. yoursite.now.sh
|
||||||
--help Show this message and exit.
|
--spatialite Enable SpatialLite extension
|
||||||
|
--help Show this message and exit.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue