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
Create a .netrc without port number, and curl works:
cat <<EOF > ~/.netrcmachine 127.0.0.1login usernamepassword tokenEOF
chmod 600 ~/.netrc
curl --netrc -v http://127.0.0.1:11234
# * Trying 127.0.0.1:11234...# * Connected to 127.0.0.1 (127.0.0.1) port 11234# * Server auth using Basic with user 'username'# > GET / HTTP/1.1# > Host: 127.0.0.1:11234# > Authorization: Basic dXNlcm5hbWU6dG9rZW4=# > User-Agent: curl/8.5.0# > Accept: */*# > # < HTTP/1.1 302 Found
pak does not pick this up:
pak::repo_add(CRAN=repo$url(), username="username")
pak::repo_get()
# x Did not find credentials for repo <http://[email protected]:11234/>, keyring lookup failed (env backend).# # A data frame: 6 x 7# name url type r_version bioc_version username has_password# * <chr> <chr> <chr> <chr> <chr> <chr> <lgl> # 1 CRAN http://usern~ cran * NA username FALSE
Create a .netrc with port number, and curl fails:
cat <<EOF > ~/.netrcmachine 127.0.0.1:11234login usernamepassword tokenEOF
chmod 600 ~/.netrc
curl --netrc -v http://127.0.0.1:11234
# * Couldn't find host 127.0.0.1 in the .netrc file; using defaults# * Trying 127.0.0.1:11234...# * Connected to 127.0.0.1 (127.0.0.1) port 11234# > GET / HTTP/1.1# > Host: 127.0.0.1:11234# > User-Agent: curl/8.5.0# > Accept: */*# > # < HTTP/1.1 401 Unauthorized
pak works here:
pak::repo_get()
v Found credentials for repo <http://[email protected]:11234/> (.netrc).
# A data frame: 6 x 7
name url type r_version bioc_version username has_password
*<chr><chr><chr><chr><chr><chr><lgl>
1 CRAN http://usern~ cran * NA username TRUE
The text was updated successfully, but these errors were encountered:
glin
changed the title
pak requires non-standard ports to be specified in .netrc, unlike curl
Auth: pak requires non-standard ports to be specified in .netrc, unlike curlMar 4, 2025
Testing
.netrc
support with pak 0.8.0.9000:For repos with non-standard ports like http://127.0.0.1:11234, I'm finding that pak requires a port to be in
.netrc
:Whereas
curl
only works if you omit the port:The
.netrc
documentation is sort of unclear here, but it sounds like it only supports hostnames in the machine field.To repro, I am running this on Ubuntu 24.04:
.netrc
without port number, and curl works:.netrc
with port number, and curl fails:The text was updated successfully, but these errors were encountered: