Commit Graph

6661 Commits

Author SHA1 Message Date
Dan Bungert 737c3567e1 warn if no users but authorized_keys 2024-03-07 18:24:50 -07:00
Dan Bungert 6626fc2e9c identity: require in autoinstall only on server 2024-03-07 18:24:49 -07:00
Dan Bungert a38c86f085 identity: clarification of user creation handling 2024-03-07 18:24:49 -07:00
Robert Krátký 1b492981b2 Add ubuntu-image reference. 2024-03-07 15:09:47 +01:00
Chris Peterson 8721395803
Merge pull request #1925 from Chris-Peterson444/non-reportable-errors
Support for Non Reportable Errors
2024-03-06 19:54:02 -08:00
Chris Peterson bae102e6cb AutoinstallValidation: Fix typo in error message 2024-03-06 09:09:01 -08:00
Chris Peterson fefd498288 client: Add support for non-reportable errors
Adds support for AutoinstallValidation errors, the first class
of non-reportable errors. Includes a separate error overaly to
display a warning to the user about the issue.

Changes to the server to allow restarting the installer before all
of the controllers are loaded, since the error means the controllers
won't ever be loaded. Adds special handling to the ProgressView to
change the Reboot (the machine) button to a Restart (the installer) button
for this case.
2024-03-06 09:08:56 -08:00
Olivier Gayot 01e4f633ab Merge pull request #1921 from ogayot/nvmeotcp-rootfs
filesystem: accept to place the rootfs on remote storage for NVMe-o-TCP
2024-03-06 14:25:47 +01:00
Olivier Gayot 3bf2c02dfb
Merge pull request #1927 from ogayot/grub-bug-workaround
debconf-selections: work around grub2 bug until it is fixed
2024-03-06 14:21:29 +01:00
Olivier Gayot cffce32305 debconf-selections: work around grub2 bug until it is fixed
Currently, installations of Ubuntu Server and Ubuntu Desktop both fail
on UEFI-based systems because of a grub2 bug. This is a workaround to
avoid failing installs until grub2 migrates to the release pocket.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-06 13:25:59 +01:00
Olivier Gayot 2670f4857d filesystem: accept to place the rootfs on remote storage for NVMe-o-TCP
Now that curtin more or less supports NVMe over TCP with the rootfs on
remote storage, relax the contraints set by subiquity.

We still need the /boot (and /boot/efi) partitions on local storage
though.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-06 10:44:07 +01:00
Chris Peterson 30dfc2f0cb server: Define interactivity sooner
Change when the server discovers if the install is interactive or not.
This allows clients to display autoinstall errors in an interactive
way, if applicable. This also enables accessing the ssh_info endpoint
before all of the controllers are loaded. Autoinstall loading happens
after the loading cloudinit stage, so this should be accessible by then.
If a failure happens during/before cloudinit is finished, `interactive`
will still be set to `None` and clients should default to the
non-interactive case.
2024-03-05 11:31:52 -08:00
Chris Peterson 32e7dc54c5 API: Add non-reportable errors to /meta/status API response
Adds a field to the ApplicationStatus struct, nonreportable_error,
to be filled when the server enters an error state due to a
non-reportable error/exception type.
2024-03-05 11:31:52 -08:00
Chris Peterson 1dcb728c12 server: refactor exception handler and make apport suppression generic 2024-03-05 11:31:46 -08:00
Dan Bungert 2fd9c68571
Merge pull request #1926 from dbungert/curtin-namespace-ischroot
snapcraft: rev for ischroot fixes in pid namespace
2024-03-05 11:54:17 -07:00
Dan Bungert abd33a3493 snapcraft: rev for ischroot fixes in pid namespace 2024-03-05 11:40:06 -07:00
Olivier Gayot f06d1956b1
Merge pull request #1924 from ogayot/ssh-ellipsis-fix
ssh: fix UI crash when importing key on non UTF-8 and/or serial terminal
2024-03-05 09:05:24 +01:00
Olivier Gayot 07d7562508 ssh: fix UI crash when importing key on non UTF-8 and/or serial terminal
When importing a key on a terminal with limited capabilities, the UI can
crash with:

 File "urwid/canvas.py", line 1315, in apply_text_layout
     return TextCanvas(t, a, c, maxcol=maxcol)
   File "urwid/canvas.py", line 358, in __init__
     raise CanvasError("Canvas text is wider than the maxcol [...]
 urwid.canvas.CanvasError: Canvas text is wider than the maxcol specified

When a SSH key is too long to be displayed on the terminal, we clip the
end and show the ellipsis "…" character instead. It is supposedly 1
column wide but it reverts to "..." (3 columns wide) on terminals with
limited capabilities.

The bug seems fixed in urwid in noble but we're using core22 for now.
Let's not try to show the character until we switch to core24 (or until
the bug is fixed in jammy).

