]> git.proxmox.com Git - pve-manager.git/blobdiff - PVE/API2/Subscription.pm
website: update external links to www.proxmox.com
[pve-manager.git] / PVE / API2 / Subscription.pm
index 22455e3a199afc2784b8b3e6cd8b7b2de5b38bea..c9db8d986338dcada3f91161e813071347bea246 100644 (file)
@@ -62,7 +62,7 @@ sub read_etc_subscription {
 
     my $info = Proxmox::RS::Subscription::read_subscription($filename);
 
-    return $info if $info->{status} ne 'active';
+    return $info if !$info || $info->{status} ne 'active';
 
     my ($sockets, $level);
     eval { ($sockets, $level) = check_key($info->{key}, $req_sockets); };
@@ -83,6 +83,14 @@ sub write_etc_subscription {
     my $server_id = PVE::API2Tools::get_hwaddress();
     mkdir "/etc/apt/auth.conf.d";
     Proxmox::RS::Subscription::write_subscription($filename, "/etc/apt/auth.conf.d/pve.conf", "enterprise.proxmox.com/debian/pve", $info);
+
+    # NOTE: preparation for easier upgrade to Proxmox VE 8, which introduced the ceph enterprise repo
+    my $ceph_auth = '';
+    for my $ceph_release ('quincy', 'reef') {
+       $ceph_auth .= "machine enterprise.proxmox.com/debian/ceph-${ceph_release}"
+           ." login $info->{key} password $info->{serverid}\n"
+    }
+    PVE::Tools::file_set_contents("/etc/apt/auth.conf.d/ceph.conf", $ceph_auth);
 }
 
 __PACKAGE__->register_method ({
@@ -109,7 +117,7 @@ __PACKAGE__->register_method ({
        my $has_permission = $rpcenv->check($authuser, "/nodes/$node", ['Sys.Audit'], 1);
 
        my $server_id = PVE::API2Tools::get_hwaddress();
-       my $url = "https://www.proxmox.com/proxmox-ve/pricing";
+       my $url = "https://www.proxmox.com/en/proxmox-virtual-environment/pricing";
 
        my $info = read_etc_subscription();
        if (!$info) {
@@ -169,7 +177,10 @@ __PACKAGE__->register_method ({
        my $server_id = PVE::API2Tools::get_hwaddress();
        my $key = $info->{key};
 
-       # key has been recently checked or is a valid, signed offline key
+       die "Updating offline key not possible - please remove and re-add subscription key to switch to online key.\n"
+           if $info->{signature};
+
+       # key has been recently checked
        return undef
            if !$param->{force}
                && $info->{status} eq 'active'