};
my $get_changelog_url =sub {
- my ($pkgname, $info, $pkgver, $origin) = @_;
+ my ($pkgname, $info, $pkgver, $origin, $component) = @_;
my $changelog_url;
my $base = dirname($info->{FileName});
$changelog_url = "http://packages.debian.org/changelogs/$base/" .
"${srcpkg}_${pkgver}/changelog";
} elsif ($origin eq 'Proxmox') {
- $changelog_url = "http://download.proxmox.com/changelogs/${pkgname}/" .
- "${pkgname}_${pkgver}_changelog";
+ if ($component eq 'pve-enterprise') {
+ $changelog_url = "https://enterprise.proxmox.com/debian/$base/" .
+ "${srcpkg}_${pkgver}.changelog";
+ } else {
+ $changelog_url = "http://download.proxmox.com/debian/$base/" .
+ "${srcpkg}_${pkgver}.changelog";
+ }
}
}
};
if (my $pkgfile = &$get_pkgfile($candidate_ver)) {
- my $origin = $pkgfile->{Origin};
- $data->{Origin} = $origin;
- if (my $changelog_url = &$get_changelog_url($pkgname, $info, $candidate_ver->{VerStr}, $origin)) {
+ $data->{Origin} = $pkgfile->{Origin};
+ if (my $changelog_url = &$get_changelog_url($pkgname, $info, $candidate_ver->{VerStr},
+ $pkgfile->{Origin}, $pkgfile->{Component})) {
$data->{ChangeLogUrl} = $changelog_url;
}
}
my $url;
die "changelog for '${pkgname}_$ver->{VerStr}' not available\n"
- if !($pkgfile && ($url = &$get_changelog_url($pkgname, $info, $ver->{VerStr}, $pkgfile->{Origin})));
+ if !($pkgfile && ($url = &$get_changelog_url($pkgname, $info, $ver->{VerStr}, $pkgfile->{Origin}, $pkgfile->{Component})));
my $data = "";
$ua->agent("PVE/1.0");
$ua->timeout(10);
$ua->max_size(1024*1024);
-
+ $ua->ssl_opts(verify_hostname => 0); # don't care for changelogs
+
if ($proxy) {
- $ua->proxy(['http'], $proxy);
+ $ua->proxy(['http', 'https'], $proxy);
} else {
$ua->env_proxy;
}
+ my $username;
+ my $pw;
+
+ if ($pkgfile->{Origin} eq 'Proxmox' && $pkgfile->{Component} eq 'pve-enterprise') {
+ my $info = PVE::INotify::read_file('subscription');
+ if ($info->{status} eq 'Active') {
+ $username = $info->{key};
+ $pw = PVE::API2Tools::get_hwaddress();
+ $ua->credentials("enterprise.proxmox.com:443", 'pve-enterprise-repository',
+ $username, $pw);
+ }
+ }
+
my $response = $ua->get($url);
if ($response->is_success) {
my $allowcheckfaildays = 5;
my $shared_key_data = "kjfdlskfhiuewhfk947368";
-my $hwaddress;
-
-sub get_hwaddress {
-
- return $hwaddress if defined ($hwaddress);
-
- my $fn = '/etc/ssh/ssh_host_rsa_key.pub';
- my $sshkey = PVE::Tools::file_get_contents($fn);
- $hwaddress = uc(md5_hex($sshkey));
-
- return $hwaddress;
-}
sub get_sockets {
my $info = PVE::ProcFSTools::read_cpuinfo();
die "checksum failure\n" if $csum ne $newcsum;
my $req_sockets = get_sockets();
- my $server_id = get_hwaddress();
+ my $server_id = PVE::API2Tools::get_hwaddress();
check_fields($localinfo, $server_id, $req_sockets);
sub write_apt_auth {
my $key = shift;
- my $server_id = get_hwaddress();
- my $auth = { 'enterprise.proxmox.com' => { login => $key, password => get_hwaddress() } };
+ my $server_id = PVE::API2Tools::get_hwaddress();
+ my $auth = { 'enterprise.proxmox.com' => { login => $key, password => $server_id } };
PVE::INotify::update_file('apt-auth', $auth);
}
my $uri = "$whmcsurl/modules/servers/licensing/verify.php";
- my $server_id = get_hwaddress();
+ my $server_id = PVE::API2Tools::get_hwaddress();
my $req_sockets = get_sockets();
code => sub {
my ($param) = @_;
- my $server_id = get_hwaddress();
+ my $server_id = PVE::API2Tools::get_hwaddress();
my $info = PVE::INotify::read_file('subscription');
if (!$info) {
};
my $req_sockets = get_sockets();
- my $server_id = get_hwaddress();
+ my $server_id = PVE::API2Tools::get_hwaddress();
check_fields($info, $server_id, $req_sockets);