add preliminary pdm support

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Christoph Heiss 2024-11-25 14:28:43 +01:00 committed by Thomas Lamprecht
parent 8ea891cd81
commit 17f3ff2268
19 changed files with 393 additions and 6 deletions

View File

@ -151,7 +151,7 @@ cargo-build:
.PHONY: upload .PHONY: upload
upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
upload: $(ALL_DEBS) upload: $(ALL_DEBS)
tar cf - $(ALL_DEBS) | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs --dist $(UPLOAD_DIST) tar cf - $(ALL_DEBS) | ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg,pbs,pdm --dist $(UPLOAD_DIST)
%.img: %.img:
truncate -s 2G $@ truncate -s 2G $@
@ -222,6 +222,20 @@ check-pbs: prepare-check-pbs
check-pbs-tui: prepare-check-pbs check-pbs-tui: prepare-check-pbs
testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr
prepare-check-pdm: prepare-check-env test.img
rm -f cd-info.test; $(MAKE) \
PRODUCT='pdm' \
PRODUCTLONG='Proxmox Datacenter Manager' \
ISONAME='proxmox-datacenter-manager' \
cd-info.test
./proxmox-low-level-installer dump-env -t test.img
check-pdm: prepare-check-pdm
G_SLICE=always-malloc perl -I testdir/usr/share/perl5 testdir/usr/bin/proxinstall -t test.img
check-pdm-tui: prepare-check-pdm
testdir/usr/bin/proxmox-tui-installer -t test.img 2>testdir/run/stderr
.phony: clean .phony: clean
clean: clean:
rm -rf target build $(PACKAGE)-[0-9]* testdir rm -rf target build $(PACKAGE)-[0-9]* testdir

View File

@ -1455,6 +1455,16 @@ _EOD
file_write_all("$targetdir/$user_cfg_fn", "user: root\@pam\n\temail ${mailto}\n"); file_write_all("$targetdir/$user_cfg_fn", "user: root\@pam\n\temail ${mailto}\n");
chroot_chown($targetdir, $user_cfg_fn, user => 'root', group => 'backup'); chroot_chown($targetdir, $user_cfg_fn, user => 'root', group => 'backup');
chroot_chmod($targetdir, $user_cfg_fn, mode => '0640'); chroot_chmod($targetdir, $user_cfg_fn, mode => '0640');
} elsif ($iso_env->{product} eq 'pdm') {
my $base_cfg_path = "/etc/proxmox-datacenter-manager";
mkdir "$targetdir/$base_cfg_path";
mkdir "$targetdir/$base_cfg_path/access";
my $user_cfg_fn = "$base_cfg_path/acess/user.cfg";
file_write_all("$targetdir/$user_cfg_fn", "user: root\@pam\n\temail ${mailto}\n");
chroot_chown($targetdir, $base_cfg_path, user => 'www-data', recursive => 1);
chroot_chmod($targetdir, $base_cfg_path, mode => '0700');
} }
}; };

View File

@ -31,6 +31,12 @@ my $product_cfg = {
enable_btrfs => 0, enable_btrfs => 0,
bridged_network => 0, bridged_network => 0,
}, },
pdm => {
fullname => 'Proxmox Datacenter Manager',
port => '8443', # TODO: confirm
enable_btrfs => 0,
bridged_network => 0,
},
}; };
my sub read_locale_info { my sub read_locale_info {

View File

@ -3,6 +3,7 @@ INSTALLER_SOURCES= \
pmg-banner.png \ pmg-banner.png \
pve-banner.png \ pve-banner.png \
pbs-banner.png \ pbs-banner.png \
pdm-banner.png \
%-banner.png: %-banner.svg %-banner.png: %-banner.svg
rsvg-convert -o $@ $< rsvg-convert -o $@ $<

1
banner/pdm-banner.png Symbolic link
View File

@ -0,0 +1 @@
pbs-banner.png

1
banner/pdm-banner.svg Symbolic link
View File

@ -0,0 +1 @@
pbs-banner.svg

5
debian/control vendored
View File

@ -51,9 +51,10 @@ Breaks: pbs-installer (<< 7~), pve-installer (<< 7~),
Replaces: pbs-installer (<< 7~), pve-installer (<< 7~), Replaces: pbs-installer (<< 7~), pve-installer (<< 7~),
Description: Installer for Proxmox Projects Description: Installer for Proxmox Projects
This package contains the graphical installer for: This package contains the graphical installer for:
* Proxmox VE. * Proxmox VE
* Proxmox Mail Gateway. * Proxmox Mail Gateway
* Proxmox Backup Server * Proxmox Backup Server
* Proxmox Datacenter Manager
Package: proxmox-auto-install-assistant Package: proxmox-auto-install-assistant
Architecture: any Architecture: any

1
debian/install vendored
View File

@ -4,6 +4,7 @@
banner/pbs-banner.png /var/lib/proxmox-installer banner/pbs-banner.png /var/lib/proxmox-installer
banner/pmg-banner.png /var/lib/proxmox-installer banner/pmg-banner.png /var/lib/proxmox-installer
banner/pve-banner.png /var/lib/proxmox-installer banner/pve-banner.png /var/lib/proxmox-installer
banner/pdm-banner.png /var/lib/proxmox-installer
etc etc
html /var/lib/proxmox-installer/ html /var/lib/proxmox-installer/
sbin sbin

7
html/pdm/Makefile Normal file
View File

@ -0,0 +1,7 @@
DESTDIR=
all:
.phony: clean
clean:
rm -rf *~

View File

@ -0,0 +1,54 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">In-Development Datacenter Manager</b></td><!-- TODO: rework for stable -->
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tr><td>
<b>Open-Source Management Software for Servers</b><br><br>
- Central overview of all your Proxmox VE cluster.<br>
- Modern user interface.<br>
- Simple architecture.<br>
- Easy management<br><br>
For more information, visit <b>forum.proxmox.com</b>.<!-- TODO: rework for stable -->
<br><br>
</td></tr>
</table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table border="0" width="400">
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Graphical User Interface</b><br>
Easily manage your resources with the integrated web interface.<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Performance</b><br>
The entire software stack, including the user interface, is written in Rust for high speed, performance, and memory efficiency.
<br>
</td>
</tr>
</table>
</p>
</td>
</tr>
</table>
</center>
</body>
</html>

View File

@ -0,0 +1,62 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">Data Safety & Minimized Storage Consumption</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tr><td>
Proxmox Datacenter Manager is currently under development and not yet production ready.<br><br>
The role-based permission management, combined with the integration of multiple external
authentication sources provides the basis for a secure and stable environment.<br><br>
<!--Visit <b>www.proxmox.com</b> for more information regarding commercial support
subscriptions.<br><br>-->
</td></tr>
</table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table border="0" width="400">
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Commitment to Free Software</b><br>
The source code is released under the GNU Affero General Public License, v3.
</td>
</tr>
<tr></tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>RESTful web API</b><br>
The resource-oriented architecture (ROA) and declarative API definition using JSON
Schema enable easy integration for third party management tools.
</td>
</tr>
<tr></tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Independent</b><br>
There is no dependency between Proxmox Datacenter Manager and the resources it manages,
any Proxmox VE cluster stays fully self-contained.
</td>
</tr>
<tr></tr>
</table>
</p>
</td>
</tr>
</table>
</center>
</body></html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">Web-Based Management</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tr><td>
Proxmox Datacenter Manager helps you manage and gain visibility into your mission-critical
resources.<br>
</td></tr>
</table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table border="0" width="400">
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Support for Proxmox VE</b><br>
The Proxmox Virtual Environment will be fully supported, and the seamless integration
allows you to easily manage VMs and containers.<br>
</td>
</tr>
<tr></tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Web Console</b><br>
SSL-secured, browser-integrated system console.<br>
</td>
</tr>
<tr></tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Flaky connection? No Problem.</b><br>
Using only the API to access resources eliminates the need for highly stable,
low-latency network connections.<br>
</td>
</tr>
</table>
</p>
</td>
</tr>
</table>
</center>
</body></html>

View File

@ -0,0 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">Proxmox Datacenter Manager</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br>
<p>
<table>
<tr><td>
<b>Status Overview</b><br>
Easily check that all resources and services are up and running and not overloaded.<br><br>
</td></tr>
<tr><td>
<b>Central Control</b><br>
Operate your whole Proxmox projects based infrastructure from a single endpoint.<br><br>
</td></tr>
</table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table border="0" width="400">
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Essential Management</b><br>
Execute essential operation on the managed resources directly.<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top">
<b>Technical Support</b><br>
Enterprise support options will be available from Proxmox once stable.<br><br>
</td>
</tr>
</table>
</p></td>
</tr>
</table>
</center>
</body>
</html>

58
html/pdm/page1.htm Normal file
View File

@ -0,0 +1,58 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">Proxmox Datacenter Manager (PDM)</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tbody><tr><td><b>The Proxmox Installer</b>
automatically partitions your hard disk. It installs all required packages and makes the
system bootable from the hard disk.
All existing partitions and data on the selected disks will be lost.
<br><br>
To continue the installation, press the Next button.
</td></tr>
</tbody></table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table border="0" width="400">
<tbody><tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top"><b>Please verify the installation target</b><br>
The displayed hard disk will be used for the installation.
<br>Warning: All existing partitions and data on selected disks will be lost.
<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top"><b>Automatic hardware detection</b><br>
The installer automatically configures your hardware.
<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top" width="560"><b>Graphical user interface</b><br>
Final configuration will be done on the graphical user interface, via a web browser.
<br><br>
</td>
</tr>
</tbody></table>
</p>
</td>
</tr>
</tbody></table>
</center>
</body></html>

52
html/pdm/passwd.htm Normal file
View File

@ -0,0 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="pve-installer.css">
</head>
<body>
<center>
<table border="0" width="800">
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="4" align="center" width="800">
<b class="htext">Administration Password and Email Address</b>
</td>
</tr>
<tr>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tr><td><b>Proxmox Datacenter Manager</b> is a
full-featured, highly secure system, based on Debian GNU/Linux.
<br><br>
In this step, please provide the <i>root</i> password.
</td></tr>
</table>
</p></td>
<td colspan="2" valign="top" width="400"><br><p>
<table>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top"><b>Password:</b>
Please use a strong password. It should be at least 8 characters long,
and contain a combination of letters, numbers, and symbols.
<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"><img src="plus.png"></td>
<td valign="top"><b>Email:</b>
Enter a valid email address. Your Proxmox Datacenter Manager will send
important alert notifications to this email account (all emails for 'root').
<br><br>
</td>
</tr>
<tr>
<td valign="top" width="30"></td>
<td valign="top">To continue the installation, press the Next button.</td>
</tr>
</table>
</p></td>
</tr>
</tbody></table>
</center>
</body></html>

View File

@ -465,7 +465,7 @@ impl NetworkOptions {
Fqdn::from(&format!("{hostname}.{domain}")).unwrap_or_else(|_| { Fqdn::from(&format!("{hostname}.{domain}")).unwrap_or_else(|_| {
// Safety: This will always result in a valid FQDN, as we control & know // Safety: This will always result in a valid FQDN, as we control & know
// the values of default_hostname (one of "pve", "pmg" or "pbs") and // the values of default_hostname (one of "pve", "pmg", "pbs" or "pdm") and
// constant-defined DEFAULT_DOMAIN. // constant-defined DEFAULT_DOMAIN.
Fqdn::from(&format!("{}.{}", default_hostname, Self::DEFAULT_DOMAIN)).unwrap() Fqdn::from(&format!("{}.{}", default_hostname, Self::DEFAULT_DOMAIN)).unwrap()
}) })
@ -517,6 +517,7 @@ mod tests {
); );
assert_eq!(default_zfs_arc_max(ProxmoxProduct::PBS, *total_memory), 0); assert_eq!(default_zfs_arc_max(ProxmoxProduct::PBS, *total_memory), 0);
assert_eq!(default_zfs_arc_max(ProxmoxProduct::PMG, *total_memory), 0); assert_eq!(default_zfs_arc_max(ProxmoxProduct::PMG, *total_memory), 0);
assert_eq!(default_zfs_arc_max(ProxmoxProduct::PDM, *total_memory), 0);
} }
} }
} }

View File

@ -26,6 +26,7 @@ pub enum ProxmoxProduct {
PVE, PVE,
PBS, PBS,
PMG, PMG,
PDM,
} }
impl ProxmoxProduct { impl ProxmoxProduct {
@ -34,6 +35,7 @@ impl ProxmoxProduct {
Self::PVE => "pve", Self::PVE => "pve",
Self::PMG => "pmg", Self::PMG => "pmg",
Self::PBS => "pbs", Self::PBS => "pbs",
Self::PDM => "pdm",
} }
} }
} }
@ -44,6 +46,7 @@ impl fmt::Display for ProxmoxProduct {
Self::PVE => "pve", Self::PVE => "pve",
Self::PMG => "pmg", Self::PMG => "pmg",
Self::PBS => "pbs", Self::PBS => "pbs",
Self::PDM => "pdm",
}) })
} }
} }

View File

@ -168,8 +168,8 @@ struct PostHookInfo {
schema: PostHookInfoSchema, schema: PostHookInfoSchema,
/// major.minor version of Debian as installed, retrieved from /etc/debian_version /// major.minor version of Debian as installed, retrieved from /etc/debian_version
debian_version: String, debian_version: String,
/// PVE/PMG/PBS version as reported by `pveversion`, `pmgversion` or /// PVE/PMG/PBS/PDM version as reported by `pveversion`, `pmgversion`,
/// `proxmox-backup-manager version`, respectively. /// `proxmox-backup-manager version` or `proxmox-datacenter-manager version`, respectively.
product: ProductInfo, product: ProductInfo,
/// Release information for the ISO used for the installation. /// Release information for the ISO used for the installation.
iso: IsoInfo, iso: IsoInfo,
@ -399,6 +399,7 @@ impl PostHookInfo {
ProxmoxProduct::PVE => "pve-manager", ProxmoxProduct::PVE => "pve-manager",
ProxmoxProduct::PMG => "pmg-api", ProxmoxProduct::PMG => "pmg-api",
ProxmoxProduct::PBS => "proxmox-backup-server", ProxmoxProduct::PBS => "proxmox-backup-server",
ProxmoxProduct::PDM => "proxmox-datacenter-manager",
}; };
let version = run_cmd(&[ let version = run_cmd(&[

View File

@ -51,6 +51,10 @@ while (my ($total_mem, $expected) = each %default_tests) {
mock_product('pmg'); mock_product('pmg');
is(Proxmox::Install::RunEnv::default_zfs_arc_max(), 0, is(Proxmox::Install::RunEnv::default_zfs_arc_max(), 0,
"zfs_arc_max should default to `0` for PMG with $total_mem MiB system memory"); "zfs_arc_max should default to `0` for PMG with $total_mem MiB system memory");
mock_product('pdm');
is(Proxmox::Install::RunEnv::default_zfs_arc_max(), 0,
"zfs_arc_max should default to `0` for PDM with $total_mem MiB system memory");
} }
my @clamp_tests = ( my @clamp_tests = (