Compare commits

..

478 Commits

Author SHA1 Message Date
Olivier Gayot f200888e70
Merge pull request #1996 from ogayot/2063124-document
DESIGN.md: document what happens to the API when the server restarts
2024-05-24 08:40:14 +02:00
Michael Hudson-Doyle debf176316
Merge pull request #1995 from mwhudson/install-uc24
add ability to install uc20+ systems
2024-05-24 08:30:07 +12:00
Olivier Gayot b72bf2ee3a DESIGN.md: document what happens to the API when the server restarts
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-23 15:27:13 +02:00
Michael Hudson-Doyle 1f09b19eab add integration test for installing core 2024-05-23 15:21:23 +12:00
Michael Hudson-Doyle bdf0e24d69 add a more explicit method for whether to use snapd install API 2024-05-23 15:21:23 +12:00
Michael Hudson-Doyle d8fc0cc9ea allow a source catalog to have a type of 'null'
This means the source does not have anything to put into the rootfs /
user-data partition, as is the case for Ubuntu Core.
2024-05-23 15:21:23 +12:00
Michael Hudson-Doyle 1f64752315 example data for installing uc24 2024-05-23 15:21:21 +12:00
Michael Hudson-Doyle eb3c4bf2ee
Merge pull request #1993 from mwhudson/allow-system-seed-in-live-layer
allow system definition to be in live layer
2024-05-23 14:15:56 +12:00
Chris Peterson c5131fca5f
Merge pull request #1965 from Chris-Peterson444/autoinstall-bug-lp-2060547
identity: fail on missing section sooner
2024-05-22 23:48:37 +02:00
Chris Peterson 68ae5a4cdc source: determine variant earlier than .start()
The current check for Desktop in the identity controller doesn't
work because the variant isn't set until SourceController.start
is called. Move this logic to earlier in the sequence so that the
variant information can be referenced by later-loaded controllers.
2024-05-22 13:48:48 -07:00
Chris Peterson 3b3e3310d6 filesystem: look-ahead on reset-partition-only
The identity controller shouldn't own the logic for determining
if the filesystem controller will only install the reset partition.
Creates a utility function that can be called by the identity
controller to determine if only installing the reset partition.
2024-05-22 13:48:34 -07:00
Michael Hudson-Doyle cd3d7b1c95 tidy string literals 2024-05-22 12:09:06 +12:00
Michael Hudson-Doyle d0366229ec add docstring explaining _get_system return value 2024-05-22 12:06:32 +12:00
Chris Peterson eb155c363c
Merge pull request #1985 from Chris-Peterson444/cloud-init-schema-failure-lp-2062988
cc-extract: don't unnecessarily access data
2024-05-22 01:10:03 +02:00
Chris Peterson dea2ca2379
Merge pull request #1994 from Chris-Peterson444/merge-netplan-config
network: drop logic to split out wifi config
2024-05-14 09:07:31 -07:00
Olivier Gayot 7a2002bc6c
Merge pull request #1991 from ogayot/console-conf-uc24-next-screen
console-conf: fix calls to prev_screen without await
2024-05-10 14:32:55 +02:00
Chris Peterson 7fedee55fa identity: refactor requirements tests 2024-05-08 09:28:47 -07:00
Chris Peterson 88f8b21633 identity: move config validation to load_autoinstall_data
Moves the logic for checking if user-data or identity section is
provided (on server) in the autoinstall config to the
load_autoinstall_data function. Without this change, the exception
thrown in apply_autoinstall_config won't halt the installer until
the postinstall steps (LP: 2060547).
2024-05-08 09:28:47 -07:00
Chris Peterson 45d0c7ab87 network: drop logic to split out wifi config
In commit 9ecc4060b (PR #1911), we changed the permissions of the
written netplan config files to be stricter but still retained the
logic to separate out the wifi information. Since these both are
likely to contain secrets and also have the same permissions, we can
keep the config merged.
2024-05-07 14:58:53 -07:00
Michael Hudson-Doyle 86282f5721 refactor to avoid checking the labels in the live layer twice 2024-05-07 11:07:07 +02:00
Michael Hudson-Doyle c7fd905c6b allow system definition to be in live layer
Rather than always assuming it has to be mounted in from the layer to be
installed (snapd will now populate the seed in the target system when
its install API is called if it is empty).
2024-05-07 11:07:07 +02:00
Chris Peterson c6a1b583de
Merge pull request #1972 from Chris-Peterson444/reset-partition-bug
filesystem: reset-partition size bug
2024-05-06 12:27:36 -07:00
Chris Peterson 652f73209c filesystem: reset-partition size bug
In python, bool is a subclass of int so we can't use isinstance
to check if the user specified a size for the reset partition.
This causes autoinstall with "reset-partition: True" and
"reset-partition-only: true" to crash the installer due to creating
a reset-partition of size 1 (LP: #2061042).
2024-05-06 10:41:15 -07:00
Michael Hudson-Doyle b2e9393ddb
Merge pull request #1992 from mwhudson/rename-core-integration-test
rename "core" examples to "core-desktop"
2024-05-07 03:04:04 +12:00
Michael Hudson-Doyle d9f4f721fb rename "core" examples to "core-desktop"
We'll hopefully be able to install other kinds of core system soon.
2024-05-06 16:05:50 +02:00
Olivier Gayot 0398ec8b0e console-conf: fix calls to prev_screen without await
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-06 12:42:11 +02:00
Michael Hudson-Doyle 771fc1355b
Merge pull request #1984 from mwhudson/non-exhaustive-enums
subiquity.common.serialize: add a way to have a "non-exhaustive" enum
2024-05-05 18:19:15 +12:00
Michael Hudson-Doyle e3f16aaded use NonExhaustive to make snapdapi.Role an enum again 2024-05-03 17:49:20 +12:00
Michael Hudson-Doyle 5605942e70 Add a way to annotate the result of a asynchronous snapd operation 2024-05-03 17:49:20 +12:00
Michael Hudson-Doyle b53c1fffb7 subiquity.common.serialize: add a way to have a "non-exhaustive" enum
We use the subiquity.common.api stuff to talk to snapd, and use
enumerations to describe several field names. This is a bit of a
landmine in some situations because snapd can add a value to the set of
possible return values and thus cause serialization to fail. Rather than
just giving up on all of the typo-resistance of declaring enums for API
types, this adds a way to mark an enumeration as "non-exhaustive":
values that are part of the declared enum will be deserialized as values
of the enum but values that are not will be passed straight through (as
strings, in all the cases used in snapdapi.py), which conveniently will
never compare equal to an enumeration. This should let us just declare
the values of the enumerations we actually care about and not break if
we don't declare every value snapd actually uses.
2024-05-03 17:49:20 +12:00
Michael Hudson-Doyle a59ef9fba0 serialize a dict with enum keys that serialize as strings as an object
Rather than as a list of [key, value] pairs.
2024-05-03 17:49:17 +12:00
Chris Peterson 396e4d5a87
Merge pull request #1989 from Chris-Peterson444/spelling-hook-no-filenames
pre-commit: don't pass file names to spell check
2024-05-02 13:53:33 -07:00
Chris Peterson b56ea4508f pre-commit: don't pass file names to spell check
With "pass_filenames: True" (the default) the spell check entry
will be invoked as "make -C doc spelling <file1> <file2> ..."
which will cause the default Make target to be run for the specified
files, leading to errors like:

. .sphinx/venv/bin/activate; sphinx-build -M doc/some_file "." "_build"
Running Sphinx v7.3.7

Sphinx error:
Builder name doc/some_file not registered or available through entry point

Since the spelling target will check all files, we can suppress sending
any filenames.
2024-05-02 10:44:32 -07:00
Olivier Gayot d4a51027d9 Merge pull request #1944 from ogayot/noble-ui-rework
Fix UI so it runs properly with modern urwid
2024-05-02 14:25:11 +02:00
Olivier Gayot 144a2adf49 spinner: pass the app to the spinners, to make the screen redraw 2024-05-02 14:07:35 +02:00
Olivier Gayot 592714279c spinner: don't restart the spinner when .start() is called
Previously, when we called spinner.start(), we would automatically call
.stop() first to reset it.

Unfortunately, after calling stop(), the spinner mutates its visual
representation to become invisible using .set_text("").

This is a problem because after disappearing, the spinner does not
reappear instantly, which causes visual glitches depending on how often
we redraw the screen.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Olivier Gayot 0987dc5a7a spinner: add the ability to redraw after spinning
Every time a spinner "spins", it changes its visual representation. In
order for the user to see a smooth animation, we need to redraw the
spinner after each iteration. Hopefully this is not too much when
multiple spinners are visible at the same time.

For that, we give the option to pass the application to the spinner, so
that we can request a screen redraw after each iteration.

Alternatively, the user can decide not to pass the application to the
spinner, and to manage the animation themselves using calls to .spin()

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Olivier Gayot a81caf7f65 spinner: add a debug mode with extra logging
Spinners run very quickly and generate a lot of events. If we forget to
stop() a spinner, it will continue running forever until the event loop
is closed.

We now add an optional debug parameter that will cause spinner events to
be logged. It is very useful to find out if we forgot to stop spinners.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Olivier Gayot e3e365de89 ssh: stop the SSH spinner after importing a key
well it's not enough because closing the overlay only gets closed if the
user clicks on cancel

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Olivier Gayot 76815d6fa1 views: redraw screen after receiving event
Views that are dynamically updated using asynchronous events that are
handled by urwid need to be redrawn.

Ensure that such events trigger a redraw.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Olivier Gayot e129c13590 view: add way to redraw screen if the view is visible
Views can now redraw themselves using the request_redraw_if_visible()
method. Behind the scenes, it will look if the view is the currently
visible view and skip the redraw otherwise.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-05-02 14:07:35 +02:00
Dan Bungert e3b0805d3c
Merge pull request #1988 from dbungert/test-apt-mountpoint-install-tree
apt: fix mountpoint-install-tree test write dir
2024-05-01 18:21:11 -06:00
Chris Peterson 1ef2b0741a cc-extract: don't unnecessarily access data
We currently don't have plans to do anything with the _data_ of the
keys that fail to validate by cloud-init; and trying to access this
data has the potential to crash the installer if it doesn't exist,
at least at the top level (LP: #2062988).
2024-05-01 16:20:03 -07:00
Dan Bungert acf88ac452 apt: fix mountpoint-install-tree test write dir
test_run_apt_config_check currently writes to curdir, update that to a
tempdir instead.
2024-05-01 16:30:56 -06:00
Michael Hudson-Doyle e1ca8731c7
Merge pull request #1986 from mwhudson/begin-relicensing
relicense code outside of subiquity to GPLv3-only
2024-04-30 09:58:40 +12:00
Michael Hudson-Doyle 9ff9d6c36f use newer version of AGPL-3 (very minor changes) 2024-04-30 09:58:15 +12:00
Dan Bungert a73d997b5d
Merge pull request #1983 from dbungert/lp-2063252-cryptsetup-warns
filesystem: swap options
2024-04-29 15:18:28 -06:00
Michael Hudson-Doyle 34afb5b40c update license headers outside of subiquity package 2024-04-29 09:28:40 +12:00
Michael Hudson-Doyle 295b0455c2 update license metadata 2024-04-29 09:22:04 +12:00
Dan Bungert 389a50e194
Merge pull request #1982 from dbungert/quick-test-udb
quick-test: handle ubuntu-desktop-bootstrap
2024-04-26 12:16:17 -06:00
Dan Bungert 129623cc6b quick-test: handle ubuntu-desktop-bootstrap 2024-04-26 11:51:02 -06:00
Olivier Gayot 65f8ef50d4
Merge pull request #1981 from ogayot/utcnow
Replace deprecated uses of datetime.datetime.utcnow
2024-04-26 15:58:47 +02:00
Olivier Gayot 1d7c7c051c
Merge pull request #1978 from ogayot/restricted-block-probing+nvme
filesystem: probe NVMe controllers when running the restricted probe
2024-04-26 09:14:05 +02:00
Dan Bungert 3f2529bc49 filesystem: swap options
Under some plymouth configs, cryptsetup shows warnings on boot for
underspecified cryptoswap options.  This makes the warnings go away, but
we've hardcoded some options that may change in the future.

LP: #2063252
2024-04-25 18:30:05 -06:00
Olivier Gayot c18d434439 file-util: replace use of deprecate datetime.datetime.utcnow()
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 17:51:14 +02:00
Olivier Gayot fa8e49457b ubuntu-advantage: compare date from two /aware/ datetime objects
The current implementation attempts to compare two datetime objects
by comparing the value returned by .timestamp().

However, one of the objects is an /aware/ datetime and the other is a
/naive/ datetime.

When calling .timestamp() on a naive datetime object, the function
expects the datetime object to represent local time. However, in our
scenario, it was UTC time.

Therefore, the comparison is slightly inaccurate and can end up
rejecting a token that is not yet expired ; or accepting one that is
about to expire.

In practice, this should rarely be a problem (a few hours is not a big
deal). But we now compare two /aware/ datetime objects to make the
comparison more correct.

Also, datetime.datetime.utcnow() (which returns a naive datetime object)
is deprecated in favor of datetime.datetime.now() (which can return an
aware datetime object if timezone information is passed).

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 15:59:56 +02:00
Olivier Gayot 4695078c84 ubuntu-advantage: mention that fromisoformat can handle Z suffix in Python >= 3.11
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 15:53:39 +02:00
Dan Bungert 26bc08b694
Merge pull request #1979 from Chris-Peterson444/24.04.1-release-pics
doc: autoinstall release notes pictures
2024-04-24 17:36:47 -06:00
Chris Peterson f3e1d6977e doc: autoinstall release notes pictures 2024-04-24 16:34:30 -07:00
Olivier Gayot 92a47635d8 filesystem: probe NVMe controllers when running the restricted probe
If block probing times out, we rerun it with the restricted set of
probes. Sadly, the restricted set does not include "nvme" so we do not
enumerate NVMe controllers. This leads to the following error if NVMe
storage devices are present:

  File "subiquity/models/filesystem.py", line 1492, in reset
    self.process_probe_data()
  File "subiquity/models/filesystem.py", line 1512, in process_probe_data
    self._orig_config = storage_config.extract_storage_config(self._probe_data)[
  File "/site-packages/curtin/storage_config.py", line 1420, in extract_storage_config
    tree = get_config_tree(cfg.get('id'), final_config)
  File "/site-packages/curtin/storage_config.py", line 313, in get_config_tree
    for dep in find_item_dependencies(item, sconfig):
  File "/site-packages/curtin/storage_config.py", line 283, in find_item_dependencies
    _validate_dep_type(item_id, dep_key, dep, config)
  File "/site-packages/curtin/storage_config.py", line 230, in _validate_dep_type
    raise ValueError(
ValueError: Invalid dep_id (nvme-controller-nvme0) not in storage config

Fixed by also enumerating NVMe controllers as part of the restricted
probe operation.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-23 09:46:39 +02:00
Dan Bungert dbcf723676
Merge pull request #1977 from dbungert/lp-2063059-ai-codecs
doc: fix indent in reference of codecs.install
2024-04-22 07:35:05 -06:00
Dan Bungert 2afd7f2fa5 doc: fix indent in reference of codecs.install 2024-04-21 18:08:49 -06:00
Dan Bungert 74c37fe0c2
Merge pull request #1976 from ogayot/curtin-string-interpolation
snapcraft: bump curtin rev for ZFS string interpolation fix
2024-04-17 08:23:42 -06:00
Olivier Gayot 4bbab28588 snapcraft: bump curtin rev for ZFS string interpolation fix
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-17 14:50:10 +02:00
Olivier Gayot aaf0d56472
Merge pull request #1968 from ogayot/server-ignore-mirror-test-offline
mirror: if the mirror test fails, suggest an offline install
2024-04-17 10:12:55 +02:00
Olivier Gayot 0bb4915c9f mirror: if mirror test fails, suggest an offline install
In the mirror screen, if the test fails and the user decides to ignore
the failure, we used to continue the installation normally ; which in
most scenarios resulted in an error at a later stage of the
installation.

Instead, we now revert to an installation without network (i.e., only
packages from the pool are considered for installation) if the user
decides to ignore the failure.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-17 09:57:15 +02:00
Dan Bungert ac60b184ff
Merge pull request #1975 from ogayot/v2-systems-log-error
storage: log snapd response text when v2/systems/{system} or v2/snaps/{snap} fails
2024-04-16 16:53:47 -06:00
Olivier Gayot b2f9ce3649 refresh: log snapd response text when v2/snaps/{snap} fails
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-16 14:59:37 +02:00
Olivier Gayot 3e9d9762fb storage: log snapd response text when v2/systems/{system} fails
When the request to v2/systems/enhanced-secureboot-desktop (or
equivalent) fails, Subiquity did not capture the reason. This makes
it difficult to understand why this call sometimes fails. We now log the
response text to understand better what's going on.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-16 14:03:01 +02:00
Dan Bungert 2550aaa7ea
Merge pull request #1974 from dbungert/quiet-splash
curtin: desktop grub.replace_linux_default False
2024-04-15 17:21:47 -06:00
Dan Bungert ecfe394bd0 curtin: desktop grub.replace_linux_default False
Grub provides "quiet splash" for GRUB_CMDLINE_LINUX_DEFAULT out of the
box, but curtin rewrites that value and drops both "quiet" and "splash".
On desktop, retain "quiet splash".

This should be configurable via autoinstall if this change is undesired.
2024-04-15 15:55:41 -06:00
Dan Bungert 5226839467
Merge pull request #1973 from dbungert/lp-2057661
snapcraft: rev for more zfs / udev fixes
2024-04-15 08:11:01 -06:00
Dan Bungert 26d1e197eb snapcraft: rev for more zfs / udev fixes 2024-04-14 11:40:22 -06:00
Dan Bungert 75200b8091
Merge pull request #1971 from ogayot/fallback-offline-install-by-default
mirror: switch default policy to OFFLINE_INSTALL by default
2024-04-12 08:19:48 -06:00
Olivier Gayot 01338fae05 mirror: switch default policy to OFFLINE_INSTALL by default
Automated installations and desktop installations will now switch to an
offline installation by default. In this mode, only packages from the
pool will be fetched.

This should allow the installation to proceed when installing from a
private network without external access to the internet.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-12 14:37:02 +02:00
Olivier Gayot 01f4db5894
Merge pull request #1970 from dbungert/lp-2060695-dpkg-grub
models/subiquity: disable cc_dpkg_grub
2024-04-12 10:08:48 +02:00
Dan Bungert 037a8c2ece models/subiquity: disable cc_dpkg_grub
On first boot, there appear to be cases where the cc_dpkg_grub module in
cloud-init is not doing the right thing, which are to be sorted out.
But for first boot to happen we have a working boot config, so let's not
perturb that.

LP: #2060695
2024-04-11 16:47:43 -06:00
Dan Bungert 1b7fc279ec
Merge pull request #1967 from dbungert/doc-makefile
Doc makefile
2024-04-11 08:13:18 -06:00
Dan Bungert 13d68ecf89 pre-commit: simplify spelling invocation 2024-04-11 08:10:14 -06:00
Dan Bungert 1dd2388def doc: fix Makefile dependencies 2024-04-11 08:10:14 -06:00
Dan Bungert 2821206661
Merge pull request #1966 from dbungert/lp-2057837-home-dataset
filesystem: datasets for /root and /home
2024-04-11 08:09:13 -06:00
Dan Bungert 19ca4b7901 filesystem: datasets for /root and /home
Partial implementation of LP: #2057837.  To create a specific dataset
for /home/$user, this requires moving where and when users are created,
which is not in plan for 24.04.
2024-04-11 08:02:11 -06:00
Olivier Gayot 5553793f43 mirror: allow to query or set if archive/mirror is used during install
The /mirror GET and POST endpoints now include a boolean field named
"use_during_installation".

* if set to True, the mirror information will be used during
  installation to fetch packages online.

* if set to False, we will only fetch packages from the pool.

In either case, the mirror information will still be used to build the
etc/apt/ directory in the target system.

Currently, the way use_during_installation is implemented is coupled
with the force_offline property of the network model. This means that
Ubuntu Pro and other stuff will be disabled too if we're skipping the
use of the archive.

NOTE: the default value for "use_during_installation" in the POST
endpoint is `null` ; which means that we should not change the current
value of force_offline.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-11 11:00:26 +02:00
Chris Peterson 979f546f27
Merge pull request #1964 from Chris-Peterson444/pre-commit-spelling
pre-commit: add spelling check
2024-04-10 14:18:25 -07:00
Olivier Gayot 6db2ff8113
Merge pull request #1961 from ogayot/lvm-size-max
storage: fix UI crash when partition size gets capped
2024-04-09 16:58:06 +02:00
Robert Krátký 797f223705
Merge pull request #1963 from rkratky/review-of-1956
Language and formatting fixes as a follow up to #1956
2024-04-09 13:14:37 +02:00
Robert Krátký 76440813bd
Merge pull request #1962 from rkratky/FR-5798_autoinstall-intro
Better introduction to autoinstall
2024-04-09 13:13:05 +02:00
Robert Krátký ce6dd33e80 Better introduction to autoinstall. 2024-04-09 12:58:51 +02:00
Chris Peterson 5a1b0e35d9 pre-commit: add spelling check
Check for any changed .rst files in the doc/ directory and run
`make spelling` if any changes are detected.

The files directives per hook have to be more restrictive than the
global hook, so this also slightly changes the files match for
the other hooks.
2024-04-05 08:58:54 -07:00
Robert Krátký 219f55258d Language and formatting fixes. 2024-04-05 15:58:08 +02:00
Olivier Gayot 15f6848dc6 storage: fix UI crash when partition size gets capped
In cda6c54b87, we introduced the accurate
size vs human readable size for the size form fields. Unfortunately, we
also introduced a regression when the size gets capped (when it exceeds
the maximum size defined on the form). Currently, specifying a size that
is beyond the maximum value fails when submitting the form with:

  [...]
  File "urwid/wimp.py", line 543, in keypress
    self._emit('click')
  File "urwid/widget.py", line 461, in _emit
    signals.emit_signal(self, name, self, *args)
  File "urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "subiquitycore/ui/form.py", line 486, in _click_done
    emit_signal(self, "submit", self)
  File "urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "subiquity/ui/views/filesystem/partition.py", line 636, in done
    handler(self.disk, spec, partition=self.partition, gap=self.gap)
  File "subiquity/common/filesystem/manipulator.py", line 334, in logical_volume_handler
    lv.size = align_up(spec["size"])
              ^^^^^^^^^^^^^^^^^^^^^^
  File "subiquity/models/filesystem.py", line 1382, in align_up
    return (size + block_size - 1) & ~(block_size - 1)
            ~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'BoundFormField' and 'int'

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-05 11:20:34 +02:00
Chris Peterson 16bcfcf7ae
Merge pull request #1956 from Chris-Peterson444/top-level-autoinstall
Allow top-level autoinstall in all delivery methods
2024-04-04 14:32:37 -07:00
Chris Peterson 26761b4f1a doc: update wordlist 2024-04-04 14:26:12 -07:00
Chris Peterson aed2905db0 doc: consistent top-level autoinstall keyword
Also deletes a note to users about not needing the autoinstall keyword
in non cloud-config delivery methods. We should keep a hint in the reference
that this is available, but generally let's always suggest to use the
top-level autoinstall keyword.
2024-04-04 14:26:08 -07:00
Chris Peterson ecfc3a4df0 scripts: support top-level autoinstall in validator 2024-04-04 14:21:02 -07:00
Chris Peterson ba3dbb52ef autoinstall: Allow "autoinstall" as top-level key 2024-04-04 14:20:58 -07:00
Chris Peterson a25f2e03c1 server: refactor reading in autoinstall
Factor out reading the autoinstall data from the loading function.
Also add context logging to both the loading and reading functions.
2024-04-04 13:57:35 -07:00
Chris Peterson d77bfbe1e0
Merge pull request #1954 from Chris-Peterson444/cloud-init-schema-failures
Cloud init schema failures
2024-04-03 16:35:07 -07:00
Chris Peterson 1b2c6befbb client: CloudInitSchemaValidationError in error overlay 2024-04-03 11:22:47 -07:00
Chris Peterson 8a31c7e72f autoinstall: Query cloud-init for schema failures
Users attempting to do autoinstall may incorrectly send autoinstall
directives as cloud-config, which will result in cloud-init
schema validation errors. When loading autoinstall from cloud-config,
we now check to see if there are any cloud-init schema validation errors
and warn the user. Additionally, if the source of the error is from
a known autoinstall error, we inform the user and halt the installation
with a nonreportable AutoinstallError.
2024-04-03 11:22:44 -07:00
Olivier Gayot 224d9cde1e
Merge pull request #1957 from ogayot/target-resize-part-mounted
filesystem: don't suggest target resize if part is mounted
2024-04-02 09:53:31 +02:00
Dan Bungert 72bac06005
Merge pull request #1958 from dbungert/ubuntu-desktop-bootstrap
fix a few bootstrap renames
2024-03-28 18:34:25 -06:00
Dan Bungert 12934d7b97 scripts: update for bootstrap 2024-03-28 17:20:43 -06:00
Dan Bungert 3422e3be2e server: fix bootstrap log 2024-03-28 17:20:21 -06:00
Olivier Gayot c093059919 filesystem: don't suggest target resize if part is mounted
When a partition is mounted in the live environment (either by casper or
another process) and is selected for resize, curtin will fail when
running e2fsck (or equivalent) with an error such as:

  Resize requested for format ext4
  Resizing /dev/sdb4 of type ext4 down to 12546211840
  Running command ['e2fsck', '-p', '-f', '/dev/sdb4'] with allowed return codes [0] (capture=False)
  /dev/sdb4 is mounted.
  e2fsck: Cannot continue, aborting.

  An error occured handling 'disk-sdb': ProcessExecutionError - Unexpected error while running command.
  Command: ['e2fsck', '-p', '-f', '/dev/sdb4']
  Exit code: 8

This is what happens when casper creates a partition on the installer
media to store /var/log and /var/crash. Usually the partition is large
enough to install Ubuntu so a GuidedStorageTargetResize scenario gets
emitted.

This patch prevents the emission of a GuidedStorageTargetResize scenario
if the partition is marked as mounted already.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-28 15:59:24 +01:00
Olivier Gayot 020dcc0b88 ui: redraw screens after moving from one screen to another
Wieh urwid > 2.1.2, the screen is only redrawn after urwid handles an
event (e.g., keypress, resize, ...) or an urwid alarm (it is like a
timer).

All other changes made to the UI do not trigger a screen redraw. We now
redraw the screen properly after moving from one screen to another.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-28 10:04:11 +01:00
Olivier Gayot eca86c58da
Merge pull request #1955 from ogayot/grub2-wa-drop
Revert grub2 workaround for cloud_style_installation
2024-03-27 14:35:14 +01:00
Olivier Gayot 092de2e598 Revert "debconf-selections: work around grub2 bug until it is fixed"
To workaround a grub2 bug (LP: #2055294) causing 24.04 installations to
fail, we added a default debconf-selection in Subiquity.

grub2 2.12-1ubuntu4 fixes the issue and migrated to the noble release
pocket on 2024-03-06.

We can now drop the workaround.

https://launchpad.net/ubuntu/+source/grub2/2.12-1ubuntu4

This reverts commit cffce32305.
2024-03-26 10:27:00 +01:00
Olivier Gayot cdb56a0d9f
Merge pull request #1952 from ogayot/zzzz-remove
Ensure the zzzz-temp-installer-unattended-upgrade file does not end up on the target system
2024-03-26 10:07:19 +01:00
Chris Peterson f307b87426 context: also send events to log 2024-03-25 20:18:00 -07:00
Chris Peterson ce0683adec
Merge pull request #1947 from Chris-Peterson444/strict-top-level-keys
Enforce top-level keys
2024-03-25 19:59:13 -07:00
Chris Peterson d812919366 autoinstall: enforce top-level keys
Subiquity currently ignores invalid top-level keys, but this has likely
been a major source of confusion of autoinstall capabilities.

In future versions, the following autoinstall config will throw an
AutoinstallValidationError:

    version: 2
    interactive-sections:
        - identity
    literally-anything: lmao

This patch adds warnings for version 1 and will begin to throw
an AutoinstallValidationError on these instances in version 2 once
it has been enabled.
2024-03-25 19:52:39 -07:00
Chris Peterson 5da4f9b777
Merge pull request #1946 from Chris-Peterson444/interactive-context-reading
Display new reporting events in the TUI
2024-03-25 17:14:33 -07:00
Chris Peterson 6e2f256f08 progress: show log-like reporting events
Allows for warning and error type events to be printed to the progress
view.
2024-03-25 17:07:55 -07:00
Chris Peterson 735771a494
Merge pull request #1945 from Chris-Peterson444/context-logging
Improve context logging
2024-03-25 17:05:24 -07:00
Dan Bungert 5496effe45
Merge pull request #1953 from dbungert/rev-flock-ex
snapcraft: rev for flock-ex
2024-03-25 16:59:23 -06:00
Dan Bungert ed9aab0289 snapcraft: rev for flock-ex 2024-03-25 11:31:46 -06:00
Olivier Gayot 2d8a1ea9b3 install: use pathlib.Path.write_bytes construct instead of open + write
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-25 18:04:40 +01:00
Olivier Gayot 092cbf14df install: remove zzzz-temp-installer-unattended-upgrade after running UU
On recent installations of Ubuntu, the zzzz-installer-unattended-upgrade
file ended up in the etc/apt/apt.conf.d directory of the target system.
It is supposed to be a temporary file intended for one time invocation
of unattended-upgrade at the end of the installation.

Let's remove the file after unattended-upgrades finishes using a
try ... finally construct.

The previous implementation was doing the call to UU inside the
with open(...) block, after a manual call to .close(). This is
unnecessary, the file is automatically closed at the end of the with
block.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-25 18:04:40 +01:00
Dan Bungert bef10517bd
Merge pull request #1951 from ogayot/ubuntu.sources.curtin.old
snapcraft: bump curtin revision for apt-config warning fix
2024-03-25 10:53:52 -06:00
Olivier Gayot 09b79aeaf2 snapcraft: bump curtin revision for apt-config warning fix
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-25 14:23:06 +01:00
Dan Bungert e54354b8a3
Merge pull request #1950 from dbungert/lp-2058394-no-format-obj-on-unformatted
filesystem: handle empty string fstype partitions
2024-03-24 20:42:56 -06:00
Dan Bungert fc05e77a4c filesystem: handle empty string fstype partitions
This should not result in a format object being created, which curtin
doesn't like.  Normalize to None as the fstype to skip format object
creation.

LP: #2058394
2024-03-22 16:33:21 -06:00
Chris Peterson ed8971f0b2 server: Create an interface for server event listeners 2024-03-22 07:58:10 -07:00
Dan Bungert 03b68337d9
Merge pull request #1949 from dbungert/autoinstall-user-data-fix-comment
install: fix comment in autoinstall-user-data
2024-03-22 08:04:43 -06:00
Dan Bungert 1ec1c33da1 install: fix comment in autoinstall-user-data 2024-03-21 18:05:41 -06:00
Chris Peterson 0eb05d31e1 client: support log-like events in non-interactive installs
This changes the journal listener callback in the non-interactive
scenario to support all types of events, not just start and finish
events.

This also modifies the journal listener in the non-interactive scenario
to not seek all the way to the newest entry. In non-interactive installs,
the server can get pretty far into the installation by the time the client
can connect, so any important warnings/errors that the server reports
before then wouldn't be printed to the console by the client otherwise.
2024-03-20 16:14:28 -07:00
Chris Peterson 980411a670 reporting: add new logging type events
Adds new reporting type events "INFO", "WARNING", and "ERROR" to be
used for context logging. These can be invoked with the new `.info`,
`.warning`, and `.error` methods on the context object accordingly.
Useful for things like warning/errors on autoinstall configuartions.
2024-03-20 16:14:28 -07:00
Chris Peterson c25e28ef2c server: refactor _maybe_push_to_journal 2024-03-20 16:14:28 -07:00
Chris Peterson e0f02a74d7 server: add tests for publishing journal events
Currently there is a lot of state used to determine which events get
published to the journal. This is a baseline before changing behavor.
2024-03-20 16:14:28 -07:00
Dan Bungert 4fba6aa7d3
Merge pull request #1948 from dbungert/workflow-remove-lunar
workflows: -lunar
2024-03-20 06:24:38 -06:00
Dan Bungert 29868998cb workflows: -lunar 2024-03-19 23:02:00 -06:00
Olivier Gayot 50dacee4a1
Merge pull request #1942 from ogayot/warnings-capture
logging: capture warnings emitted using warnings.warn()
2024-03-19 13:30:29 +01:00
Olivier Gayot cc15d645f4
Merge pull request #1943 from ogayot/curl-timeout
tests: terminate curl processes on timeout
2024-03-19 09:59:57 +01:00
Olivier Gayot 612a8bbfc9 tests: terminate curl processes on timeout
When ensuring that the system-setup process can only be connected to
on the loopback interface, we spawn a bunch of `curl --interface ...`
processes. If the connection times out (which is the expectation in most
scenarios), the curl processes ended up not being terminated. Not only
this is small waste of resources, this is also causing errors on noble:

Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x745692661300>
Traceback (most recent call last):
  File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 126, in __del__
    self.close()
  File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 104, in close
    proto.pipe.close()
  File "/usr/lib/python3.12/asyncio/unix_events.py", line 568, in close
    self._close(None)
  File "/usr/lib/python3.12/asyncio/unix_events.py", line 592, in _close
    self._loop.call_soon(self._call_connection_lost, exc)
  File "/usr/lib/python3.12/asyncio/base_events.py", line 793, in call_soon
    self._check_closed()
  File "/usr/lib/python3.12/asyncio/base_events.py", line 540, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

Fixed by terminating the curl processes (and waiting for them to
terminate) before exiting the script.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-19 09:21:31 +01:00
Chris Peterson 0773153ea0
Merge pull request #1940 from Chris-Peterson444/secureboot-kvm
kvm-test: add --secure-boot option
2024-03-18 09:01:44 -07:00
Olivier Gayot dfea447136 logging: capture warnings emitted using warnings.warn()
By default, warnings emitted by warnings.warn() will show on stderr. For
a TUI application, this is a problem because they will be displayed over
the UI and create visual glitches.

For parts of the UI that are regularly redrawn, the text of the warning
will eventually go away (sometimes instantly, making the warning
impossible to read).

For parts of the screen that are *not* regularly redrawn, the text of
the warning will stay until the user sends a Ctrl-L sequence.

We now make use of logging.captureWarnings() to redirect the warnings to
the log files. This prevents the UI glitches and if any warning is
emitted, we can actually find it in the logs.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-18 11:14:23 +01:00
Chris Peterson 11027c55d6 kvm-test: add --secure-boot option
Adds an option to configure the VM to load SecureBoot enabled firmware.
SecureBoot is a feature of UEFI, which means --boot (for legacy BIOS
boot) is incompatible with this flag. Providing both will result
in an error.

This will be useful for testing MOK enrollment behavior, as on reboot
you can confirm if you are presented with mokmanager or regular first
boot.
2024-03-15 15:16:39 -07:00
Chris Peterson 283cae41eb
Merge pull request #1937 from ogayot/kvm-test-nvme
kvm-test: add --disk-interface option taking either "nvme" or "virtio"
2024-03-14 15:00:53 -07:00
Olivier Gayot a874ee1235
Merge pull request #1938 from ogayot/doc-disk-match-vendor-model
doc: fix documentation of match specs for model and vendor
2024-03-14 19:22:58 +01:00
Dan Bungert 8795db334b
Merge pull request #1939 from dbungert/drop-os-prober
snapcraft: drop os-prober from the server snap
2024-03-14 11:30:06 -06:00
Dan Bungert 6fa59f5cdf snapcraft: drop os-prober from the server snap 2024-03-14 10:57:25 -06:00
Olivier Gayot 4ebfcc4fb3 doc: fix documentation of match specs for model and vendor
refs LP: #2056783

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-14 17:26:40 +01:00
Olivier Gayot 04e0418230
Merge pull request #1936 from ogayot/curtin-stas-only-of
Bump curtin rev for conditional nvme-stas installation
2024-03-14 12:38:54 +01:00
Olivier Gayot 1ae2e402b1 kvm-test: add --disk-interface option taking either "nvme" or "virtio"
The local disk that scripts/kvm-test.py creates unconditionally uses the
virtio interface. Recently in Subiquity, we did some work more closely
related to NVMe drives but kvm-test.py did not support that type of
interface.

We now add the possibility to specify the interface using the
--disk-interface option. It can only take two options:

  * --disk-interface nvme
  * --disk-interface virtio    (the default)

This should allow us to spot regressions (such as in LP: #2056730) with
more ease.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-14 10:47:05 +01:00
Olivier Gayot bd59804c36 snapcraft: bump curtin rev for conditional nvme-stas installation
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-14 09:48:05 +01:00
Olivier Gayot 0ba9dc9ed6
Merge pull request #1931 from Chris-Peterson444/cdrom-metadata
Move metadata collection to Curtin
2024-03-14 09:46:01 +01:00
Chris Peterson 5837eb90f0 model: remove reading /cdrom/.disk/info
Since Curtin now has a builtin hook to copy over information from
/cdrom/.disk, it's uncessary to repeat it in Subiquity.
2024-03-13 12:56:24 -07:00
Chris Peterson 56a785fe02 curtin: bump rev to pickup /cdrom/.disk hook
A new builtin curthook was introduced to address copying over
common metadata from /cdrom/.disk/ at install time. This addressed
copying /cdrom/.disk/info and /cdrom/.disk/ubuntu_dist_channel
(LP: #2037038).
2024-03-13 12:56:20 -07:00
Dan Bungert 7cbe4c9d61
Merge pull request #1934 from dbungert/lp-2051338
filesystem: autoinstall reformat_disk match raids
2024-03-13 12:24:03 -06:00
Dan Bungert 879b393eb5 filesystem: consider raids for has_bitlocker 2024-03-13 11:29:20 -06:00
Dan Bungert c84a94b9f9 filesystem: consider raids for use_gap 2024-03-13 11:29:20 -06:00
Dan Bungert ab7391ee8a filesystem: disk action match fail exception
Move the exception raised by manual storage actions to AutoinstallError
2024-03-13 11:29:20 -06:00
Dan Bungert e6dde2e324 filesystem: basic match logging 2024-03-13 11:29:20 -06:00
Dan Bungert d81bb5e247 filesystem: autoinstall reformat_disk match raids
Raise AutoinstallError on failed match while we're at it, better than
the "disk is None" scenario today.
2024-03-13 11:29:20 -06:00
Dan Bungert c088adf90f
Merge pull request #1935 from ogayot/curtin-systemd-offline
snapcraft: bump curtin revision for the SYSTEMD_OFFLINE handling and deb822 sources
2024-03-13 10:42:15 -06:00
Olivier Gayot 3fd013205f snapcraft: bump curtin revision for the SYSTEMD_OFFLINE handling
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-03-13 15:57:48 +01:00
Dan Bungert 263520ad0b
Merge pull request #1932 from dbungert/yaaaaaml
quickstart: fix autoinstall indents
2024-03-11 07:14:22 -06:00
Dan Bungert 9111298511 quickstart: fix autoinstall indents 2024-03-09 21:51:39 -07:00
Dan Bungert fdf72cb575
Merge pull request #1928 from dbungert/allow-skip-identity
Allow skip identity
2024-03-08 06:28:30 -07:00
Dan Bungert 7361d22048
Merge pull request #1929 from rkratky/FR-6783_add-ubuntu-image
Add ubuntu-image reference
2024-03-07 18:38:38 -07:00
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
Olivier Gayot 8e3751f647 lsb-release: split the function so it can be tested with more ease
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 11:56:31 +01:00
Dan Bungert 2883cad416
Merge pull request #1880 from medicalwei/fixed-reset-partition-size
Accept a fixed partition size for reset partition in autoinstall.yaml
2024-02-12 20:21:10 -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
Olivier Gayot 3f3bb29c2e ssh: call GitHub / Launchpad service, not ssh_import_id
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 3ac1810b0c ssh: use view-helpers for detecting the confirmation key overlay
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 5861968e80 view-helpers: add function waiting for an overlay to be displayed
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 0f3c53c283 ssh: drop redundant use of context when importing key
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot f5ecece153 ssh: have a button to show a key
When selecting a SSH identity, the user can open a dialog showing the
contents of the key.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot feaf0601d3 ssh: add identity table with ability to remove key
A new table shows all the SSH identities/keys that are currently
imported. The user can select one and delete it from the list if he
wants to.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 446bf3814d answers: move ssh-import-id directive to SSH section
When running answers-based automation, the SSH controller looks into
more than one section to find ssh-import-id directives.

If the "SSH" section exists, then it is where the ssh-import-id
directives must be placed. However, if the section does not exist, the
controller will also look for ssh-import-id directives in the "Identity"
section.

The answers.yaml file used this special mechanism. This is fine.
However, if one adds a SSH section to customize other settings (e.g.,
install_server, pwauth), then the ssh-import-id directives in the
Identity section suddently get ignored ; which is confusing and looks
as if there is a bug.

Let's move ssh-import-id directives to the SSH section.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 13:59:23 +01:00
Yao Wei (魏銘廷) 61d748d549 doc: add Reset Partition to `autoinstall-reference.rst` 2024-02-12 16:49:51 +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 81ed199e17 ssh: dissociate key import from form submission
Previously, on the SSH screen, the ability to enable/disable the SSH
server and the ability to import a SSH identity were both covered by a
single form. Therefore, there was no way to import multiple identities.

This change adds a button "Import SSH key" which opens a new form to
import an identity. The button can be pressed multiple times and the
resulting identities are all submitted when the user clicks on Done.

Furthermore, navigating back to the SSH screen does not "forget" already
imported identities.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 17:53:14 +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
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 ea86499691 subiquitycore/snapd: add response set serving objects from memory
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-08 07:34:48 +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 8cfb2406b0 subiquitycore: allow to register callbacks for POST for fake snapd connections
Allow registration of handlers for POST.

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
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
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
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
Olivier Gayot 20b131ce07 ubuntu-pro: display warning message on pre-releases
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-26 10:54:59 +01:00
Chris Peterson f6a7819ef9 autoinstall: unittests to validate autoinstall schema
Provided autoinstall data is already validated against a specific
schema by the relevant controller, but these schemas themselves
are never validated against a meta schema to guarantee they are
valid JSON schemas. This patch adds unit tests for each controller,
as well as SubiquityServer, to validate their autoinstall schema
against the latest JSON meta schema draft (that is supported in
jsonschema). A particular draft validator can be used instead by
specifying meta schema in the schema definition.
2024-01-25 13:50:22 -08:00
Dan Bungert 9264e23631 workflows: +noble 2024-01-25 14:31:16 -07:00
Dan Bungert 601650b65d
Merge pull request #1896 from dbungert/workflow-drop-focal
workflows: -focal
2024-01-25 14:25:02 -07:00
Dan Bungert 994097ef1f workflows: -focal 2024-01-25 14:07:09 -07:00
Olivier Gayot 9d4bd5708c
Merge pull request #1893 from ogayot/ssh-fixes
Fix empty list of authorized_keys in /ssh endpoint
2024-01-25 17:35:30 +01:00
Yao Wei (魏銘廷) 7923aee7cd factory-reset: remove factory reset EFI boot entry 2024-01-25 11:08:34 +08:00
Yao Wei (魏銘廷) cf91a281fa make factory reset GRUB entry chainload into reset partition GRUB 2024-01-25 11:03:48 +08:00
Yao Wei (魏銘廷) 58bfe12d21 reset_partition accepts fixed size 2024-01-25 10:23:14 +08:00
Olivier Gayot 2692173a18 ssh: drop unused variable from model
The SSHModel contained a ssh_import_id member variable. According to the
comment, it was originally meant to store meta-data about a SSH key ;
and was supposed to allow showing some sort of info back in the SSH view
if the user decides to go back.

I suspect that this variable has been unused for a long time.
Furthermore, it can only hold information about a single SSH key and we
support multiple keys..

Let's get rid of it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 18:47:29 +01:00
Olivier Gayot b1cdd74775 ssh: pass the autorized_keys in GET /ssh
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 18:47:29 +01:00
Chris Peterson 5a301bcdd6
Merge pull request #1889 from Chris-Peterson444/update-reame-with-docs
Update README with hosted documentation
2024-01-24 07:25:00 -08:00
Olivier Gayot ed5329dcff
Merge pull request #1887 from kubiko/deb-build-cleanup
debian: use 'install -D' instead 'mkdir + install'
2024-01-24 14:53:25 +01:00
Olivier Gayot d19171c052 ubuntu-pro: enable on noble, although it's not yet marked LTS
The /etc/lsb-release file currently on noble shows:

  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=24.04
  DISTRIB_CODENAME=noble
  DISTRIB_DESCRIPTION="Ubuntu Noble Numbat (development branch)"

Therefore, the Ubuntu Pro pages get skipped. This makes testing on noble
difficult, so make an exception for noble now and we'll drop it once
it's marked LTS.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 13:16:51 +01:00
Olivier Gayot 1f026ac539 apt: use pathlib instead of os
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 11:36:50 +01:00
Olivier Gayot 59704a1f1e mounter: add .pp() method returning a pathlib.Path instead of str
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 11:27:47 +01:00
Olivier Gayot cd234d416a mounter: support pathlib.Path in components
Instead of supporting only string components, mount.p() now supports
strings, pathlib.Path()s, or a combination of both.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 11:27:30 +01:00
Olivier Gayot bcfa6b1c9c mounter: use custom exception for absolute path error
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-24 11:22:35 +01:00
Michael Hudson-Doyle 162f00b773
Merge pull request #1885 from julian-klode/apt-no-main-sources-list
apt: Only backup/restore sources.list if it exists
2024-01-24 13:15:45 +13:00
Chris Peterson 20759840b9 controller tests: move setting autoinstall_default
Move the assignment of autoinstall_default to the relevant block
where it's being tested.
2024-01-23 14:10:11 -08:00
Olivier Gayot 9b612dac34 apt: ensure we always drop CDROM info from sources.list
Back when sources.list was always present, we would:
 * move the contents of sources.list to sources.list.d/original.list
 * write the CDROM info to sources.list so the CDROM cat be used as an
   APT source
 * restore the original sources.list file when .deconfigure() is called,
   effectively discarding CDROM info

Nowadays, there is no guarantee that sources.list exists. So restoring
the contents of sources.list may mean deleting sources.list if it wasn't
present in the first place.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-22 13:03:35 +01:00
Olivier Gayot 3064343f45 apt: add tests for deconfigure with and without network
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-22 13:03:35 +01:00
Olivier Gayot d7e84a176f
Merge pull request #1888 from ogayot/apport-title-show-curtin-step
apport: show name of curtin stage when an error occurs
2024-01-19 19:12:45 +01:00
Olivier Gayot f555d6800e apport: show name of curtin stage when an error occurs
When an error occurs during the execution of a "$ curtin install"
invocation, the associated bug report would be titled:

  "install failed crashed with CalledProcessError"

This is not very user friendly and it does not immediately give any
insight on:

With the number of reports that we receive these days, I think
classifying these reports would make our life a bit easier, and possibly
make the users understand better what's going on.

This change adds a wat to detect if a bug report is the result of a
"$ curtin install" invocation failing. If it is, subiquity sets the
title of the bug report accordingly. Examples:

 * "partitioning crashed with CurtinInstallError"
 * "extract crashed with CurtinInstallError"
 * "curthooks crashed with CurtinInstallError"

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-19 12:10:35 +01:00
Chris Peterson 54b751cae0 readme: update contribution section wording 2024-01-18 11:23:58 -08:00
Chris Peterson 62de2b1311 readme: add Documentation section 2024-01-18 11:23:40 -08:00
Olivier Gayot eae97db849
Merge pull request #1886 from ogayot/probert-double-os-prober
filesystem: double probert timeout when running os-prober
2024-01-18 17:27:14 +01:00
Ondrej Kubik 9d34332be1 debian: use 'install -D' instead 'mkdir + install'
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-01-17 10:45:04 -08:00
Olivier Gayot 3d914e9e30 filesystem: double probert timeout when running os-prober
We know that running os-prober on some systems is slow, potentially very
slow, especially when multiple removable devices are present.

This results in many bug reports showing "block probing crashed with
TimeoutError".

For now, I suggest we double the probert timeout when os-prober is
involved.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-17 14:52:13 +01:00
Julian Andres Klode 5db34f84c8 apt: Only backup/restore sources.list if it exists
We backup the sources.list to a file in sources.list.d to be
able to insert our source first; if we do not have a sources.list
this is not necessary.

If an image uses ubuntu.sources, this logic also works fine as
sources.list that we write will be sourced before the ubuntu.sources.
2024-01-15 17:10:05 +01:00
Olivier Gayot 383a9d20f4 examples: update machine-configs to include NVMe controllers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-12 16:00:12 +01:00
Robert Krátký 753ce9f701
Merge pull request #1883 from rkratky/FR-6244_docs-update
Misc. docs updates and fixes
2024-01-12 15:41:38 +01:00
Olivier Gayot a16a69d489
Merge pull request #1879 from ogayot/nvme-o-tcp-probert-update
Update probert to get NVMe controllers information and add example file using it
2024-01-11 09:06:12 +01:00
Robert Krátký 562248af27 Fix Sphinx/rST warnings. 2024-01-10 16:17:57 +01:00
Robert Krátký b2552a3d96 Add search-bar Go button. 2024-01-10 16:17:57 +01:00
Robert Krátký f2504fe859 Update feedback button color. 2024-01-10 16:17:57 +01:00
Robert Krátký 36c115b4f4 Fix code-block copybutton default visibility. 2024-01-10 16:17:57 +01:00
Robert Krátký 0a5bdb9280 Update Sphinx extension names. 2024-01-10 16:17:50 +01:00
Olivier Gayot 1b58eaa6c6 snapcraft: bump probert to get NVMe controllers information
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-01-10 10:16:08 +01:00
Ondrej Kubik 67d829d008 console_conf: modify wrapper helper to consider consol-conf as snap
Modify wrapper to consider consol-conf installed as snap.
Prepare sshd finger prints to be used by consol-conf snap.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2024-01-05 22:37:53 +00:00
Chris Peterson e3a0f6d215
Merge pull request #1882 from Chris-Peterson444/link2doc-ai-user-data-FR-5802 2024-01-05 07:35:54 -08:00
Chris Peterson 5350d01715 ai: include link to docs in post-install user data
We write out the autoinstall data to make the install repeatable
but this should also include a reference to the autoinstall
documentation to increase usability.
2024-01-03 16:02:30 -08:00
Olivier Gayot 89c1ea2afe
Merge pull request #1881 from alfonsosanchezbeato/add-missing-dep
debian: add missing dependency for pyroute2
2024-01-02 16:45:58 +01:00
Alfonso Sánchez-Beato 96f3644a0c debian: add missing dependency for pyroute2 2024-01-02 16:24:35 +01:00
Olivier Gayot 3a55a14cc1 examples: add machine-config for NVMe-over-TCP
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-12-13 17:55:41 +01:00
Olivier Gayot ea909d1428
Merge pull request #1878 from ogayot/console-conf-network-crash
network: ensure we pass tasks to asyncio.wait
2023-12-12 10:03:48 +01:00
Olivier Gayot 0b7a4d16af network: ensure we pass tasks to asyncio.wait
In Python < 3.11, when passing a coroutine to asyncio.wait, it would
automatically be scheduled as a task. This isn't the case anymore with
Python 3.11. Now passing coroutines to asyncio.wait fails with:

 TypeError: Passing coroutines is forbidden, use tasks explicitly.

Let's ensure we schedule the coroutines as tasks before passing them on
to asyncio.wait.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-12-08 14:27:00 +01:00
Dan Bungert 93ab4f911c
Merge pull request #1877 from xnox/xnox/noble-packaging
Upgrade to noble, systemd files are now in /usr/lib
2023-11-29 13:14:29 -07:00
Dimitri John Ledkov bdea88c7ae
Upgrade to noble, systemd files are now in /usr/lib 2023-11-24 23:58:36 +00:00
Robert Krátký 69f74047b0
Merge pull request #1876 from rkratky/FR-5900_ui-titles
Unify UI screen titles and minor lang. fixes
2023-11-21 18:30:04 +01:00
Robert Krátký 97409bea6c Typo: Ubuntu Po -> Pro. 2023-11-21 14:06:07 +01:00
Robert Krátký 4e81b0d81d Unify UI screen titles and minor lang. fixes 2023-11-21 14:05:59 +01:00
Olivier Gayot 5c2dc13df6
Merge pull request #1868 from ogayot/kvm-test-profiles
kvm-test: have different profiles for server and desktop
2023-11-17 11:23:32 +01:00
Olivier Gayot afd6fca8b4 kvm-test: allow kvm-test.yaml to add/modify profiles
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-11-12 22:02:20 +01:00
Chris Peterson 7f3c137ba3
Merge pull request #1859 from Chris-Peterson444/update-readme-contribution-requirements
readme: make a contributing section and point to CONTRIBUTING.md
2023-11-09 11:35:41 +02:00
Chris Peterson 9074e966dc readme: make a contributing section and point to CONTRIBUTING.md
Updates the readme to point to the contributing guidelines document.
Include sections about the Ubuntu Code of Conduct, Contributor
License Agreement, where to file bugs, and where to submit
changes.

Signed-off-by: Chris Peterson <chris.peterson@canonical.com>
2023-11-07 16:35:52 +02:00
Olivier Gayot de4e126087 kvm-test: have different profiles for server and desktop
Booting Desktop and server live installer ISOs comes with different
platform requirements. When running kvm-test, we now accept the name of
a profile via the --profile option.

Profiles provide default settings for memory, disk size and extra QEMU
options. For now, two profiles are hard-coded: "server" - which is the
default and "desktop".

For desktop, we use two vCPU, 8 GiB of RAM, a 20 GiB disk and pass the
-device qxl option.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-11-07 14:36:07 +01:00
Dan Bungert 75a44b122c
Merge pull request #1866 from dbungert/fix-heading-links
doc: fix some link headings
2023-11-06 13:41:17 +02:00
Dan Bungert 253ecf0956
Merge pull request #1867 from dbungert/remove-old-documentation-folder
Remove old documentation folder
2023-11-03 17:53:42 +02:00
Dan Bungert 929a3df281 doc: update readme for removal of `documentation` 2023-11-02 18:32:56 +02:00
Dan Bungert 44fcdbcb31 documentation: remove this folder, use doc instead 2023-11-02 18:32:56 +02:00
Dan Bungert 7e07c291a0 doc: fix some link headings
The use of spellexception means we have some links that look like:
intro-to-autoinstall.html#autoinstall-by-way-of-cloud-spellexception-config-spellexception

Also these are already wordlisted, so we can fix by just dropping the
inline spellexception.
2023-11-02 18:23:58 +02:00
Olivier Gayot 70c8a3c41d
Merge pull request #1865 from ogayot/ssh-next-screen
identity: do not mention SSH being the next screen
2023-11-02 16:11:13 +01:00
Olivier Gayot 81c16f5a83 identity: do not mention SSH being the next screen
The identity screen tells the user that SSH can be configured on the
next screen. That said, nowadays, other screens can be presented between
the identity screen and the SSH screen (including the Ubuntu Pro screen).

Reword the message accordingly.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-11-02 15:06:02 +01:00
Michael Hudson-Doyle 5adbc4768d
Merge pull request #1864 from ogayot/fix-wording-test-mirror
mirror: fix wording when mirror testing has not yet started
2023-11-02 19:46:55 +13:00
Olivier Gayot 4b7101fb2a mirror: fix wording when mirror testing has not yet started
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-31 11:28:13 +01:00
Dan Bungert 4de285a591
Merge pull request #1863 from rkratky/link-fixes
Docs links fixed
2023-10-27 12:51:20 -06:00
Robert Krátký 2892082a10 Docs links fixed. 2023-10-27 19:31:01 +02:00
Dan Bungert 454c487242
Merge pull request #1862 from rkratky/FR-5768_review-howtos
Review howtos
2023-10-27 10:16:14 -06:00
Robert Krátký e0593a2dfc Review howto language and formatting. 2023-10-27 18:06:59 +02:00
Robert Krátký 071095183b Architecture naming fix. 2023-10-27 16:11:33 +02:00
Olivier Gayot 2fd829b568
Merge pull request #1860 from ogayot/efibootmgr-workaround
snapcraft: update curtin for the efivarfs statfs workaround
2023-10-27 14:35:47 +02:00
Olivier Gayot a36d969745 snapcraft: update curtin for the efivarfs statfs workaround
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-27 09:30:23 +02:00
Dan Bungert 16b714eb99
Merge pull request #1857 from icnahom/python3_debian_apt_deps
Added python3-debian in apt-deps.txt
2023-10-26 15:03:18 -06:00
Dan Bungert a52839f8ae
Merge pull request #1858 from rkratky/FR-5770_review-tutorials
Review and fixes of doc tutorials
2023-10-26 10:07:42 -06:00
Robert Krátký 07f404b404 Review and fixes of doc tutorials. 2023-10-26 17:53:31 +02:00
icnahom 87fc8a6111 Added python3-debian in apt-deps.txt 2023-10-26 17:58:28 +03:00
Dan Bungert 0700be2e6f
Merge pull request #1853 from rkratky/FR-5774_review-references
Review reference docs
2023-10-26 08:13:14 -06:00
Robert Krátký 0dd4ee7bae Language and formatting review of the Reference section. 2023-10-26 11:40:07 +02:00
Chris Peterson 560b0b24d1
Merge pull request #1851 from Chris-Peterson444/update-apport-logs-FR-5444
Update apport reporting
2023-10-25 16:58:00 -07:00
Chris Peterson 4dfdc805bf
Merge pull request #1855 from Chris-Peterson444/undo-os-environ-changes
Revert orig_environ fix in command controllers
2023-10-25 15:52:28 -07:00
Chris Peterson 6c27d656f2 tests: add shared mocks and remove bad import
This commit re-adds some of the shared mock fields for testing
and removes a bad import from test_snaplist. These are changes
that shouldn't have been part of the previously reverted patch:
0a70a969d4
2023-10-25 15:34:23 -07:00
Chris Peterson 0a70a969d4 Revert "autoinstall: Don't use snap env when invoking early and late commands"
This reverts commit 39f1ea9cb6. The fix proposed
in this patch caused more issues than it fixed. We will have to revisit this in
a more nuanced way in the future. In the meantime users can make use of env
directly to strip/modify the subcommand environment.
2023-10-25 15:13:26 -07:00
Dan Bungert a6708aabf3
Merge pull request #1854 from rkratky/FR-5772_review-explanations
Review explanation docs
2023-10-25 13:08:05 -06:00
Robert Krátký e84d2927cf Language and formatting review of Explanations. 2023-10-25 19:58:05 +02:00
Robert Krátký 968ba4e6b4 Redefine the 'command' role in docs. 2023-10-25 14:40:00 +02:00
Dan Bungert 0bcf58b1f8
Merge pull request #1852 from dbungert/runners-20.04
workflow: runners to 20.04
2023-10-24 11:13:22 -06:00
Robert Krátký 5b498f05ba
Merge pull request #1844 from dbungert/merge-discourse-2023-10-18
Merge discourse 2023 10 18
2023-10-24 17:35:37 +02:00
Dan Bungert 845d9bb401 workflow: runners to 20.04 2023-10-24 09:22:39 -06:00
Dan Bungert 9c6c61691f reference: make bools consistent
pseudo-merge of d604a2156f
2023-10-24 08:43:02 -06:00
Dan Bungert 91e88f3836 reference: fix netplan url 2023-10-24 08:40:10 -06:00
Dan Bungert a9102c3a02 quickstart-s390x: merge wording tweak 2023-10-24 08:40:10 -06:00
Dan Bungert 8a47e978e3 documentation: merge changes to the legacy location 2023-10-24 08:40:10 -06:00
Robert Krátký 9a4e25aedf
Merge pull request #1848 from rkratky/FR-5719_index-page
Update the index page
2023-10-24 16:07:39 +02:00
Dan Bungert fc55305066 doc: fix 2 spelling errors 2023-10-24 15:37:02 +02:00
Robert Krátký 2496ec6de4 Fix spelling mistakes to pass spellcheck.
Reflect review feedback (to be squashed once PR acked).
2023-10-24 15:36:04 +02:00
Robert Krátký d6be2a9a1d Update the index page. 2023-10-24 15:33:46 +02:00
Olivier Gayot 288691f71a
Merge pull request #1846 from ogayot/snapcraft-doc
Update instructions to test local changes in kvm
2023-10-24 10:06:00 +02:00
Robert Krátký 41114a0421
Merge pull request #1845 from rkratky/FR-5662_docs-checks
Add docs checks to GH workflows
2023-10-24 10:03:11 +02:00
Dan Bungert d28b09b206 doc: fix 2 spelling errors 2023-10-23 15:22:45 -06:00
Robert Krátký 0fdf1e7b60 Tiny doc fix to trigger docs-check workflow. 2023-10-23 21:56:36 +02:00
Robert Krátký dd24762954 Add docs checks to GH workflows:
* spellcheck
  * linkcheck
  * inclusive-language check
2023-10-23 21:56:36 +02:00
Dan Bungert 4f1b2ccca2
Merge pull request #1847 from rkratky/FR-5738_spellcheck
Fix spelling mistakes to pass spellcheck
2023-10-23 13:46:50 -06:00
Robert Krátký 1c4f2e4e6f Fix spelling mistakes to pass spellcheck.
Reflect review feedback (to be squashed once PR acked).
2023-10-23 21:43:52 +02:00
Dan Bungert 3cd76f11e7
Merge pull request #1850 from rkratky/FR-5543_feedback-button
Update and fix project navigation in docs
2023-10-23 12:02:49 -06:00
Dan Bungert 8b37752d9d
Merge pull request #1849 from rkratky/FR-5758_remove-devel
Remove the Development section from docs
2023-10-23 12:00:13 -06:00
Robert Krátký 4bad051494 Update and fix project navigation
* Header titles & links
* Footer links
* Feedback button
2023-10-23 16:28:43 +02:00
Robert Krátký 63a606cd99 Remove the Development section. 2023-10-23 15:19:54 +02:00
Olivier Gayot ab0d773bad doc: add instructions to build snap with modifs in curtin or probert
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-23 09:18:00 +02:00
Chris Peterson e3d06bce6d apt: move subiquity-curtin-apt.conf to curtin-install/ 2023-10-21 00:51:02 -07:00
Chris Peterson d520382f72 apport: update names and write traceback information to disk 2023-10-21 00:50:21 -07:00
Olivier Gayot b0e1c57145 snapcraft: use snapcraft pack instead of snapcraft snap
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-20 15:41:24 +02:00
Dan Bungert 599aefdd73
Merge pull request #1838 from rkratky/FR-5664_linkcheck-fixes
Fixes invalid links reported by linkcheck in docs
2023-10-19 07:57:11 -06:00
Robert Krátký 162a2e9a79 Fix invalid links reported by linkcheck.
(Introduced the extlinks extension for handling manpage links.)
2023-10-19 15:02:18 +02:00
Dan Bungert d2637daa0a
Merge pull request #1843 from rkratky/FR-5687_edit-this-page
Fix docs path for theme to function
2023-10-18 08:06:17 -06:00
Dan Bungert 8738abd923
Merge pull request #1842 from rkratky/FR-5545_contact-info
Add contact info to docs index page
2023-10-18 08:04:44 -06:00
Dan Bungert 300e273743
Merge pull request #1841 from rkratky/FR-5544_google
Add Google Console verif. file
2023-10-18 08:04:27 -06:00
Dan Bungert 65da5078a6
Merge pull request #1839 from rkratky/FR-5688_add-missing-artifacts
Add missing docs artifacts (to fix docs styling)
2023-10-18 08:04:16 -06:00
Robert Krátký 1f2533f7d0 Add Google Consople verif. file. 2023-10-18 15:48:15 +02:00
Robert Krátký 0204b31301 Add missing style artifacts. 2023-10-18 14:37:24 +02:00
Robert Krátký 5870cbc99d Fix greedy .gitignore. 2023-10-18 14:37:11 +02:00
Robert Krátký 0b2610397f Add contact info to index page. 2023-10-18 14:01:13 +02:00
Robert Krátký 215e50fa5a Fix docs path for theme to function. 2023-10-18 13:59:32 +02:00
Dan Bungert 3452c5772e
Merge pull request #1837 from rkratky/FR-5630_sphinx-warn
Docs build errors
2023-10-12 06:20:09 -06:00
Robert Krátký f55043f5b1 FR-5630 Fix Sphinx YAML syntax warning. 2023-10-12 14:12:32 +02:00
Robert Krátký 5530ce194c FR-5630 Fix rST heading syntax. 2023-10-12 14:11:52 +02:00
Dan Bungert 2d45af573e
Merge pull request #1836 from rkratky/FR-5673_specific-checks
FR-5673: exclude doc/ from CI and Snap checks.
2023-10-12 03:12:20 -06:00
Robert Krátký 9f36439c6d FR-5673: exclude doc/ from CI and Snap checks. 2023-10-11 19:35:07 +02:00
Dan Bungert 8eddf7fc5a
Merge pull request #1834 from dbungert/fix-target-log-dir
shutdown: fix perms on /target/var/log/installer
2023-10-10 16:10:48 -06:00
Dan Bungert 2d7210557b shutdown: fix perms on /target/var/log/installer 2023-10-10 22:56:59 +01:00
Olivier Gayot 7549af4ad0
Merge pull request #1832 from ogayot/variation-bug
Fix crash when switching sources having different variations
2023-10-10 19:17:19 +02:00
Olivier Gayot d4820497e7 filesystem: do not keep the variation info when the source changes
When the source changes, the available variations should change as well.
If we keep the old variations in the
FilesystemController._variations_info dictionary, we end up with a crash
later in the install.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-10 16:59:59 +02:00
Olivier Gayot 65612edc0b examples: add desktop source with different variations
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-10 16:59:31 +02:00
Dan Bungert f9e2cbfcc1
Merge pull request #1830 from dbungert/log-ctd
log: move /var/log/installer back to 0770 root:adm
2023-10-10 06:52:26 -06:00
Dan Bungert 84bcd5f7c8 log: move /var/log/installer back to 0770 root:adm 2023-10-10 13:25:26 +01:00
Dan Bungert 00011e24f9
Merge pull request #1828 from dbungert/c-n-f
apt: fix source.list mode
2023-10-09 09:18:29 -06:00
Dan Bungert 91e84c70ba apt: fix source.list mode 2023-10-09 14:27:40 +01:00
Dan Bungert c302876bce
Merge pull request #1826 from rkratky/FR-5578_version-numbers
Support for Sphinx substitutions
2023-10-06 09:01:25 -06:00
Robert Krátký f7a00e40f1 FR-5578: Add support for variable substitutions. 2023-10-06 08:55:44 -06:00
Dan Bungert 9621eeca9e
Merge pull request #1827 from rkratky/FR-5513-formatting-language-fixes
Fixes formatting, language and markup in s390x autoinstall
2023-10-06 08:26:04 -06:00
Dan Bungert b1e08b5907
Merge pull request #1822 from rkratky/sphinx-starter
Adopt Docs Starter Pack config
2023-10-06 07:03:43 -06:00
Robert Krátký 7b1f0c1aed Adopt Docs Starter Pack config. 2023-10-06 14:50:56 +02:00
Robert Krátký 1379670437 FR-5513: Fixes formatting, language and markup in s390x autoinstall. 2023-10-06 14:18:09 +02:00
Dan Bungert e388c263b4
Merge pull request #1825 from dbungert/log
Log
2023-10-05 18:58:19 -06:00
Dan Bungert ca8f1ca826 snapcraft: curtin logs change 2023-10-05 18:26:14 -06:00
Dan Bungert c9cfdafe0c log: create /var/log/installer root only 2023-10-05 18:03:32 -06:00
Dan Bungert 1da5cac477 several: turn off aiohttp access log
It will log arguments, so unless we are certain the arguments are clean
this will cause trouble.  Just turn it off.
2023-10-05 18:03:02 -06:00
Dan Bungert 80b144f220 file_util: just make written files root only 2023-10-05 17:22:18 -06:00
Dan Bungert f567f9e1f5 network: disable log line that logs psk 2023-10-05 17:21:07 -06:00
Dan Bungert e55b5bf8aa
Merge pull request #1823 from dbungert/translations-sync-2023-10-05
po: merge from translations-export
2023-10-05 17:01:52 -06:00
Dan Bungert 0201c7756a revert en_GB, it has czech 2023-10-05 15:54:49 -06:00
Dan Bungert 6417720a2e po: merge from translations-export 2023-10-05 11:37:30 -06:00
Dan Bungert d4e9f7d3b8
Merge pull request #1814 from ogayot/noop-no-emit-source-configured
source: do not fire a configured event again if nothing changed
2023-10-04 20:46:13 -06:00
Dan Bungert 2970912b7c
Merge pull request #1820 from dbungert/CVE-2023-5182
install: create autoinstall-user-data 0400
2023-10-04 20:45:49 -06:00
Dan Bungert 62e126896f install: create autoinstall-user-data 0400
CVE-2023-5182

As autoinstall-user-data contains a password hash hash for a user with
sudo access, create the autoinstall-user-data as 0400 root:root.

The old permissions are 0640 root:adm, and the adm group does not by
default have sudo access, so cracking that hash could lead to privilege
escallation for someone in the adm group.

Thanks to Patric Åhlin and Johan Hortling for identifying and reporting
the issue.
2023-10-04 19:32:33 -06:00
Dan Bungert f86a533ed6
Merge pull request #1819 from dbungert/cloud-init-log
Cloud init log
2023-10-04 19:32:08 -06:00
Dan Bungert ab0af6375e shutdown: fix owner on cloud-init logs
These have owner syslog at install time, but that is uid remapped on the
target system which may end up with a different owning user.
2023-10-04 17:56:30 -06:00
Dan Bungert d3debfcea3 shutdown: refactor cloud init logs logic 2023-10-04 17:56:15 -06:00
Dan Bungert a2b63dae13 util: ensure log file is root owned 2023-10-04 14:06:09 -06:00
Dan Bungert 3a319e77d7
Merge pull request #1818 from dbungert/file-writer-enhancement
util: File writer enhancements
2023-10-03 19:16:37 -06:00
Dan Bungert 8ab052c200 util: set_log_perms tests 2023-10-03 19:02:16 -06:00
Dan Bungert 4a4e8ba886 util: explicit isdir arg from set_log_perms
target already exists, we should just inspect target and find if it is a
directory or not.
2023-10-03 18:56:07 -06:00
Dan Bungert ddc11d8687 util: more control on file writer mode and group 2023-10-03 17:09:05 -06:00
Dan Bungert ddc3345eb6 util: standardize on term 'mode' 2023-10-03 17:09:01 -06:00
Dan Bungert 85af88e2d6
Merge pull request #1811 from Chris-Peterson444/lp-2032961-clean-environment-commands
autoinstall: Don't use snap env when invoking early and late commands
2023-10-03 11:20:26 -06:00
Chris Peterson 8f28063b92 tests: remove obsolete commands 2023-10-03 10:09:29 -07:00
Chris Peterson 39f1ea9cb6 autoinstall: Don't use snap env when invoking early and late commands 2023-10-03 10:09:26 -07:00
Olivier Gayot f6da6162e4 source: warn when POST /source specifies an unmatched source id
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-02 17:57:22 +02:00
Olivier Gayot 143d8e359a
Merge pull request #1813 from ogayot/target-not-mounted-error
shutdown: do not try to unmount /target if install was not started
2023-10-02 17:45:19 +02:00
Olivier Gayot d99a348958
Merge pull request #1815 from ogayot/workflows-rename
workflows: differentiate CI and Snap workflows
2023-10-02 17:44:56 +02:00
Olivier Gayot a34bce470f workflows: differentiate CI and Snap workflows
The workflows defined respectively in build.yaml and snap.yaml were
both called "CI". On the Github web interface, it resulted in two menus
called "CI" with no easy way to know which is which.

To make things clearer, we now:
 * rename build.yaml -> ci.yaml
 * call "Snap" the workflow defined by snap.yaml

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-02 14:38:04 +02:00
Olivier Gayot fff2f6591f source: do not fire a configured event again if nothing changed
When handling a POST request to /source, Subiquity sends a 'source
configured' event. This signals other controllers / models that they
need to restart their tasks that depend on the source being used.

However, if the user of the installer goes back all the way to the
source page and submits it again without changing the settings, there
should be no reason to restart the machinery.

If a call to source ends up doing no modification to the model (i.e.,
not changing the source used or the search_drivers setting), we now
avoid emitting the 'source configured' event ; except if the model has
not been configured yet.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-02 14:12:54 +02:00
Olivier Gayot abef05178c shutdown: do not try to unmount /target if install was not started
If we ask for reboot before the installation has started (i.e., if
curtin install was not invoked at least once), the following call fails
and prevents the system from rebooting.

 $ umount --recursive /target

Make sure we check that /target exists and is mounted before calling
umount.

Another approach would be to check the return value of umount but the
values are not documented.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-10-02 13:29:53 +02:00
Olivier Gayot bd52c483de
Merge pull request #1812 from ogayot/install-package-skip-offline
codecs: skip installation when running an offline install
2023-10-02 09:13:58 +02:00
Olivier Gayot 01ec1da86f codecs: skip installation when running an offline install
ubuntu-restricted-addons is a multiverse package and is not included in
the pool. Therefore, trying to get it installed when offline leads to an
obvious error.

Instead of making the whole Ubuntu installation fail, we now warn and
skip installation of the package when performing an offline install.
In a perfect world, we should not have offered to install the package in
the first place, but in practice, we can run an offline installation as
the result of failed mirror testing (bad network for instance).

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-29 18:20:19 +02:00
Dan Bungert 9bf0a50a24
Merge pull request #1806 from dbungert/lp-2009141-udev-events
filesystem: revamp udev handling
2023-09-27 14:12:08 -06:00
Dan Bungert b11726d398 filesystem: revamp udev handling
In LP: #2009141, we are hitting kernel limits and pyudev buffer limits.
We don't care about specific events, so much as getting one event,
waiting for things to calm down, then reprobing.

Outright disable the event monitor, and re-enable later.  If there is a
storm of events, testing has shown that stopping the listener is not
enough.
2023-09-27 13:43:14 -06:00
Olivier Gayot 9d30dc29be
Merge pull request #1809 from ogayot/oem-crash-early-confirmation
oem: make sure storage is configured before using is_core_boot_classic
2023-09-27 21:28:47 +02:00
Olivier Gayot 59849f7f45 oem: make sure storage is configured before using is_core_boot_classic
Before using fs_controller.is_core_boot_classic(), we wait for the call
to /meta/confirmation?tty=xxx. That said, in semi-automated desktop
installs, sometimes the call to /meta/confirmation happens before
marking storage configured. This leads to the following error:

  File "subiquity/server/controllers/oem.py", line 209, in apply_autoinstall_config
    await self.load_metapkgs_task
  File "subiquity/server/controllers/oem.py", line 81, in list_and_mark_configured
    await self.load_metapackages_list()
  File "subiquitycore/context.py", line 149, in decorated_async
    return await meth(self, **kw)
  File "subiquity/server/controllers/oem.py", line 136, in load_metapackages_list
    if fs_controller.is_core_boot_classic():
  File "subiquity/server/controllers/filesystem.py", line 284, in is_core_boot_classic
    return self._info.is_core_boot_classic()
AttributeError: 'NoneType' object has no attribute 'is_core_boot_classic'

Receiving the confirmation before getting the storage configured is
arguably wrong - but let's be prepared for it just in case.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-27 11:18:58 +02:00
Olivier Gayot f951146d6a
Merge pull request #1808 from ogayot/early-v2-orig-config
filesystem: don't crash if v2/orig_config is called early
2023-09-27 09:05:58 +02:00
Olivier Gayot 7de6f0538b filesystem: don't crash if v2/orig_config is called early
When v2/orig_config is called too early, the load_probe_data function
will fail because probe_data is None:

  Traceback (most recent call last):
    File "subiquity/common/api/server.py", line 164, in handler
      result = await implementation(**args)
    File "subiquity/server/controllers/filesystem.py", line 1029, in v2_orig_config_GET
      model = self.model.get_orig_model()
    File "subiquity/models/filesystem.py", line 1428, in get_orig_model
      orig_model.load_probe_data(self._probe_data)
    File "subiquity/models/filesystem.py", line 1894, in load_probe_data
      for devname, devdata in probe_data["blockdev"].items():
  TypeError: 'NoneType' object is not subscriptable

Make sure we don't dereference model._probe_data if it is None.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-26 16:00:34 +02:00
Chris Peterson 926bfeb5e1
Merge pull request #1807 from Chris-Peterson444/lp-2037133-locale-interactive
locale is not implicitly interactive with other interactive sessions
2023-09-25 17:12:22 -07:00
Chris Peterson 4ba59a503b docs: locale must be specified to be interactive 2023-09-25 15:59:07 -07:00
Olivier Gayot c9f3e252af
Merge pull request #1802 from ogayot/rich-mode-s390x
ui: have a distinct state file for rich mode over serial
2023-09-25 09:06:58 +02:00
Dan Bungert 333e4d96c8
Merge pull request #1804 from dbungert/lp-2034715-just-wait-longer
snapd api: wait longer
2023-09-22 16:09:15 -06:00
Dan Bungert 5a573f2cef snapd api: wait longer
While these changes are not supposed to take nearly this long,
per LP: #2034715 we know that they are, and that some systems will
correctly perform the finish_install() step if just given more time.
2023-09-22 15:05:01 -06:00
Olivier Gayot d7f5ef1a99
Merge pull request #1805 from ogayot/zdev-key-encryption
Bump curtin rev for recovery key on systems using zkey
2023-09-22 16:44:21 +02:00
Olivier Gayot 22b6d1258b Bump curtin rev for recovery key on systems using zkey
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-22 09:34:22 +02:00
Olivier Gayot c95261e0de ui: have a distinct state file for rich mode over serial
We recently made sure that after doing a snap refresh, the rich mode
(i.e., either rich or basic) is preserved. This was implemented by
storing the rich mode in a state file. When the client starts, it loads
the rich mode from said state file if it exists.

Unfortunately, on s390x, it causes installs to default to basic mode.
This happens because on this architecture, a subiquity install consists
of:

 * a first client (over serial) showing the SSH password
 * a second client (logging over SSH) actually going through the
   installation UI.

Since the first client uses a serial connection, the state file is
created with rich-mode set to basic. Upon connecting using SSH, the
state file is read and the rich-mode is set to basic as well.

Fixed by storing the rich-mode in two separate files, one for clients
over serial and one for other clients.

LP: #2036096

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-22 09:27:13 +02:00
Chris Peterson 4010f0ad5f
Merge pull request #1803 from Chris-Peterson444/kernel-autoinstall-file
Allow for specifying the autoinstall file over the kernel command line
2023-09-21 13:45:29 -07:00
Chris Peterson 28dd55f9dd docs: reflect autoinstall options and precedence 2023-09-21 13:23:04 -07:00
Chris Peterson 76b520afa9 autoinstall: allow for specifying autoinstall path on kernel command line 2023-09-21 11:57:46 -07:00
Dan Bungert aaaf87355c
Merge pull request #1800 from dbungert/curtin-2023-09-19
snapcraft: rev curtin for deb822, large sectors
2023-09-19 18:31:02 -06:00
Dan Bungert 21e6b1ebfc
Merge pull request #1799 from ogayot/chreipl-earlier
s390x: ensure chreipl is called before unmounting /target
2023-09-19 18:28:24 -06:00
Dan Bungert ea7b683d8e snapcraft: rev curtin for deb822, large sectors
This curtin rev adds the following:
Dan Bungert (3):
      extract: log source information
      tests/data: 4k sector disk
      storage_config: handle partitions on 4k disk

Nick Rosbrook (1):
      apt: disable default deb822 migration
2023-09-19 18:22:58 -06:00
Michael Hudson-Doyle 30cbd28152
Merge pull request #1796 from mwhudson/reusing-raid
include api-only data when sending storage objects from client to server
2023-09-20 09:27:49 +12:00
Olivier Gayot cf828eeb8d s390x: ensure chreipl is called before unmounting /target
For ZFS, we recently introduced a call to $(umount --recursive /target)
slighly before shutting down or rebooting. Unfortunately, on s390x, we
also had a very late call to chreipl to make the firmware boot from the
installed system.

The call to chreipl reads data from /target/boot, and it fails if the
filesystem is no longer mounted.

Fixed by calling chreipl earlier in the installation, during the
postinst phase rather than after the user clicks "reboot".

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-09-19 15:31:43 +02:00
Dan Bungert a4fe424df6
Merge pull request #1797 from Chris-Peterson444/faster-unattended-upgrades
Make unattended upgrades run faster by disabling minimal steps
2023-09-15 13:30:12 -06:00
Chris Peterson cd7d3dd2cb add Unattended-Upgrade::MinimalSteps "faslse" to uu_apt conf
Co-authored-by: Dan Bungert <danielbungert@gmail.com>
2023-09-15 12:20:08 -07:00
Michael Hudson-Doyle 4d24865a63 include api-only data when sending storage objects from client to server
Making an install that used an existing RAID failed because of an
attempt to log the size of the RAID when rendering the curtin config.

This turns out to be because when the client sends the storage objects
back to the server it loses all the "api only" data including the udev
data that is needed to display the size.

In some sense this is a bit silly, we could just drop the log statement
and it would be fine but I think it's probably better to always have the
full storage objects in the server (until we can get away from this
hackish API anyway).
2023-09-15 13:28:20 +12:00
387 changed files with 14803 additions and 8415 deletions

View File

@ -0,0 +1,22 @@
name: Main Documentation Checks
on:
pull_request:
paths:
- 'doc/**'
push:
paths:
- 'doc/**'
workflow_dispatch:
paths:
- 'doc/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
documentation-checks:
uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main
with:
working-directory: 'doc'

View File

@ -1,6 +1,12 @@
name: CI
on: [push, pull_request]
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'
jobs:
test:
@ -9,10 +15,9 @@ jobs:
fail-fast: false
matrix:
image:
- ubuntu-daily:focal
- ubuntu-daily:jammy
- ubuntu-daily:lunar
- ubuntu-daily:mantic
- ubuntu-daily:noble
steps:
- uses: actions/checkout@v4
- name: run
@ -24,15 +29,15 @@ jobs:
fail-fast: false
matrix:
image:
- ubuntu-daily:jammy # match the core snap we're running against
- ubuntu-daily:mantic # latest
- ubuntu-daily:jammy # match the core snap we're running against
# - ubuntu-daily:noble # latest
steps:
- uses: actions/checkout@v4
- name: lint
run: sudo ./scripts/test-in-lxd.sh ${{ matrix.image }} "make lint"
format-black:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
@ -41,7 +46,7 @@ jobs:
src: "console_conf subiquity subiquitycore system_setup"
format-isort:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: isort/isort-action@v1
@ -52,7 +57,7 @@ jobs:
static-typing:
# In this job, we compare the output of mypy before and after the PR.
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
runs-on: ubuntu-22.04 # minimimum 22.04 for python3-typeshed
steps:
- name: Install mypy and typeshed
run: sudo apt-get install -y python3-mypy python3-typeshed

View File

@ -1,10 +1,16 @@
name: CI
name: Snap
on: [push, pull_request]
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'
jobs:
snap-build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1

View File

@ -1,11 +1,21 @@
files: "(console_conf|subiquity|subiquitycore|system_setup)"
files: "(console_conf|subiquity|subiquitycore|system_setup|doc)"
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
files: "(console_conf|subiquity|subiquitycore|system_setup)"
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
files: "(console_conf|subiquity|subiquitycore|system_setup)"
- repo: local
hooks:
- id: doc-spelling
name: doc-spelling
language: system
entry: make -C doc spelling
files: "doc/.*rst"
pass_filenames: false

View File

@ -1,13 +1,40 @@
Thank you for considering a contribution to Subiquity. Here's what we like to
see:
Thank you for considering a contribution to Subiquity. Here are some things to
note:
* Contributors will need to have signed the
[CLA](https://ubuntu.com/legal/contributors/agreement).
* Format, lint, unit, integration, and API tests should be passing.
* format - either run `make format` or `pre-commit install`.
See [pre-commit](https://pre-commit.com/#install) for more details on that
tool.
## Code of Conduct
This project is subject to the [Ubuntu Code of Conduct](https://ubuntu.com/community/code-of-conduct)
to foster an open and welcoming place to contribute. By participating in the
project (in the form of code contributions, issues, comments, and other
activities), you agree to abide by its terms.
## Contributor License Agreement
This project is subject to the
[Canonical contributor license agreement](https://ubuntu.com/legal/contributors),
please make sure you have [signed it](https://ubuntu.com/legal/contributors/agreement)
before (or shortly after) submitting your first pull request.
A github workflow will verify that your GitHub username or email address is
associated with a contributor license agreement signature, but it may take
some time after your initial signature for the check to see it. If you're
part of [@canonical](https://github.com/canonical), you will also need to make
sure your canonical.com email address is associated with your GitHub account.
## Bugs
Bugs are tracked on [Launchpad](https://bugs.launchpad.net/subiquity). It is
recommended you use `ubuntu-bug` (or similar) to let apport collect relevant
logs which are helpful for the debug process, instead of filing one directly.
## Pull Requests
Changes to this project should be proposed as pull requests on GitHub at:
[https://github.com/canonical/subiquity/](https://github.com/canonical/subiquity/)
Format, lint, unit, integration, and API tests should be passing.
* format - run either `make format` or `pre-commit install`.
* Install pre-commit with `sudo apt install pre-commit`.
* all the rest - `make lint check`.
Prerequisites for running these locally can be installed with
* Prerequisites for running these locally can be installed with
`make aptdeps`.

View File

@ -171,6 +171,12 @@ which will not return until the check has completed (or failed). In a similar
vein, `meta.status.GET()` takes an argument indicating what the client
thinks the application state currently is and will block until that changes.
In some scenarios (e.g., after updating the installer), the server process will
automatically restart. In such an event, every open socket will automatically
get closed. As a consequence, ongoing long polling requests will not receive a
response. To handle this scenario gracefully, the client should catch the
error and retry the long polling request after a short time.
### Examples and common patterns
Adding a typical screen requires:
@ -270,10 +276,10 @@ class ExampleController(SubiquityTuiController):
return ExampleView(self, thing)
def cancel(self):
self.app.prev_screen()
self.app.request_prev_screen()
def done(self, thing):
self.app.next_screen(self.endpoint.POST(thing))
self.app.request_next_screen(self.endpoint.POST(thing))
```
Setting `endpoint_name` means that self.client gets set to an implementation of
@ -521,7 +527,7 @@ Tests (and lint checks) are run by github actions using lxd. See
`.github/workflows/build.yaml` and `./scripts/test-in-lxd.sh` and so
on.
For "real" testing, you need to make a snap (`snapcraft snap`), mash
For "real" testing, you need to make a snap (`snapcraft pack`), mash
it into an existing ISO using `./scripts/inject-subiquity-snap.sh`,
and boot the result in a VM. There is an even hackier pair of scripts
(`./scripts/slimy-update-snap.sh` and

666
LICENSE
View File

@ -1,662 +1,8 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
The subiquity/ directory is licensed under the GNU Affero General Public
License version 3 or later.
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
All other content is licensed under the GNU General Public License version 3
(only).
It is likely that a future version of this repository will all be licensed
under the GNU General Public License version 3 (only).

661
LICENSE.AGPL-3 Normal file
View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

674
LICENSE.GPL-3 Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -59,10 +59,41 @@ an ISO. Rather than building one from scratch, it's much easier to
install your version of subiquity into the daily image. Here's how to
do this:
1. Build your change into a snap:
## Commit your changes locally
If you are only making a change in Subiquity itself, running `git add <modified-file...>`
and then `git commit` should be enough.
Otherwise, if you made any modification to curtin or probert, you need to ensure that:
* The modification is committed inside the relevant repository (i.e., `git add` + `git commit`).
* The relevant `source` property in snapcraft.yaml points to the local
repository instead of the upstream repository.
* The relevant `source-commit` property in snapcraft.yaml is updated to reflect
your new revision (one must use the full SHA-1 here).
* The above modifications to snapcraft.yaml are committed.
Example:
```
parts:
curtin:
plugin: nil
# Comment out the original source property, pointing to the upstream repository
#source: https://git.launchpad.net/curtin
# Instead, specify the name of the directory where curtin is checked out
source: curtin
source-type: git
# Update the below so it points to the commit ID within the curtin repository
source-commit: 7c18bf6a24297ed465a341a1f53875b61c878d6b
```
## Build and inject your changes into an ISO
1. Build your changes into a snap:
```
$ snapcraft snap --output subiquity_test.snap
$ snapcraft pack --output subiquity_test.snap
```
2. Grab the current version of the installer:
@ -94,3 +125,15 @@ do this:
```
The first three steps are bundled into the script ./scripts/test-this-branch.sh.
# Contributing
Please see our [contributing guidelines](CONTRIBUTING.md).
# Documentation
Subiquity's documentation is hosted at
[https://canonical-subiquity.readthedocs-hosted.com/en/latest/](https://canonical-subiquity.readthedocs-hosted.com/en/latest/).
The documentation source can be found in the [doc/](doc/) folder, which
contains instructions for building a local preview.

View File

@ -25,7 +25,9 @@ python3-async-timeout
python3-attr
python3-bson
python3-coverage
python3-debian
python3-dev
python3-distro-info
python3-distutils-extra
python3-flake8
python3-gi
@ -41,6 +43,7 @@ python3-pytest
python3-pytest-xdist
python3-pyudev
python3-requests
python3-requests-mock
python3-requests-unixsocket
python3-setuptools
python3-systemd

View File

@ -6,6 +6,12 @@
"minimum": 1,
"maximum": 1
},
"interactive-sections": {
"type": "array",
"items": {
"type": "string"
}
},
"early-commands": {
"type": "array",
"items": {

View File

@ -6,6 +6,12 @@
"minimum": 1,
"maximum": 1
},
"interactive-sections": {
"type": "array",
"items": {
"type": "string"
}
},
"early-commands": {
"type": "array",
"items": {

View File

@ -26,7 +26,7 @@ fi
if [ -e "/var/lib/snapd/modeenv" ]; then
mode="$(sed -n 's/mode=\([^[:space:]]*\)/\1/p' /var/lib/snapd/modeenv)"
else
mode="$(sed 's/.*snapd_recovery_mode=\([^[:space:]]*\)[[:space:]].*/\1/' /proc/cmdline))"
mode="$(sed 's/.*snapd_recovery_mode=\([^[:space:]]*\)[[:space:]].*/\1/' /proc/cmdline)"
fi
if [ "${mode}" = "install" ]; then
@ -84,7 +84,13 @@ if [ "$(snap managed)" = "true" ]; then
exit 0
fi
cat /usr/share/subiquity/console-conf-wait
# if there is NOT console-conf snap, exit gracefully
if [ ! -e "/snap/console-conf" ]; then
touch /var/lib/console-conf/complete
exit 0
fi
snap run console-conf.wait
read REPLY
# start the console-conf routine in snapd to delay any new refreshes, and wait
# for current refreshes to complete, this will print off messages if there are
@ -92,4 +98,12 @@ read REPLY
if snap routine console-conf-start --help >/dev/null 2>/dev/null; then
snap routine console-conf-start
fi
exec console-conf "$@"
# preapre host finger prints for console-conf as it cannot access sshd or host keys
mkdir -p /run/console-conf
/usr/share/subiquity/console-conf-write-login-details --host-fingerprints > /run/console-conf/host-fingerprints.txt
snap run console-conf "$@"
rval=$?
if [ ! ${rval} -eq 0 ]; then
echo "console-conf exited with: ${rval}"
exit ${rval}
fi

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Console-Conf """

View File

@ -2,16 +2,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import argparse

View File

@ -2,16 +2,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" console-conf controllers """

View File

@ -1,16 +1,15 @@
# Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
@ -70,7 +69,7 @@ class RecoveryChooserController(RecoveryChooserBaseController):
def select(self, system, action):
self.model.select(system, action)
self.app.next_screen()
self.app.request_next_screen()
def more_options(self):
self._current_view = self._all_view
@ -96,4 +95,4 @@ class RecoveryChooserConfirmController(RecoveryChooserBaseController):
def back(self):
self.model.unselect()
self.app.prev_screen()
self.app.request_prev_screen()

View File

@ -1,19 +1,17 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import logging
import os
import pwd
@ -21,10 +19,11 @@ import shlex
import sys
from console_conf.ui.views import IdentityView, LoginView
from subiquitycore import snap
from subiquitycore.snapd import SnapdConnection
from subiquitycore.ssh import get_ips_standalone, host_key_info
from subiquitycore.tuicontroller import TuiController
from subiquitycore.utils import disable_console_conf, run_command
from subiquitycore.utils import disable_console_conf
log = logging.getLogger("console_conf.controllers.identity")
@ -51,9 +50,8 @@ def get_core_version():
return version
def get_managed():
def get_managed(con):
"""Check if device is managed"""
con = SnapdConnection("", "/run/snapd.socket")
return con.get("v2/system-info").json()["result"]["managed"]
@ -65,9 +63,8 @@ def get_realname(username):
return info.pw_gecos.split(",", 1)[0]
def get_device_owner():
def get_device_owner(con):
"""Get device owner, if any"""
con = SnapdConnection("", "/run/snapd.socket")
for user in con.get("v2/users").json()["result"]:
if "username" not in user:
continue
@ -102,7 +99,7 @@ Personalize your account at https://login.ubuntu.com.
"""
def write_login_details(fp, username, ips):
def write_login_details(fp, username, ips, state_dir=None):
sshcommands = "\n"
for ip in ips:
sshcommands += " ssh %s@%s\n" % (username, ip)
@ -116,10 +113,11 @@ def write_login_details(fp, username, ips):
)
else:
first_ip = ips[0]
key_info = host_key_info(runtime_state_dir=state_dir)
fp.write(
login_details_tmpl.format(
sshcommands=sshcommands,
host_key_info=host_key_info(),
host_key_info=key_info,
tty_name=tty_name,
first_ip=first_ip,
version=version,
@ -128,7 +126,9 @@ def write_login_details(fp, username, ips):
def write_login_details_standalone():
owner = get_device_owner()
# running in standalone mode
con = SnapdConnection("/", "/run/snapd.socket")
owner = get_device_owner(con)
ips = get_ips_standalone()
if len(ips) == 0:
if owner is None:
@ -142,7 +142,13 @@ def write_login_details_standalone():
if owner is None:
print("device managed without user @ {}".format(", ".join(ips)))
else:
write_login_details(sys.stdout, owner["username"], ips)
if snap.is_snap() and snap.is_snap_strictly_confined():
# normally this is set by the application context, but here we are
# executing standalone
runtime_state = os.path.join("/run", snap.snap_name())
else:
runtime_state = None
write_login_details(sys.stdout, owner["username"], ips, state_dir=runtime_state)
return 0
@ -152,13 +158,10 @@ class IdentityController(TuiController):
self.model = app.base_model.identity
def make_ui(self):
if get_managed():
device_owner = get_device_owner()
if get_managed(self.app.snapdcon):
device_owner = get_device_owner(self.app.snapdcon)
if device_owner:
self.model.add_user(device_owner)
key_file = os.path.join(device_owner["homedir"], ".ssh/authorized_keys")
cp = run_command(["ssh-keygen", "-lf", key_file])
self.model.user.fingerprints = cp.stdout.replace("\r", "").splitlines()
return self.make_login_view()
else:
return IdentityView(self.model, self)
@ -173,34 +176,36 @@ class IdentityController(TuiController):
login_details_path = self.opts.output_base + "/login-details.txt"
else:
self.app.urwid_loop.draw_screen()
cp = run_command(["snap", "create-user", "--sudoer", "--json", email])
if cp.returncode != 0:
user_action = {"action": "create", "email": email, "sudoer": True}
res = self.app.snapdcon.post("v2/users", body=user_action)
if res.json()["status"] != "OK":
if isinstance(self.ui.body, IdentityView):
self.ui.body.snap_create_user_failed(
"Creating user failed:", cp.stderr
"Creating user failed:", res.json()["result"]["message"]
)
return
else:
data = json.loads(cp.stdout)
username = res.json()["result"][0]["username"]
result = {
"realname": email,
"username": data["username"],
"username": username,
}
os.makedirs("/run/console-conf", exist_ok=True)
login_details_path = "/run/console-conf/login-details.txt"
login_details_path = self.app.state_path("login-details.txt")
self.model.add_user(result)
ips = []
net_model = self.app.base_model.network
for dev in net_model.get_all_netdevs():
ips.extend(dev.actual_global_ip_addresses)
with open(login_details_path, "w") as fp:
write_login_details(fp, result["username"], ips)
write_login_details(
fp, result["username"], ips, state_dir=self.app.state_dir
)
self.login()
def cancel(self):
# You can only go back if we haven't created a user yet.
if self.model.user is None:
self.app.prev_screen()
self.app.request_prev_screen()
def make_login_view(self):
title = "Configuration Complete"

View File

@ -1,16 +1,15 @@
# Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
from unittest import mock
@ -74,7 +73,7 @@ class TestChooserConfirmController(unittest.TestCase):
c.back()
app.respond.assert_not_called()
app.exit.assert_not_called()
app.prev_screen.assert_called()
app.request_prev_screen.assert_called()
c.model.unselect.assert_called()
def test_confirm(self):
@ -106,7 +105,7 @@ class TestChooserController(unittest.TestCase):
)
self.assertEqual(c.model.selection, exp)
app.next_screen.assert_called()
app.request_next_screen.assert_called()
app.respond.assert_not_called()
app.exit.assert_not_called()
@ -148,9 +147,10 @@ class TestChooserController(unittest.TestCase):
# go back now
c.back()
c.ui.set_body.assert_called_with("current")
c.ui.set_body.reset_mock()
# nothing
c.back()
c.ui.set_body.not_called()
c.ui.set_body.assert_not_called()
@mock.patch(
"console_conf.controllers.chooser.ChooserCurrentSystemView",
@ -169,7 +169,7 @@ class TestChooserController(unittest.TestCase):
self.assertEqual(v, "current")
# going back does nothing
c.back()
c.ui.set_body.not_called()
c.ui.set_body.assert_not_called()
@mock.patch(
"console_conf.controllers.chooser.ChooserCurrentSystemView",

View File

@ -0,0 +1,121 @@
# Copyright 2024 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os.path
import tempfile
import unittest
from unittest.mock import MagicMock, patch
from console_conf.controllers.identity import IdentityController
from console_conf.ui.views import IdentityView, LoginView
from subiquitycore.models.network import NetworkDev
from subiquitycore.snapd import MemoryResponseSet, get_fake_connection
from subiquitycore.tests.mocks import make_app
class TestIdentityController(unittest.TestCase):
@patch("os.ttyname", return_value="/dev/tty1")
@patch("console_conf.controllers.identity.get_core_version", return_value="24")
def test_snap_integration(self, core_version, ttyname):
with tempfile.TemporaryDirectory(suffix="console-conf-test") as statedir:
app = make_app()
app.state_dir = statedir
app.opts.dry_run = False
app.snapdcon = get_fake_connection()
app.state_dir = statedir
network_model = MagicMock()
mock_devs = [MagicMock(spec=NetworkDev)]
network_model.get_all_netdevs.return_value = mock_devs
mock_devs[0].actual_global_ip_addresses = ["1.2.3.4"]
app.base_model.network = network_model
app.urwid_loop = MagicMock()
def state_path(*parts):
return os.path.join(statedir, *parts)
app.state_path = MagicMock(side_effect=state_path)
create_user_calls = 0
def create_user_cb(path, body, **args):
nonlocal create_user_calls
create_user_calls += 1
self.assertEqual(path, "v2/users")
self.assertEqual(
body, {"action": "create", "email": "foo@bar.com", "sudoer": True}
)
return {
"status": "OK",
"result": [
{
"username": "foo",
}
],
}
# fake POST handlers
app.snapdcon.post_cb["v2/users"] = create_user_cb
c = IdentityController(app)
c.identity_done("foo@bar.com")
self.assertEqual(create_user_calls, 1)
with open(os.path.join(statedir, "login-details.txt")) as inf:
data = inf.read()
self.assertIn("Ubuntu Core 24 on 1.2.3.4 (tty1)\n", data)
@patch("pwd.getpwnam")
@patch("os.path.isdir", return_value=True)
def test_make_ui_managed_with_user(self, isdir, getpwnam):
pwinfo = MagicMock()
pwinfo.pw_gecos = "Foo,Bar"
getpwnam.return_value = pwinfo
app = make_app()
app.opts.dry_run = False
app.snapdcon = get_fake_connection()
# app.state_dir = statedir
network_model = MagicMock()
mock_devs = [MagicMock(spec=NetworkDev)]
network_model.get_all_netdevs.return_value = mock_devs
mock_devs[0].actual_global_ip_addresses = ["1.2.3.4"]
app.base_model.network = network_model
app.snapdcon.response_sets = {
"v2-system-info": MemoryResponseSet([{"result": {"managed": True}}]),
"v2-users": MemoryResponseSet(
[
# no "username" for first entry
{"result": [{}, {"username": "foo"}]}
]
),
}
c = IdentityController(app)
ui = c.make_ui()
self.assertIsInstance(ui, LoginView)
getpwnam.assert_called_with("foo")
def test_make_ui_unmanaged(self):
app = make_app()
app.opts.dry_run = False
app.snapdcon = get_fake_connection()
app.snapdcon.response_sets = {
"v2-system-info": MemoryResponseSet([{"result": {"managed": False}}]),
}
c = IdentityController(app)
ui = c.make_ui()
self.assertIsInstance(ui, IdentityView)

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from console_conf.ui.views import ChooserWelcomeView, WelcomeView
@ -24,7 +23,7 @@ class WelcomeController(TuiController):
return self.welcome_view(self)
def done(self):
self.app.next_screen()
self.app.request_next_screen()
def cancel(self):
# Can't go back from here!

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
@ -18,15 +17,23 @@ import logging
from console_conf.models.console_conf import ConsoleConfModel
from console_conf.models.systems import RecoverySystemsModel
from subiquitycore.prober import Prober
from subiquitycore.snap import snap_name
from subiquitycore.snapd import SnapdConnection
from subiquitycore.tui import TuiApplication
log = logging.getLogger("console_conf.core")
# project is used to build the state directory path under /run/, which usually
# ends up as /run/console-conf. Note this should only be changed in
# coordination with console-conf-wrapper and any other glue shipped with Ubuntu
# Core boot base
CONSOLE_CONF_PROJECT = snap_name() or "console-conf"
class ConsoleConf(TuiApplication):
from console_conf import controllers as controllers_mod
project = "console_conf"
project = CONSOLE_CONF_PROJECT
make_model = ConsoleConfModel
@ -39,12 +46,15 @@ class ConsoleConf(TuiApplication):
def __init__(self, opts):
super().__init__(opts)
self.prober = Prober(opts.machine_config, self.debug_flags)
# we're talking to snapd over the main socket, this may require
# snapd-control if executing inside a snap
self.snapdcon = SnapdConnection(self.root, "/run/snapd.socket")
class RecoveryChooser(TuiApplication):
from console_conf import controllers as controllers_mod
project = "console_conf"
project = CONSOLE_CONF_PROJECT
controllers = [
"RecoveryChooserWelcome",

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
@ -25,7 +24,6 @@ class User(object):
realname = attr.ib()
username = attr.ib()
homedir = attr.ib(default=None)
fingerprints = attr.ib(init=False, default=[])
class IdentityModel(object):

View File

@ -2,16 +2,15 @@
# Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import logging

View File

@ -2,16 +2,15 @@
# Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import unittest

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Subiquity UI Components """

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" ConsoleConf UI Views """

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Chooser

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Login

View File

@ -1,16 +1,15 @@
# Copyright 2020 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest

View File

@ -1,16 +1,15 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Welcome

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
subiquity (24.04.1+git45g5f9fae19) noble; urgency=medium
* Upgrade to noble, systemd files are now in /usr/lib
-- Dimitri John Ledkov <dimitri.ledkov@canonical.com> Fri, 24 Nov 2023 23:10:15 +0000
subiquity (20.04.1+git45g5f9fae19) focal; urgency=medium
* Upload subquity snapshot with reverted consoleconf patch.

1
debian/control vendored
View File

@ -25,6 +25,7 @@ Depends: probert-network,
python3-yaml,
python3-requests,
python3-requests-unixsocket,
python3-pyroute2,
${misc:Depends},
${python3:Depends}
Description: Ubuntu Server Installer - core libraries

21
debian/copyright vendored
View File

@ -3,12 +3,16 @@ Upstream-Name: subiquity
Source: https://github.com/canonical/subiquity
Files: *
Copyright: Copyright 2015, Canonical Ltd., All Rights Reserved.
License: GPL-3.0
Files: subiquity/*
Copyright: Copyright 2015, Canonical Ltd.
License: AGPL-3.0+
Files: debian/*
Copyright: Copyright 2015, Canonical Ltd.
License: AGPL-3.0+
Copyright: Copyright 2015, Canonical Ltd., All Rights Reserved.
License: GPL-3.0
License: AGPL-3.0+
This program is free software: you can redistribute it and/or modify
@ -23,3 +27,16 @@ License: AGPL-3.0+
.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
License: GPL-3.0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

6
debian/rules vendored
View File

@ -26,10 +26,8 @@ override_dh_python3:
override_dh_installinit:
dh_installsystemd --no-start --name=console-conf@
dh_installsystemd --no-start --name=serial-console-conf@
mkdir $(CURDIR)/debian/console-conf/lib/systemd/system/getty@.service.d/
install -m 0644 $(CURDIR)/debian/console-conf.conf $(CURDIR)/debian/console-conf/lib/systemd/system/getty@.service.d/
mkdir $(CURDIR)/debian/console-conf/lib/systemd/system/serial-getty@.service.d/
install -m 0644 $(CURDIR)/debian/console-conf-serial.conf $(CURDIR)/debian/console-conf/lib/systemd/system/serial-getty@.service.d/
install -D -m 0644 $(CURDIR)/debian/console-conf.conf $(CURDIR)/debian/console-conf/usr/lib/systemd/system/getty@.service.d/console-conf.conf
install -D -m 0644 $(CURDIR)/debian/console-conf-serial.conf $(CURDIR)/debian/console-conf/usr/lib/systemd/system/serial-getty@.service.d/console-conf-serial.conf
override_dh_auto_test:
@echo "No tests."

88
doc/.custom_wordlist.txt Normal file
View File

@ -0,0 +1,88 @@
AArch
Autoinstall
Autoinstalls
Btrfs
DHCP
EFI
Esc
ESP
ESPs
GPT
GUID
GiB
GiB
Libera
LPAR
LTS
LUKS
LV
LVM
LinuxONE
Mantic
MiB
NIC
Netplan
NoCloud
OEM
OpenSSH
Petitboot
PgDn
PgUp
POST
PPA
PReP
SSD
Seagate
Subiquity
UEFI
URI
Zdev
amd
authorized
autoinstall
autoinstaller
autoinstalls
bootable
bootloader
bootloaders
codecs
config
conf
curtin
debconf
debian
dir
el
flavor
geoip
geolocation
globbing
hostname
iSCSI
init
md
oem
passwd
ppc
pre
preseed
preseeded
preseeding
preseeds
pw
realname
rootfs
rsyslog
runtime
subvolume
subvolumes
superset
sysfs
traceback
tty
ubuntu
udev
unformatted
VLAN
webhook
workdir

9
doc/.gitignore vendored
View File

@ -1,2 +1,9 @@
/*env*/
.sphinx/venv/
.sphinx/warnings.txt
.sphinx/.wordlist.dic
.sphinx/.doctrees/
_build
.sphinx
.DS_Store
__pycache__
.idea/

View File

@ -1,54 +1,13 @@
/** Fix the font weight (300 for normal, 400 for slightly bold) **/
/** Should be 100 for all headers, 400 for normal text **/
h1, h2, h3, h4, h5, h6, .sidebar-tree .current-page>.reference, button, input, optgroup, select, textarea, th.head {
font-weight: 200;
div.page, h1, h2, h3, h4, h5, h6, .sidebar-tree .current-page>.reference, button, input, optgroup, select, textarea, th.head {
font-weight: 300
}
.toc-title {
.toc-tree li.scroll-current>.reference, dl.glossary dt, dl.simple dt, dl:not([class]) dt {
font-weight: 400;
}
.sidebar-tree .toctree-l2.has-children>.reference {
font-weight: 300;
}
li.toctree-l3 {
font-weight: 200;
}
div.page, li.scroll-current>.reference, dl.glossary dt, dl.simple dt, dl:not([class]) dt {
font-weight: 300;
line-height: 1.5;
font-size: var(--font-size--normal);
}
/** Side bars (side-bar tree = left, toc-tree = right) **/
div.sidebar-tree {
font-weight: 200;
line-height: 1.5;
font-size: var(--font-size--normal);
}
div.toc-tree {
font-weight: 200;
font-size: var(--font-size--medium);
line-height: 1.5;
}
.sidebar-tree .toctree-l1>.reference, .toc-tree li.scroll-current>.reference {
font-weight: 400;
}
/** List styling **/
ol, ul {
margin-bottom: 1.5rem;
margin-left: 1rem;
margin-top: 0;
padding-left: 1rem;
}
/** Table styling **/
th.head {
@ -67,9 +26,9 @@ table.docutils td, table.docutils th, table.docutils td:last-child, table.docuti
border-left: none;
}
/* center align table cells with ":-:" */
td.text-center {
text-align: center;
/* Allow to centre text horizontally in table data cells */
table.align-center {
text-align: center !important;
}
/** No rounded corners **/
@ -78,44 +37,12 @@ td.text-center {
border-radius: 0;
}
/** code blocks and literals **/
code.docutils.literal.notranslate, .highlight pre, pre.literal-block {
font-size: var(--font-size--medium);
}
/** Admonition styling **/
.admonition {
font-size: var(--font-size--medium);
box-shadow: none;
}
/** Styling for links **/
/* unvisited link */
a:link {
color: #06c;
text-decoration: none;
}
/* visited link */
a:visited {
color: #7d42b8;
text-decoration: none;
}
/* mouse over link */
a:hover {
text-decoration: underline;
}
/* selected link */
a:active {
text-decoration: underline;
}
a.sidebar-brand.centered {
text-decoration: none;
border-top: 1px solid #d9d9d9;
border-right: 1px solid #d9d9d9;
border-bottom: 1px solid #d9d9d9;
}
/** Color for the "copy link" symbol next to headings **/
@ -242,7 +169,43 @@ details summary {
color: var(--color-link);
}
/** Context links at the bottom of the page **/
footer {
font-size: var(--font-size--medium);
/** Fix the styling of the version box for readthedocs **/
#furo-readthedocs-versions .rst-versions, #furo-readthedocs-versions .rst-current-version, #furo-readthedocs-versions:focus-within .rst-current-version, #furo-readthedocs-versions:hover .rst-current-version {
background: var(--color-sidebar-item-background--hover);
}
.rst-versions .rst-other-versions dd a {
color: var(--color-link);
}
#furo-readthedocs-versions:focus-within .rst-current-version .fa-book, #furo-readthedocs-versions:hover .rst-current-version .fa-book, .rst-versions .rst-other-versions {
color: var(--color-sidebar-link-text);
}
.rst-versions .rst-current-version {
color: var(--color-version-popup);
font-weight: bolder;
}
/* Code-block copybutton invisible by default
(overriding Furo config to achieve default copybutton setting). */
.highlight button.copybtn {
opacity: 0;
}
/* Mimicking the 'Give feedback' button for UX consistency */
.sidebar-search-container input[type=submit] {
color: #FFFFFF;
border: 2px solid #D6410D;
padding: var(--sidebar-search-input-spacing-vertical) var(--sidebar-search-input-spacing-horizontal);
background: #D6410D;
font-weight: bold;
font-size: var(--font-size--small);
cursor: pointer;
}
.sidebar-search-container input[type=submit]:hover {
text-decoration: underline;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,88 @@
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
--font-stack: Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
--font-stack--monospace: Ubuntu Mono, Consolas, Monaco, Courier, monospace;
--color-foreground-primary: #111;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #333;
--color-background-secondary: #FFF;
--color-background-hover: #f2f2f2;
--color-brand-primary: #111;
--color-brand-content: #06C;
--color-api-background: #cdcdcd;
--color-inline-code-background: rgba(0,0,0,.03);
--color-sidebar-link-text: #111;
--color-sidebar-item-background--current: #ebebeb;
--color-sidebar-item-background--hover: #f2f2f2;
--toc-font-size: var(--font-size--small);
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #EbEbEb;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #772953;
}
@media not print {
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #CDCDCD;
--color-background-secondary: var(--color-background-primary);
--color-background-hover: #666;
--color-brand-primary: #fff;
--color-brand-content: #06C;
--color-sidebar-link-text: #f7f7f7;
--color-sidebar-item-background--current: #666;
--color-sidebar-item-background--hover: #333;
--color-admonition-background: transparent;
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #666;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #F29879;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
--color-foreground-secondary: var(--color-foreground-primary);
--color-foreground-muted: #CDCDCD;
--color-background-secondary: var(--color-background-primary);
--color-background-hover: #666;
--color-brand-primary: #fff;
--color-brand-content: #06C;
--color-sidebar-link-text: #f7f7f7;
--color-sidebar-item-background--current: #666;
--color-sidebar-item-background--hover: #333;
--color-admonition-background: transparent;
--color-admonition-title-background--note: var(--color-background-primary);
--color-admonition-title-background--tip: var(--color-background-primary);
--color-admonition-title-background--important: var(--color-background-primary);
--color-admonition-title-background--caution: var(--color-background-primary);
--color-admonition-title--note: #24598F;
--color-admonition-title--tip: #24598F;
--color-admonition-title--important: #C7162B;
--color-admonition-title--caution: #F99B11;
--color-highlighted-background: #666;
--color-link-underline: var(--color-background-primary);
--color-link-underline--hover: var(--color-background-primary);
--color-version-popup: #F29879;
}
}
}

View File

@ -4,7 +4,7 @@
.github-issue-link {
font-size: var(--font-size--small);
font-weight: bold;
background-color: #DD4814;
background-color: #D6410D;
padding: 13px 23px;
text-decoration: none;
}

View File

@ -1,19 +1,17 @@
// if we already have an onload function, save that one
var prev_handler = window.onload;
window.onload = function() {
// call the previous onload function
if (prev_handler) {
prev_handler();
}
const link = document.createElement("a");
link.classList.add("muted-link");
link.classList.add("github-issue-link");
link.text = "Give feedback";
link.href = (
"https://github.com/canonical/subiquity/issues/new?"
+ "title=docs%3A+TYPE+YOUR+QUESTION+HERE"
+ "&body=*Please describe the question or issue you're facing with "
+ `"${document.title}"`
+ ".*"
+ "%0A%0A%0A%0A%0A"
+ "---"
+ "%0A"
+ `*Reported+from%3A+${location.href}*`
);
link.href = ("https://bugs.launchpad.net/subiquity/+filebug");
link.target = "_blank";
const div = document.createElement("div");

View File

@ -0,0 +1,10 @@
$(document).ready(function() {
$(document).on("click", function () {
$(".more-links-dropdown").hide();
});
$('.nav-more-links').click(function(event) {
$('.more-links-dropdown').toggle();
event.stopPropagation();
});
})

View File

@ -0,0 +1,167 @@
.p-navigation {
border-bottom: 1px solid var(--color-sidebar-background-border);
}
.p-navigation__nav {
background: #333333;
display: flex;
}
.p-logo {
display: flex !important;
padding-top: 0 !important;
text-decoration: none;
}
.p-logo-image {
height: 44px;
padding-right: 10px;
}
.p-logo-text {
margin-top: 18px;
color: white;
text-decoration: none;
}
ul.p-navigation__links {
display: flex;
list-style: none;
margin-left: 0;
margin-top: auto;
margin-bottom: auto;
max-width: 800px;
width: 100%;
}
ul.p-navigation__links li {
margin: 0 auto;
text-align: center;
width: 100%;
}
ul.p-navigation__links li a {
background-color: rgba(0, 0, 0, 0);
border: none;
border-radius: 0;
color: var(--color-sidebar-link-text);
display: block;
font-weight: 400;
line-height: 1.5rem;
margin: 0;
overflow: hidden;
padding: 1rem 0;
position: relative;
text-align: left;
text-overflow: ellipsis;
transition-duration: .1s;
transition-property: background-color, color, opacity;
transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
white-space: nowrap;
width: 100%;
}
ul.p-navigation__links .p-navigation__link {
color: #ffffff;
font-weight: 300;
text-align: center;
text-decoration: none;
}
ul.p-navigation__links .p-navigation__link:hover {
background-color: #2b2b2b;
}
ul.p-navigation__links .p-dropdown__link:hover {
background-color: var(--color-sidebar-item-background--hover);
}
ul.p-navigation__links .p-navigation__sub-link {
background: var(--color-background-primary);
padding: .5rem 0 .5rem .5rem;
font-weight: 300;
}
ul.p-navigation__links .more-links-dropdown li a {
border-left: 1px solid var(--color-sidebar-background-border);
border-right: 1px solid var(--color-sidebar-background-border);
}
ul.p-navigation__links .more-links-dropdown li:first-child a {
border-top: 1px solid var(--color-sidebar-background-border);
}
ul.p-navigation__links .more-links-dropdown li:last-child a {
border-bottom: 1px solid var(--color-sidebar-background-border);
}
ul.p-navigation__links .p-navigation__logo {
padding: 0.5rem;
}
ul.p-navigation__links .p-navigation__logo img {
width: 40px;
}
ul.more-links-dropdown {
display: none;
overflow-x: visible;
height: 0;
z-index: 55;
padding: 0;
position: relative;
list-style: none;
margin-bottom: 0;
margin-top: 0;
}
.nav-more-links::after {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23111' d='M8.187 11.748l6.187-6.187-1.06-1.061-5.127 5.127L3.061 4.5 2 5.561z'/%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: "";
display: block;
filter: invert(100%);
height: 1rem;
pointer-events: none;
position: absolute;
right: 1rem;
text-indent: calc(100% + 10rem);
top: calc(1rem + 0.25rem);
width: 1rem;
}
.nav-ubuntu-com {
display: none;
}
@media only screen and (min-width: 480px) {
ul.p-navigation__links li {
width: 100%;
}
.nav-ubuntu-com {
display: inherit;
}
}
@media only screen and (max-width: 800px) {
.nav-more-links {
margin-left: auto !important;
padding-right: 2rem !important;
width: 8rem !important;
}
}
@media only screen and (min-width: 800px) {
ul.p-navigation__links li {
width: 100% !important;
}
}
@media only screen and (min-width: 1310px) {
ul.p-navigation__links {
margin-left: calc(50% - 41em);
}
}

BIN
doc/.sphinx/_static/tag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,12 @@
{% extends "furo/base.html" %}
{% block theme_scripts %}
<script>
const github_url = "{{ github_url }}";
</script>
{% endblock theme_scripts %}
{# ru-fu: don't include the color variables from the conf.py file, but use a
separate CSS file to save space #}
{% block theme_styles %}
{% endblock theme_styles %}

View File

@ -0,0 +1,99 @@
{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #}
<div class="related-pages">
{# mod: Per-page navigation #}
{% if meta %}
{% if 'sequential_nav' in meta %}
{% set sequential_nav = meta.sequential_nav %}
{% endif %}
{% endif %}
{# mod: Conditional wrappers to control page navigation buttons #}
{% if sequential_nav != "none" -%}
{% if next and (sequential_nav == "next" or sequential_nav == "both") -%}
<a class="next-page" href="{{ next.link }}">
<div class="page-info">
<div class="context">
<span>{{ _("Next") }}</span>
</div>
<div class="title">{{ next.title }}</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
{%- endif %}
{% if prev and (sequential_nav == "prev" or sequential_nav == "both") -%}
<a class="prev-page" href="{{ prev.link }}">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>{{ _("Previous") }}</span>
</div>
{% if prev.link == pathto(master_doc) %}
<div class="title">{{ _("Home") }}</div>
{% else %}
<div class="title">{{ prev.title }}</div>
{% endif %}
</div>
</a>
{%- endif %}
{%- endif %}
</div>
<div class="bottom-of-page">
<div class="left-details">
{%- if show_copyright %}
<div class="copyright">
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e -%}
<a href="{{ path }}">Copyright</a> &#169; {{ copyright }}
{%- endtrans %}
{%- else %}
{% trans copyright=copyright|e -%}
Copyright &#169; {{ copyright }}
{%- endtrans %}
{%- endif %}
</div>
{%- endif %}
{# mod: removed "Made with" #}
{%- if last_updated -%}
<div class="last-updated">
{% trans last_updated=last_updated|e -%}
Last updated on {{ last_updated }}
{%- endtrans -%}
</div>
{%- endif %}
{%- if show_source and has_source and sourcename %}
<div class="show-source">
<a class="muted-link" href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">Show source</a>
</div>
{%- endif %}
</div>
<div class="right-details">
{# mod: replaced RTD icons with our links #}
{% if discourse %}
<div class="ask-discourse">
<a class="muted-link" href="{{ discourse }}">Ask a question on Discourse</a>
</div>
{% endif %}
{% if github_url and github_version and github_folder %}
{% if github_issues %}
<div class="issue-github">
<a class="muted-link" href="https://bugs.launchpad.net/subiquity/+filebug">Open a Launchpad issue for this documentation</a>
</div>
{% endif %}
<div class="edit-github">
<a class="muted-link" href="{{ github_url }}/edit/{{ github_version }}{{ github_folder }}{{ pagename }}{{ page_source_suffix }}">Edit this page on GitHub</a>
</div>
{% endif %}
</div>
</div>
</div>

View File

@ -0,0 +1,36 @@
<header id="header" class="p-navigation">
<div class="p-navigation__nav" role="menubar">
<ul class="p-navigation__links" role="menu">
<li>
<a class="p-logo" href="https://{{ product_page }}" aria-current="page">
<img src="{{ pathto(product_tag,1) }}" alt="Logo" class="p-logo-image">
<div class="p-logo-text p-heading--4">{{ project.title() }}
</div>
</a>
</li>
<li class="nav-ubuntu-com">
<a href="https://{{ product_page }}" class="p-navigation__link">{{ product_page }}</a>
</li>
<li>
<a href="#" class="p-navigation__link nav-more-links">More resources</a>
<ul class="more-links-dropdown">
<li>
<a href="{{ discourse }}" class="p-navigation__sub-link p-dropdown__link">Forum</a>
</li>
<li>
<a href="{{ github_url }}" class="p-navigation__sub-link p-dropdown__link">GitHub</a>
</li>
</ul>
</li>
</ul>
</div>
</header>

View File

@ -0,0 +1,49 @@
{% extends "furo/page.html" %}
{% block footer %}
{% include "footer.html" %}
{% endblock footer %}
{% block body -%}
{% include "header.html" %}
{{ super() }}
{%- endblock body %}
{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %}
{% set furo_hide_toc_orig = furo_hide_toc %}
{% set furo_hide_toc=false %}
{% endif %}
{% block right_sidebar %}
<div class="toc-sticky toc-scroll">
{% if not furo_hide_toc_orig %}
<div class="toc-title-container">
<span class="toc-title">
{{ _("Contents") }}
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
{{ toc }}
</div>
</div>
{% endif %}
{% if meta and ((meta.discourse and discourse_prefix) or meta.relatedlinks) %}
<div class="relatedlinks-title-container">
<span class="relatedlinks-title">
Related links
</span>
</div>
<div class="relatedlinks-container">
<div class="relatedlinks">
{% if meta.discourse and discourse_prefix %}
{{ discourse_links(meta.discourse) }}
{% endif %}
{% if meta.relatedlinks %}
{{ related_links(meta.relatedlinks) }}
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endblock right_sidebar %}

View File

@ -0,0 +1,7 @@
<form class="sidebar-search-container" method="get" action="{{ pathto('search') }}" role="search">
<input class="sidebar-search" placeholder="{{ _("Search") }}" name="q" aria-label="{{ _("Search" ) }}">
<input type="submit" value="Go">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div>

View File

@ -1,6 +1,13 @@
sphinx
sphinx-autobuild
sphinx-design
furo
m2r2
sphinx==5.1.1
sphinx_autobuild
sphinx_copybutton
sphinx_design
sphinx-tabs
sphinx-reredirects
pyspelling
sphinxext-opengraph
lxd-sphinx-extensions
sphinx-copybutton
myst-parser
sphinxcontrib-jquery
sphinx-notfound-page

View File

@ -0,0 +1,28 @@
matrix:
- name: rST files
aspell:
lang: en
d: en_GB
dictionary:
wordlists:
- .wordlist.txt
- .custom_wordlist.txt
output: .sphinx/.wordlist.dic
sources:
- _build/**/*.html
pipeline:
- pyspelling.filters.html:
comments: false
attributes:
- title
- alt
ignores:
- code
- pre
- spellexception
- link
- title
- div.relatedlinks
- div.visually-hidden
- img
- a.p-navigation__link

4
doc/.wokeignore Normal file
View File

@ -0,0 +1,4 @@
# the cheat sheets contain a link to a repository with a block word which we
# cannot avoid for now, ie
# https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
doc-cheat-sheet*

41
doc/.wordlist.txt Normal file
View File

@ -0,0 +1,41 @@
API
APIs
CLI
Charmhub
Diátaxis
EBS
EKS
Grafana
IAM
ISO
ISOs
JSON
Jira
Juju
Kubeflow
Kubernetes
Makefile
MyST
NodePort
OLM
Permalink
RTD
ReadMe
UI
VM
YAML
addons
balancer
boolean
dropdown
favicon
installable
namespace
namespaces
observability
reST
reStructuredText
subdirectories
subfolders
subtree

View File

@ -10,10 +10,12 @@ VENV = .sphinx/venv/bin/activate
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
help: install
@. $(VENV); $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
install:
install: .sphinx/venv
.sphinx/venv: .sphinx/requirements.txt
@echo "... setting up virtualenv"
python3 -m venv .sphinx/venv
. $(VENV); pip install --upgrade -r .sphinx/requirements.txt
@ -30,16 +32,20 @@ install:
"* check links: make linkcheck \n" \
"* check inclusive language: make woke \n" \
"--------------------------------------------------------------- \n"
run:
.sphinx/requirements.txt:
:
run: install
. $(VENV); sphinx-autobuild -c . -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)"
html:
html: install
. $(VENV); $(SPHINXBUILD) -c . -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w .sphinx/warnings.txt
epub:
epub: install
. $(VENV); $(SPHINXBUILD) -c . -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w .sphinx/warnings.txt
serve:
serve: run
cd "$(BUILDDIR)"; python3 -m http.server 8000
clean: clean-doc
@ -48,17 +54,17 @@ clean: clean-doc
clean-doc:
git clean -fx "$(BUILDDIR)"
spelling: html
spelling: install html
. $(VENV) ; python3 -m pyspelling -c .sphinx/spellingcheck.yaml
linkcheck:
linkcheck: install
. $(VENV) ; $(SPHINXBUILD) -c . -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)"
woke:
type woke >/dev/null 2>&1 || { snap install woke; exit 1; }
type woke >/dev/null 2>&1 || { sudo snap install woke || exit 1; }
woke *.rst **/*.rst -c https://github.com/canonical-web-and-design/Inclusive-naming/raw/main/config.yml
.PHONY: help Makefile
.PHONY: help Makefile install
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

View File

@ -1,19 +1,14 @@
# Documentation
This `doc` folder is the future location of documentation for Subiquity. This
will be used to migrate the official documentation to readthedocs, and later
will be the home of that documentation.
This `doc` folder is the location of documentation for Subiquity.
The `../documentation` folder is the existing location for this sort of
documentation. As the RTD version is not yet ready, documentation changes
should be made to `../documentation` until this README is updated to say
otherwise. As such, please make any desired documentation changes to
`../documentation`.
In the not distant past, there was also a `../documentation` folder, but that
is now an obsolete copy of what was on Discourse.
# Local preview
To build this documentation, you can run `make install` from this folder to
create the virtual environment.
create the virtual environment.
Then run the `make run` command, which will build a html version of the docs,
and serve the docs in the virtual environment. This is very convenient if you

View File

@ -1,7 +0,0 @@
.sidebar-brand.centered {
text-align: start;
}
.sidebar-logo {
max-width: 44px;
margin: initial;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -1,138 +1,128 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
import datetime
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown:
sys.path.append('./')
from custom_conf import *
#sys.path.insert(0, os.path.abspath('../../'))
#sys.path.insert(0, os.path.abspath('../'))
#sys.path.insert(0, os.path.abspath('./'))
#sys.path.insert(0, os.path.abspath('.'))
# Configuration file for the Sphinx documentation builder.
# You should not do any modifications to this file. Put your custom
# configuration into the custom_conf.py file.
# If you need to change this file, contribute the changes upstream.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
project = 'Ubuntu Install Guide'
copyright = 'Canonical Group Ltd'
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '5.1.1'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
############################################################
### Extensions
############################################################
extensions = [
'sphinx.ext.intersphinx',
'sphinx_copybutton',
'sphinx_design',
'sphinx_tabs.tabs',
'sphinx_reredirects',
'canonical.youtube-links',
'canonical.related-links',
'canonical.custom-rst-roles',
'canonical.terminal-output',
'sphinx_copybutton',
'sphinxext.opengraph',
'myst_parser',
'sphinxcontrib.jquery',
'notfound.extension'
]
extensions.extend(custom_extensions)
### Configuration for extensions
# Additional MyST syntax
myst_enable_extensions = [
'substitution',
'deflist'
]
intersphinx_mapping = {
'cloud-init': (
'https://canonical-cloud-init.readthedocs-hosted.com/en/latest',
None
)
# Used for related links
if 'discourse' in html_context:
html_context['discourse_prefix'] = html_context['discourse'] + '/t/'
# The default for notfound_urls_prefix usually works, but not for
# documentation on documentation.ubuntu.com
if slug:
notfound_urls_prefix = '/' + slug + '/en/latest/'
notfound_context = {
'title': 'Page not found',
'body': '<h1>Page not found</h1>\n\n<p>Sorry, but the documentation page that you are looking for was not found.</p>\n<p>Documentation changes over time, and pages are moved around. We try to redirect you to the updated content where possible, but unfortunately, that didn\'t work this time (maybe because the content you were looking for does not exist in this version of the documentation).</p>\n<p>You can try to use the navigation to locate the content you\'re looking for, or search for a similar page.</p>\n',
}
# Add any paths that contain templates here, relative to this directory.
# Default image for OGP (to prevent font errors, see
# https://github.com/canonical/sphinx-docs-starter-pack/pull/54 )
if not 'ogp_image' in locals():
ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg'
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The root toctree document.
root_doc = 'index'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
# version = version.version_string()
# release = version
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
############################################################
### General configuration
############################################################
exclude_patterns = [
'.sphinx/venv/*',
'README.md',
'_build',
'Thumbs.db',
'.DS_Store',
'.sphinx',
]
exclude_patterns.extend(custom_excludes)
# Sphinx-copybutton config options:
# 1) prompt to be stripped from copied code.
# 2) Set to copy all lines (not just prompt lines) to ensure multiline snippets
# can be copied even if they don't contain an EOF line.
copybutton_prompt_text = '$ '
copybutton_only_copy_prompt_lines = False
rst_epilog = '''
.. include:: /reuse/links.txt
'''
if 'custom_rst_epilog' in locals():
rst_epilog = custom_rst_epilog
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes:
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'furo'
html_logo = '_static/ubuntu_logo.png'
html_theme_options = {
'light_css_variables': {
'color-sidebar-background-border': 'none',
'font-stack': 'Ubuntu, -apple-system, Segoe UI, Roboto, Oxygen, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif',
'font-stack--monospace': 'Ubuntu Mono variable, Ubuntu Mono, Consolas, Monaco, Courier, monospace',
'color-foreground-primary': '#111',
'color-foreground-secondary': 'var(--color-foreground-primary)',
'color-foreground-muted': '#333',
'color-background-secondary': '#FFF',
'color-background-hover': '#f2f2f2',
'color-brand-primary': '#111',
'color-brand-content': '#06C',
'color-inline-code-background': 'rgba(0,0,0,.03)',
'color-sidebar-link-text': '#111',
'color-sidebar-item-background--current': '#ebebeb',
'color-sidebar-item-background--hover': '#f2f2f2',
'sidebar-item-line-height': '1.3rem',
'color-link-underline': 'var(--color-background-primary)',
'color-link-underline--hover': 'var(--color-background-primary)',
},
'dark_css_variables': {
'color-foreground-secondary': 'var(--color-foreground-primary)',
'color-foreground-muted': '#CDCDCD',
'color-background-secondary': 'var(--color-background-primary)',
'color-background-hover': '#666',
'color-brand-primary': '#fff',
'color-brand-content': '#06C',
'color-sidebar-link-text': '#f7f7f7',
'color-sidebar-item-background--current': '#666',
'color-sidebar-item-background--hover': '#333',
},
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named 'default.css' will overwrite the builtin 'default.css'.
html_static_path = ['_static']
if not 'conf_py_path' in html_context and 'github_folder' in html_context:
html_context['conf_py_path'] = html_context['github_folder']
# If you ever want to use the feedback button, turn on GH issues and then
# uncomment the github_issue_links files
# For ignoring specific links
linkcheck_anchors_ignore_for_url = [
r'https://github\.com/.*'
]
linkcheck_anchors_ignore_for_url.extend(custom_linkcheck_anchors_ignore_for_url)
############################################################
### Styling
############################################################
# Find the current builder
builder = 'dirhtml'
if '-b' in sys.argv:
builder = sys.argv[sys.argv.index('-b')+1]
# Setting templates_path for epub makes the build fail
if builder == 'dirhtml' or builder == 'html':
templates_path = ['.sphinx/_templates']
# Theme configuration
html_theme = 'furo'
html_last_updated_fmt = ''
html_permalinks_icon = ''
############################################################
### Additional files
############################################################
html_static_path = ['.sphinx/_static']
html_css_files = [
'css/logo.css',
# 'css/github_issue_links.css',
'css/custom.css',
]
html_js_files = [
# 'js/github_issue_links.js',
'custom.css',
'header.css',
'github_issue_links.css',
'furo_colors.css'
]
html_css_files.extend(custom_html_css_files)
html_js_files = ['header-nav.js']
if 'github_issues' in html_context and html_context['github_issues'] and not disable_feedback_button:
html_js_files.append('github_issue_links.js')
html_js_files.extend(custom_html_js_files)

179
doc/custom_conf.py Normal file
View File

@ -0,0 +1,179 @@
import datetime
# Custom configuration for the Sphinx documentation builder.
# All configuration specific to your project should be done in this file.
#
# The file is included in the common conf.py configuration file.
# You can modify any of the settings below or add any configuration that
# is not covered by the common conf.py file.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
############################################################
### Project information
############################################################
# Product name
project = 'Ubuntu installation'
author = 'Canonical Group Ltd'
# Uncomment if your product uses release numbers
# release = '1.0'
# The default value uses the current year as the copyright year.
#
# For static works, it is common to provide the year of first publication.
# Another option is to give the first year and the current year
# for documentation that is often changed, e.g. 20222023 (note the en-dash).
#
# A way to check a GitHub repo's creation date is to obtain a classic GitHub
# token with 'repo' permissions here: https://github.com/settings/tokens
# Next, use 'curl' and 'jq' to extract the date from the GitHub API's output:
#
# curl -H 'Authorization: token <TOKEN>' \
# -H 'Accept: application/vnd.github.v3.raw' \
# https://api.github.com/repos/canonical/<REPO> | jq '.created_at'
copyright = '%s, %s' % (datetime.date.today().year, author)
## Open Graph configuration - defines what is displayed in the website preview
# The URL of the documentation output
ogp_site_url = 'https://canonical-subiquity.readthedocs-hosted.com/'
# The documentation website name (usually the same as the product name)
ogp_site_name = 'Ubuntu Installation Guide'
# An image or logo that is used in the preview
ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg'
# Update with the favicon for your product (default is the circle of friends)
html_favicon = '.sphinx/_static/favicon.png'
# (Some settings must be part of the html_context dictionary, while others
# are on root level. Don't move the settings.)
html_context = {
# Change to the link to your product website (without "https://")
'product_page': 'ubuntu.com/download',
# Add your product tag to ".sphinx/_static" and change the path
# here (start with "_static"), default is the circle of friends
'product_tag': '_static/tag.png',
# Change to the discourse instance you want to be able to link to
# using the :discourse: metadata at the top of a file
# (use an empty value if you don't want to link)
'discourse': 'https://discourse.ubuntu.com/c/foundations/',
# Change to the GitHub info for your project
'github_url': 'https://github.com/canonical/subiquity',
# Change to the branch for this version of the documentation
'github_version': 'main',
# Change to the folder that contains the documentation
# (usually "/" or "/docs/")
'github_folder': '/doc/',
# Change to an empty value if your GitHub repo doesn't have issues enabled.
# This will disable the feedback button and the issue link in the footer.
'github_issues': 'https://bugs.launchpad.net/subiquity',
# Controls the existence of Previous / Next buttons at the bottom of pages
# Valid options: none, prev, next, both
'sequential_nav': "none"
}
# If your project is on documentation.ubuntu.com, specify the project
# slug (for example, "lxd") here.
slug = ""
############################################################
### Redirects
############################################################
# Set up redirects (https://documatt.gitlab.io/sphinx-reredirects/usage.html)
# For example: 'explanation/old-name.html': '../how-to/prettify.html',
redirects = {}
############################################################
### Link checker exceptions
############################################################
# Links to ignore when checking links
linkcheck_ignore = [
'http://127.0.0.1:8000'
]
# Pages on which to ignore anchors
# (This list will be appended to linkcheck_anchors_ignore_for_url)
custom_linkcheck_anchors_ignore_for_url = [
]
############################################################
### Additions to default configuration
############################################################
## The following settings are appended to the default configuration.
## Use them to extend the default functionality.
# Add extensions
custom_extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks'
]
# Add files or directories that should be excluded from processing.
custom_excludes = [
'doc-cheat-sheet*',
'.sphinx/venv/*',
'README.md',
]
# Add CSS files (located in .sphinx/_static/)
custom_html_css_files = []
# Add JavaScript files (located in .sphinx/_static/)
custom_html_js_files = []
## The following settings override the default configuration.
# Specify a reST string that is included at the end of each file.
# If commented out, use the default (which pulls the reuse/links.txt
# file into each reST file).
custom_rst_epilog = '''
.. include:: /reuse/substitutions.txt
.. include:: /reuse/links.txt
'''
# By default, the documentation includes a feedback button at the top.
# You can disable it by setting the following configuration to True.
disable_feedback_button = False
############################################################
### Additional configuration
############################################################
## Add any configuration that is not covered by the common conf.py file.
intersphinx_mapping = {
'cloud-init': (
'https://canonical-cloud-init.readthedocs-hosted.com/en/latest',
None
)
}
# The root toctree document.
root_doc = 'index'
# Sphinx-copybutton config options:
# 1) prompt to be stripped from copied code.
# 2) Set to copy all lines (not just prompt lines) to ensure multiline snippets
# can be copied even if they don't contain an EOF line.
copybutton_prompt_text = '$ '
copybutton_only_copy_prompt_lines = False
extlinks = {
'manualpage': ( 'https://manpages.ubuntu.com/manpages/lunar/en/%s', '' )
}

View File

@ -1,33 +0,0 @@
Development
***********
Subiquity is an open source project that warmly welcomes community
projects, contributions, suggestions, fixes and constructive feedback. If you
would like to contribute to Subiquity, this set of documentation will help
orient you with our processes.
-----
Contributing
============
.. toctree::
:maxdepth: 1
Debugging and reporting
=======================
.. toctree::
:maxdepth: 1
Testing
=======
.. toctree::
:maxdepth: 1
Documentation
=============
.. toctree::
:maxdepth: 1

View File

@ -0,0 +1,35 @@
.. _cloudinit-autoinstall-interaction:
Cloud-init and autoinstall interaction
======================================
While cloud-init may provide the autoinstall configuration to the Ubuntu
installer, it does not process the autoinstall directives itself.
Cloud-init runs in both the ephemeral system (during installation) and in the target
system during first boot. Cloud-init then becomes inert for every subsequent
reboot.
To modify the ephemeral system with cloud-init, any
:external+cloud-init:ref:`#cloud-config module schema keys<modules>` can
be provided. If instead cloud-init directives are intended to modify the system
being installed, they must appear under a :ref:`ai-user-data` section under
``autoinstall:``.
.. code-block:: yaml
#cloud-config
# cloud-init directives may optionally be specified here.
# These directives affect the ephemeral system performing the installation.
autoinstall:
# autoinstall directives must be specified here, not directly at the
# top level. These directives are processed by the Ubuntu Installer,
# and configure the target system to be installed.
user-data:
# cloud-init directives may also be optionally be specified here.
# These directives also affect the target system to be installed,
# and are processed on first boot.
For an overview of the methods used to provide the autoinstall configuration to the Ubuntu installer, go to :ref:`Providing autoinstall configuration <providing-autoinstall>`.

View File

@ -1,176 +0,0 @@
.. _configure-storage:
Configuring storage
*******************
There are a lot of options for storage configuration with the Subiquity
installer. This guide will walk you through some of the common options for an
Ubuntu Server installation.
Guided options
==============
.. image:: figures/configure-storage-guided-options.png
:alt:
Selecting "Use an entire disk" on the Guided storage configuration screen will
install Ubuntu onto the selected disk, replacing any partitions or data already
there.
You can choose whether or not to set up LVM, and if you do, whether or not to
encrypt the volume with LUKS. If you encrypt the volume, you need to choose a
passphrase that will need to be entered each time the system boots.
If you select "Custom storage layout", no configuration will be applied to the
disks.
In either case, the installer moves onto the main storage customisation screen.
The main storage screen
=======================
.. image:: figures/configure-storage-main-screen.png
:alt:
This screen presents a summary of the current storage configuration. Each
device or partition of a device corresponds to a different row (which can be
selected), and pressing :kbd:`Enter` or :kbd:`space` while a device is selected
opens a menu of actions that apply to that device.
Partitions
==========
.. image:: figures/configure-storage-partitions.png
:alt:
To add a partition to a device, select "Add GPT Partition" for that device.
.. image:: figures/configure-storage-GPT-partition.png
:alt:
You can leave "Size" blank to use all the remaining space on the device.
RAID
====
.. image:: figures/configure-storage-raid.png
:alt:
`Linux software RAID <https://raid.wiki.kernel.org/index.php/Linux_Raid>`_
(where RAID stands for "Redundant Array of Inexpensive Disks") can be used to
combine several disks into a single device that is (usually) tolerant to any
one disk failure.
A software RAID device can be created out of entire disks or unformatted
partitions. Select the "Create software RAID ("MD")" button to open the
creation dialog.
The server installer supports devices with RAID level 0, 1, 5, 6 or 10 being
created. It does not allow customising other options such as metadata format or
RAID10 layout at this time. See the
`Linux RAID documentation <https://raid.wiki.kernel.org/index.php/Linux_Raid>`_
for more details.
A software RAID device can be formatted and mounted directly, can be
partitioned into several partitions, and can even be used as part of another
RAID device or LVM volume group.
Logical Volume Manager (LVM)
============================
.. image:: figures/configure-storage-lvm.png
:alt:
The LVM is a system of managing logical volumes, or filesystems, that is much
more advanced and flexible than the traditional method of partitioning a disk
into one or more segments and formatting that partition with a filesystem. It
can be used to combine several disks into one larger pool of storage but it
offers advantages even in a single disk system, such as snapshots and easy
resizing of logical volumes.
As with RAID, a LVM volume group can be created out of entire disks or
unformatted partitions. Select the "Create LVM volume group" button to open
the creation dialog.
Once a volume group has been created, it can be divided into named logical
volumes which can then be formatted and mounted. It generally makes sense to
leave some space in the volume group for storage of snapshots and creation of
more logical volumes as needed.
The server installer does not supported configuring any of the many, many
options that LVM supports when creating volume groups and logical volumes.
Selecting boot devices
======================
.. image:: figures/configure-storage-boot-devices.png
:alt:
On all architectures other than s390x, the bootloader needs to be installed to
a disk in such a way that the system firmware can find it on boot. By default,
the first device to have a partition created on it is selected as a boot device
but this can be changed later.
On amd64 and arm64 systems, multiple disks can be selected as boot devices,
which means a system can be configured so that it will continue to boot after
a failure of any one drive (assuming the root filesystem is placed on a RAID).
The bootloader will be installed to each of these drives, and the operating
system configured to install new versions of GRUB to each drive as it is
updated.
amd64 systems use GRUB as the bootloader. amd64 systems can boot in either UEFI
or legacy (sometimes called "BIOS") mode (many systems can be configured to
boot in either mode) and the bootloader is located completely differently in
the two modes.
Legacy mode
-----------
In legacy mode, the bootloader is read from the first "sector" of a hard drive
(exactly which hard drive is up to the system firmware, which can usually be
configured in a vendor-specific way). The installer will write GRUB to the
start of all disks selected as a boot devices. As GRUB does not entirely fit
in one sector, a small unformatted partition is needed at the start of the
disk, which will automatically be created when a disk is selected as a boot
device (a disk with an existing GPT partition table can only be used as a boot
device if it has this partition).
UEFI mode
---------
In UEFI mode, the bootloader loaded from a "EFI System Partition" (ESP), which
is a partition with a particular type GUID. The installer automatically creates
an ESP (with minimum size 538 MiB) on a disk when it is selected as a boot
device and will install GRUB there (a disk with an existing partition table can
only be used as a boot device if it has an ESP -- bootloaders for multiple
operating systems can be installed into a single ESP). UEFI defines a standard
way to configure the way in which the operating system is chosen on boot, and
the installer uses this to configure the system to boot the just-installed
operating system. One of the ESPs must be mounted at ``/boot/efi``.
Supported arm64 servers boot using UEFI, and are configured the same way as an
UEFI-booting amd64 system.
ppc64el systems also load their bootloader (Petitboot, a small linux kernel)
from a "PReP" partition with a special flag, so in most ways they are similar
to a UEFI system. The installer only supports one PReP partition at this time.
Limitations and workarounds
===========================
Currently, the installer cannot **edit** partition tables. You can use existing
partitions or reformat a drive entirely, but you cannot (for example) remove a
large partition and replace it with two smaller ones.
The installer allows the creation of LVM volume groups and logical volumes and
MD raid devices, but does not allow tweaking of the parameters -- for example,
all logical volumes are linear and all MD raid devices use the default metadata
format (1.2).
These limits can both be worked around in the same way: drop to a shell and use
the usual shell commands to edit the partition table or create the LV or RAID
with desired parameters, and then select these partitions or devices as mount
points in the installer. Any changes you make while the installer is running
but before altering the storage configuration will reflected in the installer.
The installer cannot yet configure iSCSI mounts or btrfs subvolumes.

View File

@ -1,17 +1,15 @@
Explanation
***********
===========
Our explanatory and conceptual guides are written to provide a better
understanding of how Subiquity works. They enable you to expand your
knowledge and become better at using and configuring Subiquity.
The explanatory and conceptual guides are written to provide a better understanding of how Subiquity works. They enable you to expand your knowledge and become better at using and configuring Subiquity.
-----
About the Server installer
==========================
--------------------------
.. toctree::
:maxdepth: 1
operate-server-installer
configure-storage
cloudinit-autoinstall-interaction
zero-touch-autoinstall

View File

@ -1,96 +0,0 @@
.. _operate-server-installer:
Operating the Server installer
******************************
This document explains how to use the installer in general terms. For a
step-by-step guide through the screens of the installer, you can use our
`screen-by-screen reference guide <https://discourse.ubuntu.com/t/draft-using-the-server-installer-step-by-step/16690>`_.
Get the installer
=================
Installer images are made (approximately) daily and are available from
https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/. These are not
tested as extensively as the images from release day, but they contain the
latest packages and installer, so fewer updates will be required during or
after installation.
You can download the server installer for amd64 from
https://ubuntu.com/download/server and other architectures from
http://cdimage.ubuntu.com/releases/20.04/release/.
Installer UI navigation
=======================
In general, the installer can be used with the :kbd:`up` and :kbd:`down` arrows
and :kbd:`space` or :kbd:`Enter` keys and a little typing.
:kbd:`Tab` and :kbd:`Shift` + :kbd:`Tab` move the focus down and up respectively.
:kbd:`Home` / :kbd:`End` / :kbd:`Page Up` / :kbd:`Page Down` can be used to
navigate through long lists more quickly in the usual way.
Running the installer over serial
=================================
By default, the installer runs on the first virtual terminal, ``tty1``. This
is what is displayed on any connected monitor by default. However, servers do
not always have a monitor. Some out-of-band management systems provide a
remote virtual terminal, but sometimes it is necessary to run the installer on
the serial port. To do this, the kernel command line needs to
`have an appropriate console <https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html>`_
specified on it -- a common value is ``console=ttyS0`` but this is not
something that can be generically documented.
When running on serial, the installer starts in a basic mode that uses only
the ASCII character set and black and white colours. If you are connecting from
a terminal emulator such as gnome-terminal that supports Unicode and rich
colours you can switch to "rich mode" which uses Unicode, colours and supports
many languages.
.. _connect-via-ssh:
Connecting to the installer over SSH
====================================
If the only available terminal is very basic, an alternative is to connect via
SSH. If the network is up by the time the installer starts, instructions are
offered on the initial screen in basic mode. Otherwise, instructions are
available from the help menu once networking is configured.
In addition, connecting via SSH is assumed to be capable of displaying all
Unicode characters, enabling more translations to be used than can be displayed
on a virtual terminal.
Help menu
=========
The help menu is always in the top right of the screen. It contains help --
both general and for the currently displayed screen -- and some general actions.
Switching to a shell prompt
---------------------------
You can switch to a shell at any time by selecting "Enter shell" from the help
menu, or pressing :kbd:`Control` + :kbd:`Z` or :kbd:`F2`.
If you are accessing the installer via ``tty1``, you can also access a shell
by switching to a different virtual terminal (:kbd:`Control` + :kbd:`Alt` +
arrow, or :kbd:`Control` + :kbd:`Alt` + number keys, to move between virtual
terminals).
Global keys
===========
There are some global keys you can press at any time:
==================================== =============================================
Key Action
==================================== =============================================
:kbd:`ESC` Go back
:kbd:`F1` Open help menu
:kbd:`Control` + :kbd:`Z`, :kbd:`F2` Switch to shell
:kbd:`Control` + :kbd:`L`, :kbd:`F3` Redraw screen
:kbd:`Control` + :kbd:`T`, :kbd:`F4` Toggle rich mode (colour, Unicode) on and off
==================================== =============================================

View File

@ -0,0 +1,18 @@
Zero-touch deployment with autoinstall
======================================
The Ubuntu Installer contains a safeguard, intended to prevent USB Flash Drives
with an :code:`autoinstall.yaml` file from wiping out the wrong system.
Before the Ubuntu Installer actually makes changes to the target system, a
prompt is shown. ::
start: subiquity/Meta/status_GET
Confirmation is required to continue.
Add 'autoinstall' to your kernel command line to avoid this
Continue with autoinstall? (yes|no)
To bypass this prompt, arrange for the argument :code:`autoinstall` to be
present on the kernel command line.

View File

@ -0,0 +1 @@
google-site-verification: google8dda472a993637b7.html

View File

@ -1,75 +1,75 @@
.. _autoinstall-quickstart-s390x:
.. _autoinstall_quick_start_s390x:
Autoinstall quick start for s390x
*********************************
=================================
The intent of this page is to provide simple instructions to perform an
autoinstall in a VM on your machine on s390x.
This guide provides instructions on how to use autoinstall with a current version of Ubuntu for the s390x architecture in a virtual machine (VM) on your computer.
This page is just a slightly adapted page of the
`autoinstall quickstart page<autoinstall_quickstart>` mapped to s390x.
For older Ubuntu releases, substitute the version in the name of the ISO image. The instructions should otherwise be the same. See :ref:`Autoinstall quick start<autoinstall_quick_start>` for instructions on installing on the amd64 architecture.
Download an ISO
===============
Download the ISO
----------------
At the time of writing (just after the Kinetic release), the best place to go
is here:
https://cdimage.ubuntu.com/ubuntu/releases/22.10/release/
..code-block:: bash
wget https://cdimage.ubuntu.com/ubuntu/releases/22.10/release/ubuntu-22.10-live-server-s390x.iso -P ~/Downloads
Download the latest release of the Ubuntu Server image (ISO) from the `Ubuntu ISO download page`_ (currently |ubuntu-latest-version| (|ubuntu-latest-codename|)).
Mount the ISO
=============
-------------
.. code-block:: bash
Make the content of the ISO image accessible from a local directory:
.. code:: none
mkdir -p ~/iso
sudo mount -r ~/Downloads/ubuntu-22.10-live-server-s390x.iso ~/iso
sudo mount -r ~/Downloads/ubuntu-<version-number>-live-server-s390x.iso ~/iso
Write your autoinstall config
=============================
Change ``<version-number>`` to match the number of the release you have downloaded.
This means creating cloud-init config as follows:
Write your autoinstall configuration
------------------------------------
.. code-block:: bash
Create a cloud-init configuration:
.. code-block:: none
mkdir -p ~/www
cd ~/www
cat > user-data << 'EOF'
#cloud-config
autoinstall:
version: 1
identity:
version: 1
identity:
hostname: ubuntu-server
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
username: ubuntu
EOF
touch meta-data
The crypted password is just ``ubuntu``.
The encrypted password is ``ubuntu``.
Serve the cloud-init config over HTTP
=====================================
Serve the cloud-init configuration over HTTP
--------------------------------------------
Leave this running in one terminal window:
Leave the HTTP server running in a terminal:
.. code-block:: bash
.. code-block:: none
cd ~/www
python3 -m http.server 3003
Create a target disk
====================
--------------------
Proceed with a second terminal window:
In a new terminal, install the ``qemu-img`` utility:
.. code-block:: bash
.. code-block:: none
sudo apt install qemu-utils
...
Create the target VM disk for the installation:
.. code-block:: none
qemu-img create -f qcow2 disk-image.qcow2 10G
Formatting 'disk-image.qcow2', fmt=qcow2 size=10737418240 cluster_size=65536 lazy_refcounts=off refcount_bits=16
@ -85,41 +85,45 @@ Proceed with a second terminal window:
refcount bits: 16
corrupt: false
Run the install!
================
Run the installation
--------------------
.. code-block:: bash
Install the ``kvm`` command:
.. code-block:: none
sudo apt install qemu-kvm
...
You may need to add the default user to the ``kvm`` group: <<BR>>
Add the default user to the ``kvm`` group:
.. code-block:: bash
.. code-block:: none
sudo usermod -a -G kvm ubuntu # re-login to make the changes take effect
Run the installation in a VM. Change ``<version-number>`` in the following command to match the release ISO you downloaded:
.. code-block:: none
kvm -no-reboot -name auto-inst-test -nographic -m 2048 \
-drive file=disk-image.qcow2,format=qcow2,cache=none,if=virtio \
-cdrom ~/Downloads/ubuntu-22.10-live-server-s390x.iso \
-cdrom ~/Downloads/ubuntu-<version-number>-live-server-s390x.iso \
-kernel ~/iso/boot/kernel.ubuntu \
-initrd ~/iso/boot/initrd.ubuntu \
-append 'autoinstall ds=nocloud-net;s=http://_gateway:3003/ console=ttysclp0'
This will boot, download the config from the server (set up in the previous
step) and run the install.
The installer reboots at the end but the ``-no-reboot`` flag to ``kvm`` means
that ``kvm`` will exit when this happens. It should take about 5 minutes.
This command boots the VM, downloads the configuration from the server (prepared in the previous step) and runs the installation. The installer reboots at the end. The ``-no-reboot`` option to the ``kvm`` command instructs ``kvm`` to exit on reboot.
Boot the installed system
=========================
-------------------------
.. code-block:: bash
.. code-block:: none
kvm -no-reboot -name auto-inst-test -nographic -m 2048 \
-drive file=disk-image.qcow2,format=qcow2,cache=none,if=virtio
This will boot into the freshly installed system and you should be able to log
in as ``ubuntu/ubuntu``.
This command boots the installed system in the VM. Log in using ``ubuntu`` for both the user name and password.
.. LINKS
.. _Ubuntu ISO download page: https://releases.ubuntu.com/

View File

@ -1,128 +1,114 @@
.. _autoinstall_quickstart:
.. _autoinstall_quick_start:
Autoinstall quick start
***********************
=======================
The intent of this page is to provide simple instructions to perform an
autoinstall in a VM on your machine.
This guide provides instructions on how to use autoinstall with a current version of Ubuntu for the amd64 architecture in a virtual machine (VM) on your computer.
This page assumes that you are installing a recent Ubuntu release. However,
for older releases, you can substitute the name of the ISO image but the
instructions should otherwise be the same.
This page also assumes you are on the AMD64 architecture. There is a
:ref:`version for s390x<autoinstall-quickstart-s390x>` too.
For older Ubuntu releases, substitute the version in the name of the ISO image. The instructions should otherwise be the same. See :ref:`Autoinstall quick start for s390x<autoinstall_quick_start_s390x>` for instructions on installing on the s390x architecture.
Providing the autoinstall data over the network
===============================================
-----------------------------------------------
This method is the one that generalises most easily to doing an entirely
network-based install, where a machine netboots and then is automatically
installed.
This method describes a network-based installation. When booting over a network, use this method to deliver autoinstall to perform the installation.
Download the ISO
----------------
~~~~~~~~~~~~~~~~
Go to the `Ubuntu ISO download page`_ and download the latest Ubuntu
live-server ISO.
Download the latest release of the Ubuntu Server image (ISO) from the `Ubuntu ISO download page`_ (currently |ubuntu-latest-version| (|ubuntu-latest-codename|)).
Mount the ISO
-------------
~~~~~~~~~~~~~
.. code-block:: bash
Make the content of the ISO image accessible from a local directory:
sudo mount -r ~/Downloads/ubuntu-<release-number>-live-server-amd64.iso /mnt
.. code:: none
Where you should change `<release-number>` to match the number of the LTS or
release you have downloaded (e.g., `22.04.3` for Jammy or `23.04` for the Lunar
interim release).
sudo mount -r ~/Downloads/ubuntu-<version-number>-live-server-amd64.iso /mnt
Write your autoinstall config
-----------------------------
Change ``<version-number>`` to match the number of the release you have downloaded.
This means creating cloud-init config as follows:
Write your autoinstall configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
Create a cloud-init configuration:
.. code:: none
mkdir -p ~/www
cd ~/www
cat > user-data << 'EOF'
#cloud-config
autoinstall:
version: 1
identity:
version: 1
identity:
hostname: ubuntu-server
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
username: ubuntu
EOF
touch meta-data
The crypted password is just "ubuntu".
The encrypted password is ``ubuntu``.
Serve the cloud-init config over HTTP
-------------------------------------
Serve the cloud-init configuration over HTTP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Leave this running in one terminal window:
Leave the HTTP server running in a terminal:
.. code-block:: bash
.. code:: none
cd ~/www
python3 -m http.server 3003
Create a target disk
--------------------
~~~~~~~~~~~~~~~~~~~~
.. code-block::
Create the target VM disk for the installation:
.. code:: none
truncate -s 10G image.img
Run the install!
----------------
Run the installation
~~~~~~~~~~~~~~~~~~~~
As before, you will need to change `<release-number>` in the following command
to match the release ISO you downloaded.
Change ``<version-number>`` in the following command to match the release ISO you downloaded.
.. code-block:: bash
.. code:: none
kvm -no-reboot -m 2048 \
-drive file=image.img,format=raw,cache=none,if=virtio \
-cdrom ~/Downloads/ubuntu-<release-number>-live-server-amd64.iso \
-cdrom ~/Downloads/ubuntu-<version-number>-live-server-amd64.iso \
-kernel /mnt/casper/vmlinuz \
-initrd /mnt/casper/initrd \
-append 'autoinstall ds=nocloud-net;s=http://_gateway:3003/'
This will boot, download the config from the server (set up in the previous
step) and run the install. The installer reboots at the end but the
``-no-reboot`` flag to ``kvm`` means that ``kvm`` will exit when this happens.
It should take about 5 minutes.
This command boots the VM, downloads the configuration from the server (prepared in the previous step) and runs the installation. The installer reboots at the end. The ``-no-reboot`` option to the ``kvm`` command instructs ``kvm`` to exit on reboot.
Boot the installed system
-------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
.. code:: none
kvm -no-reboot -m 2048 \
-drive file=image.img,format=raw,cache=none,if=virtio
This will boot into the freshly installed system and you should be able to log
in as ``ubuntu/ubuntu``.
This command boots the installed system in the VM. Log in using ``ubuntu`` for both the user name and password.
Using another volume to provide the autoinstall config
======================================================
Using another volume to provide the autoinstall configuration
-------------------------------------------------------------
This is the method to use when you want to create media that you can just plug
into a system to have it be installed.
Use this method to create an installation medium to plug into a computer to have it be installed.
Download the live-server ISO
----------------------------
Download the ISO
~~~~~~~~~~~~~~~~
Go to the `Ubuntu ISO download page`_ and download the latest Ubuntu
live-server ISO.
Download the latest Ubuntu Server ISO from the `Ubuntu ISO download page`_.
Create your user-data and meta-data files
-----------------------------------------
Create user-data and meta-data files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
.. code:: none
mkdir -p ~/cidata
cd ~/cidata
@ -137,55 +123,57 @@ Create your user-data and meta-data files
EOF
touch meta-data
The crypted password is just ``ubuntu``.
The encrypted password is ``ubuntu``.
Create an ISO to use as a cloud-init data source
------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
Install utilities for working with cloud images:
.. code:: none
sudo apt install cloud-image-utils
Create the ISO image for cloud-init:
.. code:: none
cloud-localds ~/seed.iso user-data meta-data
Create a target disk
--------------------
~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
Create the target VM disk for the installation:
.. code:: none
truncate -s 10G image.img
Run the install!
----------------
Run the installation
~~~~~~~~~~~~~~~~~~~~
As before, you will need to change `<release-number>` in the following command
to match the release ISO you downloaded.
Change ``<version-number>`` in the following command to match the release ISO you downloaded.
.. code-block:: bash
.. code:: none
kvm -no-reboot -m 2048 \
-drive file=image.img,format=raw,cache=none,if=virtio \
-drive file=~/seed.iso,format=raw,cache=none,if=virtio \
-cdrom ~/Downloads/ubuntu-<release-number>-live-server-amd64.iso
-cdrom ~/Downloads/ubuntu-<version-number>-live-server-amd64.iso
This will boot and run the install. Unless you interrupt boot to add
'autoinstall' to the kernel command line, the installer will prompt for
confirmation before touching the disk.
This command boots the system and runs the installation. The installer prompts for a confirmation before modifying the disk. To skip the need for a confirmation, interrupt the booting process, and add the ``autoinstall`` parameter to the kernel command line.
The installer reboots at the end but the ``-no-reboot`` flag to ``kvm`` means
that ``kvm`` will exit when this happens.
The whole process should take about 5 minutes.
The installer reboots at the end. The ``-no-reboot`` option to the ``kvm`` command instructs ``kvm`` to exit on reboot.
Boot the installed system
-------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
.. code:: none
kvm -no-reboot -m 2048 \
-drive file=image.img,format=raw,cache=none,if=virtio
This will boot into the freshly installed system and you should be able to log
in as ``ubuntu/ubuntu``.
This command boots the installed system in the VM. Log in using ``ubuntu`` for both the user name and password.
.. LINKS

View File

@ -0,0 +1,84 @@
Basic server installation
=========================
This chapter provides an overview of how to install Ubuntu Server Edition. See also the guide on :ref:`how to operate the installer <operate-server-installer>` for more information on using the installer, and the :ref:`screen-by-screen guide <screen-by-screen>` for more information about each of the installer screens.
Preparing to install
--------------------
This section explains various aspects to consider before starting the installation.
System requirements
~~~~~~~~~~~~~~~~~~~
Ubuntu Server Edition provides a common, minimalist base for a variety of server applications, such as file or print services, web hosting, email hosting, etc. This version supports four 64-bit architectures:
* amd64 (AMD64, Intel 64)
* arm64 (AArch64)
* ppc64el (POWER8 and POWER9)
* s390x (IBM Z and LinuxONE)
Recommended system requirements:
* CPU: 1 GHz or better
* RAM: 1 GB or more
* Disk: 2.5 GB or more
Perform a system backup
~~~~~~~~~~~~~~~~~~~~~~~
Before installing Ubuntu Server Edition, back up all system data.
.. warning:: Power failures, configuration mistakes, and other problems occurring during disk (re-)partitioning can result in complete data loss. Always back up your data before performing an installation of a new system.
Download the Server ISO
~~~~~~~~~~~~~~~~~~~~~~~
Download the amd64 Server Edition from `releases.ubuntu.com <https://releases.ubuntu.com/>`_. Choose the version to install and select the :guilabel:`Server install image` download. Note that the Server download includes the installer.
There are platform-specific how-to guides for installations on:
* `s390x LPAR <https://discourse.ubuntu.com/t/interactive-live-server-installation-on-ibm-z-lpar-s390x/16601>`_
* `z/VM <https://discourse.ubuntu.com/t/interactive-live-server-installation-on-ibm-z-vm-s390x/16604>`_
* `ppc64el <https://discourse.ubuntu.com/t/using-a-virtual-cdrom-and-petitboot-to-start-a-live-server-installation-on-ibm-power-ppc64el/16694>`_
Create a bootable USB
~~~~~~~~~~~~~~~~~~~~~
There are many ways to boot the installer but the simplest and most common way is to `create a bootable USB stick <https://ubuntu.com/tutorials/create-a-usb-stick-on-ubuntu>`_ (`tutorials for other operating systems <https://ubuntu.com/search?q=%22create+a+bootable+USB+stick%22>`_ are also available).
Perform the installation
------------------------
Now that you have prepared your installation medium, you are ready to install.
Boot the installer
~~~~~~~~~~~~~~~~~~
Plug the USB stick into the system to be installed and (re)start it.
Many computers automatically boot from available USB or DVD media. If you don't see the boot message and
the :guilabel:`Welcome` screen, set your computer to boot from the installation media.
.. note:: See your computer manual for instructions on how to select the boot source. You can also watch the screen during computer (re)start for a message with what key to press to access settings or a boot menu. Depending on the manufacturer, this can be :kbd:`Escape`, :kbd:`Enter`, :kbd:`F2`, :kbd:`F10` or :kbd:`F12`. Restart your computer and hold down this key until the boot menu appears, then select the drive with the Ubuntu installation medium. See also `Ubuntu Community documentation on booting from CD/DVD <https://help.ubuntu.com/community/BootFromCD>`_.
After a few moments, the installer starts in its language selection screen.
.. image:: figures/basic-installation-start-screen.png
:alt: Welcome screen of the Server installer showing the language selection options
Using the installer
~~~~~~~~~~~~~~~~~~~
The installer is designed to be easy to use and have sensible default settings. For a first installation, you can accept the defaults:
#. Choose your language.
#. Update the installer (if offered).
#. Select your keyboard layout.
#. Do not configure networking (the installer attempts to configure wired network interfaces via DHCP, but you can continue without networking if this fails).
#. Do not configure a proxy or custom mirror unless you have to in your network.
#. For storage, leave :guilabel:`Use an entire disk` checked, and choose a disk to install to, then select :guilabel:`Done` on the configuration screen and confirm the installation.
#. Enter a username, hostname and password.
#. On the :guilabel:`SSH Setup` and :guilabel:`Featured Server Snaps` screens, select :guilabel:`Done`.
#. You now see log messages as the installation is completed.
#. Select :guilabel:`Reboot` when this is complete, and log in using the username and password provided.

View File

@ -0,0 +1,108 @@
.. _configure-storage:
Configuring storage
===================
This article describes how to use the most common options for storage configuration of the Subiquity installer.
Guided options
--------------
.. image:: figures/configure-storage-guided-options.png
:alt:
Select :guilabel:`Use an entire disk` on the :guilabel:`Guided storage configuration` screen to install Ubuntu to the selected disk, replacing any partitions or data already there.
You can choose whether or not to set up LVM, and if you do, whether or not to encrypt the volume with LUKS. If you encrypt the volume, choose a passphrase to be entered every time the system boots.
Select :guilabel:`Custom storage layout` to apply no configuration to the disks.
The installer then moves to the main storage customisation screen.
The main storage screen
-----------------------
.. image:: figures/configure-storage-main-screen.png
:alt:
This screen presents a summary of the current storage configuration. Each device or partition of a device corresponds to a different row (which can be selected). Press :kbd:`Enter` or :kbd:`space` while a device is selected to open a menu of actions that apply to that device.
Partitions
----------
.. image:: figures/configure-storage-partitions.png
:alt:
To add a partition to a device, select :guilabel:`Add GPT Partition` for that device.
.. image:: figures/configure-storage-GPT-partition.png
:alt:
To use all the remaining space on the device, leave :guilabel:`Size` blank.
RAID
----
.. image:: figures/configure-storage-raid.png
:alt:
`Linux software RAID <https://raid.wiki.kernel.org/index.php/Linux_Raid>`_ (Redundant Array of Independent Disks) can be used to combine several disks into a single device that is (usually) tolerant to any one disk failure.
A software RAID device can be created from entire disks or unformatted partitions. Select the :guilabel:`Create software RAID ("MD")` button to open the creation dialog.
The server installer supports RAID levels 0, 1, 5, 6 and 10. It does not allow customising other options, such as metadata format. See the `Linux RAID documentation <https://raid.wiki.kernel.org/index.php/Linux_Raid>`_ for more details.
A software RAID device can be formatted and mounted directly. It can be partitioned into several partitions, and can be used as part of another RAID device or LVM volume group.
Logical Volume Manager (LVM)
----------------------------
.. image:: figures/configure-storage-lvm.png
:alt:
LVM is a system of managing logical volumes, or file systems, that is more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a file system. LVM can be used to combine several disks into one larger pool of storage. It also offers advantages for single-disk systems, such as snapshots and easy resizing of logical volumes.
As with RAID, a LVM volume group can be created from entire disks or unformatted partitions. Select the :guilabel:`Create LVM volume group` button to open the creation dialog.
Once a volume group has been created, it can be divided into named logical volumes, which can then be formatted and mounted. It is recommended to leave some space in the volume group for storage of snapshots and creation of more logical volumes as needed.
The server installer does not support configuring any LVM options for creating volume groups and logical volumes.
Selecting boot devices
----------------------
.. image:: figures/configure-storage-boot-devices.png
:alt:
On all architectures other than s390x, the bootloader needs to be installed to a disk in such a way that the system firmware can find it on boot. By default, the first device to have a partition created on it is selected as a boot device. This can be changed later.
On amd64 and arm64 systems, multiple disks can be selected as boot devices, which means a system can be configured to continue booting after a failure of any one drive (provided the root file system is placed on a RAID). The bootloader is installed to each of these drives, and the operating system configured to install new versions of GRUB to each drive as it is updated.
amd64 systems use GRUB as the bootloader. amd64 systems can boot in either UEFI (Unified Extensible Firmware Interface) or legacy (sometimes called "BIOS") mode (many systems can be configured to boot in either mode). The bootloader is located in different places in the two modes.
Legacy mode
~~~~~~~~~~~
In legacy mode, the bootloader is read from the first "sector" of a hard drive (which hard drive depends on the system firmware, which can usually be configured in a vendor-specific way). The installer writes GRUB to the start of all disks selected as boot devices. As GRUB does not entirely fit in one sector, a small unformatted partition is needed at the start of the disk, which is automatically created when a disk is selected as a boot device (a disk with an existing GPT partition table can only be used as a boot device if it has this partition).
UEFI mode
~~~~~~~~~
In UEFI mode, the bootloader is loaded from an "EFI System Partition" (ESP), which is a partition with a particular GUID type. The installer automatically creates an ESP (with a minimum size of 538 MiB) on a disk when it is selected as a boot device and install GRUB there (a disk with an existing partition table can only be used as a boot device if it has an ESP -- bootloaders for multiple operating systems can be installed into a single ESP).
UEFI defines a standard way to configure the way in which the operating system is chosen on boot, and the installer uses this to configure the system to boot the just-installed operating system. One of the ESPs must be mounted at ``/boot/efi``.
Supported arm64 servers boot using UEFI and are configured the same way as an UEFI-booting amd64 system.
ppc64el systems also load their bootloader (Petitboot, a small Linux kernel) from a PReP (PowerPC Reference Platform) partition with a special flag, so in most ways they are similar to a UEFI system. The installer only supports one PReP partition.
Limitations and workarounds
---------------------------
The installer cannot **edit** partition tables. You can use existing partitions or reformat a drive entirely, but you cannot, for example, remove a large partition and replace it with two smaller ones.
The installer supports the creation of LVM volume groups, logical volumes, and MD RAID (software RAID) devices, but it does not provide a way to configure parameters. For example, all logical volumes are linear and all MD RAID devices use the default metadata format (1.2).
To work around these limitations, switch to a shell and use shell commands to edit the partition table or create the LV or RAID with desired parameters. Then select these partitions or devices as mount points in the installer. Any changes you make while the installer is running but before altering the storage configuration are reflected in the installer.
The installer cannot configure iSCSI mounts or BTRFS subvolumes.

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,31 +1,29 @@
.. _howto_index:
How-to guides
*************
=============
If you have a specific goal in mind and are already familiar with the basics
of Subiquity, our how-to guides cover some of the more common operations
and tasks that you may need to complete.
If you have a specific goal in mind and are already familiar with the basics of Subiquity, our how-to guides cover some of the more common operations and tasks you may need to complete.
They will help you to achieve a particular end result, but may require you to
understand and adapt the steps to fit your specific requirements.
They will help you to achieve a particular end result, but may require you to understand and adapt the steps to fit your specific requirements.
-----
Getting started with Autoinstall
================================
Getting started with autoinstall
--------------------------------
.. toctree::
:maxdepth: 1
Autoinstall quick-start guide <autoinstall-quickstart>
Autoinstall quick-start guide for s390x <autoinstall-quickstart-s390x>
autoinstall-quickstart
autoinstall-quickstart-s390x
basic-server-installation
configure-storage
Found a problem?
================
----------------
.. toctree::
:maxdepth: 1
report-bugs

View File

@ -1,56 +1,32 @@
.. _report-bugs:
How to report a problem
***********************
Troubleshooting
===============
We always hope, of course, that every install with the server installer
succeeds. But reality doesn't always work that way and there will sometimes be
failures of various kinds. This section explains the most useful way to report
any failures so that we can fix the bugs causing them, and we'll keep the topic
up to date as the installer changes.
This section explains how to deal with installation problems and how to report issues to the Subiquity team.
Update Subiquity
================
----------------
The first thing to do is to update your Subiquity snap using `snap refresh`.
Not only because we fix issues that cause failures over time but also because
we've been working on features to make failure reporting easier.
Ensure you're using the latest stable version of the installer. Update the Subiquity snap by running ``snap refresh``.
Crash reports
=============
-------------
A failure will result in a crash report being generated which bundles up all
the information we need to fully diagnose a failure. These live in
``/var/crash`` in the installer environment, and for Ubuntu 19.10 and newer
this is persisted to the install media by default (if there is space).
A failure results in a crash report being generated in ``/var/crash`` in the installer environment. The crash report includes all information for failure diagnostics. Starting with Ubuntu 19.10, crash reports are saved to the installation medium by default (provided there is enough space).
When an error occurs you are presented with a dialog that allows you to upload
the report to the error tracker and offers options for continuing. Uploads to
the error tracker are non-interactive and anonymous, so they are useful for
tracking which kinds of errors are affecting most users, but they do not give
us a way to ask you to help diagnose the failure.
When an error occurs, the installer displays a dialog for uploading the report to the error tracker and offers options for continuing. Uploads to the error tracker are non-interactive and anonymous. This is useful for
tracking which kinds of errors affect most users.
Create Launchpad bug report
===========================
Create a Launchpad bug report
-----------------------------
You can create a Launchpad bug report, which lets us establish this kind
of two way communication, based on the contents of a crash report by using the
standard ``apport-cli`` tool that is part of Ubuntu. Copy the crash report to
another system, run:
To create a Launchpad bug report based on the contents of a crash report, use the ``apport-cli`` tool that is part of Ubuntu. Copy the crash report to another system, and follow the prompts after executing:
.. code-block:: bash
apport-cli /path/to/report.crash
and follow the prompts.
You can also run ``apport-cli`` in the installer environment by switching to a
shell but ``apport`` won't be able to open a browser to allow you to complete
the report so you'll have to type the URL by hand on another machine.
.. note::
Bugs for the Subiquity autoinstaller are `tracked in Launchpad <https://bugs.launchpad.net/subiquity>`_.
To run ``apport-cli`` in the installer environment, switch to a shell. This way, ``apport`` can not open a browser to for you to complete the report. Instead, it provides a URL for completing the report, which you can do on another computer.
.. note:: Issues for the Subiquity autoinstaller are `tracked in Launchpad <https://bugs.launchpad.net/subiquity>`_.

View File

@ -1,28 +1,19 @@
.. _index:
Ubuntu Installation documentation
#################################
Ubuntu installation guide
=========================
A single sentence that says what the product is, succinctly and memorably
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.
Subiquity is an installer framework for Ubuntu. It provides the Ubuntu Server with a text-based installation user interface and Ubuntu Core first-boot configuration. Subiquity is also the back end for the Ubuntu Desktop installer.
A paragraph of one to three short sentences, that describe what the product
does. Urna cursus eget nunc scelerisque viverra mauris in. Nibh mauris cursus
mattis molestie a iaculis at vestibulum rhoncus est pellentesque elit. Diam
phasellus vestibulum lorem sed.
This documentation set offers guidance for installing Ubuntu Server using Subiquity. It also includes instructions on performing an automated installation using the autoinstall feature.
A third paragraph of similar length, this time explaining what need the product
meets. Dui ut ornare lectus sit amet est. Nunc sed augue lacus viverra vitae
congue eu consequat ac libero id faucibus nisl tincidunt eget nullam.
Finally, a paragraph that describes whom the product is useful for. Nunc non
blandit massa enim nec dui nunc mattis enim. Ornare arcu odio ut sem nulla
pharetra diam porttitor leo a diam sollicitudin tempor id eu. Ipsum dolor sit
amet consectetur adipiscing elit pellentesque habitant.
.. note:: The aim is to gradually expand this documentation to cover the installation of all variants of the Ubuntu operating system.
-----
In this documentation
---------------------
.. grid:: 1 1 2 2
:gutter: 3
@ -54,34 +45,37 @@ amet consectetur adipiscing elit pellentesque habitant.
Discussion and clarification of key topics
Having trouble? We would like to help!
======================================
- Links to other communication channels go here
Project and community
=====================
---------------------
Subiquity is a member of the Ubuntu family. It's an open source project that
warmly welcomes community projects, contributions, suggestions, fixes, and
constructive feedback.
Subiquity is a member of the Ubuntu family. It's an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback. Use the following resources to ask questions, report bugs, contribute translations, or participate in the development of the Ubuntu installer.
* Read our `Code of Conduct`_
* IRC?
* Discourse?
* Contribute?
* Roadmap?
Get started:
* Read our `Code of Conduct`_
Discuss:
* IRC: `Libera.Chat`_, the *#ubuntu-server* channel
* Discourse: `Ubuntu Foundations`_
Contribute:
* `Contribution guidelines`_ on GitHub
* `Issue tracker`_ on Launchpad
* `Localisation`_ on Launchpad
.. toctree::
:hidden:
:maxdepth: 2
Introduction to Autoinstall<intro-to-autoinstall>
Introduction to autoinstall<intro-to-autoinstall>
tutorial/index
howto/index
reference/index
explanation/index
development/index
.. Links:
.. _Code of Conduct: https://ubuntu.com/community/code-of-conduct
.. _Code of Conduct: https://ubuntu.com/community/ethos/code-of-conduct
.. _Ubuntu Foundations: https://discourse.ubuntu.com/c/foundations/
.. _Libera.Chat: https://libera.chat/
.. _Contribution guidelines: https://github.com/canonical/subiquity/blob/main/CONTRIBUTING.md
.. _Localisation: https://translations.launchpad.net/ubuntu/+source/subiquity/
.. _Issue tracker: https://bugs.launchpad.net/subiquity

View File

@ -1,7 +1,7 @@
.. _tutorial_intro-to-autoinstall:
Introduction to autoinstall
***************************
===========================
Automatic Ubuntu installation is performed with the autoinstall format.
You might also know this feature as "unattended", "hands-off" or "preseeded"
@ -11,15 +11,20 @@ This format is supported in the following installers:
* Ubuntu Server, version 20.04 and later
* Ubuntu Desktop, version 23.04 and later
Autoinstallation lets you answer all those configuration questions ahead of
time with an *autoinstall config* and lets the installation process run without
Automatic installation lets you answer all configuration questions ahead of
time with an *autoinstall configuration* and lets the installation process run without
any interaction.
For more details on the relationship between autoinstall and cloud-init, as well as their respective functions, go to:
Differences from debian-installer preseeding
============================================
* :ref:`Cloud-init and autoinstall interaction <cloudinit-autoinstall-interaction>`
* :ref:`Providing autoinstall configuration <providing-autoinstall>`
*preseeds* are the way to automate an installer based on debian-installer
Differences from `debian-installer` preseeding
----------------------------------------------
*preseeds* are the way to automate an installer based on `debian-installer`
(also known as d-i).
Autoinstalls differ from preseeds in the following ways:
@ -34,223 +39,8 @@ Autoinstalls differ from preseeds in the following ways:
those.
Providing the autoinstall configuration
=======================================
There are 2 ways to provide the autoinstall configuration:
* Provide :external+cloud-init:ref:`#cloud-config
user-data<user_data_formats-cloud_config>` containing ``autoinstall:``
configuration directives to cloud-init at boot time
* Directly on the install media
Autoinstall by way of cloud-config
----------------------------------
The suggested way of providing autoinstall config to the Ubuntu installer is
via cloud-init. This allows the configuration to be applied to the installer
without having to modify the install media.
The autoinstall config is provided via cloud-init configuration, which is
almost endlessly flexible. In most scenarios the easiest way will be to provide
user data via the :external+cloud-init:ref:`datasource_nocloud` data source.
When providing autoinstall via cloud-init, the autoinstall config is provided
as :external+cloud-init:ref:`user_data_formats-cloud_config`. This
means we need a :code:`#cloud-config` header. The autoinstall directives are
placed under a top level :code:`autoinstall:` key, like so:
.. code-block:: yaml
#cloud-config
autoinstall:
version: 1
....
.. note::
:external+cloud-init:ref:`user_data_formats-cloud_config` files must contain
the ``#cloud-config`` header to be recognized as a valid cloud config data
file.
Autoinstall on the install media
--------------------------------
Another option for supplying autoinstall to the Ubuntu installer is to place a
file named :code:`autoinstall.yaml` on the install media itself.
There are two potential locations for the :code:`autoinstall.yaml` file:
* At the root of the "CD-ROM". When you write the installation ISO to a USB
Flash Drive, this can be done by copying the :code:`autoinstall.yaml` to the
partition containing the contents of the ISO - i.e.,
in the directory containing the ``casper`` sub-directory.
* On the rootfs of the installation system - this option will typically
require modifying the installation ISO and is not suggested, but is
supported.
Directly specifying autoinstall as a :code:`autoinstall.yaml` file does not
require a :code:`#cloud-config` header, and does not use a top level
``autoinstall:`` key. The autoinstall directives are placed at the top
level. For example:
.. code-block:: yaml
version: 1
....
Cloud-init and autoinstall interaction
======================================
Cloud-init runs in both the ephemeral system (during install) and in the target
system during first boot. Cloud-init then becomes inert for every subsequent
reboot.
While cloud-init may provide the autoinstall configuration to the Ubuntu
installer, it does not process the autoinstall directives itself.
To modify the ephemeral system with cloud-init, any
:external+cloud-init:ref:`#cloud-config module schema keys<modules>` can
be provided. If instead cloud-init directives are intended to modify the system
being installed, they must appear under a :ref:`ai-user-data` section under
``autoinstall:``.
.. code-block:: yaml
#cloud-config
# cloud-init directives may optionally be specified here.
# These directives affect the ephemeral system performing the install.
autoinstall:
# autoinstall directives must be specified here, not directly at the
# top level. These directives are processed by the Ubuntu Installer,
# and configure the target system to be installed.
user-data:
# cloud-init directives may also be optionally be specified here.
# These directives also affect the target system to be installed,
# and are processed on first boot.
Zero-touch deployment with autoinstall
======================================
The Ubuntu Installer contains a safeguard, intended to prevent USB Flash Drives
with an :code:`autoinstall.yaml` file from wiping out the wrong system.
Before the Ubuntu Installer actually makes changes to the target system, a
prompt is shown. ::
start: subiquity/Meta/status_GET
Confirmation is required to continue.
Add 'autoinstall' to your kernel command line to avoid this
Continue with autoinstall? (yes|no)
To bypass this prompt, arrange for the argument :code:`autoinstall` to be
present on the kernel command line.
Creating an autoinstall config
==============================
When any system is installed using the Ubuntu installer, an autoinstall file
for repeating the install is created at
:code:`/var/log/installer/autoinstall-user-data`.
The structure of an autoinstall configuration
=============================================
See the :ref:`ai` for full details on the supported autoinstall directives.
A minimal autoinstall configuration in
:external+cloud-init:ref:`user_data_formats-cloud_config` format looks like:
.. code-block:: yaml
#cloud-config
autoinstall:
version: 1
identity:
hostname: hostname
username: username
password: $crypted_pass
Here is an example file that shows off most of the autoinstall directives:
.. parsed-literal::
#cloud-config
autoinstall:
:ref:`ai-version`: 1
:ref:`ai-reporting`:
hook:
type: webhook
endpoint: http\://example.com/endpoint/path
:ref:`ai-early-commands`:
- ping -c1 198.162.1.1
:ref:`ai-locale`: en_US
:ref:`ai-keyboard`:
layout: gb
variant: dvorak
:ref:`ai-network`:
network:
version: 2
ethernets:
enp0s25:
dhcp4: yes
enp3s0: {}
enp4s0: {}
bonds:
bond0:
dhcp4: yes
interfaces:
- enp3s0
- enp4s0
parameters:
mode: active-backup
primary: enp3s0
:ref:`ai-proxy`: http\://squid.internal:3128/
:ref:`ai-apt`:
primary:
- arches: [default]
uri: http\://repo.internal/
sources:
my-ppa.list:
source: "deb http\://ppa.launchpad.net/curtin-dev/test-archive/ubuntu $RELEASE main"
keyid: B59D 5F15 97A5 04B7 E230 6DCA 0620 BBCF 0368 3F77
:ref:`ai-storage`:
layout:
name: lvm
:ref:`ai-identity`:
hostname: hostname
username: username
password: $crypted_pass
:ref:`ai-ssh`:
install-server: yes
authorized-keys:
- $key
allow-pw: no
:ref:`ai-snaps`:
- name: go
channel: 1.20/stable
classic: true
:ref:`ai-debconf-selections`: |
bind9 bind9/run-resolvconf boolean false
:ref:`ai-packages`:
- libreoffice
- dns-server^
:ref:`ai-user-data`:
disable_root: false
:ref:`ai-late-commands`:
- sed -ie 's/GRUB_TIMEOUT=.\*/GRUB_TIMEOUT=30/' /target/etc/default/grub
:ref:`ai-error-commands`:
- tar c /var/log/installer | nc 192.168.0.1 1000
Error handling
==============
--------------
Progress through the installer is reported via the :ref:`ai-reporting` system,
including errors. In addition, when a fatal error occurs, the

File diff suppressed because it is too large Load Diff

View File

@ -1,589 +1,41 @@
.. _autoinstall_schema:
Autoinstall schema
******************
==================
The server installer validates the provided autoinstall config against a
:ref:`JSON schema<autoinstall_JSON_schema>`.
The server installer validates the provided autoinstall configuration against a :ref:`JSON schema<autoinstall_JSON_schema>`.
How the config is validated
===========================
How the configuration is validated
----------------------------------
Although the schema is presented below as a single document, and if you want
to pre-validate your config you should validate it against this document, the
config is not actually validated against this document at run time. What
happens instead is that some sections are loaded, validated, and applied
first, before all other sections are validated. In detail:
This reference manual presents the schema as a single document. Use it pre-validate your configuration.
At run time, the configuration is not validated against this document. Instead, configuration sections are loaded and validated in this order:
1. The reporting section is loaded, validated and applied.
2. The error commands are loaded and validated.
3. The early commands are loaded and validated.
4. The early commands, if any, are run.
5. The config is reloaded, and now all sections are loaded and validated.
5. The configuration is reloaded, and all sections are loaded and validated.
This is so that validation errors in most sections can be reported via the
reporting and error-commands configuration, as all other errors are.
This is to ensure that potential validation errors in most sections can be reported using the reporting and error-commands configuration the same way as other errors.
.. _autoinstall_JSON_schema:
Schema
======
------
The `JSON schema`_ for autoinstall data is as follows:
The `JSON schema`_ for autoinstall data:
.. code-block:: JSON
"type": "object",
"properties": {
"version": {
"type": "integer",
"minimum": 1,
"maximum": 1
},
"early-commands": {
"type": "array",
"items": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
}
},
"reporting": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
},
"required": [
"type"
],
"additionalProperties": true
}
},
"error-commands": {
"type": "array",
"items": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
}
},
"user-data": {
"type": "object"
},
"packages": {
"type": "array",
"items": {
"type": "string"
}
},
"debconf-selections": {
"type": "string"
},
"locale": {
"type": "string"
},
"refresh-installer": {
"type": "object",
"properties": {
"update": {
"type": "boolean"
},
"channel": {
"type": "string"
}
},
"additionalProperties": false
},
"kernel": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"flavor": {
"type": "string"
}
},
"oneOf": [
{
"type": "object",
"required": [
"package"
]
},
{
"type": "object",
"required": [
"flavor"
]
}
]
},
"keyboard": {
"type": "object",
"properties": {
"layout": {
"type": "string"
},
"variant": {
"type": "string"
},
"toggle": {
"type": [
"string",
"null"
]
}
},
"required": [
"layout"
],
"additionalProperties": false
},
"source": {
"type": "object",
"properties": {
"search_drivers": {
"type": "boolean"
},
"id": {
"type": "string"
}
}
},
"network": {
"oneOf": [
{
"type": "object",
"properties": {
"version": {
"type": "integer",
"minimum": 2,
"maximum": 2
},
"ethernets": {
"type": "object",
"properties": {
"match": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"macaddress": {
"type": "string"
},
"driver": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"wifis": {
"type": "object",
"properties": {
"match": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"macaddress": {
"type": "string"
},
"driver": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"bridges": {
"type": "object"
},
"bonds": {
"type": "object"
},
"tunnels": {
"type": "object"
},
"vlans": {
"type": "object"
}
},
"required": [
"version"
]
},
{
"type": "object",
"properties": {
"network": {
"type": "object",
"properties": {
"version": {
"type": "integer",
"minimum": 2,
"maximum": 2
},
"ethernets": {
"type": "object",
"properties": {
"match": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"macaddress": {
"type": "string"
},
"driver": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"wifis": {
"type": "object",
"properties": {
"match": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"macaddress": {
"type": "string"
},
"driver": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"bridges": {
"type": "object"
},
"bonds": {
"type": "object"
},
"tunnels": {
"type": "object"
},
"vlans": {
"type": "object"
}
},
"required": [
"version"
]
}
},
"required": [
"network"
]
}
]
},
"ubuntu-pro": {
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 24,
"maxLength": 30,
"pattern": "^C[1-9A-HJ-NP-Za-km-z]+$",
"description": "A valid token starts with a C and is followed by 23 to 29 Base58 characters.\nSee https://pkg.go.dev/github.com/btcsuite/btcutil/base58#CheckEncode"
}
}
},
"ubuntu-advantage": {
"type": "object",
"properties": {
"token": {
"type": "string",
"minLength": 24,
"maxLength": 30,
"pattern": "^C[1-9A-HJ-NP-Za-km-z]+$",
"description": "A valid token starts with a C and is followed by 23 to 29 Base58 characters.\nSee https://pkg.go.dev/github.com/btcsuite/btcutil/base58#CheckEncode"
}
},
"deprecated": true,
"description": "Compatibility only - use ubuntu-pro instead"
},
"proxy": {
"type": [
"string",
"null"
],
"format": "uri"
},
"apt": {
"type": "object",
"properties": {
"preserve_sources_list": {
"type": "boolean"
},
"primary": {
"type": "array"
},
"mirror-selection": {
"type": "object",
"properties": {
"primary": {
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"const": "country-mirror"
},
{
"type": "object",
"properties": {
"uri": {
"type": "string"
},
"arches": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"uri"
]
}
]
}
}
}
},
"geoip": {
"type": "boolean"
},
"sources": {
"type": "object"
},
"disable_components": {
"type": "array",
"items": {
"type": "string",
"enum": [
"universe",
"multiverse",
"restricted",
"contrib",
"non-free"
]
}
},
"preferences": {
"type": "array",
"items": {
"type": "object",
"properties": {
"package": {
"type": "string"
},
"pin": {
"type": "string"
},
"pin-priority": {
"type": "integer"
}
},
"required": [
"package",
"pin",
"pin-priority"
]
}
},
"fallback": {
"type": "string",
"enum": [
"abort",
"continue-anyway",
"offline-install"
]
}
}
},
"storage": {
"type": "object"
},
"identity": {
"type": "object",
"properties": {
"realname": {
"type": "string"
},
"username": {
"type": "string"
},
"hostname": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"username",
"hostname",
"password"
],
"additionalProperties": false
},
"ssh": {
"type": "object",
"properties": {
"install-server": {
"type": "boolean"
},
"authorized-keys": {
"type": "array",
"items": {
"type": "string"
}
},
"allow-pw": {
"type": "boolean"
}
}
},
"snaps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"channel": {
"type": "string"
},
"classic": {
"type": "boolean"
}
},
"required": [
"name"
],
"additionalProperties": false
}
},
"active-directory": {
"type": "object",
"properties": {
"admin-name": {
"type": "string"
},
"domain-name": {
"type": "string"
}
},
"additionalProperties": false
},
"codecs": {
"type": "object",
"properties": {
"install": {
"type": "boolean"
}
}
},
"drivers": {
"type": "object",
"properties": {
"install": {
"type": "boolean"
}
}
},
"oem": {
"type": "object",
"properties": {
"install": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string",
"const": "auto"
}
]
}
},
"required": [
"install"
]
},
"timezone": {
"type": "string"
},
"updates": {
"type": "string",
"enum": [
"security",
"all"
]
},
"late-commands": {
"type": "array",
"items": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
}
},
"shutdown": {
"type": "string",
"enum": [
"reboot",
"poweroff"
]
}
},
"required": [
"version"
],
"additionalProperties": true
}
.. literalinclude:: ../../autoinstall-schema.json
:language: JSON
Regeneration
============
------------
The schema above can be regenerated by running ``make schema`` in a Subiquity
source checkout.
To regenerate the schema, run ``make schema`` in the root directory of the `Subiquity source repository`_.
.. LINKS
.. _JSON schema: https://json-schema.org/
.. _Subiquity source repository: https://github.com/canonical/subiquity

View File

@ -1,17 +1,26 @@
Reference
*********
=========
Our reference section contains support information for Subiquity.
This includes details on the network requirements, API definitions, support
matrices and so on.
The reference section contains reference information for Autoinstall and other tooling. This includes command syntax and options, details on network requirements, API definitions, support matrices, and other.
-----
Autoinstall reference manual
============================
----------------------------
.. toctree::
:maxdepth: 1
Autoinstall configuration <autoinstall-reference.rst>
Autoinstall JSON schema <autoinstall-schema.rst>
ubuntu-image reference
----------------------
``ubuntu-image`` is a tool for generating bootable disk images with Ubuntu.
.. toctree::
:maxdepth: 1
ubuntu-image reference <ubuntu-image.rst>

View File

@ -0,0 +1,246 @@
ubuntu-image syntax and options
===============================
``ubuntu-image`` is a program for generating bootable disk images. It supports building snap_-based and classical preinstalled Ubuntu images.
Snap-based images
-----------------
Snap-based images are built from a *model assertion*, which is a YAML file describing a particular combination of core, kernel, and gadget snaps, along with other declarations, signed with a digital signature asserting its authenticity. The assets defined in the model assertion uniquely describe the device for which the image is built.
Classical images
----------------
Classical images are built from a local `gadget tree`_ path. The `gadget tree`_ is a primed `gadget snap`_ containing a ``gadget.yaml`` file in the ``meta`` directory and all the necessary bootloader gadget bits built. For instance, a `gadget tree`_ can be prepared by fetching a specially tailored `gadget snap`_ source and running ``snapcraft prime`` on it, with the resulting tree being stored in the ``prime/`` directory.
The ``gadget.yaml`` file
------------------------
As part of the model assertion, a `gadget snap`_ is specified. The gadget contains a ``gadget.yaml`` file, which contains the exact description of the disk-image contents in the YAML format. The ``gadget.yaml`` file describes, among other things:
* Names of all the volumes to be produced (volumes are roughly analogous to disk images).
* Structures (structures define the layout of the volume, including partitions, Master Boot Records, or any other relevant content.) within the volume. :none:`wokeignore:rule=master,`
* Whether the volume contains a bootloader and if so, what kind of bootloader.
Note that ``ubuntu-image`` communicates with the Snap Store using the ``snap prepare-image`` sub-command. The model-assertion file is passed to ``snap prepare-image``, which handles downloading the appropriate gadget and any extra snaps. See the :manualpage:`snap(8) manual page <man8/snap.8.html>` for additional details.
Basic syntax
------------
.. code-block:: yaml
ubuntu-image snap [options] model.assertion
ubuntu-image classic [options] image_definition.yaml
General options
~~~~~~~~~~~~~~~
-h, --help
Show the help message and exit.
--version
Show the program version number and exit.
Options of the ``snap`` command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These are the options for defining the contents of snap-based images. They can only be used when the ``ubuntu-image snap`` command is used.
``model_assertion``
Path to the model assertion file. This positional argument must be given for this mode of operation.
--cloud-init USER-DATA-FILE
``cloud-config`` data to be copied to the image.
--disable-console-conf
Disable ``console-conf`` on the resulting image.
--factory-image
Hint that the image is meant to boot in a device factory.
--validation=<ignore|enforce>
Control whether validations should be ignored or enforced.
--snap SNAP
Install an extra snap. This is passed through to ``snap prepare-image``. The snap argument can include additional information about the channel and/or risk with the following syntax: ``<snap>=<channel|risk>``. Note that this flag will cause an error if the model assertion has a grade higher than dangerous.
--revision <SNAP_NAME:REVISION>
Install a specific revision of a snap rather than the latest available in a particular channel. The snap specified with ``SNAP_NAME`` must be included either in the model assertion or as an argument to ``--snap``. If both a revision and channel are provided, the revision specified is installed in the image, and updates come from the specified channel.
--preseed
Preseed the image (Ubuntu Core 20 and higher only).
--preseed-sign-key=<key>
Name of the key to use to sign the preseed assertion, otherwise use the default key.
--sysfs-overlay=<path to directory that contains sysfs overlay>
Specify the directory that contains the sysfs overlay. This options also requires the ``--preseed`` and ``--preseed-sign-key`` options.
Options of the ``classic`` command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These are the options for defining the contents of classical preinstalled Ubuntu images. They can only be used when the ``ubuntu-image classic`` command is used.
``image_definition``
Path to the image-definition file. This file defines all of the customisation required when building the image. This positional argument must be given for this mode of operation.
Common options
~~~~~~~~~~~~~~
There are two general operational modes to ``ubuntu-image``. The usual mode is to run the script giving the required model-assertion file as a required positional argument, generating a disk image file. These options are useful in this mode of operation.
The second mode of operation is provided for debugging and testing purposes. It allows you to run the internal state machine step by step and is described in more detail below.
-d, --debug
Enable debugging output.
--verbose
Enable verbose output.
--quiet
Only print error messages. Suppress all other output.
-O DIRECTORY, --output-dir DIRECTORY
Write generated disk-image files to this directory. The files will be named after the ``gadget.yaml`` volume names, with the ``.img`` suffix appended. If not given, the value of the ``--workdir`` flag is used if specified. If neither ``--output-dir`` nor ``--workdir`` is used, the image(s) will be placed in the current working directory. This option replaces, and cannot be used with, the deprecated ``--output`` option.
-i SIZE, --image-size SIZE
The size of the generated disk-image files. If this size is smaller than the minimum calculated size of the volume, a warning is issued and ``--image-size`` is ignored. The value is the size in bytes, with allowable suffixes ``M`` for MiB and ``G`` for GiB.
An extended syntax is supported for ``gadget.yaml`` files that specify multiple volumes (i.e. disk images). In that case, a single ``SIZE`` argument is used for all the defined volumes, with the same rules for ignoring values that are too small. You can specify the image size for a single volume using an indexing prefix on the ``SIZE`` parameter, where the index is either a volume name or an integer index starting at zero. For example, to set the image size only on the second volume, which might be called ``sdcard`` in ``gadget.yaml``, use: ``--image-size 1:8G`` (the number ``1`` index indicates the second volume; volumes are 0-indexed). Or use ``--image-size sdcard:8G``.
You can also specify multiple volume sizes by separating them with commas, and you can mix and match integer indices and volume-name indices. Thus, if ``gadget.yaml`` names three volumes, and you want to set all three to different sizes, you can use ``--image-size 0:2G,sdcard:8G,eMMC:4G``.
In the case of ambiguities, the size hint is ignored, and the calculated size for the volume is used instead.
--disk-info DISK-INFO-CONTENTS
File to be used as ``.disk/info`` on the root file system of the image. This file can contain useful information about the target image, such as image identification data, system name, build timestamp, etc.
-c CHANNEL, --channel CHANNEL
The default Snap channel to use while preseeding the image.
--sector-size SIZE
When creating the disk-image file, use the given sector size. This can be either 512 or 4096 (4k sector size), defaulting to 512.
State-machine options
~~~~~~~~~~~~~~~~~~~~~
.. caution:: The options described here are primarily for debugging and testing purposes and should not be considered part of the stable, public API. State-machine step numbers and names can change between releases.
``ubuntu-image`` internally runs a state machine to create the disk image. These are some options for controlling this state machine. Other than ``--workdir``, these options are mutually exclusive. When ``--until`` or ``--thru`` is given, the state machine can be resumed later with ``--resume``, but ``--workdir`` must be given in that case since the state is saved in a ``ubuntu-image.json`` file in the working directory.
-w DIRECTORY, --workdir DIRECTORY
The working directory in which to download and unpack all the source files for the image. This directory can exist or not, and it is not removed after this program exits. If not given, a temporary working directory is used instead, which *is* deleted after this program exits. Use ``--workdir`` if you want to be able to resume a partial state-machine run. The ``gadget.yaml`` file is copied to the working directory after it's downloaded.
-u STEP, --until STEP
Run the state machine until the given ``STEP``, non-inclusively. ``STEP`` is the name of a state-machine method. See the `List of steps`_.
-t STEP, --thru STEP
Run the state machine until the given ``STEP``, inclusively. ``STEP`` is the name of a state-machine method. See the `List of steps`_.
-r, --resume
Continue the state machine from the previously saved state. It returns an error if there is no previous state.
Files used by ``ubuntu-image``
------------------------------
* |gadgetyaml|_
* `model assertion`_
* `gadget tree`_ (example)
* `cloud-config`_
Environment variables
---------------------
The following environment variables are recognised by ``ubuntu-image``.
``UBUNTU_IMAGE_PRESERVE_UNPACK``
When set, the variable specifies the directory for preserving a pristine copy of the unpacked gadget contents. The directory must exist, and an ``unpack`` directory will be created under this directory. The full contents of the ``<workdir>/unpack`` directory after the ``snap prepare-image`` sub-command has run is copied here.
There are a few other environment variables used for building and testing only.
.. _list of steps:
List of steps
-------------
The names of steps that can be used with ``--until`` and ``--thru`` for each image type are listed below.
Classical-image steps
~~~~~~~~~~~~~~~~~~~~~
State machines are dynamically created for classical-image builds based on the contents of the image definition. The list of all possible states is as follows:
#. ``make_temporary_directories``
#. ``parse_image_definition``
#. ``calculate_states``
#. ``build_gadget_tree``
#. ``prepare_gadget_tree``
#. ``load_gadget_yaml``
#. ``create_chroot``
#. ``germinate``
#. ``add_extra_ppas``
#. ``install_packages``
#. ``clean_extra_ppas``
#. ``verify_artifact_names``
#. ``customize_cloud_init``
#. ``customize_fstab``
#. ``manual_customization``
#. ``preseed_image``
#. ``clean_rootfs``
#. ``populate_rootfs_contents``
#. ``generate_disk_info``
#. ``calculate_rootfs_size``
#. ``populate_bootfs_contents``
#. ``populate_prepare_partitions``
#. ``make_disk``
#. ``generate_package_manifest``
To check the steps that are going to be used for a specific image-definition file, use the ``--print-states`` flag.
Snap-image steps
~~~~~~~~~~~~~~~~
#. ``make_temporary_directories``
#. ``prepare_image``
#. ``load_gadget_yaml``
#. ``populate_rootfs_contents``
#. ``generate_disk_info``
#. ``calculate_rootfs_size``
#. ``populate_bootfs_contents``
#. ``populate_prepare_partitions``
#. ``make_disk``
#. ``generate_snap_manifest``
Additional resources
--------------------
* :manualpage:`snap(8) manual page <man8/snap.8.html>`
.. |gadgetyaml| replace:: ``gadget.yaml``
.. LINKS
.. _snap: http://snapcraft.io/
.. _gadget snap: https://snapcraft.io/docs/the-gadget-snap
.. _gadget tree: https://github.com/snapcore/pc-gadget
.. _image_definition.yaml: https://github.com/canonical/ubuntu-image/tree/main/internal/imagedefinition#readme
.. _gadgetyaml: https://forum.snapcraft.io/t/gadget-snaps/696
.. _model assertion: https://ubuntu.com/core/docs/reference/assertions/model
.. _gadget tree: https://github.com/snapcore/pc-gadget
.. _cloud-config: https://help.ubuntu.com/community/CloudInit

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

2
doc/reuse/links.txt Normal file
View File

@ -0,0 +1,2 @@
.. _reStructuredText style guide: https://canonical-documentation-with-sphinx-and-readthedocscom.readthedocs-hosted.com/style-guide/
.. _Example product documentation: https://canonical-example-product-documentation.readthedocs-hosted.com/

View File

@ -0,0 +1,3 @@
.. |ubuntu-latest-version| replace:: 23.10
.. |ubuntu-latest-codename| replace:: Mantic Minotaur
.. role:: command(literal)

View File

@ -1,123 +0,0 @@
Basic server installation
*************************
This chapter provides an overview of how to install Ubuntu Server Edition. You
can also refer to this guide on
:ref:`how to operate the installer <operate-server-installer>` for more
information on using the installer, and to this
:doc:`screen-by-screen reference guide <screen-by-screen>` for more
information about each of the installer screens.
Preparing to install
====================
This section explains various aspects to consider before starting the
installation.
System requirements
-------------------
Ubuntu Server Edition provides a common, minimalist base for a variety of
server applications, such as file/print services, web hosting, email hosting,
etc. This version supports four 64-bit architectures:
* amd64 (Intel/AMD 64-bit)
* arm64 (64-bit ARM)
* ppc64el (POWER8 and POWER9)
* s390x (IBM Z and LinuxONE)
The recommended system requirements are:
* CPU: 1 gigahertz or better
* RAM: 1 gigabyte or more
* Disk: a minimum of 2.5 gigabytes
Perform a system back up
------------------------
Before installing Ubuntu Server Edition you should make sure all data on the
system is backed up.
If this is not the first time an operating system has been installed on your
computer, it is likely you will need to re-partition your disk to make room
for Ubuntu.
Any time you partition your disk, you should be prepared to lose everything on
the disk should you make a mistake or something goes wrong during partitioning.
The programs used in installation are quite reliable, most have seen years of
use, but they also perform destructive actions.
Download the server ISO
-----------------------
You can obtain the amd64 server download from https://releases.ubuntu.com/.
Select the version you wish to install and select the "server install image"
download. Note that the server download includes the installer.
There are platform-specific how-to guides for installations on:
* `s390x LPAR <https://discourse.ubuntu.com/t/interactive-live-server-installation-on-ibm-z-lpar-s390x/16601>`_
* `z/VM <https://discourse.ubuntu.com/t/interactive-live-server-installation-on-ibm-z-vm-s390x/16604>`_
* `ppc64el <https://discourse.ubuntu.com/t/using-a-virtual-cdrom-and-petitboot-to-start-a-live-server-installation-on-ibm-power-ppc64el/16694>`_
Create a bootable USB
---------------------
There are many ways to boot the installer but the simplest and most common way
is to
`create a bootable USB stick <https://ubuntu.com/tutorials/tutorial-create-a-usb-stick-on-ubuntu>`_
to boot the system to be installed with
(`tutorials for other operating systems <https://ubuntu.com/search?q=%22create+a+bootable+USB+stick%22>`_
are also available).
Perform the installation
========================
Now that you have prepared your install medium, you are ready to install.
Boot the installer
------------------
Plug the USB stick into the system to be installed and start it.
Most computers will automatically boot from USB or DVD, though in some cases
this is disabled to improve boot times. If you don't see the boot message and
the "Welcome" screen which should appear after it, you will need to set your
computer to boot from the install media.
There should be an on-screen message when the computer starts, telling you what
key to press for settings or a boot menu. Depending on the manufacturer, this
could be :kbd:`Escape`, :kbd:`F2`, :kbd:`F10` or :kbd:`F12`. Restart your
computer and hold down this key until the boot menu appears, then select the
drive with the Ubuntu install media.
If you are still having problems, check out the
`Ubuntu Community documentation on booting from
CD/DVD <https://help.ubuntu.com/community/BootFromCD>`_.
After a few moments, the installer will start in its language selection screen.
.. image:: figures/basic-installation-start-screen.png
:alt: Welcome screen of the Server installer showing the language selection options
Using the installer
-------------------
The installer is designed to be easy to use and have sensible defaults so for
a first install you can mostly just accept the defaults for the most
straightforward install:
* Choose your language
* Update the installer (if offered)
* Select your keyboard layout
* Do not configure networking (the installer attempts to configure wired
network interfaces via DHCP, but you can continue without networking if this
fails)
* Do not configure a proxy or custom mirror unless you have to in your network
* For storage, leave "use an entire disk" checked, and choose a disk to install
to, then select "Done" on the configuration screen and confirm the install
* Enter a username, hostname and password
* On the SSH and snap screens, select "Done"
* You will now see log messages as the install is completed
* Select restart when this is complete, and log in using the username and
password provided

View File

@ -0,0 +1,91 @@
Creating autoinstall configuration
===================================
When any system is installed using the Ubuntu installer, an autoinstall file for repeating the installation is created at :code:`/var/log/installer/autoinstall-user-data`. :ref:`providing-autoinstall` describes the two ways of delivering this autoinstall configuration to Ubuntu installer.
The structure of an autoinstall configuration
---------------------------------------------
Go to the :ref:`ai` for full details on the supported autoinstall directives.
.. code-block:: yaml
#cloud-config
autoinstall:
version: 1
identity:
hostname: hostname
username: username
password: $crypted_pass
Here is an example file that shows most of the autoinstall directives:
.. parsed-literal::
#cloud-config
autoinstall:
:ref:`ai-version`: 1
:ref:`ai-reporting`:
hook:
type: webhook
endpoint: http\://example.com/endpoint/path
:ref:`ai-early-commands`:
- ping -c1 198.162.1.1
:ref:`ai-locale`: en_US
:ref:`ai-keyboard`:
layout: gb
variant: dvorak
:ref:`ai-network`:
network:
version: 2
ethernets:
enp0s25:
dhcp4: yes
enp3s0: {}
enp4s0: {}
bonds:
bond0:
dhcp4: yes
interfaces:
- enp3s0
- enp4s0
parameters:
mode: active-backup
primary: enp3s0
:ref:`ai-proxy`: http\://squid.internal:3128/
:ref:`ai-apt`:
primary:
- arches: [default]
uri: http\://repo.internal/
sources:
my-ppa.list:
source: "deb http\://ppa.launchpad.net/curtin-dev/test-archive/ubuntu $RELEASE main"
keyid: B59D 5F15 97A5 04B7 E230 6DCA 0620 BBCF 0368 3F77
:ref:`ai-storage`:
layout:
name: lvm
:ref:`ai-identity`:
hostname: hostname
username: username
password: $crypted_pass
:ref:`ai-ssh`:
install-server: yes
authorized-keys:
- $key
allow-pw: no
:ref:`ai-snaps`:
- name: go
channel: 1.20/stable
classic: true
:ref:`ai-debconf-selections`: |
bind9 bind9/run-resolvconf boolean false
:ref:`ai-packages`:
- libreoffice
- dns-server^
:ref:`ai-user-data`:
disable_root: false
:ref:`ai-late-commands`:
- sed -ie 's/GRUB_TIMEOUT=.\*/GRUB_TIMEOUT=30/' /target/etc/default/grub
:ref:`ai-error-commands`:
- tar c /var/log/installer | nc 192.168.0.1 1000

View File

@ -1,25 +1,21 @@
.. _tutorial_index:
Tutorials
*********
=========
This section contains step-by-step tutorials to help you get started with
Subiquity. We hope our tutorials make as few assumptions as possible and
are accessible to anyone with an interest in Subiquity. They should be a
great place to start learning about Subiquity, how it works, and what it's
capable of.
This section contains step-by-step tutorials to help you get started with Subiquity. The tutorials make as few assumptions as possible in order to be accessible to anyone with an interest in Subiquity. This is the place to start learning about Subiquity: how it works, and what it's capable of.
-----
For Ubuntu Server
=================
-----------------
This tutorial introduces the core concepts of autoinstall and is recommended as
the first step.
This tutorial introduces the core concepts of autoinstall and is recommended as the first step.
.. toctree::
:maxdepth: 1
basic-server-installation
creating-autoinstall-configuration
providing-autoinstall
operate-server-installer
screen-by-screen

View File

@ -0,0 +1,64 @@
.. _operate-server-installer:
Operating the server installer
==============================
This document explains how to use the installer in general terms. For a step-by-step guide through the screens of the installer, use the `screen-by-screen guide <https://discourse.ubuntu.com/t/screen-by-screen-installer-guide/16690>`_.
Get the installer
-----------------
Installer images are created (approximately) daily and are available from the `Ubuntu release <https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/>`_ page. These images are not tested as extensively as the images from release days, but they contain the latest packages and installer. Therefore, fewer updates are required during or after installation.
Download the server installer for amd64 from the `Ubuntu Server <https://ubuntu.com/download/server>`_ page and other architectures from the `release directory <http://cdimage.ubuntu.com/releases/20.04/release/>`_.
Installer UI navigation
-----------------------
Use the :kbd:`↑` and :kbd:`↓` arrows, as well as the :kbd:`Space` or :kbd:`Enter` keys to navigate the installer.
:kbd:`Tab` and :kbd:`Shift` + :kbd:`Tab` move the focus down and up respectively. Use :kbd:`Home`, :kbd:`End`, :kbd:`PgUp` and :kbd:`PgDn` to navigate through long lists quickly.
Running the installer over a serial port
----------------------------------------
By default, the installer runs on the first virtual terminal, ``tty1``. This is what is displayed on any connected monitor by default. On systems without a monitor or a remote virtual terminal, you can run the installer on the serial port. To do this, specify an `appropriate console <https://www.kernel.org/doc/html/latest/admin-guide/serial-console.html>`_ on the kernel command line. A common value is ``console=ttyS0``.
When running on a serial port, the installer starts in a basic mode that uses only the ASCII character set and black and white colours. If you are connecting from a terminal emulator, such as gnome-terminal, that supports Unicode and rich colours, you can switch to "rich mode", which uses Unicode and colours, and supports
many languages.
.. _connect-via-ssh:
Connecting to the installer over SSH
------------------------------------
An alternative to basic terminals is to connect via SSH. If the network is up by the time the installer starts, instructions are offered on the initial screen in basic mode. Otherwise, instructions are available from the help menu once networking is configured.
In addition, connecting via SSH is capable of displaying all Unicode characters, which enables the use of more translations than can be displayed on a virtual terminal.
Help menu
---------
The help menu is in the top right of the screen. It contains help -- both general and for the currently displayed screen -- and some general actions.
Switching to a shell prompt
~~~~~~~~~~~~~~~~~~~~~~~~~~~
To switch to a shell at any time, select :guilabel:`Enter shell` from the help menu, or press :kbd:`Control` + :kbd:`Z` or :kbd:`F2`.
If you are accessing the installer via ``tty1``, you can also access a shell by switching to a different virtual terminal (:kbd:`Control` + :kbd:`Alt` + arrow, or :kbd:`Control` + :kbd:`Alt` + number keys, to move between virtual terminals).
Global keys
-----------
The following global keys work at any time:
==================================== =============================================
Key Action
==================================== =============================================
:kbd:`Esc` Go back
:kbd:`F1` Open help menu
:kbd:`Control` + :kbd:`Z`, :kbd:`F2` Switch to shell
:kbd:`Control` + :kbd:`L`, :kbd:`F3` Redraw screen
:kbd:`Control` + :kbd:`T`, :kbd:`F4` Toggle rich mode (colour, Unicode) on and off
==================================== =============================================

View File

@ -0,0 +1,79 @@
.. _providing-autoinstall:
Providing autoinstall configuration
===================================
There are two ways to provide the autoinstall configuration:
* :external+cloud-init:ref:`#cloud-config user data <user_data_formats-cloud_config>` containing ``autoinstall:`` configuration directives for cloud-init
* Directly on the installation media
For detailed how-to guides that provide step-by-step instructions on how to use these two methods, go to:
* :ref:`Autoinstall quick start <autoinstall_quick_start>`
* :ref:`Autoinstall quick start for s390x <autoinstall_quick_start_s390x>`
Autoinstall by way of `cloud-config`
------------------------------------
The suggested way of providing autoinstall configuration to the Ubuntu installer is via cloud-init. This allows the configuration to be applied to the installer without having to modify the installation media.
The autoinstall configuration is provided via cloud-init configuration, which is almost endlessly flexible. In most scenarios the easiest way will be to provide user data via the :external+cloud-init:ref:`datasource_nocloud` data source.
When providing autoinstall via cloud-init, the autoinstall configuration is provided as :external+cloud-init:ref:`user_data_formats-cloud_config`. This means it requires a :code:`#cloud-config` header. The autoinstall directives are placed under a top level :code:`autoinstall:` key:
.. code-block:: yaml
#cloud-config
autoinstall:
version: 1
....
.. note::
:external+cloud-init:ref:`user_data_formats-cloud_config` files must contain the ``#cloud-config`` header to be recognised as a valid cloud configuration data file.
Autoinstall on the installation media
-------------------------------------
Another option for supplying autoinstall to the Ubuntu installer is to place a file named :code:`autoinstall.yaml` on the installation media itself.
The autoinstall configuration provided in this way is passed to the Ubuntu installer directly and does not require the top-level :code:`autoinstall:` key:
.. code-block:: yaml
version: 1
....
Starting in 24.04 (Noble), to be consistent with the cloud-config based format, a top-level :code:`autoinstall:` keyword is allowed:
.. code-block:: yaml
autoinstall:
version: 1
....
There are two locations that Subiquity checks for the :code:`autoinstall.yaml` file:
* At the root of the installation medium. When writing the installation ISO to a USB flash drive, copy :code:`autoinstall.yaml` to the partition containing the contents of the ISO - i.e. to the directory containing the ``casper`` sub-directory.
* On the root file system of the installation system - this option typically requires modifying the installation ISO and is not recommended.
Alternatively, you can pass the location of the autoinstall file on the kernel command line via the :code:`subiquity.autoinstallpath` parameter, where the path is relative to the root directory of the installation system. For example:
.. code-block::
subiquity.autoinstallpath=path/to/autoinstall.yaml`
Order of precedence for autoinstall locations
---------------------------------------------
Because there are many ways to specify the autoinstall file, it may happen that multiple locations are specified at the same time. Subiquity searches for the autoinstall file in the following order and uses the first existing one:
1. Kernel command line
2. Root of the installation system
3. `cloud-config`
4. Root of the installation medium (ISO)

View File

@ -1,46 +1,38 @@
Screen-by-screen installer
**************************
.. _screen-by-screen:
The installer is designed to be easy to use without documentation. However,
this guide provides more information on each of the screens of the installer to
help walk you through an installation.
Screen-by-screen installer walk-through
=======================================
The installer is designed to be easy to use without documentation. This guide provides more information on each of the screens of the installer to guide you through an installation.
Language selection
==================
------------------
.. image:: figures/sbs-language.png
:alt:
:alt: Welcome!
This screen selects the language for the installer and the default language
for the installed system.
More languages can be displayed if you
`connect via SSH <https://discourse.ubuntu.com/t/draft-using-the-server-installer/16689#connect-via-ssh>`_.
This screen lets you select the language for the installer and the default language for the installed system. In case only a basic terminal with limited language support is available for the installation, an alternative is to :ref:`connect via SSH <connect-via-ssh>`.
Refresh
=======
-------
.. image:: figures/sbs-refresh.png
:alt:
:alt: Installer update available
This screen is shown if there is an update available for the installer. This
allows you to get any improvements and bug fixes made since release.
This screen is shown if there is an update available for the installer. Update the installer to get any improvements and bug fixes made since the release.
If you choose to update, the new version will be downloaded and the installer
will restart at the same point of the installation.
If you choose to update, the new version is downloaded, and the installer will restart at the same point of the installation.
Keyboard
========
--------
.. image:: figures/sbs-keyboard.png
:alt:
:alt: Keyboard configuration
Choose the layout and variant of keyboard attached to the system, if any. When
running in a virtual terminal, it is possible to guess the layout and variant
by answering questions about the keyboard.
Choose the layout and variant of keyboard attached to the system, if any. When running in a virtual terminal, it is possible to guess the layout and variant by answering questions about the keyboard. Select :guilabel:`Identify keyboard` to use this feature.
Zdev (s390x only)
=================
-----------------
.. code-block::
@ -48,7 +40,7 @@ Zdev (s390x only)
Zdev setup
====================================================================
ID ONLINE NAMES ^
generic-ccw │
0.0.0009 > │
0.0.000c > │
@ -59,116 +51,94 @@ Zdev (s390x only)
0.0.0190 > │
0.0.0191 > │
0.0.019d > │
0.0.019e >┌────────────┐
0.0.0200 >│< (close) │
0.0.0300 >│ Enable │
0.0.0400 >│ Disable │
0.0.019e >┌────────────┐
0.0.0200 >│< (close) │
0.0.0300 >│ Enable │
0.0.0400 >│ Disable │
0.0.0592 >└────────────┘ v
[ Continue ]
[ Back ]
This screen is only shown on s390x and allows z-specific configuration of
devices.
[ Continue ]
[ Back ]
The list of devices can be long. :kbd:`Home` / :kbd:`End` / :kbd:`PageUp`
/ :kbd:`PageDown` can be used to navigate through the list more quickly.
This screen is only shown on the s390x architecture and allows z-specific configuration of devices.
The list of devices can be long. Use the :kbd:`Home`, :kbd:`End`, :kbd:`PgUp` and :kbd:`PgDn` keys navigate through the list quickly.
Network
=======
-------
.. image:: figures/sbs-network.png
:alt:
:alt: Network connections
This screen allows the configuration of the network. Ubuntu Server uses NetPlan
to configure networking and the UI of the installer can configure a subset of
NetPlan's capabilities. In particular it can configure DHCP or static
addressing, VLANs and bonds.
This screen allows the configuration of the network. Ubuntu Server uses Netplan to configure networking and the installer can configure a subset of Netplan capabilities. In particular, it can configure DHCP or static
addressing, VLAN and bonds.
If networking is present (defined as "at least one interface has a default
route") then the installer will install updates from the archive at the end of
installation.
If networking is present (defined as "at least one interface has a default route"), then the installer installs updates from the repository at the end of installation.
Proxy
=====
-----
.. image:: figures/sbs-proxy.png
:alt:
:alt: Configure proxy
The proxy configured on this screen is used for accessing the package
repository and the snap store both in the installer environment and in the
installed system.
Use this screen to configure proxy for accessing the package repository and the snap store both in the installer environment and in the installed system.
Mirror
======
------
.. image:: figures/sbs-mirror.png
:alt:
:alt: Configure Ubuntu archive mirror
The installer will attempt to use ``geoip`` to look up an appropriate default
package mirror for your location. If you want or need to use a different
mirror, enter its URL here.
The installer attempts to use geolocation to find an appropriate default package mirror for your location. To use a different mirror, enter its URL here.
Storage
=======
-------
.. image:: figures/sbs-storage.png
:alt:
:alt: Storage configuration
Storage configuration is a complicated topic and :ref:`has its own page for documentation <configure-storage>`.
Storage configuration is a complex topic and :ref:`has its own page for documentation <configure-storage>`.
.. image:: figures/sbs-confirm-storage.png
:alt:
:alt: Storage configuration
Once the storage configuration is confirmed, the install begins in the
background.
Once the storage configuration is confirmed, the installation begins in the background.
Identity
========
--------
.. image:: figures/sbs-identity.png
:alt:
:alt: Profile setup
The default user will be an administrator, able to use ``sudo`` (this is why a
password is needed, even if SSH public key access is enabled on the next
screen).
The default user will be an administrator who can use ``sudo`` (this is why a password is needed, even if SSH public-key access is enabled on the next screen).
SSH
===
---
.. image:: figures/sbs-ssh.png
:alt:
:alt: SSH Setup
A default Ubuntu install has no open ports. It is very common to administer
servers via SSH so the installer allows it to be installed with the click of a
button.
A default Ubuntu installation has no open ports. As it is very common to administer servers via SSH, the installer allows it to be installed.
You can import keys for the default user from GitHub or Launchpad.
If you import a key, then password authentication is disabled by default but it
can be re-enabled again at a later time if you wish.
If you import a key, then password authentication is disabled by default. It can be re-enabled later.
Snaps
=====
-----
.. image:: figures/sbs-snaps.png
:alt:
:alt: Featured Server Snaps
If a network connection is enabled, a selection of snaps that are useful in a
server environment are presented and can be selected for installation.
If a network connection is enabled, a selection of snaps that are useful in a server environment is presented and can be selected for installation.
Installation logs
=================
-----------------
.. image:: figures/sbs-logs.png
:alt:
:alt: Installing system
The final screen of the installer shows the progress of the installer and
allows viewing of the full log file. Once the install has completed and
security updates installed, the installer waits for confirmation before
restarting.
The final screen of the installer shows the progress of the installer and allows viewing of the full log file. Once the installation has completed and security updates have been installed, the installer waits for a confirmation before restarting.
.. image:: figures/sbs-complete.png
:alt:
:alt: Installation complete

Some files were not shown because too many files have changed in this diff Show More