LP: #2055702

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-04 10:45:52 +01:00
Dan Bungert d010f921d5
Merge pull request #1923 from blackboxsw/cloudinit-no-init-when-disabled
bug(cloudinit): do not call cloudinit stages.Init when disabled
2024-03-01 17:10:43 -07:00
Chad Smith 972e0d55e4 bug(cloudinit): do not call cloudinit stages.Init when disabled
Inspect cloud-init status for disabled. When disabled do not
call stages.Init due to a side-effect that cloud-init tries to
rediscover any viable datasource when none are previously
discovered.

LP: #2055077
2024-03-01 17:03:36 -07:00
Dan Bungert f759d19336
Merge pull request #1922 from dbungert/curtin-zfs-keystore
snapcraft: rev curtin for zfs keystore
2024-02-29 16:04:52 -07:00
Dan Bungert 2f70a4621b snapcraft: rev curtin for zfs keystore 2024-02-29 15:09:31 -07:00
Dan Bungert 0aaade5c53
Merge pull request #1918 from dbungert/use-zfs-keystore
Use zfs keystore
2024-02-27 15:37:19 -07:00
Dan Bungert 922d1bdce0 filesystem: one more ZFS_LUKS->ZFS_LUKS_KEYSTORE 2024-02-27 15:14:34 -07:00
Dan Bungert a8c1143eee filesystem: create zpool with encryption info 2024-02-27 15:14:34 -07:00
Dan Bungert 1b00eb5616 utils: extract write_named_tempfile 2024-02-27 15:14:34 -07:00
Dan Bungert d886dcd97d
Merge pull request #1920 from dbungert/tests-noble
Fix unittests on Noble
2024-02-26 23:58:57 -07:00
Dan Bungert 76c9b6607a console_conf: fix not_called usage 2024-02-26 17:06:17 -07:00
Dan Bungert d266ac6a3f server: fix py3.12 related unittest deprecation 2024-02-26 17:05:53 -07:00
Dan Bungert 6fc7f46dd4
Merge pull request #1917 from dbungert/zfs-luks-keystore
types: rename ZFS_LUKS -> ZFS_LUKS_KEYSTORE
2024-02-23 08:00:03 -07:00
Dan Bungert f60290bb11 types: rename ZFS_LUKS -> ZFS_LUKS_KEYSTORE
Clarify that the implemented mechanism is the keystore setup.  An
implementation that doesn't use native ZFS encryption is plausibly
interesting, which is a better use of the term ZFS_LUKS.
2024-02-23 07:53:27 -07:00
Dan Bungert 98ca9cdfa8
Merge pull request #1919 from bboozzoo/bboozzoo/console-conf-wrapper-sync
bin/console-conf-wrapper: use /run/console-conf, fix mode extraction
2024-02-23 07:17:55 -07:00
Maciej Borzecki 3ea3da1a9a bin/console-conf-wrapper: fix mode extraction when modeenv is not available
We generally expect /var/lib/snapd/modeenv to exist, but in case it does not,
fall back to picking up the mode from kernel command line (just like snapd does
it).

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-23 14:21:06 +01:00
Maciej Borzecki 09b039a868 bin/console-conf-wrapper: update wrapper to use /run/console-conf
The changes in 66e8222a09 and
f3043cde88 introduced established
/run/console-conf as the project runtime directory. Make sure that the wrapper
uses the same location.

