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 envVars to example in deployApp() #1027

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

fh-mthomson
Copy link
Contributor

@fh-mthomson fh-mthomson commented Nov 21, 2023

Pulls out helpful example from #859 (comment)

This workflow and messaging was very clear and easy!

Additionally, it'd be helpful to mention rsconnect as an option to set env vars prior to deployment in the Posit Connect User Guide, which currently only references the Connect API.

@fh-mthomson fh-mthomson changed the title add envvars to example add envvars to example in deployApp() Nov 21, 2023
@fh-mthomson fh-mthomson changed the title add envvars to example in deployApp() add envVars to example in deployApp() Nov 21, 2023
@hadley
Copy link
Member

hadley commented Nov 21, 2023

Except that's not quite right either because running Sys.setenv() in the console will mean that your secret is now in the .Rhistory file 😞

@fh-mthomson
Copy link
Contributor Author

Oof, right. I've updated the example to defer to an already-Renviron-defined variable, but probably a broader symptom of environment variables not being overly secure (vs e.g. a Keychain / Hashicorp Vault approach to secrets).

@hadley
Copy link
Member

hadley commented Nov 28, 2023

@fh-mthomson do you use hashicorp vault? I've been trying to find someone who uses it to help me learn if there's something we should do to make it easier to use from R.

@hadley hadley merged commit d8c89dd into rstudio:main Nov 28, 2023
3 of 4 checks passed
@fh-mthomson fh-mthomson deleted the mthomson/env_vars_example branch November 30, 2023 00:59
@fh-mthomson
Copy link
Contributor Author

fh-mthomson commented Nov 30, 2023

I do! As a starting point, check out https://github.com/vimc/vaultr (h/t @richfitz for the great work!)

General feedback:

  • Solid coverage of main Vault auth methods: token, user/pass, approle, LDAP
  • Given R6 interface, I found it hard to pick up / navigate function levels initially, but most flows, once established, can be wrapped: vault_client() -> login -> fetch secret from a given path

@richfitz
Copy link

Thanks for the tag Michael.

I've been trying to find someone who uses it to help me learn if there's something we should do to make it easier to use from R.

We've used vault from both R and python for the last ~7 years or so. If you want a chat/email/etc about what has worked well or not, feel free to drop me a line ([email protected])

@hadley
Copy link
Member

hadley commented Nov 30, 2023

Thanks @richfitz & @fh-mthomson!

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.

3 participants