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

add scripts from cli #680

Merged
merged 4 commits into from
Apr 22, 2019
Merged

add scripts from cli #680

merged 4 commits into from
Apr 22, 2019

Conversation

csweaver
Copy link
Contributor

Fixes #678

Able to add scripts to the html from launch CLI with --scripts flag. This means it will be accessible from the CLI and from docker since docker runs the cellxgene CLI.

I reformatted the html file in the process. I could make that a separate PR, but I think it looks nicer now 😁

@csweaver
Copy link
Contributor Author

csweaver commented Apr 2, 2019

Added security warning message

|___/
The --scripts flag is intended for developers to include google analytics etc. You could be opening yourself to a
security risk by including the --scripts flag. Make sure you trust the scripts that you are including.
""")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would further make people type in a confirmation that they understand this message before spawning the browser.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have users who want to deploy in a docker-deployed environment, ie, scripted startup where they have control over the deployment script. I like Tony's suggestion, but we need to ensure that the confirmation can be scripting (eg, pipe yes to it, or whatever). Alternative to "|yes": provide a --I-attest-that-really-mean-to-inject-scripts CLI param that still prints the warning, but dispenses with the interactive prompt. @ttung - thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should be able to add this such that | yes works.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine. The browser being fired up is sufficient, I believe, for bad stuff to run, so I do think the confirmation is important, at least for the first time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added confirm.

yes | cellxgene launch --scripts foo --scripts bar example-dataset/pbmc3k.h5ad bypasses the confirm as expected.

@csweaver csweaver requested a review from ttung April 8, 2019 19:40
@csweaver
Copy link
Contributor Author

From Sara on the security team:

I think this works. It doesn’t open up any major security concerns. I think if this becomes an ongoing ask then we should look at other options but as a one off the warning works

Looks ok, as long as we keep an eye on it.

@csweaver csweaver merged commit ea187f4 into master Apr 22, 2019
@csweaver csweaver deleted the csweaver/script-cli branch May 6, 2019 17:47
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

Successfully merging this pull request may close these issues.

Add option to add script files in template
3 participants