Commit Graph

211 Commits

Author SHA1 Message Date
Dan Bungert 76c9b6607a console_conf: fix not_called usage 2024-02-26 17:06:17 -07:00
Dan Bungert d617ae0f1f
Merge pull request #1872 from kubiko/console-conf-use-snapd-socket
console_conf: identity: use snapd unix socket
2024-02-12 20:17:26 -07:00
Maciej Borzecki 9e081f4fd8 console_conf/controllers/identity: extend unit tests
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-08 07:51:58 +01:00
Maciej Borzecki de12383725 console_conf/controllers/identity: update unit tests to fake snapd socket connection
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-08 07:34:48 +01:00
Maciej Borzecki 7144a65d22 console_conf/controllers/identity: use app level snapd connection
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-08 07:34:48 +01:00
Maciej Borzecki f0183d1cee console_conf: set application level snapd connection
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-08 07:34:48 +01:00
Ondrej Kubik 55a1bff166 console_conf: identity: use snapd unix socket
When running in strict snap confinement snap client binary is not
accessible. Additionally output format of snap client binary is
not guaranteed not to change. snapd REST API should be used instead.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-02-08 07:29:16 +01: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
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
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
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 c08fdab2f8 one-off format of long lines with black 2023-07-25 15:27:49 -06:00
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Michael Hudson-Doyle c0438b44ca fix "make lint" when run with the new pycodestyle/flake8 2023-03-23 16:38:35 +13:00
Michael Hudson-Doyle 06d7f04032 remove --script/--click command line arguments
I implemented these a long time ago to help working on parts of the ui
by allowing a way to script moving past some screens. I haven't used
them in ages, it's pretty bad code and probably a fragmentary answers
file is a better solution to the same problem. What do you think?
2022-12-07 14:56:00 +13:00
Olivier Gayot 638e2cbfbf loop: fix setuptools entry-points not using asyncio.run
setuptools declares a certain number of entry points that use the main
function of the associated component. That said, now that main is an
async function, it does not work. There seems to be no way to tell
setuptools to wrap the call to the entry point with asyncio.run so we
need to revert to a synchronous main function.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-10-28 17:05:54 +02:00
Olivier Gayot a62a0b6002 loop: start running the event loop before doing anything else
This allows us to use asyncio.run() and to avoid many pitfalls.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-10-28 17:05:54 +02:00
Dan Bungert d73772258d fix some easier cases of impolite language 2022-08-29 12:30:39 -06:00
Olivier Gayot 812bba1de1 Use logger names consistent with directory structure
Refreshed name of loggers to make them consistent with the directory
structure.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-25 17:35:45 +01:00
Dan Bungert 0f9c9eef3f options: add output_base for dryrun use
To enable parallel API testing, add an output_base argument to replace
the default '.subiquity' that is sprinkled everywhere.
2022-01-26 10:39:23 -07:00
Michael Hudson-Doyle 65b3cdf79b fix console_conf yet again 2021-09-13 16:22:25 +12:00
Dan Bungert ada889328d Verify that machine-config arg is a file
If machine-config is pointed to a non-existant file, dryrun can kind of
unhelpfully hang without much indication that anything is happening.
2021-07-14 16:40:22 -06:00
Dan Bungert 6a189dd598
Add EventCallback, and move mirror task things to GeoIP (#983)
Move mock_app to common location.
Move run_coro to subiquitycore so that subiquitycore doesn't have to
reference things in subiquity, even for test.
Move task tracking things from mirror to geoip.
Server app owns the geoip instance.
Create EventCallback as an alternative to MessageHub that should
hopefully express clearer intermodule dependencies.
2021-06-14 16:05:27 -06:00
Michael Hudson-Doyle 6a9d100b64 have console-conf-write-login-details exit with code 2 when no IPs found
Also make the log files resulting from console-conf-write-login-details
execution a bit easier to spot.
2021-05-03 11:04:03 +12:00
Michael Hudson-Doyle 00cfee002f trivial fixes for console_conf breakage 2020-11-06 09:54:30 +13:00
Michael Hudson-Doyle edc43ff811 add a minimal server process
run it automatically in dry-run mode
2020-09-22 14:43:26 +12:00
Michael Hudson-Doyle f0082c2068 change controller api to return a view, rather than setting it 2020-09-18 11:44:00 +12:00
Michael Hudson-Doyle edc65dbbfb make the base controller have no ui, add subclass for one that has ui 2020-08-23 23:18:28 +12:00
Michael Hudson-Doyle f5f8a8a75c import the controllers module explicitly 2020-08-23 23:18:28 +12:00
Michael Hudson-Doyle ccd8c2382e split urwid-using bits out of subiquitycore.core.Application 2020-08-23 23:18:26 +12:00
Michael Hudson-Doyle 210cdcb51b Move the code for setting up the screen to its own file
Looking at this code thinking about the coming client / server split
made me realise that we could start by at least moving this
functionality to a more encapsulated place.
2020-07-27 23:40:17 +12:00
Michael Hudson-Doyle 0c9737097a fix get_device_owner return value 2020-07-09 23:22:20 +12:00
Michael Hudson-Doyle 57cd4c3e4c changes suggested in review 2020-07-09 10:47:46 +12:00
Michael Hudson-Doyle 164c575f2a use snapd apis to check for a user and (minimally) handle a managed system with no owner 2020-07-03 15:55:07 +12:00
Dimitri John Ledkov 6de8970560 console_conf: fix showing error messages, when snap create-user fails 2020-05-18 12:42:14 +01:00
Dimitri John Ledkov 760fbaa22f Review comments 2020-04-16 00:22:52 +01:00
Dimitri John Ledkov 5be2961a62 subiquity: add --ssh option to print ssh login details. 2020-04-16 00:08:56 +01:00
Dimitri John Ledkov b34aeda02d
Merge pull request #695 from CanonicalLtd/fix-login-view-focus
Fix login view button focus to done
2020-04-09 13:28:34 +01:00
Dimitri John Ledkov b61a3369a3 Fix login view button focus to done 2020-04-09 12:34:37 +01:00
Dimitri John Ledkov a70d309f6a Use common palette.
Fixes header frindge colors in console-conf.
2020-04-09 12:20:16 +01:00
Dimitri John Ledkov f3b1a70822
Merge pull request #692 from bboozzoo/bboozzoo/chooser-tweaks
console_conf: various recover chooser tweaks
2020-04-09 10:59:39 +01:00
Maciej Borzecki 9293d85638 console_conf/ui/views: simplify sorting actions, tweaks
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-04-08 12:56:18 +02:00