Commit Graph

6541 Commits

Author SHA1 Message Date
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 24f48f0d87 Merge pull request #1884 from ogayot/nvme-o-tcp-poc
NVMe over TCP with /home on remote storage
2024-02-09 11:38:59 +01:00
Dan Bungert ab31a3b206
Merge pull request #1907 from dbungert/use-cryptoswap
Use cryptoswap
2024-02-08 18:07:36 -07:00
Dan Bungert 08a91988fa snapcraft: rev curtin for dm_crypt config support 2024-02-08 16:19:08 -07:00
Dan Bungert 72ca35d06b filesystem: add ZFS_LUKS capability flag
Start the ZFS_LUKS work with adding the flag and connecting the parts
needed.  Enable cryptoswap as part of that.
2024-02-08 16:19:08 -07:00
Olivier Gayot c1105dffee filesystem: add integration test using nvme-o-tcp
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 88b6dcb6c6 filesystem: add support for reformatting in run-answers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 76f0469705 filesystem: fix run-answers for deleting a partition
When trying to delete a partition using the answers-based mechanism,
subiquity tries to call .done() on the ConfirmDeletesStretchy overlay.
However, this method does not exist. The .confirm() method is what we
should use instead.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 376131b04d filesystem: pass _netdev option for mounts on remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot c3de13d10c filesystem: only allow /home on remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 802e9ef8db storage: add property to tell if FS objects are "on" remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot e83343c02c filesystem: LVM_VolGroup has a list of devices, not a set
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot c95716669c storage: expect optional NVMe controllers in the storage config
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 39640140ca
Merge pull request #1892 from ogayot/noble+pro
ubuntu-pro: enable on noble, although it's not yet marked LTS
2024-02-08 09:56:46 +01:00
Olivier Gayot fc5adf2946 ubuntu-pro: actually show the screen with warning for future LTSes
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 09:56:11 +01:00
Olivier Gayot d9fa0a0c44
Merge pull request #1891 from ogayot/apt-mounter-pathlib
Mounter / APT use pathlib instead of os
2024-02-08 09:04:15 +01:00
Dan Bungert 3035098d22
Merge pull request #1908 from dbungert/fix-cc-state-dir
tests: fix state_dir failure
2024-02-07 23:31:14 -07:00
Dan Bungert 17a0a198ef tests: fix state_dir failure 2024-02-07 23:05:56 -07:00
Dan Bungert f03d5b5c5a
Merge pull request #1873 from kubiko/console-conf-use-ready-fingerprints
console_conf: identity: use prepared fingerprints
2024-02-07 22:57:43 -07:00
Dan Bungert cd1fc53126
Merge pull request #1904 from bboozzoo/bboozzoo/console-conf-use-one-run-dir
console-conf: set project name, consistently use as state directory
2024-02-07 22:50:47 -07:00
Dan Bungert 47256905a4 ssh: fix unclosed file 2024-02-07 22:45:06 -07:00
Maciej Borzecki b6f8cf334f console_conf/controllers/identity: use state directory when querying host key info
When obtaining host key fingerprints, use the state directory.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:44:05 +01:00
Maciej Borzecki 66e8222a09 subiquitycore: use a premade host key fingerprints info if present
It is possible that the platform integration glue may have already prepared a
summary of host key fingerprints at the state directory. If so, use it
otherwise, try to build the summary directly.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:44:05 +01:00
Ondrej Kubik 082c59a9a9 console_conf: identity: move strict confinement handling to ssh
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-02-07 11:30:39 +01:00
Ondrej Kubik e6aa7e1dcc console_conf: identity: allow use of prepared host keys fingerprints
In strict snap confinement, sshd config or host keys are not accessible.
If strict confinement is detected, instead allow reuse of
the host keys fingerprints already prepared by invoking process.
Prepared fingerprints are stored in: /run/console-conf/host-fingerprints.txt

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-02-07 11:30:39 +01:00
Maciej Borzecki 87efd8aa18 console_conf: use snap helper for obtaining project name
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:20:44 +01:00
Maciej Borzecki 0764bb50b9 console_conf/controllers: add unit test for identity controller
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:20:44 +01:00
Maciej Borzecki 592887b540 console_conf/controllers/identity: store login details in project state directory
Since we set a project name centrally, it implies a specific path to the state
directory. Instead of hardcoding the same value directly again in the controller
code, use the application level state directory.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:17:20 +01:00
Maciej Borzecki f3043cde88 console_conf/core: use a common project for console-conf related apps
Make sure that console-conf related apps use the same value for project, which
results in using the same shared state directory.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-07 11:17:20 +01:00
Ondrej Kubik 3295691e6b console_conf: use 'console-conf' as project name
'project' value is used to construct /run/<project> path
Other parts are already using 'console-conf', prefer this syntax.
In the future we might consider using SNAP_NAME, and this '_' are
not permitted as part of the snap name.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-02-07 11:17:20 +01:00
Dan Bungert 5a1a2b0faa
Merge pull request #1875 from kubiko/console-conf-wrapper
console_conf: modify wrapper helper to consider consol-conf as snap
2024-02-06 20:44:31 -07:00
Dan Bungert 177df5002c
Merge pull request #1906 from bboozzoo/bboozzoo/snap-helpers
subiquitycore: helpers for probing for snap execution environment
2024-02-06 20:36:17 -07:00
Dan Bungert 61af71f64d
Merge pull request #1905 from bboozzoo/bboozzoo/drop-user-key-fingerprint
console_conf: do not attempt to obtain user's public key fingerprints
2024-02-06 20:35:00 -07:00
Maciej Borzecki b4708b0a51 subiquitycore: helpers for probing for snap execution environment
Add helpers for probing if the process is executing inside a snap.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-06 16:02:08 +01:00
Maciej Borzecki 257910e52d console_conf/models: drop key fingerprints
The fingerprints are not used anywhere, no point in keeping the field.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-06 14:05:41 +01:00
Maciej Borzecki b19c716613 console_conf/controllers: do not attempt to set user's key fingerprint
In preparation for running console-conf as a strictly confined snaps, review of
the existing code has shown that user's key fingerprints are not being used or
displayed anywhere. Since we would not be able to read those public keys anyway,
we may as well drop the code which attempts to device the key fingerprints.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-06 14:03:55 +01:00
Dan Bungert b2441fd91d
Merge pull request #1902 from dbungert/cloud-init-status-json
cloudinit: handle format=json status
2024-02-05 17:19:47 -07:00
Chris Peterson 48e5f9c616
Merge pull request #1897 from Chris-Peterson444/autoinstall-exception-FR-6293
AutoinstallError exception
2024-02-05 16:19:15 -08:00
Dan Bungert b064528ed4 cloudinit: handle format=json status
Add version checks for cloud-init to know if we can read status in JSON
format or not.  If so, use that for a superior answer to the legacy
format.  Handle legacy code paths also.
2024-02-05 10:58:35 -07:00
Chris Peterson 24de248cec AutoinstallError: Disable apport reporting
Autoinstall related failures are more likely than not going to be
user caused, so we shouldn't immediately generate a crash report
for these types of failures. This should hopefully allow the user
to debug their autoinstall data much faster and reduce the number
of autoinstall-related bugs reported.
2024-02-05 09:37:42 -08:00
Dan Bungert fa8cc0371f
Merge pull request #1903 from bboozzoo/bboozzoo/log-dir-owner-in-snap
subiquitycore/log: use 'root' as group for strictly confined snaps
2024-02-05 10:13:35 -07:00
Maciej Borzecki 5c266cc38c subiquitycore/log: use 'root' as group for strictly confined snaps
When setting up the logging in a strictly confined snap, use the 'root' group,
rather than 'adm'. This will not interfere with the sandbox's policy but also
does not result in providing wider access to the logs.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-05 16:18:03 +01:00
Chris Peterson f1944dd2f7 AutoinstallValidationError: An error for autoinstall validation failures
Adds a base exception type for Autoinstall related failures and a
specific implementation for autoinstall validation failures.

