rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
129 stars 79 forks source link

add envVars to example in deployApp() #1027

Closed fh-mthomson closed 7 months ago

fh-mthomson commented 7 months ago

Pulls out helpful example from https://github.com/rstudio/rsconnect/issues/859#issuecomment-1600949465

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.

hadley commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

@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.

fh-mthomson commented 7 months ago

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

General feedback:

richfitz commented 7 months ago

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 (rich.fitzjohn@gmail.com)

hadley commented 7 months ago

Thanks @richfitz & @fh-mthomson!