You are not logged in.

#1 2019-03-28 16:19:56

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

[SOLVED] Authentication-protected repository

I'm looking for the way to add password-protected repository to pacman list of repos. For example, my repository database resides on HTTPS/FTP server with password-based access (private FTP or AuthBasic apache share). What is the best practice to allow access for pacman to such restricted sources? The most straightforward solution is to embed login:password pair into the URI inside pacman.conf, but it doesn't seems safe. May be there are any advanced ways to store credentials for authentication?

Last edited by dviktor (2019-03-28 17:54:41)

Offline

#2 2019-03-28 16:24:17

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Authentication-protected repository

You should be able to do this by using entries in /root/.curlrc and/or /root/.netrc.
https://ec.haxx.se/cmdline-passwords.html


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2019-03-28 17:54:32

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: [SOLVED] Authentication-protected repository

Thank you a lot! Both .netrc and .curlrc (proper XferCommand is required in pacman.conf) works great. Solved

Offline

#4 2019-03-28 19:41:24

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: [SOLVED] Authentication-protected repository

The only problem is with pkgfile - seems like it doesn't honor neither .curlrc nor .netrc. Setting up XferCommand in pacman.conf doesn't solve this problem

Last edited by dviktor (2019-03-28 19:42:06)

Offline

#5 2019-03-28 19:50:56

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Authentication-protected repository

Are you running pkgfile as a regular user? You may need to put the credentials in ~ as well.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#6 2019-03-28 20:14:21

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: [SOLVED] Authentication-protected repository

No, I'm running it with sudo:

[viktor@desolve-lab ~]$ sudo pkgfile --update
[sudo] password for viktor: 
:: Updating 5 repos...
  multilib is up to date
  core is up to date
  extra is up to date
  community is up to date
warning: download failed: ******* [error 401]
error: failed to update repo: apocalypse

Offline

#7 2019-03-28 20:58:03

progandy
Member
Registered: 2012-05-17
Posts: 5,193

Re: [SOLVED] Authentication-protected repository

pkgfile is most likely not setting CURLOPT_NETRC to honor netrc settings. You could submit a feature request. In the meantime, you should be able to replace most/all of pkgfile with the FILE (-F) option for pacman

pacman -Fy
pacman -Fo ...

Last edited by progandy (2019-03-28 21:01:12)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#8 2019-03-29 21:41:03

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: [SOLVED] Authentication-protected repository

Filed an issue. Will see which solution could be applied.

EDIT: fixed and works great

Last edited by dviktor (2019-04-01 09:00:15)

Offline

Board footer

Powered by FluxBB