Credits to @kubiko for introducing the changes in his core24 nucleus branch.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-23 14:20:48 +01:00
Dan Bungert f83bf19e47
Merge pull request #1916 from dbungert/desktop-reduce-models
server: fix desktop INSTALL_MODEL_NAMES
2024-02-22 07:08:56 -07:00
Dan Bungert ca91bf0108 server: fix desktop INSTALL_MODEL_NAMES
Mirror and proxy are not in plan to be shown in the UI, so stop
requiring them.
2024-02-21 11:46:18 -07:00
Chris Peterson efd5138853 network: fix typo in BondConfig to_config method
A mismatch between the key names in BondConfig's to_config method
and NetworkDev's netdev_info function was causing subiquity to
crash when creating a bond with a valid transmit hash policy and
then later trying to edit it (LP: #2051586).

The correct key name set by the to_config method should be
"transmit-hash-policy" since this later gets passed to netplan
and neither "xmit-hash-policy" nor "xmit_hash_policy" is a valid
key name in pure netplan config.
2024-02-21 08:48:34 -08:00
Olivier Gayot cf909d751c
Merge pull request #1915 from ogayot/fix-netplan-detection
network: fix detection of netplan on recent Ubuntu releases
2024-02-21 09:18:42 +01:00
Olivier Gayot 4e6bae198b network: fix detection of netplan on recent Ubuntu releases
Subiquity has a mechanism to detect the presence of netplan. It does so
by checking the existence of the file /lib/netplan/generate. This
mechanism is used in the network screen to validate the YAML
configuration.

However, since netplan 0.107 (present in mantic and noble), the file
/lib/netplan/generate is no longer present. It used to be provided as an
alias for /usr/libexec/netplan/generate ; starting in jammy.

This made Subiquity unable to detect that netplan is running ; and
therefore skip the YAML validation against netplan.

Since we support focal in Subiquity, let's change the detection code so
that we look for both locations. When we stop supporting Focal in the
future, we can drop the reference to /lib/netplan/generate.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-19 13:03:30 +01:00
Chris Peterson 477fef9590
Merge pull request #1913 from Chris-Peterson444/netplan-comment
update rationale for netplan config permissions
2024-02-16 15:26:54 -08:00
Olivier Gayot c8501d81db
Merge pull request #1910 from ogayot/pro-dynamic-eol
Do not use hard-coded EOL year for ESM updates on the ubuntu-pro screen
2024-02-16 09:46:08 +01:00
Chris Peterson 7f388aded2 update rationale for netplan config permissions
Previously we had stripped the wifi config and wrote it separately with
stricter permissions than normal to avoid leaking sensitive data, but
now at first glance this seems redundant with all the netplan config
file permissions being the same. The reason we didn't collapse
everything back to one file with the permissions change is that
there are scenarios in which the 00-installer-config.yaml file could
purposefully be shared, so we should continue to strip known private
information from that file.
2024-02-15 10:56:27 -08:00
Michael Hudson-Doyle 5e5ef826d5
Merge pull request #1894 from medicalwei/factory-reset-fix-boots
factory-reset: remove EFI boot entry, retarget GRUB entry to chainload Reset Partition GRUB
2024-02-15 09:50:39 +13:00
Chris Peterson beb41c30d0
Merge pull request #1911 from Chris-Peterson444/netplan-permissions-tests
permissions: update netplan configs to 0600
2024-02-13 17:06:30 -08:00
Chris Peterson ed3d2b3e7d ci: disable lint on noble
Temporarily disable lint ci test on noble until we can determine
regression.
2024-02-13 16:58:48 -08:00
Chris Peterson 9ecc4060b9 permissions: update netplan configs to 0600
Since netplan 0.106.1, Netplan YAMLs should have file permissions
with mode 0o600 (owner RW only) and root owner.
2024-02-13 16:36:11 -08:00
Olivier Gayot ce938e6d03
Merge pull request #1895 from ogayot/pr/ssh-dissociate-form-submission
Dissociate SSH key import from form submission
2024-02-13 19:20:34 +01:00
Olivier Gayot b5bbb76900 ubuntu-pro: consume general info and show on the UI
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 13:02:40 +01:00
Olivier Gayot a42ea0a685 ubuntu-pro: return number of packages and EOL ESM in /ubuntu_pro/info
We now rely on distro-info to find out the EOL ESM date on LTS releases.
This information is meant to be shown on the Ubuntu Pro screens ;
instead of hardcoded values.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 13:02:25 +01:00
Olivier Gayot 7a5ff9e76a examples: add lsb-release for jammy and noble
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 11:56:31 +01:00