You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
renv behind a corporate Proxy. Improve documentation? #146
Like in #64 we have an awful man in the middle Proxy using Windows logins (SSPI) and the ntlm authentication protocol. A good explanation is found in this stackoverflow answer. To make matter worse, the bundled curl is removed from our windows image.
renv::install() fails:
> renv::install("xtable")
Retrieving 'https://cran.rstudio.com/bin/windows/contrib/3.5/xtable_1.8-4.zip' ...
Warning message:
In (function (url, destfile, method, quiet = FALSE, mode = "w", :
URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/xtable_1.8-4.zip': status was 'HTTP response code said error'
I found a simple solution in the end, but it was cumbersome to find all the pieces of information:
• Install curl with renv::equip()
• Create following _curlrc in Sys.getenv("HOME") or Sys.getenv("R_USER")
> renv::install("xtable")
Retrieving 'https://cran.rstudio.com/bin/windows/contrib/3.5/xtable_1.8-4.zip' ...
OK [downloaded 688.3 Kb in 1.9 secs]
Installing xtable [1.8-4] from CRAN ...
OK (installed binary)
* Copying 'xtable' into the cache ... Done!
I'm going to consider it a success that renv was able to work in this configuration without any extra changes from me :-)
I've added some documentation to the Getting Started vignette to give some hints as to how to configure renv + curl to use proxy servers, though. Let me know if you think that's sufficient.
See the curl documentation on [proxies](https://ec.haxx.se/usingcurl-proxies.html) and [config files](https://ec.haxx.se/cmdline-configfile.html) for more details.
And perhaps add the example _curlrc and drop the keywords ntlm and sspi, something along the lines:
This config file works with a common proxy setup in a windows environment (authentication with ntlm and sspi):
```--proxy "your.proxy.dns:port"--proxy-ntlm--proxy-user ":"--insecure```
In the best case it works for the user, else he has some keywords to start googling or asking his IT support.
The curl packages has the helper function curl::ie_get_proxy_for_url() to find the proxy address. Don't know if this should be included.
I struggled mostly with the following points:
location of _curlrc. For me sys.getenv("APPDATA") and 'sys.getenv("USERPROFILE")\Application Data' doesn't work. In the end I had to take a look at the renv source code to get a working location. This is resolved with the added sections
The --proxy-user ":" switch. i really disliked to store my password in text file. And i asked me how gets RStudio my credentials to download files and packages from cran / github? Found the answer on stackoverflow. I configured the proxy in a .renviron file in Sys.getenv("HOME").
As an after thought:
yeah it is definitely a success. And the problems I had, was with the missing curl, the correct curl configuration and missing knowledge about proxy authentication not in renv. renv has even the tools to help me with the missing curl. On the other side, i had a working setup for install.packages() and remotes::install_*.
Yesterday i was just a bit frustrated about how simple the solution is, but i wasted a lot of time to get the configuration right.
Thank you for the feedback -- it is hugely appreciated. I've updated the documentation with that example, and also altered how renv looks for _curlrc (since the documentation makes it clear that curl would normally look in %APPDATA% and the other folder as well).
Activity
add documentation for proxies + curl (#146)
kevinushey commentedon Aug 15, 2019
I'm going to consider it a success that
renvwas able to work in this configuration without any extra changes from me :-)I've added some documentation to the Getting Started vignette to give some hints as to how to configure
renv+curlto use proxy servers, though. Let me know if you think that's sufficient.tva-lks commentedon Aug 16, 2019
Seems good. Perhaps change the last paragraph to:
And perhaps add the example _curlrc and drop the keywords ntlm and sspi, something along the lines:
In the best case it works for the user, else he has some keywords to start googling or asking his IT support.
The curl packages has the helper function
curl::ie_get_proxy_for_url()to find the proxy address. Don't know if this should be included.I struggled mostly with the following points:
location of _curlrc. For me
sys.getenv("APPDATA")and'sys.getenv("USERPROFILE")\Application Data'doesn't work. In the end I had to take a look at the renv source code to get a working location. This is resolved with the added sectionsThe
--proxy-user ":"switch. i really disliked to store my password in text file. And i asked me how gets RStudio my credentials to download files and packages from cran / github? Found the answer on stackoverflow. I configured the proxy in a .renviron file inSys.getenv("HOME").-Then the _curlrc format first i had
proxy-user = :and ran into curl/curl#3738 (comment).As an after thought:
yeah it is definitely a success. And the problems I had, was with the missing curl, the correct curl configuration and missing knowledge about proxy authentication not in renv. renv has even the tools to help me with the missing curl. On the other side, i had a working setup for
install.packages()andremotes::install_*.Yesterday i was just a bit frustrated about how simple the solution is, but i wasted a lot of time to get the configuration right.
kevinushey commentedon Aug 16, 2019
Thank you for the feedback -- it is hugely appreciated. I've updated the documentation with that example, and also altered how
renvlooks for_curlrc(since the documentation makes it clear thatcurlwould normally look in%APPDATA%and the other folder as well).