How to automate /opt/rstudio-connect/bin/rscadmin configure --encrypt-config-value

Hey. I need to automate the encryption of a password parameter in Rstudio connect configuration. I know how to encrypt the value manually:

/opt/rstudio-connect/bin/rscadmin configure --encrypt-config-value

and then I am asked to input the value i need to encrypt. This works but i need to be part of a bash script.

I need this to be part of an automated script and get the encrypted value as an output value (to put in the config file). How can I automate those steps in bash script?

This is a great question! Do you mind explaining a bit more about your use case? Are you using Infrastructure as Code of some type?

I believe sending the value you want over stdin should be sufficient, for example ( I sent stderr to /dev/null so you can see that the config value comes to stdout) :

# echo 'test' | /opt/rstudio-connect/bin/rscadmin configure --encrypt-config-value 2>/dev/null

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.