Changeset 2234 in ProjectBuilder


Ignore:
Timestamp:
Jun 27, 2017, 3:32:10 PM (7 years ago)
Author:
Bruno Cornec
Message:

Adds https_proxy support

Location:
devel
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-doc/SECURITY

    r2012 r2234  
    2424
    2525The default /etc/sudoers file created for VM/VE contains:
    26 Defaults:pb env_keep += "http_proxy ftp_proxy"
     26Defaults:pb env_keep += "http_proxy https_proxy ftp_proxy"
    2727Defaults:pb !requiretty
    2828pb ALL=(ALL) NOPASSWD:ALL
  • devel/pb-modules/etc/pb.conf.pod

    r2156 r2234  
    167167 Example: http_proxy default = http://example.com:3128/
    168168
     169=item B<https_proxy>
     170
     171 Nature: Optional
     172 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here.
     173 Value: string indicating the proxy to use
     174 Conffile: pb
     175 Example: https_proxy default = http://example.com:3128/
     176
    169177=item B<logcmd>
    170178
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r2222 r2234  
    322322my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy"));
    323323my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy"));
     324my $https_proxy = pb_distro_get_param($pbos,pb_conf_get_if("https_proxy"));
    324325
    325326# We do not overwrite shell settings
    326327$ENV{ftp_proxy} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne ""));
    327328$ENV{http_proxy} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne ""));
     329$ENV{https_proxy} ||= $https_proxy if ((defined $https_proxy) && ($https_proxy ne ""));
    328330}
    329331
     
    350352pb_log(1, "ftp_proxy=$ENV{ftp_proxy}\n") if (defined $ENV{ftp_proxy});
    351353pb_log(1, "http_proxy=$ENV{http_proxy}\n")  if (defined $ENV{http_proxy});
     354pb_log(1, "https_proxy=$ENV{https_proxy}\n")  if (defined $ENV{https_proxy});
    352355
    353356# Get dependencies in the build file if not forced
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r2233 r2234  
    9696if ($EFFECTIVE_USER_ID != 0) {
    9797    $sudocmd ="sudo ";
    98     foreach my $proxy (qw/http_proxy ftp_proxy/) {
     98    foreach my $proxy (qw/http_proxy https_proxy ftp_proxy/) {
    9999        if (defined $ENV{$proxy}) {
    100100            open(CMD,"sudo sh -c 'echo \$$proxy' |") or die "can't run sudo sh?: $!";
     
    308308            print DOCKER "ENV ftp_proxy $ENV{ftp_proxy}\n" if (defined $ENV{ftp_proxy});
    309309            print DOCKER "ENV http_proxy $ENV{http_proxy}\n" if (defined $ENV{http_proxy});
     310            print DOCKER "ENV https_proxy $ENV{https_proxy}\n" if (defined $ENV{https_proxy});
    310311            # We are root in that container so no need to sudo, which is present potentially
    311312            my $cmd2 = $pbos->{'install'};
  • devel/pb/bin/pb

    r2232 r2234  
    619619 verpmtype default = rpmbootstrap
    620620
    621 You may also choose to specify a mirror for the OS packages, and optionally http/ftp proxies.  You can specify the proxies either through environment variables ($http_proxy/$ftp_proxy) or in the configuration file. The configuration file will be used if no corresponding environment variable has been set. For example, for debian and with a local squid proxy:
     621You may also choose to specify a mirror for the OS packages, and optionally http/ftp proxies.  You can specify the proxies either through environment variables ($http_proxy/$https_proxy/$ftp_proxy) or in the configuration file. The configuration file will be used if no corresponding environment variable has been set. For example, for debian and with a local squid proxy:
    622622
    623623 rbsmirrorsrv debian = http://mirrors1.kernel.org/debian/
    624624 http_proxy default = http://localhost:3128/
     625 https_proxy default = http://localhost:3128/
    625626 ftp_proxy default = http://localhost:3128/
    626627
     
    33893390        print SCRIPT "export http_proxy=\"$ENV{'http_proxy'}\"\n";
    33903391    }
    3391 
     3392    if (defined $ENV{'https_proxy'}) {
     3393        print SCRIPT "export https_proxy=\"$ENV{'https_proxy'}\"\n";
     3394    }
    33923395    if (defined $ENV{'ftp_proxy'}) {
    33933396        print SCRIPT "export ftp_proxy=\"$ENV{'ftp_proxy'}\"\n";
     
    38583861        print SCRIPT << "EOF";
    38593862# Keep proxy configuration while using sudo
    3860 print PBOUT "Defaults:$pbac->{$ENV{'PBPROJ'}}    env_keep += \\\"http_proxy ftp_proxy\\\"\\n";
    3861 print PBOUT "Defaults:root    env_keep += \\\"http_proxy ftp_proxy\\\"\\n";
     3863print PBOUT "Defaults:$pbac->{$ENV{'PBPROJ'}}    env_keep += \\\"http_proxy https_proxy ftp_proxy\\\"\\n";
     3864print PBOUT "Defaults:root    env_keep += \\\"http_proxy https_proxy ftp_proxy\\\"\\n";
    38623865EOF
    38633866    }
  • devel/rpmbootstrap/bin/rpmbootstrap

    r2032 r2234  
    585585#
    586586$pbos->{'install'} =~ s/sudo//g;
    587 if (((defined $ENV{http_proxy}) && ($ENV{http_proxy} ne '')) || ((defined $ENV{ftp_proxy}) && ($ENV{ftp_proxy} ne ''))) {
     587if (((defined $ENV{http_proxy}) && ($ENV{http_proxy} ne '')) || ((defined $ENV{https_proxy}) && ($ENV{https_proxy} ne '')) || ((defined $ENV{ftp_proxy}) && ($ENV{ftp_proxy} ne ''))) {
    588588    if ($pbos->{'name'} eq "opensuse") {
    589589        # For opensuse 11.4 or 12.1 -- one of them didn't work with http_proxy or HTTP_PROXY set.
    590590        open(PROXY, "> $vepath/etc/sysconfig/proxy") || die "can't open $vepath/etc/sysconfig/proxy: $!";
    591591        print PROXY "HTTP_PROXY=$ENV{http_proxy}\n" if ((defined $ENV{http_proxy}) && ($ENV{http_proxy} ne ''));
     592        print PROXY "HTTPS_PROXY=$ENV{https_proxy}\n" if ((defined $ENV{https_proxy}) && ($ENV{https_proxy} ne ''));
    592593        print PROXY "FTP_PROXY=$ENV{ftp_proxy}\n" if ((defined $ENV{ftp_proxy}) && ($ENV{ftp_proxy} ne ''));
    593594        close(PROXY);
Note: See TracChangeset for help on using the changeset viewer.