Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
binhost ftps support
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
kai.scorpio
n00b
n00b


Joined: 01 Sep 2011
Posts: 45

PostPosted: Mon Sep 03, 2012 11:46 pm    Post subject: binhost ftps support Reply with quote

According to the Binary Package Guide on the wiki, portage supports ftps binhosts. However, I have not been able to get this working, as specifying a binhost with ftps:// in the URL gives:
Code:

!!! Error fetching binhost package info from 'ftps://binhost:*password*@myhost.tld'
!!! <urlopen error unknown url type: ftps>

Leaving the url starting with ftp:// I get the following error from the host (pure-ftpd with option -Y 2)
Code:

!!! Error fetching binhost package info from 'ftp://binhost:*password*@myhost.tld'
!!! <urlopen error ftp error: 421 Sorry, cleartext sessions are not accepted on this server.>


Is this a mistake on the website, or do I need to change something in the configuration?

Thanks,
Kai
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8995
Location: beyond the rim

PostPosted: Wed Sep 05, 2012 10:43 am    Post subject: Reply with quote

Is your python built with USE=ssl enabled? (just random guessing here)
Back to top
View user's profile Send private message
kai.scorpio
n00b
n00b


Joined: 01 Sep 2011
Posts: 45

PostPosted: Wed Sep 05, 2012 3:54 pm    Post subject: Reply with quote

It is compiled with ssl, both in version 2.7 and 3.2.

Any other ideas? What should my config contain except those binhost lines?

Kai
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8995
Location: beyond the rim

PostPosted: Tue Sep 25, 2012 8:33 am    Post subject: Reply with quote

Checking the relevant python documentation doesn't say anything about FTPS support in the used urllib module (the urllib2 module mentions it at least). One thing you could try is to define a FETCHCOMMAND_FTPS variable in your make.conf with a command that supports ftps:// urls (see FETCHCOMMAND documentation/examples for variables supported) as portage should use that if urlopen fails.
Back to top
View user's profile Send private message
kai.scorpio
n00b
n00b


Joined: 01 Sep 2011
Posts: 45

PostPosted: Tue Sep 25, 2012 12:24 pm    Post subject: Reply with quote

I have tried that with the following lines in make.conf (replacing the binhost with the correct details):
Code:

FETCHCOMMAND_FTP= "/usr/bin/curl -R \${URI} -o ${DISTDIR}/\${FILE} --ssl"
RESUMECOMMAND_FTP="/usr/bin/curl -R \${URI} -o ${DISTDIR}/\${FILE} --ssl -C -"
PORTAGE_BINHOST="ftp://user:password@domain.tld"


However, this fails with the following:
Code:

kai@kai-laptop ~ % sudo emerge -av links                                 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1103k  100 1103k    0     0   190k      0  0:00:05  0:00:05 --:--:--  247k


!!! Binhost package index  has no TIMESTAMP field.

Fetching bininfo from ftp://user:*password*@domain.tld
!!! 421 Sorry, cleartext sessions are not accepted on this server.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] www-client/links-2.7  USE="X bzip2 deprecated gpm jpeg ssl tiff unicode zlib -directfb -fbcon -livecd -lzma (-suid) (-svga)" 3,806 kB

Total: 1 package (1 reinstall), Size of downloads: 3,806 kB

Would you like to merge these packages? [Yes/No] no

Note it does not suggest the binary (which is definitely available) so it must be falling back to another source (probably the official mirrors).

Fetching with cURL into a normal directory works fine. I'm not sure what I'm missing or whether portage simply does not support this. I've been considering a switch to Paludis for this reason, do you have any idea whether this would help?

Kai
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8995
Location: beyond the rim

PostPosted: Tue Sep 25, 2012 12:53 pm    Post subject: Reply with quote

Yeah, was afraid of it insisting on the Packages file and not using FETCHCOMMAND for that. Could file an enhancement request at bugs.gentoo.org about that (supporting FETCHCOMMAND for Packages file and/or using urllib2).
Back to top
View user's profile Send private message
kai.scorpio
n00b
n00b


Joined: 01 Sep 2011
Posts: 45

PostPosted: Tue Sep 25, 2012 2:58 pm    Post subject: Reply with quote

To me it looked like it was fetching the packages file correctly, since it shows a curl-style progress indicator. I've looked at the portage source but have been unable to find where it tries to get the TIMESTAMP header from. Do you have any other ideas? If not, I'll go file that bug report.

Kai
Back to top
View user's profile Send private message
kai.scorpio
n00b
n00b


Joined: 01 Sep 2011
Posts: 45

PostPosted: Tue Sep 25, 2012 10:40 pm    Post subject: Reply with quote

Further errors when using --pretend :
Code:

kai@kai-laptop ~ % emerge -pv keepass
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0 1103k    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0Warning: Failed to create the file /usr/portage/distfiles/tmpf4g9tj:
Warning: Permission denied
  1 1103k    1 16384    0     0   3337      0  0:05:38  0:00:04  0:05:34  3490
curl: (23) Failed writing body (0 != 16384)
Fetcher exited with a failure condition.


!!! Error fetching binhost package info from 'ftp://binhost:*password*@kjw-bins.crabdance.com'
!!! FETCHCOMMAND_FTP failed


I'm tempted to open a request for general cURL support, but I suppose that might not get a very good response since the developers seem to have decided on wget. Any ideas on how this would work with Paludis?

Kai
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8995
Location: beyond the rim

PostPosted: Thu Sep 27, 2012 6:52 am    Post subject: Reply with quote

Curl is just as supported as wget, the latter is simply the default for fetching distfiles that's all. For binpkgs the default is to use pythons urllib and only if that fails falling back to FETCHCOMMAND_*. I don't know how well tested the latter is though. Maybe adjusting permissions on $DISTDIR helps already.
If you want to look at the relevant code see http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=blob;f=pym/portage/dbapi/bintree.py starting at the for-loop around line 830, and more specifically the else-clause and following code around line 900.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum