Christoph Heiss [Wed, 19 Jul 2023 16:31:30 +0000 (18:31 +0200)]
tui: fix FQDN validation
Add checks to ensure that:
* It is actually has a hostname, not just a domain name
* Properly check if the hostname is purely numeric, which was
broken/different to how the GUI installer does it
The custom error type also allows for easier future adaptions, as the
changes can be entirely contained to the `Fqdn` type.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Philipp Hufnagl [Thu, 13 Jul 2023 09:38:53 +0000 (11:38 +0200)]
disk partitioning: fix checking answer for to-small-disk prompt
Currently there is a bug that you only can install < 8 GB when you NOT
accept the warning. This is wrong. A user should have to accept the
warning to install on small systems
Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
[T: reword commit subject & fix typo there ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
tui: don't abort install if min ram requirement is not met
If the minimum requirements are not met, the TUI installer will create a
popup notifying you that the install might not work and then exits the
installer.
While the GUI also creates such a popup, it will not exit the installer.
This patch adapts the behavior of the GUI: the TUI creates a popup
warning you that min spec is not met but doesn't abort the install.
Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com> Reviewed-by: Christoph Heiss <c.heiss@proxmox.com> Tested-by: Christoph Heiss <c.heiss@proxmox.com>
[T: fix conflict in context and drop intermediate variable ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Christoph Heiss [Mon, 3 Jul 2023 07:35:00 +0000 (09:35 +0200)]
tui: check hvm support through runtime env info instead of open-coding
As the runtime environment now exports that info, use it. In turn, this
allows us to drop the dependency on `proxmox-sys`, as that check was its
only user.
The dependency graph drops from 107 to 88 crates from this, which
definitively is a nice change.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Thomas Lamprecht [Wed, 28 Jun 2023 16:34:16 +0000 (18:34 +0200)]
installation: disable clamav-clamonacc.service by default for PMG
> On-Access [...] leverages a kernel api called fanotify to block
> processes from attempting to access malicious files. This
> prevention occurs in kernel-space, and thus offers stronger
> protection than a purely user-space solution.
This is not really useful for the PMG use case and requires user
configuration as otherwise it refuses to start. In fact, is the sole
unit marked as failed after a fresh installation:
> ERROR: Clamonacc: at least one of OnAccessExcludeUID,
> OnAccessExcludeUname, or OnAccessExcludeRootUID must be specified
> it is recommended you exclude the clamd instance UID or uname to
> prevent infinite event scanning loops.
So disable it by default, if a user really wants this, whyever that
would be, the can just configure it and enable it again via
systemctl.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stefan Sterz [Tue, 27 Jun 2023 14:15:07 +0000 (16:15 +0200)]
tui: persist disk selection for zfs and btrfs
previously the disk selection was reset if the advanced options
dialogue was re-opened. this commit adapts the behavior to restore
the previous selection.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Stoiko Ivanov [Thu, 22 Jun 2023 13:57:13 +0000 (15:57 +0200)]
fix space calculation for small disks for pve product
The convoluted calculation logic in case the disks is 8GB leads to
datasize becoming 16EiB further down:
* after calculating and removing the rootsize from $rest, $rest becomes
smaller than $space (which should be the minimal non-used space in the
volume-group) - this leads to a negative value, which overflows in
the `& ~0xFFF` opration.
Fiona Ebner [Thu, 22 Jun 2023 14:18:34 +0000 (16:18 +0200)]
always align rootdisk size to 4 MiB
While this was already done in the $rest < 48 GiB cases, it wasn't yet
done for the else branch and also not if $maxroot_mb was assigned,
because of being smaller.
Second and last step towards fixing an issue reported in the community
forum [0] where using 250.00 hdsize, 250 maxroot and 0 minfree would
fail.
Turns out two extents would be missing because of lvcreate implicitly
rounding up, one of them for the root LV (the one for metadata was
already handled in the previous commit).
Stefan Sterz [Thu, 22 Jun 2023 09:20:38 +0000 (11:20 +0200)]
tui: switch to `f64` for disk sizes
previously the tui used `u64` internally to represent the disk size.
since the perl-based installer expects GiB as floats and that is also
what is displayed in the tui that meant a lot of converting back and
forth. it also lead to an error where the disk sizes that were set
seemed to not have been persisted, even though the sizes were
correctly set. this commit refactors the installer to convert the size
once in the beginning and then stick to `f64`.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com> Reviewed-by: Christoph Heiss <c.heiss@proxmox.com> Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Thomas Lamprecht [Thu, 22 Jun 2023 08:45:59 +0000 (10:45 +0200)]
Revert "critic: lazily read directories via <> glob"
Perl definitively acts very different with the while variant, it
seems it keeps the file handle open and reuses it in future calls,
even if the directory base of the glob is different
Thomas Lamprecht [Thu, 22 Jun 2023 05:16:12 +0000 (07:16 +0200)]
fix checking the now boolean prompt response
When the prompt abstraction got added in bc05a8f ("add basic UI
plugin infrastructure") it also inlined the check for the answer, as
that can be differently structured for each user interface, and
returns bool. But when switching over to this new infra, two sites
weren't updated to the simpler bool check and still checked with the
previous "equals 'ok'", which now was always false.
Fixes: 72bea99 ("switch prompt, error and message calls to new UI infra") Reported-by: Alexander Zeidler <a.zeidler@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Christoph Heiss [Wed, 21 Jun 2023 12:04:09 +0000 (14:04 +0200)]
tui: remove underline-effect from advanced disk setup titles
While this might look at it should it terminal emulators, in a raw tty
this can have different effects; e.g. being a bright blue/green and
nearly unreadable. For now, just remove the effect completely, the
semantics are still very much clear.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
fix #4643: show a confirmation dialog when clicking abort
Note that unlike the rest of the file, we connect to the response signal
instead of using Gtk3::Dialog->run, the reason is that run blocks the
main loop used by GTK and this undesirable to the point where
Gtk3::Dialog->run was removed for GTK 4.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Thomas Lamprecht [Wed, 21 Jun 2023 09:58:36 +0000 (11:58 +0200)]
gtk: return truthy for rescheduling the timer for autoreboot
This definitively worked without that value when the functionality
was first added in dfc02f3 ("fix #3093: allow to automatically reboot
on installation success"), so possibly something new with the glib,
gtk, or the perl bindings in bookworm..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 21 Jun 2023 09:52:14 +0000 (11:52 +0200)]
run env: make addresses optional, include all interfaces
Similar to our actual battle proven get_ip_config, but as the TUI
uses this one, and switching to it rather more risk, make just
addresses optional, add skip for "lo" loopback and don't skip ifaces
that aren't UP in the current helper.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
with this you can type without removing the decimal places, but if
you type inside the decimal places it'll just move the cursor to the
end and do nothing
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 21 Jun 2023 08:45:28 +0000 (10:45 +0200)]
config: avoid warning if no country was detected
e.g., due to having no network (no DHCP lease)
Reported-by: Christian Ebner <c.ebner@proxmox.com> Reported-by: Stefan Hanreich <s.hanreich@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Christoph Heiss [Wed, 21 Jun 2023 07:31:50 +0000 (09:31 +0200)]
tui: make auto-deteced routes optional
If, for some reason, the network is not properly configured (due to
e.g. no DHCP server being present on the network), there will be no
routes in the runtime environment as well. So do not depend on that,
otherwise the installer fails at the start.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>