When a user passes incorrect autoinstall data, the installer will crash
with an AutoinstallValidationError exception. Failure messages are
currently in the form of:

    "Malformed autoinstall in '<autoinstall_key>' section"

where <autoinstall_key> is the name of the top-level key a particular
controller is responsible (e.g., 'apt' and MirrorController).

The section reporting is a little crude in the validation
of the base schema done by SubiquityServer, which can't discern
between the 'interative-sessions' and 'version' keys, but for now
the scope is pretty limited and can be fixed up at a later time.
2024-02-01 10:30:46 -08:00
Chris Peterson e29a2a6c11 SubiquityServer: Include interactive-sections as a property
SubiquityServer is responsible for checking and loading the
interactive-sessions, so it should be responsible for validating
this section as well. Additionally add this to the autoinstall
schema in the docs.
2024-01-29 20:15:45 -08:00
Chris Peterson 53180bbc35
Merge pull request #1898 from Chris-Peterson444/schema-doc-literalinclude
doc: use literalinclude for autoinstall-schema
2024-01-29 16:36:12 -08:00
Dan Bungert fb9679abfa
Merge pull request #1900 from dbungert/workflow-noble
workflow: +noble
2024-01-29 17:18:06 -07:00
Dan Bungert a695329216 ui/identity: remove _AsyncValidatedMixin
_AsyncValidatedMixin has been merged into the parent UsernameEditor,
reluctantly. I like the concept of _AsyncValidatedMixin, but what's
happening here is that UsernameEditor has inherited from 3 classes, the
first of which is in urwid, and when the constructor /
super().__init__() status changed in urwid,
_AsyncValidatedMixin.__init__() stopped being called.

OK cool, so maybe we'll just manually run initializers in the case where
it matters.  That's semi-better, but with old urwid we end up calling
_AsyncValidatedMixin.__init__() twice (once directly, once by the urwid
__init__ using super()).

Further workarounds could be employed but at the moment there is one
user of _AsyncValidatedMixin, so just merge it into UsernameEditor.
2024-01-29 15:40:49 -07:00
Dan Bungert 29b3f361d1 scripts: handle cloud-init status 2 2024-01-29 13:52:58 -07:00
Chris Peterson 25b65e4e1a doc: use literalinclude for autoinstall-schema
Instead of manually changing the autoinstall-schema reference,
use literalinclude to insert the autoinstall-schema.json file
from the root of the repository.
2024-01-29 09:31:32 -08:00