Compare commits
63 Commits
ubuntu/nob
...
main
Author | SHA1 | Date |
---|---|---|
Olivier Gayot | f200888e70 | |
Michael Hudson-Doyle | debf176316 | |
Olivier Gayot | b72bf2ee3a | |
Michael Hudson-Doyle | 1f09b19eab | |
Michael Hudson-Doyle | bdf0e24d69 | |
Michael Hudson-Doyle | d8fc0cc9ea | |
Michael Hudson-Doyle | 1f64752315 | |
Michael Hudson-Doyle | eb3c4bf2ee | |
Chris Peterson | c5131fca5f | |
Chris Peterson | 68ae5a4cdc | |
Chris Peterson | 3b3e3310d6 | |
Michael Hudson-Doyle | cd3d7b1c95 | |
Michael Hudson-Doyle | d0366229ec | |
Chris Peterson | eb155c363c | |
Chris Peterson | dea2ca2379 | |
Olivier Gayot | 7a2002bc6c | |
Chris Peterson | 7fedee55fa | |
Chris Peterson | 88f8b21633 | |
Chris Peterson | 45d0c7ab87 | |
Michael Hudson-Doyle | 86282f5721 | |
Michael Hudson-Doyle | c7fd905c6b | |
Chris Peterson | c6a1b583de | |
Chris Peterson | 652f73209c | |
Michael Hudson-Doyle | b2e9393ddb | |
Michael Hudson-Doyle | d9f4f721fb | |
Olivier Gayot | 0398ec8b0e | |
Michael Hudson-Doyle | 771fc1355b | |
Michael Hudson-Doyle | e3f16aaded | |
Michael Hudson-Doyle | 5605942e70 | |
Michael Hudson-Doyle | b53c1fffb7 | |
Michael Hudson-Doyle | a59ef9fba0 | |
Chris Peterson | 396e4d5a87 | |
Chris Peterson | b56ea4508f | |
Olivier Gayot | d4a51027d9 | |
Olivier Gayot | 144a2adf49 | |
Olivier Gayot | 592714279c | |
Olivier Gayot | 0987dc5a7a | |
Olivier Gayot | a81caf7f65 | |
Olivier Gayot | e3e365de89 | |
Olivier Gayot | 76815d6fa1 | |
Olivier Gayot | e129c13590 | |
Dan Bungert | e3b0805d3c | |
Chris Peterson | 1ef2b0741a | |
Dan Bungert | acf88ac452 | |
Michael Hudson-Doyle | e1ca8731c7 | |
Michael Hudson-Doyle | 9ff9d6c36f | |
Dan Bungert | a73d997b5d | |
Michael Hudson-Doyle | 34afb5b40c | |
Michael Hudson-Doyle | 295b0455c2 | |
Dan Bungert | 389a50e194 | |
Dan Bungert | 129623cc6b | |
Olivier Gayot | 65f8ef50d4 | |
Olivier Gayot | 1d7c7c051c | |
Dan Bungert | 3f2529bc49 | |
Olivier Gayot | c18d434439 | |
Olivier Gayot | fa8e49457b | |
Olivier Gayot | 4695078c84 | |
Dan Bungert | 26bc08b694 | |
Chris Peterson | f3e1d6977e | |
Olivier Gayot | 92a47635d8 | |
Dan Bungert | dbcf723676 | |
Dan Bungert | 2afd7f2fa5 | |
Olivier Gayot | 020dcc0b88 |
|
@ -18,3 +18,4 @@ repos:
|
|||
language: system
|
||||
entry: make -C doc spelling
|
||||
files: "doc/.*rst"
|
||||
pass_filenames: false
|
||||
|
|
10
DESIGN.md
10
DESIGN.md
|
@ -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
|
||||
|
|
666
LICENSE
666
LICENSE
|
@ -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).
|
||||
|
|
|
@ -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/>.
|
|
@ -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>.
|
|
@ -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 """
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 """
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
@ -206,7 +205,7 @@ class IdentityController(TuiController):
|
|||
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"
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2024 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 os.path
|
||||
import tempfile
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 """
|
||||
|
|
|
@ -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 """
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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/>.
|
||||
|
|
|
@ -734,7 +734,7 @@ codecs
|
|||
Configure whether common restricted packages (including codecs) from the multiverse repository are to be installed.
|
||||
|
||||
install
|
||||
~~~~~~~
|
||||
^^^^^^^
|
||||
|
||||
* **type:** boolean
|
||||
* **default:** ``false``
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
|
@ -1,4 +1,4 @@
|
|||
#source-catalog: examples/sources/core.yaml
|
||||
#source-catalog: examples/sources/core-desktop.yaml
|
||||
Source:
|
||||
source: ubuntu-core
|
||||
Welcome:
|
|
@ -0,0 +1,24 @@
|
|||
#source-catalog: examples/sources/uc24.yaml
|
||||
Source:
|
||||
source: ubuntu-core
|
||||
Welcome:
|
||||
lang: en_US
|
||||
Refresh:
|
||||
update: no
|
||||
Keyboard:
|
||||
layout: us
|
||||
Zdev:
|
||||
accept-default: yes
|
||||
Network:
|
||||
accept-default: yes
|
||||
Proxy:
|
||||
proxy: ""
|
||||
Filesystem:
|
||||
guided: yes
|
||||
guided-index: 0
|
||||
UbuntuPro:
|
||||
token: ""
|
||||
InstallProgress:
|
||||
reboot: yes
|
||||
Drivers:
|
||||
install: no
|
|
@ -0,0 +1,238 @@
|
|||
{
|
||||
"type": "sync",
|
||||
"status-code": 200,
|
||||
"status": "OK",
|
||||
"result": {
|
||||
"current": true,
|
||||
"label": "20240314",
|
||||
"model": {
|
||||
"architecture": "amd64",
|
||||
"authority-id": "canonical",
|
||||
"base": "core24",
|
||||
"brand-id": "canonical",
|
||||
"grade": "dangerous",
|
||||
"model": "ubuntu-core-24-amd64-dangerous",
|
||||
"revision": "2",
|
||||
"series": "16",
|
||||
"sign-key-sha3-384": "9tydnLa6MTJ-jaQTFUXEwHl1yRx7ZS4K5cyFDhYDcPzhS7uyEkDxdUjg9g08BtNn",
|
||||
"snaps": [
|
||||
{
|
||||
"default-channel": "24/edge",
|
||||
"id": "UqFziVZDHLSyO3TqSWgNBoAdHbLI4dAH",
|
||||
"name": "pc",
|
||||
"type": "gadget"
|
||||
},
|
||||
{
|
||||
"default-channel": "24/beta",
|
||||
"id": "pYVQrBcKmBa0mZ4CCN7ExT6jH8rY1hza",
|
||||
"name": "pc-kernel",
|
||||
"type": "kernel"
|
||||
},
|
||||
{
|
||||
"default-channel": "latest/edge",
|
||||
"id": "dwTAh7MZZ01zyriOZErqd1JynQLiOGvM",
|
||||
"name": "core24",
|
||||
"type": "base"
|
||||
},
|
||||
{
|
||||
"default-channel": "latest/edge",
|
||||
"id": "PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4",
|
||||
"name": "snapd",
|
||||
"type": "snapd"
|
||||
},
|
||||
{
|
||||
"default-channel": "24/edge",
|
||||
"id": "ASctKBEHzVt3f1pbZLoekCvcigRjtuqw",
|
||||
"name": "console-conf",
|
||||
"presence": "optional",
|
||||
"type": "app"
|
||||
}
|
||||
],
|
||||
"timestamp": "2024-03-12T08:42:32+00:00",
|
||||
"type": "model"
|
||||
},
|
||||
"brand": {
|
||||
"id": "canonical",
|
||||
"username": "canonical",
|
||||
"display-name": "Canonical",
|
||||
"validation": "verified"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"title": "Reinstall",
|
||||
"mode": "install"
|
||||
},
|
||||
{
|
||||
"title": "Recover",
|
||||
"mode": "recover"
|
||||
},
|
||||
{
|
||||
"title": "Factory reset",
|
||||
"mode": "factory-reset"
|
||||
},
|
||||
{
|
||||
"title": "Run normally",
|
||||
"mode": "run"
|
||||
}
|
||||
],
|
||||
"volumes": {
|
||||
"pc": {
|
||||
"schema": "gpt",
|
||||
"bootloader": "grub",
|
||||
"id": "",
|
||||
"structure": [
|
||||
{
|
||||
"name": "mbr",
|
||||
"filesystem-label": "",
|
||||
"offset": 0,
|
||||
"offset-write": null,
|
||||
"min-size": 440,
|
||||
"size": 440,
|
||||
"type": "mbr",
|
||||
"role": "mbr",
|
||||
"id": "",
|
||||
"filesystem": "",
|
||||
"content": [
|
||||
{
|
||||
"source": "",
|
||||
"target": "",
|
||||
"image": "mbr.img",
|
||||
"offset": null,
|
||||
"size": 0,
|
||||
"unpack": false
|
||||
}
|
||||
],
|
||||
"update": {
|
||||
"edition": 1,
|
||||
"preserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BIOS Boot",
|
||||
"filesystem-label": "",
|
||||
"offset": 1048576,
|
||||
"offset-write": null,
|
||||
"min-size": 1048576,
|
||||
"size": 1048576,
|
||||
"type": "21686148-6449-6E6F-744E-656564454649",
|
||||
"role": "",
|
||||
"id": "",
|
||||
"filesystem": "",
|
||||
"content": null,
|
||||
"update": {
|
||||
"edition": 2,
|
||||
"preserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ubuntu-seed",
|
||||
"filesystem-label": "ubuntu-seed",
|
||||
"offset": 2097152,
|
||||
"offset-write": null,
|
||||
"min-size": 1258291200,
|
||||
"size": 1258291200,
|
||||
"type": "C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
|
||||
"role": "system-seed",
|
||||
"id": "",
|
||||
"filesystem": "vfat",
|
||||
"content": [
|
||||
{
|
||||
"source": "grubx64.efi",
|
||||
"target": "EFI/boot/grubx64.efi",
|
||||
"image": "",
|
||||
"offset": null,
|
||||
"size": 0,
|
||||
"unpack": false
|
||||
},
|
||||
{
|
||||
"source": "shim.efi.signed",
|
||||
"target": "EFI/boot/bootx64.efi",
|
||||
"image": "",
|
||||
"offset": null,
|
||||
"size": 0,
|
||||
"unpack": false
|
||||
}
|
||||
],
|
||||
"update": {
|
||||
"edition": 2,
|
||||
"preserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ubuntu-boot",
|
||||
"filesystem-label": "ubuntu-boot",
|
||||
"offset": 1260388352,
|
||||
"offset-write": null,
|
||||
"min-size": 786432000,
|
||||
"size": 786432000,
|
||||
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
|
||||
"role": "system-boot",
|
||||
"id": "",
|
||||
"filesystem": "ext4",
|
||||
"content": [
|
||||
{
|
||||
"source": "grubx64.efi",
|
||||
"target": "EFI/boot/grubx64.efi",
|
||||
"image": "",
|
||||
"offset": null,
|
||||
"size": 0,
|
||||
"unpack": false
|
||||
},
|
||||
{
|
||||
"source": "shim.efi.signed",
|
||||
"target": "EFI/boot/bootx64.efi",
|
||||
"image": "",
|
||||
"offset": null,
|
||||
"size": 0,
|
||||
"unpack": false
|
||||
}
|
||||
],
|
||||
"update": {
|
||||
"edition": 1,
|
||||
"preserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ubuntu-save",
|
||||
"filesystem-label": "ubuntu-save",
|
||||
"offset": 2046820352,
|
||||
"offset-write": null,
|
||||
"min-size": 33554432,
|
||||
"size": 33554432,
|
||||
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
|
||||
"role": "system-save",
|
||||
"id": "",
|
||||
"filesystem": "ext4",
|
||||
"content": null,
|
||||
"update": {
|
||||
"edition": 0,
|
||||
"preserve": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ubuntu-data",
|
||||
"filesystem-label": "ubuntu-data",
|
||||
"offset": 2080374784,
|
||||
"offset-write": null,
|
||||
"min-size": 1073741824,
|
||||
"size": 1073741824,
|
||||
"type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
|
||||
"role": "system-data",
|
||||
"id": "",
|
||||
"filesystem": "ext4",
|
||||
"content": null,
|
||||
"update": {
|
||||
"edition": 0,
|
||||
"preserve": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"storage-encryption": {
|
||||
"support": "unavailable",
|
||||
"storage-safety": "prefer-encrypted",
|
||||
"unavailable-reason": "not encrypting device storage as checking TPM gave: cannot read secure boot variable: cannot read EFI var \"SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c\": open /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c: no such file or directory"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"type": "sync",
|
||||
"status-code": 200,
|
||||
"status": "OK",
|
||||
"result": {
|
||||
"systems": [
|
||||
{
|
||||
"current": true,
|
||||
"label": "20240314",
|
||||
"model": {
|
||||
"model": "ubuntu-core-24-amd64-dangerous",
|
||||
"brand-id": "canonical",
|
||||
"display-name": "ubuntu-core-24-amd64-dangerous"
|
||||
},
|
||||
"brand": {
|
||||
"id": "canonical",
|
||||
"username": "canonical",
|
||||
"display-name": "Canonical",
|
||||
"validation": "verified"
|
||||
},
|
||||
"actions": [
|
||||
{
|
||||
"title": "Reinstall",
|
||||
"mode": "install"
|
||||
},
|
||||
{
|
||||
"title": "Recover",
|
||||
"mode": "recover"
|
||||
},
|
||||
{
|
||||
"title": "Factory reset",
|
||||
"mode": "factory-reset"
|
||||
},
|
||||
{
|
||||
"title": "Run normally",
|
||||
"mode": "run"
|
||||
}
|
||||
],
|
||||
"default-recovery-system": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
- description:
|
||||
en: This test source provides a "Ubuntu Core" base install
|
||||
id: ubuntu-core
|
||||
locale_support: none
|
||||
name:
|
||||
en: Ubuntu Core 24
|
||||
type: null
|
||||
size: 0
|
||||
variant: core
|
||||
snapd_system_label: "20240314"
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2018 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/>.
|
||||
|
||||
# The keyboard autodetection process is driven by the data in
|
||||
|
|
|
@ -17,8 +17,14 @@ tmpdir="$(mktemp -d)"
|
|||
cd "${tmpdir}"
|
||||
|
||||
PYTHONPATH=$LIVEFS_EDITOR python3 -m livefs_edit $old_iso /dev/null --setup-rootfs \
|
||||
--shell 'cp rootfs//var/lib/snapd/seed/snaps/subiquity_*.snap '$tmpdir'/old.snap'
|
||||
--shell 'cp rootfs/var/lib/snapd/seed/snaps/subiquity_*.snap '$tmpdir'/old.snap || \
|
||||
cp rootfs/var/lib/snapd/seed/snaps/ubuntu-desktop-bootstrap_*.snap '$tmpdir'/old.snap'
|
||||
|
||||
$src/scripts/slimy-update-snap.sh old.snap subiquity_new.snap
|
||||
if [ ! -f old.snap ] ; then
|
||||
echo "subiquity-like snap not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PYTHONPATH=$LIVEFS_EDITOR python3 -m livefs_edit $old_iso $new_iso --inject-snap subiquity_new.snap
|
||||
$src/scripts/slimy-update-snap.sh old.snap new.snap
|
||||
|
||||
PYTHONPATH=$LIVEFS_EDITOR python3 -m livefs_edit $old_iso $new_iso --inject-snap new.snap
|
||||
|
|
|
@ -39,7 +39,7 @@ validate () {
|
|||
autoinstall-reset-only)
|
||||
python3 scripts/validate-yaml.py --no-root-mount "${cfgs[@]}"
|
||||
;;
|
||||
answers-core)
|
||||
answers-core-desktop|answers-uc24)
|
||||
;;
|
||||
*)
|
||||
python3 scripts/validate-yaml.py "${cfgs[@]}"
|
||||
|
@ -50,7 +50,7 @@ validate () {
|
|||
exit 1
|
||||
fi
|
||||
case $testname in
|
||||
answers-core)
|
||||
answers-core-desktop|answers-uc24)
|
||||
;;
|
||||
*)
|
||||
python3 scripts/validate-autoinstall-user-data.py < $tmpdir/var/log/installer/autoinstall-user-data
|
||||
|
@ -223,9 +223,13 @@ for answers in examples/answers/*.yaml; do
|
|||
--snaps-from-examples \
|
||||
--source-catalog $catalog
|
||||
validate install
|
||||
if [ $answers != examples/answers/core.yaml ]; then
|
||||
case $testname in
|
||||
answers-core-desktop|answers-uc24)
|
||||
;;
|
||||
*)
|
||||
grep -q 'finish: subiquity/Install/install/postinstall/run_unattended_upgrades: SUCCESS: downloading and installing security updates' $tmpdir/subiquity-server-debug.log
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# The OOBE doesn't exist in WSL < 20.04
|
||||
if [ "${RELEASE%.*}" -ge 20 ]; then
|
||||
|
|
|
@ -3,16 +3,15 @@
|
|||
# Copyright 2022 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/>.
|
||||
|
||||
""" Entry-point to validate autoinstall-user-data against schema.
|
||||
|
|
2
setup.py
2
setup.py
|
@ -114,7 +114,7 @@ setup(name='subiquity',
|
|||
author='Canonical Engineering',
|
||||
author_email='ubuntu-dev@lists.ubuntu.com',
|
||||
url='https://github.com/canonical/subiquity',
|
||||
license="AGPLv3+",
|
||||
license="GPLv3",
|
||||
packages=find_packages(exclude=["tests"]),
|
||||
scripts=[
|
||||
'bin/console-conf-wait',
|
||||
|
|
|
@ -483,7 +483,7 @@ class SubiquityClient(TuiApplication):
|
|||
self._remove_last_screen()
|
||||
super().exit()
|
||||
|
||||
def select_initial_screen(self):
|
||||
async def select_initial_screen(self):
|
||||
last_screen = None
|
||||
if self.updated:
|
||||
state_path = self.state_path("last-screen")
|
||||
|
@ -495,7 +495,7 @@ class SubiquityClient(TuiApplication):
|
|||
for i, controller in enumerate(self.controllers.instances):
|
||||
if controller.name == last_screen:
|
||||
index = i
|
||||
run_bg_task(self._select_initial_screen(index))
|
||||
await self._select_initial_screen(index)
|
||||
|
||||
async def _select_initial_screen(self, index):
|
||||
endpoint_names = []
|
||||
|
@ -507,7 +507,7 @@ class SubiquityClient(TuiApplication):
|
|||
if self.variant:
|
||||
await self.client.meta.client_variant.POST(self.variant)
|
||||
self.controllers.index = index - 1
|
||||
self.next_screen()
|
||||
await self.next_screen()
|
||||
|
||||
async def move_screen(self, increment, coro):
|
||||
try:
|
||||
|
@ -585,14 +585,14 @@ class SubiquityClient(TuiApplication):
|
|||
else:
|
||||
super().unhandled_input(key)
|
||||
|
||||
def debug_shell(self, after_hook=None):
|
||||
async def debug_shell(self, after_hook=None):
|
||||
def _before():
|
||||
os.system("clear")
|
||||
print(DEBUG_SHELL_INTRO)
|
||||
|
||||
env = orig_environ(os.environ)
|
||||
cmd = ["bash"]
|
||||
self.run_command_in_foreground(
|
||||
await self.run_command_in_foreground(
|
||||
cmd, env=env, before_hook=_before, after_hook=after_hook, cwd="/"
|
||||
)
|
||||
|
||||
|
|
|
@ -62,8 +62,10 @@ class DriversController(SubiquityTuiController):
|
|||
click(view.form.done_btn.base_widget)
|
||||
|
||||
def cancel(self) -> None:
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, install: bool) -> None:
|
||||
log.debug("DriversController.done next_screen install=%s", install)
|
||||
self.app.next_screen(self.endpoint.POST(DriversPayload(install=install)))
|
||||
self.app.request_next_screen(
|
||||
self.endpoint.POST(DriversPayload(install=install))
|
||||
)
|
||||
|
|
|
@ -81,6 +81,7 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
|
|||
self.current_view = await self.make_guided_ui(status)
|
||||
if isinstance(self.ui.body, SlowProbing):
|
||||
self.ui.set_body(self.current_view)
|
||||
await self.app.redraw_screen()
|
||||
else:
|
||||
log.debug("not refreshing the display. Current display is %r", self.ui.body)
|
||||
|
||||
|
@ -260,7 +261,7 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
|
|||
async def _guided_choice(self, choice: GuidedChoiceV2):
|
||||
coro = self.endpoint.guided.POST(choice)
|
||||
if not choice.capability.supports_manual_customization():
|
||||
self.app.next_screen(coro)
|
||||
await self.app.next_screen(coro)
|
||||
return
|
||||
status = await self.app.wait_with_progress(coro)
|
||||
self.model = FilesystemModel(status.bootloader, root="/")
|
||||
|
@ -273,18 +274,31 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
|
|||
self.ui.set_body(FilesystemView(self.model, self))
|
||||
|
||||
def guided_choice(self, choice):
|
||||
run_bg_task(self._guided_choice(choice))
|
||||
async def show_guided_and_redraw():
|
||||
await self._guided_choice(choice)
|
||||
await self.app.redraw_screen()
|
||||
|
||||
run_bg_task(show_guided_and_redraw())
|
||||
|
||||
async def _guided(self):
|
||||
self.ui.set_body((await self.make_ui())())
|
||||
|
||||
def guided(self):
|
||||
run_bg_task(self._guided())
|
||||
async def guided_and_redraw():
|
||||
await self._guided()
|
||||
await self.app.redraw_screen()
|
||||
|
||||
run_bg_task(guided_and_redraw())
|
||||
|
||||
def reset(self, refresh_view):
|
||||
async def reset_and_redraw():
|
||||
await self._reset(refresh_view)
|
||||
await self.app.redraw_screen()
|
||||
|
||||
log.info("Resetting Filesystem model")
|
||||
self.app.ui.block_input = True
|
||||
run_bg_task(self._reset(refresh_view))
|
||||
|
||||
run_bg_task(reset_and_redraw())
|
||||
|
||||
async def _reset(self, refresh_view):
|
||||
status = await self.endpoint.reset.POST()
|
||||
|
@ -294,11 +308,11 @@ class FilesystemController(SubiquityTuiController, FilesystemManipulator):
|
|||
self.ui.set_body(FilesystemView(self.model, self))
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def finish(self):
|
||||
log.debug("FilesystemController.finish next_screen")
|
||||
self.app.next_screen(
|
||||
self.app.request_next_screen(
|
||||
self.endpoint.POST(
|
||||
self.model._render_actions(mode=ActionRenderMode.FOR_API_CLIENT)
|
||||
)
|
||||
|
|
|
@ -43,11 +43,11 @@ class IdentityController(SubiquityTuiController):
|
|||
self.done(identity)
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, identity_data):
|
||||
log.debug("IdentityController.done next_screen user_spec=%s", identity_data)
|
||||
self.app.next_screen(self.endpoint.POST(identity_data))
|
||||
self.app.request_next_screen(self.endpoint.POST(identity_data))
|
||||
|
||||
async def validate_username(self, username):
|
||||
return await self.endpoint.validate_username.GET(username)
|
||||
|
|
|
@ -49,7 +49,7 @@ class KeyboardController(SubiquityTuiController):
|
|||
await self.endpoint.POST(setting)
|
||||
|
||||
def done(self):
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
|
|
@ -77,7 +77,7 @@ class MirrorController(SubiquityTuiController):
|
|||
self.app.ui.body.form._click_done(None)
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, mirror, skip_archive: Optional[bool]):
|
||||
if skip_archive is not None:
|
||||
|
@ -94,4 +94,4 @@ class MirrorController(SubiquityTuiController):
|
|||
mirror,
|
||||
use_during_installation,
|
||||
)
|
||||
self.app.next_screen(self.endpoint.POST(data))
|
||||
self.app.request_next_screen(self.endpoint.POST(data))
|
||||
|
|
|
@ -69,27 +69,34 @@ class NetworkController(SubiquityTuiController, NetworkAnswersMixin):
|
|||
if act == LinkAction.DEL:
|
||||
self.view.del_link(info)
|
||||
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def route_watch_POST(self, has_default_route: bool) -> None:
|
||||
if self.view is not None:
|
||||
self.view.update_has_default_route(has_default_route)
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def apply_starting_POST(self) -> None:
|
||||
if self.view is not None:
|
||||
self.view.show_apply_spinner()
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def apply_stopping_POST(self) -> None:
|
||||
if self.view is not None:
|
||||
self.view.hide_apply_spinner()
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def apply_error_POST(self, stage: str) -> None:
|
||||
if self.view is not None:
|
||||
self.view.show_network_error(stage)
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def wlan_support_install_finished_POST(
|
||||
self, state: PackageInstallState
|
||||
) -> None:
|
||||
if self.view:
|
||||
self.view.update_for_wlan_support_install_state(state.name)
|
||||
self.view.request_redraw_if_visible()
|
||||
|
||||
async def subscribe(self):
|
||||
self.tdir = tempfile.mkdtemp()
|
||||
|
@ -118,10 +125,10 @@ class NetworkController(SubiquityTuiController, NetworkAnswersMixin):
|
|||
run_bg_task(self.unsubscribe())
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self):
|
||||
self.app.next_screen(self.endpoint.POST())
|
||||
self.app.request_next_screen(self.endpoint.POST())
|
||||
|
||||
def set_static_config(
|
||||
self, dev_name: str, ip_version: int, static_config: StaticConfig
|
||||
|
|
|
@ -33,8 +33,8 @@ class ProxyController(SubiquityTuiController):
|
|||
self.done(self.answers["proxy"])
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, proxy):
|
||||
log.debug("ProxyController.done next_screen proxy=%s", proxy)
|
||||
self.app.next_screen(self.endpoint.POST(proxy))
|
||||
self.app.request_next_screen(self.endpoint.POST(proxy))
|
||||
|
|
|
@ -77,7 +77,7 @@ class RefreshController(SubiquityTuiController):
|
|||
|
||||
def done(self, sender=None):
|
||||
log.debug("RefreshController.done next_screen")
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
||||
def cancel(self, sender=None):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
|
|
@ -39,7 +39,7 @@ class SerialController(SubiquityTuiController):
|
|||
def done(self, rich):
|
||||
log.debug("SerialController.done rich %s next_screen", rich)
|
||||
self.app.set_rich(rich)
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
||||
def cancel(self):
|
||||
# Can't go back from here!
|
||||
|
|
|
@ -47,10 +47,10 @@ class SnapListController(SubiquityTuiController):
|
|||
|
||||
def done(self, selections: List[SnapSelection]):
|
||||
log.debug("SnapListController.done next_screen snaps_to_install=%s", selections)
|
||||
self.app.next_screen(self.endpoint.POST(selections))
|
||||
self.app.request_next_screen(self.endpoint.POST(selections))
|
||||
|
||||
def cancel(self, sender=None):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
async def get_list_wait(self):
|
||||
return await self.endpoint.GET(wait=True)
|
||||
|
|
|
@ -43,7 +43,7 @@ class SourceController(SubiquityTuiController):
|
|||
form._click_done(None)
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, source_id, search_drivers: bool):
|
||||
log.debug(
|
||||
|
@ -51,4 +51,4 @@ class SourceController(SubiquityTuiController):
|
|||
source_id,
|
||||
search_drivers,
|
||||
)
|
||||
self.app.next_screen(self.endpoint.POST(source_id, search_drivers))
|
||||
self.app.request_next_screen(self.endpoint.POST(source_id, search_drivers))
|
||||
|
|
|
@ -84,7 +84,7 @@ class SSHController(SubiquityTuiController):
|
|||
form._click_done(None)
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def _fetch_cancel(self):
|
||||
if self._fetch_task is None:
|
||||
|
@ -100,6 +100,7 @@ class SSHController(SubiquityTuiController):
|
|||
self.ui.body.fetching_ssh_keys_failed(
|
||||
_("Importing keys failed:"), response.error
|
||||
)
|
||||
self.ui.body.request_redraw()
|
||||
return
|
||||
elif response.status == SSHFetchIdStatus.FINGERPRINT_ERROR:
|
||||
if isinstance(self.ui.body, SSHView):
|
||||
|
@ -107,12 +108,14 @@ class SSHController(SubiquityTuiController):
|
|||
_("ssh-keygen failed to show fingerprint of downloaded keys:"),
|
||||
response.error,
|
||||
)
|
||||
self.ui.body.request_redraw()
|
||||
return
|
||||
|
||||
identities = response.identities
|
||||
|
||||
if isinstance(self.ui.body, SSHView):
|
||||
self.ui.body.confirm_ssh_keys(ssh_import_id, identities)
|
||||
self.ui.body.request_redraw()
|
||||
else:
|
||||
log.debug("ui.body of unexpected instance: %s", type(self.ui.body).__name__)
|
||||
|
||||
|
@ -123,4 +126,4 @@ class SSHController(SubiquityTuiController):
|
|||
|
||||
def done(self, result):
|
||||
log.debug("SSHController.done next_screen result=%s", result)
|
||||
self.app.next_screen(self.endpoint.POST(result))
|
||||
self.app.request_next_screen(self.endpoint.POST(result))
|
||||
|
|
|
@ -216,13 +216,13 @@ class UbuntuProController(SubiquityTuiController):
|
|||
schedule_task(inner())
|
||||
|
||||
def cancel(self) -> None:
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self, token: str) -> None:
|
||||
"""Submit the token and move on to the next screen."""
|
||||
self.app.next_screen(self.endpoint.POST(UbuntuProInfo(token=token)))
|
||||
self.app.request_next_screen(self.endpoint.POST(UbuntuProInfo(token=token)))
|
||||
|
||||
def next_screen(self) -> None:
|
||||
"""Move on to the next screen. Assume the token should not be
|
||||
submitted (or has already been submitted)."""
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
|
|
@ -48,10 +48,10 @@ class WelcomeController(SubiquityTuiController):
|
|||
log.debug("WelcomeController.done %s next_screen", code)
|
||||
i18n.switch_language(code)
|
||||
self.app.native_language = display_name
|
||||
self.app.next_screen(self.endpoint.POST(code))
|
||||
self.app.request_next_screen(self.endpoint.POST(code))
|
||||
|
||||
def cancel(self, sender=None):
|
||||
if not self.serial:
|
||||
# Can't go back from here unless we're on serial!
|
||||
pass
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
|
|
@ -33,11 +33,11 @@ class ZdevController(SubiquityTuiController):
|
|||
self.done()
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def done(self):
|
||||
# switch to next screen
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
||||
async def chzdev(self, action, zdevinfo):
|
||||
return await self.endpoint.chzdev.POST(action, zdevinfo)
|
||||
|
|
|
@ -180,11 +180,19 @@ class FilesystemManipulator:
|
|||
|
||||
delete_lvm_partition = delete_logical_volume
|
||||
|
||||
cryptoswap_options = [
|
||||
"cipher=aes-cbc-essiv:sha256",
|
||||
"initramfs",
|
||||
"plain",
|
||||
"size=256",
|
||||
"swap",
|
||||
]
|
||||
|
||||
def create_cryptoswap(self, device):
|
||||
dmc = self.model.add_dm_crypt(
|
||||
device,
|
||||
keyfile="/dev/urandom",
|
||||
options=["swap", "initramfs"],
|
||||
options=self.cryptoswap_options,
|
||||
)
|
||||
self.create_filesystem(dmc, dict(fstype="swap"))
|
||||
return dmc
|
||||
|
|
|
@ -43,6 +43,13 @@ class SerializationError(Exception):
|
|||
return f"processing {self.obj}: at {p}, {self.message}"
|
||||
|
||||
|
||||
E = typing.TypeVar("E")
|
||||
|
||||
|
||||
class NonExhaustive(typing.Generic[E]):
|
||||
pass
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class SerializationContext:
|
||||
obj: typing.Any
|
||||
|
@ -71,6 +78,8 @@ class SerializationContext:
|
|||
# This is basically a half-assed version of # https://pypi.org/project/cattrs/
|
||||
# but that's not packaged and this is enough for our needs.
|
||||
|
||||
_enum_has_str_values = {}
|
||||
|
||||
|
||||
class Serializer:
|
||||
def __init__(
|
||||
|
@ -86,6 +95,7 @@ class Serializer:
|
|||
typing.List: self._walk_List,
|
||||
dict: self._walk_Dict,
|
||||
typing.Dict: self._walk_Dict,
|
||||
NonExhaustive: self._walk_NonExhaustive,
|
||||
}
|
||||
self.type_serializers = {}
|
||||
self.type_deserializers = {}
|
||||
|
@ -97,6 +107,24 @@ class Serializer:
|
|||
self.type_serializers[datetime.datetime] = self._serialize_datetime
|
||||
self.type_deserializers[datetime.datetime] = self._deserialize_datetime
|
||||
|
||||
def _ann_ok_as_dict_key(self, annotation):
|
||||
if annotation is str:
|
||||
return True
|
||||
origin = getattr(annotation, "__origin__", None)
|
||||
if origin is NonExhaustive:
|
||||
annotation = annotation.__args__[0]
|
||||
if isinstance(annotation, type) and issubclass(annotation, enum.Enum):
|
||||
if self.serialize_enums_by == "name":
|
||||
return True
|
||||
else:
|
||||
if annotation in _enum_has_str_values:
|
||||
return _enum_has_str_values[annotation]
|
||||
ok = set(type(v.value) for v in annotation) == {str}
|
||||
_enum_has_str_values[annotation] = ok
|
||||
return ok
|
||||
else:
|
||||
return False
|
||||
|
||||
def _scalar(self, annotation, context):
|
||||
context.assert_type(annotation)
|
||||
return context.cur
|
||||
|
@ -139,10 +167,12 @@ class Serializer:
|
|||
|
||||
def _walk_Dict(self, meth, args, context):
|
||||
k_ann, v_ann = args
|
||||
if not context.serializing and k_ann is not str:
|
||||
input_items = context.cur
|
||||
else:
|
||||
if self._ann_ok_as_dict_key(k_ann):
|
||||
input_items = context.cur.items()
|
||||
elif context.serializing:
|
||||
input_items = context.cur.items()
|
||||
else:
|
||||
input_items = context.cur
|
||||
output_items = [
|
||||
[
|
||||
meth(k_ann, context.child(f"/{k}", k)),
|
||||
|
@ -150,9 +180,25 @@ class Serializer:
|
|||
]
|
||||
for k, v in input_items
|
||||
]
|
||||
if context.serializing and k_ann is not str:
|
||||
return output_items
|
||||
if self._ann_ok_as_dict_key(k_ann):
|
||||
return dict(output_items)
|
||||
elif context.serializing:
|
||||
return output_items
|
||||
else:
|
||||
return dict(output_items)
|
||||
|
||||
def _walk_NonExhaustive(self, meth, args, context):
|
||||
[enum_cls] = args
|
||||
if context.serializing:
|
||||
if isinstance(context.cur, enum_cls):
|
||||
return meth(enum_cls, context)
|
||||
else:
|
||||
return context.cur
|
||||
else:
|
||||
if context.cur in (getattr(m, self.serialize_enums_by) for m in enum_cls):
|
||||
return meth(enum_cls, context)
|
||||
else:
|
||||
return context.cur
|
||||
|
||||
def _serialize_dict(self, annotation, context):
|
||||
context.assert_type(annotation)
|
||||
|
|
|
@ -23,7 +23,12 @@ import unittest
|
|||
|
||||
import attr
|
||||
|
||||
from subiquity.common.serialize import SerializationError, Serializer, named_field
|
||||
from subiquity.common.serialize import (
|
||||
NonExhaustive,
|
||||
SerializationError,
|
||||
Serializer,
|
||||
named_field,
|
||||
)
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
|
@ -61,6 +66,10 @@ class MyEnum(enum.Enum):
|
|||
name = "value"
|
||||
|
||||
|
||||
class MyIntEnum(enum.Enum):
|
||||
name = 1
|
||||
|
||||
|
||||
class CommonSerializerTests:
|
||||
simple_examples = [
|
||||
(int, 1),
|
||||
|
@ -129,12 +138,24 @@ class CommonSerializerTests:
|
|||
def test_enums(self):
|
||||
self.assertSerialization(MyEnum, MyEnum.name, "name")
|
||||
|
||||
def test_non_exhaustive_enums(self):
|
||||
self.serializer = type(self.serializer)(compact=self.serializer.compact)
|
||||
self.assertSerialization(NonExhaustive[MyEnum], MyEnum.name, "name")
|
||||
self.assertSerialization(NonExhaustive[MyEnum], "name2", "name2")
|
||||
|
||||
def test_enums_by_value(self):
|
||||
self.serializer = type(self.serializer)(
|
||||
compact=self.serializer.compact, serialize_enums_by="value"
|
||||
)
|
||||
self.assertSerialization(MyEnum, MyEnum.name, "value")
|
||||
|
||||
def test_non_exhaustive_enums_by_value(self):
|
||||
self.serializer = type(self.serializer)(
|
||||
compact=self.serializer.compact, serialize_enums_by="value"
|
||||
)
|
||||
self.assertSerialization(NonExhaustive[MyEnum], MyEnum.name, "value")
|
||||
self.assertSerialization(NonExhaustive[MyEnum], "value2", "value2")
|
||||
|
||||
def test_serialize_any(self):
|
||||
o = object()
|
||||
self.assertSerialization(typing.Any, o, o)
|
||||
|
@ -259,6 +280,29 @@ class TestSerializer(CommonSerializerTests, unittest.TestCase):
|
|||
self.serializer.deserialize(Type, {"field-1": 1, "field2": 2})
|
||||
self.assertEqual(catcher.exception.path, "['field-1']")
|
||||
|
||||
def test_serialize_dict_enumkeys_name(self):
|
||||
self.assertSerialization(
|
||||
typing.Dict[MyEnum, str], {MyEnum.name: "b"}, {"name": "b"}
|
||||
)
|
||||
|
||||
def test_serialize_dict_enumkeys_str_value(self):
|
||||
self.serializer = type(self.serializer)(
|
||||
compact=self.serializer.compact, serialize_enums_by="value"
|
||||
)
|
||||
self.assertSerialization(
|
||||
typing.Dict[MyEnum, str], {MyEnum.name: "b"}, {"value": "b"}
|
||||
)
|
||||
|
||||
def test_serialize_dict_enumkeys_notstr_value(self):
|
||||
self.serializer = type(self.serializer)(
|
||||
compact=self.serializer.compact, serialize_enums_by="value"
|
||||
)
|
||||
self.assertSerialization(
|
||||
typing.Dict[MyIntEnum, str],
|
||||
{MyIntEnum.name: "b"},
|
||||
[[1, "b"]],
|
||||
)
|
||||
|
||||
|
||||
class TestCompactSerializer(CommonSerializerTests, unittest.TestCase):
|
||||
serializer = Serializer(compact=True)
|
||||
|
|
|
@ -38,13 +38,6 @@ class NetworkModel(CoreNetworkModel):
|
|||
|
||||
def render(self):
|
||||
netplan = self.render_config()
|
||||
# We write the wifi config -- which almost certainly contains secrets --
|
||||
# to a separate file since it's possible the default file may
|
||||
# be shared (e.g., via apport for a bug report) and we don't want to
|
||||
# leak them. This isn't a perfect solution because in principle there
|
||||
# could be wired 802.1x stuff that has secrets too, but the subiquity
|
||||
# UI does not support any of that yet so this will do for now.
|
||||
|
||||
# If host cloud-init version has no readable combined-cloud-config,
|
||||
# default to False.
|
||||
cloud_cfg = cloudinit.get_host_combined_cloud_config()
|
||||
|
@ -63,8 +56,6 @@ class NetworkModel(CoreNetworkModel):
|
|||
}
|
||||
}
|
||||
else:
|
||||
# Separate sensitive wifi config from potentially shared config
|
||||
wifis = netplan["network"].pop("wifis", None)
|
||||
r = {
|
||||
"write_files": {
|
||||
# Disable cloud-init networking
|
||||
|
@ -76,7 +67,6 @@ class NetworkModel(CoreNetworkModel):
|
|||
"content": "network: {config: disabled}\n",
|
||||
"permissions": "0600",
|
||||
},
|
||||
# netplan without sensitive wifi config
|
||||
"etc_netplan_installer": {
|
||||
"path": "etc/netplan/00-installer-config.yaml",
|
||||
"content": self.stringify_config(netplan),
|
||||
|
@ -84,19 +74,6 @@ class NetworkModel(CoreNetworkModel):
|
|||
},
|
||||
},
|
||||
}
|
||||
if wifis is not None:
|
||||
netplan_wifi = {
|
||||
"network": {
|
||||
"version": 2,
|
||||
"wifis": wifis,
|
||||
},
|
||||
}
|
||||
# sensitive wifi config
|
||||
r["write_files"]["etc_netplan_installer_wifi"] = {
|
||||
"path": "etc/netplan/00-installer-config-wifi.yaml",
|
||||
"content": self.stringify_config(netplan_wifi),
|
||||
"permissions": "0600",
|
||||
}
|
||||
return r
|
||||
|
||||
async def target_packages(self) -> List[TargetPkg]:
|
||||
|
|
|
@ -25,22 +25,22 @@ from subiquity.common.serialize import Serializer
|
|||
log = logging.getLogger("subiquity.models.source")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@attr.s(auto_attribs=True, kw_only=True)
|
||||
class CatalogEntryVariation:
|
||||
path: str
|
||||
path: str = ""
|
||||
size: int
|
||||
snapd_system_label: typing.Optional[str] = None
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
@attr.s(auto_attribs=True, kw_only=True)
|
||||
class CatalogEntry:
|
||||
variant: str
|
||||
id: str
|
||||
name: typing.Dict[str, str]
|
||||
description: typing.Dict[str, str]
|
||||
path: str
|
||||
path: str = ""
|
||||
size: int
|
||||
type: str
|
||||
type: typing.Optional[str]
|
||||
default: bool = False
|
||||
locale_support: str = attr.ib(default="locale-only")
|
||||
preinstalled_langs: typing.List[str] = attr.Factory(list)
|
||||
|
@ -101,7 +101,12 @@ class SourceModel:
|
|||
return source
|
||||
raise KeyError
|
||||
|
||||
def get_source(self, variation_name: typing.Optional[str] = None):
|
||||
def get_source(
|
||||
self, variation_name: typing.Optional[str] = None
|
||||
) -> typing.Optional[str]:
|
||||
scheme = self.current.type
|
||||
if scheme is None:
|
||||
return None
|
||||
if variation_name is None:
|
||||
variation = next(iter(self.current.variations.values()))
|
||||
else:
|
||||
|
@ -114,7 +119,6 @@ class SourceModel:
|
|||
else:
|
||||
suffix = "no-languages"
|
||||
path = base + "." + suffix + ext
|
||||
scheme = self.current.type
|
||||
return f"{scheme}://{path}"
|
||||
|
||||
def render(self):
|
||||
|
|
|
@ -52,3 +52,14 @@ class TestNetworkModel(unittest.IsolatedAsyncioTestCase):
|
|||
config = self.model.render()
|
||||
for file in config["write_files"].values():
|
||||
self.assertEqual(file["permissions"], "0600")
|
||||
|
||||
async def test_netplan_wifi_combined(self):
|
||||
"""Assert the wifi config is not written separately."""
|
||||
|
||||
mock_config = {"network": {"wifis": "data"}}
|
||||
self.model.render_config = mock.Mock(return_value=mock_config)
|
||||
|
||||
config = self.model.render()
|
||||
self.assertIn(
|
||||
"wifis", config["write_files"]["etc_netplan_installer"]["content"]
|
||||
)
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# 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/>.
|
||||
|
||||
import datetime
|
||||
import fnmatch
|
||||
import json
|
||||
import re
|
||||
|
@ -264,11 +265,13 @@ class TestSubiquityModel(unittest.IsolatedAsyncioTestCase):
|
|||
self.assertEqual(expected_error, str(ctx.exception))
|
||||
|
||||
@mock.patch("subiquity.models.subiquity.lsb_release")
|
||||
@mock.patch("subiquitycore.file_util.datetime.datetime")
|
||||
@mock.patch("subiquitycore.file_util.datetime.datetime", wraps=datetime.datetime)
|
||||
def test_cloud_init_files_emits_datasource_config_and_clean_script(
|
||||
self, datetime, lsb_release
|
||||
self, m_datetime, lsb_release
|
||||
):
|
||||
datetime.utcnow.return_value = "2004-03-05 ..."
|
||||
m_datetime.now.return_value = datetime.datetime(
|
||||
2004, 3, 5, tzinfo=datetime.timezone.utc
|
||||
)
|
||||
main_user = IdentityData(
|
||||
username="mainuser", crypted_password="sample_pass", hostname="somehost"
|
||||
)
|
||||
|
@ -296,7 +299,7 @@ grub_dpkg:
|
|||
# NETPLAN_CONFIG_ROOT_READ_ONLY is True
|
||||
"/etc/cloud/cloud.cfg.d/90-installer-network.cfg"
|
||||
)
|
||||
header = "# Autogenerated by Subiquity: 2004-03-05 ... UTC\n"
|
||||
header = "# Autogenerated by Subiquity: 2004-03-05 00:00:00 UTC\n"
|
||||
with self.subTest(
|
||||
"Stable releases Jammy do not disable cloud-init."
|
||||
" NETPLAN_ROOT_READ_ONLY=True uses cloud-init networking"
|
||||
|
|
|
@ -22,7 +22,7 @@ import os
|
|||
import pathlib
|
||||
import subprocess
|
||||
import time
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
import attr
|
||||
import pyudev
|
||||
|
@ -184,6 +184,7 @@ class VariationInfo:
|
|||
capability_info: CapabilityInfo = attr.Factory(CapabilityInfo)
|
||||
min_size: Optional[int] = None
|
||||
system: Optional[SystemDetails] = None
|
||||
needs_systems_mount: bool = False
|
||||
|
||||
def is_core_boot_classic(self) -> bool:
|
||||
return self.label is not None
|
||||
|
@ -275,7 +276,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
self._on_volume: Optional[snapdapi.OnVolume] = None
|
||||
self._source_handler: Optional[AbstractSourceHandler] = None
|
||||
self._system_mounter: Optional[Mounter] = None
|
||||
self._role_to_device: Dict[str, _Device] = {}
|
||||
self._role_to_device: Dict[Union[str, snapdapi.Role], _Device] = {}
|
||||
self._device_to_structure: Dict[_Device, snapdapi.OnVolume] = {}
|
||||
self._pyudev_context: Optional[pyudev.Context] = None
|
||||
self.use_tpm: bool = False
|
||||
|
@ -288,12 +289,25 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
def is_core_boot_classic(self):
|
||||
return self._info.is_core_boot_classic()
|
||||
|
||||
def use_snapd_install_api(self):
|
||||
return self._on_volume is not None
|
||||
|
||||
def load_autoinstall_data(self, data):
|
||||
# Log disabled to prevent LUKS password leak
|
||||
# log.debug("load_autoinstall_data %s", data)
|
||||
# log.debug("self.ai_data = %s", data)
|
||||
self.ai_data = data
|
||||
|
||||
# The identity and user-data section are optional if we are only installing
|
||||
# the reset partition, however the identity controller needs to know this
|
||||
# before the filesystem controller naturally sets this. So this is a
|
||||
# function to inspect the outcome early.
|
||||
# See: https://github.com/canonical/subiquity/pull/1965
|
||||
def is_reset_partition_only(self):
|
||||
storage_config = self.app.autoinstall_config.get(self.autoinstall_key, {})
|
||||
layout = storage_config.get("layout", {})
|
||||
return layout.get("reset-partition-only", False)
|
||||
|
||||
async def configured(self):
|
||||
self._configured = True
|
||||
if self._info is None:
|
||||
|
@ -308,6 +322,8 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
|
||||
async def _mount_systems_dir(self, variation_name):
|
||||
self._source_handler = self.app.controllers.Source.get_handler(variation_name)
|
||||
if self._source_handler is None:
|
||||
raise NoSnapdSystemsOnSource
|
||||
source_path = self._source_handler.setup()
|
||||
cur_systems_dir = "/var/lib/snapd/seed/systems"
|
||||
source_systems_dir = os.path.join(source_path, cur_systems_dir[1:])
|
||||
|
@ -336,20 +352,36 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
self._source_handler.cleanup()
|
||||
self._source_handler = None
|
||||
|
||||
async def _get_system(self, variation_name, label):
|
||||
async def _get_system(
|
||||
self, variation_name, label
|
||||
) -> Tuple[Optional[SystemDetails], bool]:
|
||||
"""Return system information for a given system label.
|
||||
|
||||
The return value is a SystemDetails object (if any) and True if
|
||||
the system was found in the layer that the installer is running
|
||||
in or False if the source layer needed to be mounted to find
|
||||
it.
|
||||
"""
|
||||
systems = await self.app.snapdapi.v2.systems.GET()
|
||||
labels = {system.label for system in systems.systems}
|
||||
if label in labels:
|
||||
try:
|
||||
return await self.app.snapdapi.v2.systems[label].GET(), True
|
||||
except requests.exceptions.HTTPError as http_err:
|
||||
log.warning("v2/systems/%s returned %s", label, http_err.response.text)
|
||||
raise
|
||||
else:
|
||||
try:
|
||||
await self._mount_systems_dir(variation_name)
|
||||
except NoSnapdSystemsOnSource:
|
||||
return None
|
||||
return None, False
|
||||
try:
|
||||
system = await self.app.snapdapi.v2.systems[label].GET()
|
||||
return await self.app.snapdapi.v2.systems[label].GET(), False
|
||||
except requests.exceptions.HTTPError as http_err:
|
||||
log.warning("v2/systems/%s returned %s", label, http_err.response.text)
|
||||
raise
|
||||
finally:
|
||||
await self._unmount_systems_dir()
|
||||
log.debug("got system %s", system)
|
||||
return system
|
||||
|
||||
def info_for_system(self, name: str, label: str, system: SystemDetails):
|
||||
if len(system.volumes) > 1:
|
||||
|
@ -410,40 +442,16 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
|
||||
return info
|
||||
|
||||
async def _examine_systems(self):
|
||||
self._variation_info.clear()
|
||||
catalog_entry = self.app.base_model.source.current
|
||||
for name, variation in catalog_entry.variations.items():
|
||||
system = None
|
||||
label = variation.snapd_system_label
|
||||
if label is not None:
|
||||
system = await self._get_system(name, label)
|
||||
log.debug("got system %s for variation %s", system, name)
|
||||
if system is not None and len(system.volumes) > 0:
|
||||
if not self.app.opts.enhanced_secureboot:
|
||||
log.debug("Not offering enhanced_secureboot: commandline disabled")
|
||||
continue
|
||||
info = self.info_for_system(name, label, system)
|
||||
if info is None:
|
||||
continue
|
||||
def _maybe_disable_encryption(self, info: VariationInfo) -> None:
|
||||
if self.model.bootloader != Bootloader.UEFI:
|
||||
log.debug(
|
||||
"Disabling core boot based install options on non-UEFI "
|
||||
"system"
|
||||
)
|
||||
log.debug("Disabling core boot based install options on non-UEFI system")
|
||||
info.capability_info.disallow_if(
|
||||
lambda cap: cap.is_core_boot(),
|
||||
GuidedDisallowedCapabilityReason.NOT_UEFI,
|
||||
_(
|
||||
"Enhanced secure boot options only available on UEFI "
|
||||
"systems."
|
||||
),
|
||||
_("Enhanced secure boot options only available on UEFI systems."),
|
||||
)
|
||||
search_drivers = self.app.base_model.source.search_drivers
|
||||
if (
|
||||
search_drivers is not SEARCH_DRIVERS_AUTOINSTALL_DEFAULT
|
||||
and search_drivers
|
||||
):
|
||||
if search_drivers is not SEARCH_DRIVERS_AUTOINSTALL_DEFAULT and search_drivers:
|
||||
log.debug(
|
||||
"Disabling core boot based install options as third-party "
|
||||
"drivers selected"
|
||||
|
@ -456,16 +464,32 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
"third party drivers."
|
||||
),
|
||||
)
|
||||
self._variation_info[name] = info
|
||||
|
||||
async def _examine_systems(self):
|
||||
self._variation_info.clear()
|
||||
catalog_entry = self.app.base_model.source.current
|
||||
for name, variation in catalog_entry.variations.items():
|
||||
system = None
|
||||
label = variation.snapd_system_label
|
||||
if label is not None:
|
||||
system, in_live_layer = await self._get_system(name, label)
|
||||
log.debug("got system %s for variation %s", system, name)
|
||||
if system is not None and len(system.volumes) > 0:
|
||||
if not self.app.opts.enhanced_secureboot:
|
||||
log.debug("Not offering enhanced_secureboot: commandline disabled")
|
||||
continue
|
||||
info = self.info_for_system(name, label, system)
|
||||
if info is None:
|
||||
continue
|
||||
if not in_live_layer:
|
||||
info.needs_systems_mount = True
|
||||
self._maybe_disable_encryption(info)
|
||||
elif catalog_entry.type.startswith("dd-"):
|
||||
min_size = variation.size
|
||||
self._variation_info[name] = VariationInfo.dd(
|
||||
name=name, min_size=min_size
|
||||
)
|
||||
info = VariationInfo.dd(name=name, min_size=min_size)
|
||||
else:
|
||||
self._variation_info[name] = VariationInfo.classic(
|
||||
name=name, min_size=variation.size
|
||||
)
|
||||
info = VariationInfo.classic(name=name, min_size=variation.size)
|
||||
self._variation_info[name] = info
|
||||
|
||||
@with_context()
|
||||
async def apply_autoinstall_config(self, context=None):
|
||||
|
@ -856,9 +880,10 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
offset = offset + structure.size
|
||||
|
||||
async def guided_core_boot(self, disk: Disk):
|
||||
if self._info.needs_systems_mount:
|
||||
await self._mount_systems_dir(self._info.name)
|
||||
# Formatting for a core boot classic system relies on some curtin
|
||||
# features that are only available with v2 partitioning.
|
||||
await self._mount_systems_dir(self._info.name)
|
||||
self.model.storage_version = 2
|
||||
[volume] = self._info.system.volumes.values()
|
||||
self._on_volume = snapdapi.OnVolume.from_volume(volume)
|
||||
|
@ -949,9 +974,9 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
step=snapdapi.SystemActionStep.SETUP_STORAGE_ENCRYPTION,
|
||||
on_volumes=self._on_volumes(),
|
||||
),
|
||||
ann=snapdapi.SystemActionResponse,
|
||||
)
|
||||
role_to_encrypted_device = result["encrypted-devices"]
|
||||
for role, enc_path in role_to_encrypted_device.items():
|
||||
for role, enc_path in result.encrypted_devices.items():
|
||||
arb_device = ArbitraryDevice(m=self.model, path=enc_path)
|
||||
self.model._actions.append(arb_device)
|
||||
part = self._role_to_device[role]
|
||||
|
@ -1270,7 +1295,7 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
@with_context(name="probe_once", description="restricted={restricted}")
|
||||
async def _probe_once(self, *, context, restricted):
|
||||
if restricted:
|
||||
probe_types = {"blockdev", "filesystem"}
|
||||
probe_types = {"blockdev", "filesystem", "nvme"}
|
||||
fname = "probe-data-restricted.json"
|
||||
key = "ProbeDataRestricted"
|
||||
else:
|
||||
|
@ -1457,7 +1482,8 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
|||
rp_input = layout.get("reset-partition", None)
|
||||
if rp_input:
|
||||
reset_partition = True
|
||||
if isinstance(rp_input, (str, int)):
|
||||
# bool is a subclass of int -- check for int explicitly
|
||||
if isinstance(rp_input, str) or type(rp_input) is int:
|
||||
reset_partition_size = int(human2bytes(rp_input))
|
||||
log.info(
|
||||
"autoinstall: will install reset partition "
|
||||
|
|
|
@ -22,8 +22,8 @@ import attr
|
|||
from subiquity.common.apidef import API
|
||||
from subiquity.common.resources import resource_path
|
||||
from subiquity.common.types import IdentityData, UsernameValidation
|
||||
from subiquity.server.autoinstall import AutoinstallError
|
||||
from subiquity.server.controller import SubiquityController
|
||||
from subiquitycore.context import with_context
|
||||
|
||||
log = logging.getLogger("subiquity.server.controllers.identity")
|
||||
|
||||
|
@ -79,18 +79,22 @@ class IdentityController(SubiquityController):
|
|||
crypted_password=data["password"],
|
||||
)
|
||||
self.model.add_user(identity_data)
|
||||
|
||||
@with_context()
|
||||
async def apply_autoinstall_config(self, context=None):
|
||||
if self.model.user:
|
||||
return
|
||||
|
||||
# The identity section is required except if (any):
|
||||
# 1. a user-data section is provided
|
||||
if "user-data" in self.app.autoinstall_config:
|
||||
return
|
||||
if self.app.base_model.target is None:
|
||||
return
|
||||
# 2. we are installing not-Server (Desktop)
|
||||
if self.app.base_model.source.current.variant != "server":
|
||||
return
|
||||
raise Exception("neither identity nor user-data provided")
|
||||
# 3. we are only refreshing the reset partition
|
||||
if self.app.controllers.Filesystem.is_reset_partition_only():
|
||||
return
|
||||
# 4. identity section is interactive
|
||||
if self.interactive():
|
||||
return
|
||||
raise AutoinstallError("neither identity nor user-data provided")
|
||||
|
||||
def make_autoinstall(self):
|
||||
if self.model.user is None:
|
||||
|
|
|
@ -356,7 +356,7 @@ class InstallController(SubiquityController):
|
|||
device_map_path=logs_dir / "device-map.json",
|
||||
),
|
||||
)
|
||||
elif fs_controller.is_core_boot_classic():
|
||||
elif fs_controller.use_snapd_install_api():
|
||||
await run_curtin_step(
|
||||
name="partitioning",
|
||||
stages=["partitioning"],
|
||||
|
@ -375,6 +375,7 @@ class InstallController(SubiquityController):
|
|||
device_map_path=logs_dir / "device-map-format.json",
|
||||
),
|
||||
)
|
||||
if source is not None:
|
||||
await run_curtin_step(
|
||||
name="extract",
|
||||
stages=["extract"],
|
||||
|
|
|
@ -29,6 +29,8 @@ from subiquity.common.types import SourceSelection, SourceSelectionAndSetting
|
|||
from subiquity.server.controller import SubiquityController
|
||||
from subiquity.server.types import InstallerChannels
|
||||
|
||||
SOURCES_DEFAULT_PATH = "/cdrom/casper/install-sources.yaml"
|
||||
|
||||
log = logging.getLogger("subiquity.server.controllers.source")
|
||||
|
||||
|
||||
|
@ -77,16 +79,22 @@ class SourceController(SubiquityController):
|
|||
super().__init__(app)
|
||||
self._handler = None
|
||||
self.source_path: Optional[str] = None
|
||||
self.ai_source_id: Optional[str] = None
|
||||
self._configured: bool = False
|
||||
|
||||
path = SOURCES_DEFAULT_PATH
|
||||
if self.app.opts.source_catalog is not None:
|
||||
path = self.app.opts.source_catalog
|
||||
if os.path.exists(path):
|
||||
with open(path) as fp:
|
||||
self.model.load_from_file(fp)
|
||||
|
||||
def make_autoinstall(self):
|
||||
return {
|
||||
"search_drivers": self.model.search_drivers,
|
||||
"id": self.model.current.id,
|
||||
}
|
||||
|
||||
def load_autoinstall_data(self, data: Any) -> None:
|
||||
def load_autoinstall_data(self, data: Optional[dict[str, Any]]) -> None:
|
||||
if data is None:
|
||||
data = {}
|
||||
|
||||
|
@ -98,22 +106,11 @@ class SourceController(SubiquityController):
|
|||
"search_drivers", SEARCH_DRIVERS_AUTOINSTALL_DEFAULT
|
||||
)
|
||||
|
||||
# At this point, the model has not yet loaded the sources from the
|
||||
# catalog. So we store the ID and lean on self.start to select the
|
||||
# current source accordingly.
|
||||
self.ai_source_id = data.get("id")
|
||||
# Assign the current source if hinted by autoinstall.
|
||||
if id := data.get("id"):
|
||||
self.model.current = self.model.get_matching_source(id)
|
||||
|
||||
def start(self):
|
||||
path = "/cdrom/casper/install-sources.yaml"
|
||||
if self.app.opts.source_catalog is not None:
|
||||
path = self.app.opts.source_catalog
|
||||
if not os.path.exists(path):
|
||||
return
|
||||
with open(path) as fp:
|
||||
self.model.load_from_file(fp)
|
||||
# Assign the current source if hinted by autoinstall.
|
||||
if self.ai_source_id is not None:
|
||||
self.model.current = self.model.get_matching_source(self.ai_source_id)
|
||||
self.app.hub.subscribe(
|
||||
(InstallerChannels.CONFIGURED, "locale"), self._set_locale
|
||||
)
|
||||
|
@ -138,10 +135,11 @@ class SourceController(SubiquityController):
|
|||
|
||||
def get_handler(
|
||||
self, variation_name: Optional[str] = None
|
||||
) -> AbstractSourceHandler:
|
||||
handler = get_handler_for_source(
|
||||
sanitize_source(self.model.get_source(variation_name))
|
||||
)
|
||||
) -> Optional[AbstractSourceHandler]:
|
||||
source = self.model.get_source(variation_name)
|
||||
if source is None:
|
||||
return None
|
||||
handler = get_handler_for_source(sanitize_source(source))
|
||||
if handler is not None and self.app.opts.dry_run:
|
||||
handler = TrivialSourceHandler("/")
|
||||
return handler
|
||||
|
|
|
@ -108,7 +108,7 @@ class TestSubiquityControllerFilesystem(IsolatedAsyncioTestCase):
|
|||
|
||||
async def test_probe_restricted(self):
|
||||
await self.fsc._probe_once(context=None, restricted=True)
|
||||
expected = {"blockdev", "filesystem"}
|
||||
expected = {"blockdev", "filesystem", "nvme"}
|
||||
self.app.prober.get_storage.assert_called_with(expected)
|
||||
|
||||
async def test_probe_os_prober_false(self):
|
||||
|
@ -432,6 +432,18 @@ class TestSubiquityControllerFilesystem(IsolatedAsyncioTestCase):
|
|||
},
|
||||
}
|
||||
requests_mocker = requests_mock.Mocker()
|
||||
requests_mocker.get(
|
||||
"http+unix://snapd/v2/systems",
|
||||
json={
|
||||
"type": "sync",
|
||||
"status-code": 200,
|
||||
"status": "OK",
|
||||
"result": {
|
||||
"systems": [],
|
||||
},
|
||||
},
|
||||
status_code=200,
|
||||
)
|
||||
requests_mocker.get(
|
||||
"http+unix://snapd/v2/systems/enhanced-secureboot-desktop",
|
||||
json=json_body,
|
||||
|
@ -466,6 +478,7 @@ class TestGuided(IsolatedAsyncioTestCase):
|
|||
self.controller = FilesystemController(self.app)
|
||||
self.controller.supports_resilient_boot = True
|
||||
self.controller._examine_systems_task.start_sync()
|
||||
self.controller.cryptoswap_options = ["a", "b"]
|
||||
self.app.dr_cfg = DRConfig()
|
||||
self.app.base_model.source.current.type = "fsimage"
|
||||
self.app.base_model.source.current.variations = {
|
||||
|
@ -545,6 +558,27 @@ class TestGuided(IsolatedAsyncioTestCase):
|
|||
self.assertEqual(None, d1p2.mount)
|
||||
self.assertEqual(DRY_RUN_RESET_SIZE, d1p2.size)
|
||||
|
||||
@parameterized.expand(
|
||||
(
|
||||
({}, False, None),
|
||||
({"reset-partition": True}, True, None),
|
||||
({"reset-partition": False}, False, None),
|
||||
({"reset-partition": "12345"}, True, 12345),
|
||||
({"reset-partition": "10G"}, True, 10737418240),
|
||||
({"reset-partition": 100000}, True, 100000),
|
||||
)
|
||||
)
|
||||
async def test_rest_partition_size(
|
||||
self, ai_data, reset_partition, reset_partition_size
|
||||
):
|
||||
await self._guided_setup(Bootloader.UEFI, "gpt")
|
||||
self.controller.guided = mock.AsyncMock()
|
||||
layout = ai_data | {"name": "direct"}
|
||||
await self.controller.run_autoinstall_guided(layout)
|
||||
guided_choice = self.controller.guided.call_args.args[0]
|
||||
self.assertEqual(guided_choice.reset_partition, reset_partition)
|
||||
self.assertEqual(guided_choice.reset_partition_size, reset_partition_size)
|
||||
|
||||
async def test_guided_direct_BIOS_MSDOS(self):
|
||||
await self._guided_setup(Bootloader.BIOS, "msdos")
|
||||
target = GuidedStorageTargetReformat(
|
||||
|
@ -657,7 +691,7 @@ class TestGuided(IsolatedAsyncioTestCase):
|
|||
self.assertIsNone(swap.fs())
|
||||
[dmc] = self.model.all_dm_crypts()
|
||||
self.assertEqual("/dev/urandom", dmc.keyfile)
|
||||
self.assertEqual(["swap", "initramfs"], dmc.options)
|
||||
self.assertEqual(["a", "b"], dmc.options)
|
||||
self.assertEqual("swap", dmc.fs().fstype)
|
||||
[rpool] = self.model._all(type="zpool", pool="rpool")
|
||||
self.assertIsNone(rpool.path)
|
||||
|
@ -1375,9 +1409,10 @@ class TestCoreBootInstallMethods(IsolatedAsyncioTestCase):
|
|||
name="foo",
|
||||
label="system",
|
||||
system=snapdapi.SystemDetails(
|
||||
label="system",
|
||||
volumes={
|
||||
"pc": snapdapi.Volume(schema="gpt", structure=structures),
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -1536,11 +1571,11 @@ class TestCoreBootInstallMethods(IsolatedAsyncioTestCase):
|
|||
with mock.patch.object(
|
||||
snapdapi, "post_and_wait", new_callable=mock.AsyncMock
|
||||
) as mocked:
|
||||
mocked.return_value = {
|
||||
"encrypted-devices": {
|
||||
mocked.return_value = snapdapi.SystemActionResponse(
|
||||
encrypted_devices={
|
||||
snapdapi.Role.SYSTEM_DATA: "enc-system-data",
|
||||
},
|
||||
}
|
||||
)
|
||||
await self.fsc.setup_encryption(context=self.fsc.context)
|
||||
|
||||
# setup_encryption mutates the filesystem model objects to
|
||||
|
@ -1638,3 +1673,50 @@ class TestMatchingDisks(IsolatedAsyncioTestCase):
|
|||
# overhead
|
||||
actual = self.fsc.get_bootable_matching_disk({"path": "/dev/md/*"})
|
||||
self.assertEqual(r1, actual)
|
||||
|
||||
|
||||
class TestResetPartitionLookAhead(IsolatedAsyncioTestCase):
|
||||
def setUp(self):
|
||||
self.app = make_app()
|
||||
self.app.opts.bootloader = None
|
||||
self.fsc = FilesystemController(app=self.app)
|
||||
|
||||
@parameterized.expand(
|
||||
# (config, is reset only)
|
||||
(
|
||||
({}, False),
|
||||
(
|
||||
{
|
||||
"storage": {},
|
||||
},
|
||||
False,
|
||||
),
|
||||
(
|
||||
{
|
||||
"storage": {
|
||||
"layout": {
|
||||
"name": "direct",
|
||||
"reset-partition": True,
|
||||
},
|
||||
},
|
||||
},
|
||||
False,
|
||||
),
|
||||
(
|
||||
{
|
||||
"storage": {
|
||||
"layout": {
|
||||
"reset-partition-only": True,
|
||||
},
|
||||
},
|
||||
},
|
||||
True,
|
||||
),
|
||||
)
|
||||
)
|
||||
def test_is_reset_partition_only_utility(self, config, expected):
|
||||
"""Test is_reset_partition_only utility"""
|
||||
|
||||
self.app.autoinstall_config = config
|
||||
|
||||
self.assertEqual(self.fsc.is_reset_partition_only(), expected)
|
||||
|
|
|
@ -16,9 +16,13 @@
|
|||
import jsonschema
|
||||
from jsonschema.validators import validator_for
|
||||
|
||||
from subiquity.server.autoinstall import AutoinstallError
|
||||
from subiquity.server.controllers.filesystem import FilesystemController
|
||||
from subiquity.server.controllers.identity import IdentityController
|
||||
from subiquity.server.controllers.source import SourceController
|
||||
from subiquitycore.tests import SubiTestCase
|
||||
from subiquitycore.tests.mocks import make_app
|
||||
from subiquitycore.tests.parameterized import parameterized
|
||||
|
||||
|
||||
class TestIdentityController(SubiTestCase):
|
||||
|
@ -37,15 +41,51 @@ class TestControllerUserCreationFlows(SubiTestCase):
|
|||
# See subiquity/models/tests/test_subiquity.py for details.
|
||||
def setUp(self):
|
||||
self.app = make_app()
|
||||
self.app.opts.bootloader = False
|
||||
self.app.controllers.Filesystem = FilesystemController(self.app)
|
||||
self.ic = IdentityController(self.app)
|
||||
self.app.opts.source_catalog = "examples/sources/install.yaml"
|
||||
self.app.controllers.Source = SourceController(self.app)
|
||||
self.ic.model.user = None
|
||||
|
||||
async def test_server_requires_identity_case_4a1(self):
|
||||
self.app.base_model.source.current.variant = "server"
|
||||
with self.assertRaises(Exception):
|
||||
await self.ic.apply_autoinstall_config()
|
||||
# Test cases for 4a1. Copied for 4a2 but all cases should be valid for desktop.
|
||||
test_cases = [
|
||||
# (autoinstall config, valid)
|
||||
#
|
||||
# No identity or user data section and identity is not interactive
|
||||
({"interactive-sections": ["not-identity"]}, False),
|
||||
# Explicitly interactive
|
||||
({"interactive-sections": ["identity"]}, True),
|
||||
# Implicitly interactive
|
||||
({"interactive-sections": ["*"]}, True),
|
||||
# No Autoinstall => interactive
|
||||
({}, True),
|
||||
# Can be missing if reset-partition-only specified
|
||||
({"storage": {"layout": {"reset-partition-only": True}}}, True),
|
||||
# Can't be missing if reset-partition-only is not specified
|
||||
({"storage": {"layout": {}}}, False),
|
||||
# user-data passed instead
|
||||
({"user-data": "..."}, True),
|
||||
]
|
||||
|
||||
async def test_desktop_does_not_require_identity_case_4a2(self):
|
||||
@parameterized.expand(test_cases)
|
||||
async def test_server_requires_identity_case_4a1(self, config, valid):
|
||||
"""Test require identity section on Server"""
|
||||
self.app.base_model.source.current.variant = "server"
|
||||
|
||||
self.app.autoinstall_config = config
|
||||
|
||||
if not valid:
|
||||
with self.assertRaises(AutoinstallError):
|
||||
self.ic.load_autoinstall_data(None)
|
||||
else:
|
||||
self.ic.load_autoinstall_data(None)
|
||||
|
||||
@parameterized.expand(test_cases)
|
||||
async def test_desktop_does_not_require_identity_case_4a2(self, config, valid):
|
||||
"""Test require identity section on Desktop"""
|
||||
self.app.base_model.source.current.variant = "desktop"
|
||||
await self.ic.apply_autoinstall_config()
|
||||
# should not raise
|
||||
|
||||
self.app.autoinstall_config = config
|
||||
# should never raise
|
||||
self.ic.load_autoinstall_data(None)
|
||||
|
|
|
@ -17,8 +17,14 @@ import unittest
|
|||
|
||||
from subiquity.common.serialize import Serializer
|
||||
from subiquity.models.source import CatalogEntry
|
||||
from subiquity.models.subiquity import SubiquityModel
|
||||
from subiquity.models.tests.test_source import make_entry as make_raw_entry
|
||||
from subiquity.server.controllers.source import convert_source
|
||||
from subiquity.server.controllers.source import SourceController, convert_source
|
||||
from subiquity.server.server import INSTALL_MODEL_NAMES, POSTINSTALL_MODEL_NAMES
|
||||
from subiquitycore.pubsub import MessageHub
|
||||
from subiquitycore.tests import SubiTestCase
|
||||
from subiquitycore.tests.mocks import make_app
|
||||
from subiquitycore.tests.parameterized import parameterized
|
||||
|
||||
|
||||
def make_entry(**kw):
|
||||
|
@ -44,3 +50,45 @@ class TestSubiquityModel(unittest.TestCase):
|
|||
self.assertEqual(convert_source(entry, "fr").name, "French")
|
||||
self.assertEqual(convert_source(entry, "fr_CA").name, "French Canadian")
|
||||
self.assertEqual(convert_source(entry, "fr_BE").name, "French")
|
||||
|
||||
|
||||
class TestSourceController(SubiTestCase):
|
||||
def setUp(self):
|
||||
self.base_model = SubiquityModel(
|
||||
"test", MessageHub(), INSTALL_MODEL_NAMES, POSTINSTALL_MODEL_NAMES
|
||||
)
|
||||
self.app = make_app(model=self.base_model)
|
||||
self.app.opts.source_catalog = "examples/sources/install.yaml"
|
||||
self.controller = SourceController(self.app)
|
||||
|
||||
def _set_source_catalog(self, path):
|
||||
self.app.opts.source_catalog = path
|
||||
self.controller = SourceController(self.app)
|
||||
|
||||
@parameterized.expand(
|
||||
# (Sources list, is_desktop)
|
||||
(
|
||||
("examples/sources/desktop.yaml", "desktop"),
|
||||
("examples/sources/install.yaml", "server"),
|
||||
)
|
||||
)
|
||||
def test_install_source_detection__defaults(self, catalog, expected):
|
||||
"""Test source detection with defaults."""
|
||||
|
||||
self._set_source_catalog(catalog)
|
||||
|
||||
variant = self.controller.model.current.variant
|
||||
self.assertEqual(variant, expected)
|
||||
|
||||
@parameterized.expand(
|
||||
# (Sources list, ai_data, expected)
|
||||
(
|
||||
("examples/sources/mixed.yaml", {"id": "ubuntu-desktop"}, "desktop"),
|
||||
("examples/sources/mixed.yaml", {"id": "ubuntu-server"}, "server"),
|
||||
)
|
||||
)
|
||||
def test_install_source_detection__autoinstall(self, catalog, ai_data, expected):
|
||||
"""Test source detection with autoinstall."""
|
||||
self._set_source_catalog(catalog)
|
||||
self.controller.load_autoinstall_data(ai_data)
|
||||
self.assertEqual(self.controller.model.current.variant, expected)
|
||||
|
|
|
@ -783,12 +783,18 @@ class SubiquityServer(Application):
|
|||
log=log,
|
||||
)
|
||||
|
||||
# Raise AutoinstallError if we found any autoinstall as a cause
|
||||
# of the schema validation error, otherwise continue
|
||||
# Use filter_autoinstall on bad_keys to find potential autoinstall
|
||||
# keys as the cause of the schema validation error. If so,
|
||||
# raise AutoinstallError; else continue.
|
||||
#
|
||||
# Intentionally not attempting to extract bad key data since it is
|
||||
# not guaranteed that the offending keys will be top-level (or
|
||||
# even in?) in the combined config. Although still constructing
|
||||
# a dict since filter_autoinstall expects a dict.
|
||||
# LP: #2062988
|
||||
|
||||
# Filter only the bad keys
|
||||
potential_autoinstall: dict[str, Any] = dict(
|
||||
((key, cloud_cfg[key]) for key in bad_keys)
|
||||
potential_autoinstall: dict[str, None] = dict(
|
||||
((key, None) for key in bad_keys)
|
||||
)
|
||||
autoinstall, other = self.filter_autoinstall(potential_autoinstall)
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import attr
|
|||
|
||||
from subiquity.common.api.client import make_client
|
||||
from subiquity.common.api.defs import Payload, api, path_parameter
|
||||
from subiquity.common.serialize import Serializer, named_field
|
||||
from subiquity.common.serialize import NonExhaustive, Serializer, named_field
|
||||
from subiquity.common.types import Change, TaskStatus
|
||||
|
||||
log = logging.getLogger("subiquity.server.snapdapi")
|
||||
|
@ -90,17 +90,11 @@ class Response:
|
|||
status: str
|
||||
|
||||
|
||||
class Role:
|
||||
class Role(enum.Enum):
|
||||
NONE = ""
|
||||
MBR = "mbr"
|
||||
SYSTEM_BOOT = "system-boot"
|
||||
SYSTEM_BOOT_IMAGE = "system-boot-image"
|
||||
SYSTEM_BOOT_SELECT = "system-boot-select"
|
||||
SYSTEM_DATA = "system-data"
|
||||
SYSTEM_RECOVERY_SELECT = "system-recovery-select"
|
||||
SYSTEM_SAVE = "system-save"
|
||||
SYSTEM_SEED = "system-seed"
|
||||
SYSTEM_SEED_NULL = "system-seed-null"
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
|
@ -134,7 +128,7 @@ class VolumeStructure:
|
|||
offset_write: Optional[RelativeOffset] = named_field("offset-write", None)
|
||||
size: int = 0
|
||||
type: str = ""
|
||||
role: str = Role.NONE
|
||||
role: NonExhaustive[Role] = Role.NONE
|
||||
id: Optional[str] = None
|
||||
filesystem: str = ""
|
||||
content: Optional[List[VolumeContent]] = None
|
||||
|
@ -209,6 +203,7 @@ class StorageEncryption:
|
|||
|
||||
@attr.s(auto_attribs=True)
|
||||
class SystemDetails:
|
||||
label: str
|
||||
current: bool = False
|
||||
volumes: Dict[str, Volume] = attr.Factory(dict)
|
||||
storage_encryption: Optional[StorageEncryption] = named_field(
|
||||
|
@ -216,6 +211,11 @@ class SystemDetails:
|
|||
)
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class SystemsResponse:
|
||||
systems: List[SystemDetails] = attr.Factory(list)
|
||||
|
||||
|
||||
class SystemAction(enum.Enum):
|
||||
INSTALL = "install"
|
||||
|
||||
|
@ -232,6 +232,13 @@ class SystemActionRequest:
|
|||
on_volumes: Dict[str, OnVolume] = named_field("on-volumes")
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class SystemActionResponse:
|
||||
encrypted_devices: Dict[NonExhaustive[Role], str] = named_field(
|
||||
"encrypted-devices", default=attr.Factory(dict)
|
||||
)
|
||||
|
||||
|
||||
@api
|
||||
class SnapdAPI:
|
||||
serialize_query_args = False
|
||||
|
@ -257,6 +264,9 @@ class SnapdAPI:
|
|||
...
|
||||
|
||||
class systems:
|
||||
def GET() -> SystemsResponse:
|
||||
...
|
||||
|
||||
@path_parameter
|
||||
class label:
|
||||
def GET() -> SystemDetails:
|
||||
|
@ -313,14 +323,17 @@ def make_api_client(async_snapd):
|
|||
snapd_serializer = Serializer(ignore_unknown_fields=True, serialize_enums_by="value")
|
||||
|
||||
|
||||
async def post_and_wait(client, meth, *args, **kw):
|
||||
async def post_and_wait(client, meth, *args, ann=None, **kw):
|
||||
change_id = await meth(*args, **kw)
|
||||
log.debug("post_and_wait %s", change_id)
|
||||
|
||||
while True:
|
||||
result = await client.v2.changes[change_id].GET()
|
||||
if result.status == TaskStatus.DONE:
|
||||
return result.data
|
||||
data = result.data
|
||||
if ann is not None:
|
||||
data = snapd_serializer.deserialize(ann, data)
|
||||
return data
|
||||
elif result.status == TaskStatus.ERROR:
|
||||
raise aiohttp.ClientError(result.err)
|
||||
await asyncio.sleep(0.1)
|
||||
|
|
|
@ -108,10 +108,11 @@ class TestAptConfigurer(SubiTestCase):
|
|||
pass
|
||||
|
||||
async def test_run_apt_config_check(self):
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
self.configurer.configured_tree = OverlayMountpoint(
|
||||
upperdir="upperdir-install-tree",
|
||||
lowers=["lowers1-install-tree"],
|
||||
mountpoint="mountpoint-install-tree",
|
||||
mountpoint=pathlib.Path(tempdir) / "mountpoint-install-tree",
|
||||
)
|
||||
|
||||
async def astart_success(cmd, **kwargs):
|
||||
|
|
|
@ -456,6 +456,22 @@ class TestAutoinstallValidation(SubiTestCase):
|
|||
|
||||
self.assertEqual(cfg, expected)
|
||||
|
||||
async def test_cloud_config_extract_KeyError(self):
|
||||
"""Test autoinstall extract from cloud config resilient to missing data."""
|
||||
|
||||
self.server.base_schema = SubiquityServer.base_schema
|
||||
self.pseudo_load_controllers()
|
||||
|
||||
with patch("subiquity.server.server.validate_cloud_init_schema") as val_mock:
|
||||
val_mock.side_effect = CloudInitSchemaValidationError(
|
||||
keys=["broadcast", "foobar"],
|
||||
)
|
||||
|
||||
# Don't throw on keys that error but aren't in the combined config
|
||||
cfg = await self.server._extract_autoinstall_from_cloud_config(cloud_cfg={})
|
||||
|
||||
self.assertEqual(cfg, {})
|
||||
|
||||
async def test_autoinstall_validation__top_level_autoinstall(self):
|
||||
"""Test allow autoinstall as top-level key"""
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ helper. """
|
|||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
@ -328,10 +329,10 @@ class UAInterface:
|
|||
info = await self.get_subscription_status(token)
|
||||
|
||||
# Sometimes, a time zone offset of 0 is replaced by the letter Z. This
|
||||
# is specified in RFC 3339 but not supported by fromisoformat.
|
||||
# See https://bugs.python.org/issue35829
|
||||
# is specified in RFC 3339 but not supported by fromisoformat before
|
||||
# Python 3.11. See https://bugs.python.org/issue35829
|
||||
expiration = dt.fromisoformat(info["expires"].replace("Z", "+00:00"))
|
||||
if expiration.timestamp() <= dt.utcnow().timestamp():
|
||||
if expiration <= dt.now(datetime.timezone.utc):
|
||||
raise ExpiredTokenError(token, expires=info["expires"])
|
||||
|
||||
def is_activable_service(service: dict) -> bool:
|
||||
|
|
|
@ -86,7 +86,7 @@ class DriversView(BaseView):
|
|||
def make_waiting(self, install: bool) -> None:
|
||||
"""Change the view into a spinner and start waiting for drivers
|
||||
asynchronously."""
|
||||
self.spinner = Spinner(style="dots")
|
||||
self.spinner = Spinner(style="dots", app=self.controller.app)
|
||||
self.spinner.start()
|
||||
|
||||
if self.local_only:
|
||||
|
@ -120,6 +120,7 @@ class DriversView(BaseView):
|
|||
self.make_main(install, drivers)
|
||||
else:
|
||||
self.make_no_drivers()
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
def make_no_drivers(self) -> None:
|
||||
"""Change the view into an information page that shows that no
|
||||
|
|
|
@ -215,7 +215,7 @@ class ErrorReportStretchy(Stretchy):
|
|||
for n, b in self.btns.items():
|
||||
self.btns[n] = Padding(b, width=w, align="center")
|
||||
|
||||
self.spinner = Spinner(style="dots")
|
||||
self.spinner = Spinner(style="dots", app=app)
|
||||
self.pile = Pile([])
|
||||
self.pile.contents[:] = [
|
||||
(w, self.pile.options("pack")) for w in self._pile_elements()
|
||||
|
@ -336,15 +336,24 @@ class ErrorReportStretchy(Stretchy):
|
|||
if self.pile.selectable():
|
||||
while not self.pile.focus.selectable():
|
||||
self.pile.focus_position += 1
|
||||
await self.app.redraw_screen()
|
||||
|
||||
def debug_shell(self, sender):
|
||||
self.app.debug_shell()
|
||||
async def debug_shell_and_redraw():
|
||||
await self.app.debug_shell()
|
||||
await self.app.redraw_screen()
|
||||
|
||||
run_bg_task(debug_shell_and_redraw())
|
||||
|
||||
def restart(self, sender):
|
||||
self.app.restart(restart_server=True)
|
||||
|
||||
def view_report(self, sender):
|
||||
self.app.run_command_in_foreground(["less", self.report.path])
|
||||
async def run_less_and_redraw():
|
||||
await self.app.run_command_in_foreground(["less", self.report.path])
|
||||
await self.app.redraw_screen()
|
||||
|
||||
run_bg_task(run_less_and_redraw())
|
||||
|
||||
def submit(self, sender):
|
||||
self.report.upload()
|
||||
|
|
|
@ -30,7 +30,7 @@ class SlowProbing(BaseView):
|
|||
|
||||
def __init__(self, controller):
|
||||
self.controller = controller
|
||||
self.spinner = Spinner(style="dots")
|
||||
self.spinner = Spinner(style="dots", app=self.controller.app)
|
||||
self.spinner.start()
|
||||
super().__init__(
|
||||
screen(
|
||||
|
|
|
@ -429,8 +429,12 @@ class HelpMenu(PopUpLauncher):
|
|||
self.open_pop_up()
|
||||
|
||||
def _open(self, sender):
|
||||
async def get_ssh_info_and_redraw():
|
||||
await self._get_ssh_info()
|
||||
await self.app.redraw_screen()
|
||||
|
||||
log.debug("open help menu")
|
||||
run_bg_task(self._get_ssh_info())
|
||||
run_bg_task(get_ssh_info_and_redraw())
|
||||
|
||||
def create_pop_up(self):
|
||||
self._menu = OpenHelpMenu(self)
|
||||
|
@ -505,7 +509,11 @@ class HelpMenu(PopUpLauncher):
|
|||
self._show_overlay(GlobalKeyStretchy(self.app))
|
||||
|
||||
def debug_shell(self, sender):
|
||||
self.app.debug_shell()
|
||||
async def debug_shell_and_redraw():
|
||||
await self.app.debug_shell()
|
||||
await self.app.redraw_screen()
|
||||
|
||||
run_bg_task(debug_shell_and_redraw())
|
||||
|
||||
def toggle_rich(self, sender):
|
||||
self.app.toggle_rich()
|
||||
|
|
|
@ -90,7 +90,7 @@ class ProgressView(BaseView):
|
|||
def event_start(self, context_id, context_parent_id, message):
|
||||
self.event_finish(context_parent_id)
|
||||
walker = self.event_listbox.base_widget.body
|
||||
spinner = Spinner()
|
||||
spinner = Spinner(app=self.controller.app)
|
||||
spinner.start()
|
||||
new_line = Columns(
|
||||
[
|
||||
|
@ -101,6 +101,7 @@ class ProgressView(BaseView):
|
|||
)
|
||||
self.ongoing[context_id] = len(walker)
|
||||
self._add_line(self.event_listbox, new_line)
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
def event_finish(self, context_id):
|
||||
index = self.ongoing.pop(context_id, None)
|
||||
|
@ -110,6 +111,7 @@ class ProgressView(BaseView):
|
|||
spinner = walker[index][1]
|
||||
spinner.stop()
|
||||
walker[index] = walker[index][0]
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
def event_other(self, message: str, event_type: str) -> None:
|
||||
"""Print events that aren't start or finish events"""
|
||||
|
@ -296,7 +298,7 @@ class InstallConfirmation(Stretchy):
|
|||
if self.app.controllers.Progress.showing:
|
||||
run_bg_task(self.app.confirm_install())
|
||||
else:
|
||||
self.app.next_screen(self.app.confirm_install())
|
||||
self.app.request_next_screen(self.app.confirm_install())
|
||||
|
||||
def cancel(self, sender):
|
||||
self.app.remove_global_overlay(self)
|
||||
|
|
|
@ -270,8 +270,12 @@ class Detector:
|
|||
self.do_step(step_index)
|
||||
|
||||
def do_step(self, step_index):
|
||||
async def do_step_and_redraw():
|
||||
await self._do_step(step_index)
|
||||
self.keyboard_view.request_redraw_if_visible()
|
||||
|
||||
self.abort()
|
||||
run_bg_task(self._do_step(step_index))
|
||||
run_bg_task(do_step_and_redraw())
|
||||
|
||||
async def _do_step(self, step_index):
|
||||
log.debug("moving to step %s", step_index)
|
||||
|
@ -433,6 +437,7 @@ class KeyboardView(BaseView):
|
|||
)
|
||||
if needs_toggle:
|
||||
self.show_stretchy_overlay(ToggleQuestion(self, setting))
|
||||
self.request_redraw_if_visible()
|
||||
else:
|
||||
self.really_done(setting)
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ class MirrorView(BaseView):
|
|||
connect_signal(self.form, "cancel", self.cancel)
|
||||
|
||||
self.status_text = Text("")
|
||||
self.status_spinner = Spinner()
|
||||
self.status_spinner = Spinner(app=self.controller.app)
|
||||
self.status_wrap = WidgetWrap(self.status_text)
|
||||
self.output_text = Text("")
|
||||
self.output_box = LineBox(ListBox([self.output_text]))
|
||||
|
@ -192,6 +192,7 @@ class MirrorView(BaseView):
|
|||
await asyncio.sleep(1 / self.controller.app.scale_factor)
|
||||
status = await self.controller.endpoint.check_mirror.progress.GET()
|
||||
self.update_status(status)
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
if check_state.status == MirrorCheckStatus.FAILED:
|
||||
self.output_wrap._w = Pile(
|
||||
|
|
|
@ -54,9 +54,10 @@ class TaskProgressBar(ProgressBar):
|
|||
|
||||
|
||||
class TaskProgress(WidgetWrap):
|
||||
def __init__(self):
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
self.mode = "spinning"
|
||||
self.spinner = Spinner()
|
||||
self.spinner = Spinner(app=app)
|
||||
self.label = Text("", wrap="clip")
|
||||
cols = Color.progress_incomplete(
|
||||
Columns(
|
||||
|
@ -129,7 +130,7 @@ class RefreshView(BaseView):
|
|||
def __init__(self, controller):
|
||||
self.controller = controller
|
||||
self.check_task = None
|
||||
self.spinner = Spinner(style="dots")
|
||||
self.spinner = Spinner(style="dots", app=self.controller.app)
|
||||
|
||||
if self.controller.status.availability == RefreshCheckState.UNKNOWN:
|
||||
self.check_state_checking()
|
||||
|
@ -262,6 +263,7 @@ class RefreshView(BaseView):
|
|||
self.update_failed(err)
|
||||
return
|
||||
self.update_progress(change)
|
||||
self.request_redraw_if_visible()
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
def try_update_again(self, sender=None):
|
||||
|
@ -294,7 +296,7 @@ class RefreshView(BaseView):
|
|||
del self.task_to_bar[tid]
|
||||
if task.status == TaskStatus.DOING:
|
||||
if tid not in self.task_to_bar:
|
||||
self.task_to_bar[tid] = bar = TaskProgress()
|
||||
self.task_to_bar[tid] = bar = TaskProgress(app=self.controller.app)
|
||||
self.lb_tasks.base_widget.body.append(bar)
|
||||
else:
|
||||
bar = self.task_to_bar[tid]
|
||||
|
|
|
@ -350,7 +350,12 @@ class SnapCheckBox(CheckBox):
|
|||
|
||||
def keypress(self, size, key):
|
||||
if key.startswith("enter"):
|
||||
schedule_task(self.load_info())
|
||||
|
||||
async def load_info_and_redraw():
|
||||
await self.load_info()
|
||||
self.parent.request_redraw_if_visible()
|
||||
|
||||
schedule_task(load_info_and_redraw())
|
||||
else:
|
||||
return super().keypress(size, key)
|
||||
|
||||
|
@ -379,14 +384,18 @@ class SnapListView(BaseView):
|
|||
self.loaded(data)
|
||||
|
||||
def wait_load(self):
|
||||
spinner = Spinner(style="dots")
|
||||
async def wait_load_and_redraw():
|
||||
await self._wait_load(spinner)
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
spinner = Spinner(style="dots", app=self.controller.app)
|
||||
spinner.start()
|
||||
self._w = screen(
|
||||
[spinner],
|
||||
[ok_btn(label=_("Continue"), on_press=self.done)],
|
||||
excerpt=_("Loading server snaps from store, please wait..."),
|
||||
)
|
||||
schedule_task(self._wait_load(spinner))
|
||||
schedule_task(wait_load_and_redraw())
|
||||
|
||||
async def _wait_load(self, spinner):
|
||||
# If we show the loading screen at all, we want to show it for
|
||||
|
|
|
@ -179,8 +179,8 @@ class SSHForm(Form):
|
|||
class FetchingSSHKeys(WidgetWrap):
|
||||
def __init__(self, parent):
|
||||
self.parent = parent
|
||||
spinner = Spinner(style="dots")
|
||||
spinner.start()
|
||||
self.spinner = Spinner(style="dots", app=self.parent.controller.app)
|
||||
self.spinner.start()
|
||||
text = _("Fetching SSH keys...")
|
||||
button = cancel_btn(label=_("Cancel"), on_press=self.cancel)
|
||||
# | text |
|
||||
|
@ -191,7 +191,7 @@ class FetchingSSHKeys(WidgetWrap):
|
|||
Pile(
|
||||
[
|
||||
("pack", Text(" " + text)),
|
||||
("pack", spinner),
|
||||
("pack", self.spinner),
|
||||
("pack", button_pile([button])),
|
||||
]
|
||||
)
|
||||
|
@ -199,6 +199,7 @@ class FetchingSSHKeys(WidgetWrap):
|
|||
)
|
||||
|
||||
def cancel(self, sender):
|
||||
self.spinner.stop()
|
||||
self.parent.remove_overlay()
|
||||
self.parent.controller._fetch_cancel()
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ class CheckingContractToken(WidgetWrap):
|
|||
def __init__(self, parent: BaseView):
|
||||
"""Initializes the loading animation widget."""
|
||||
self.parent = parent
|
||||
spinner = Spinner(style="dots")
|
||||
spinner = Spinner(style="dots", app=self.parent.controller.app)
|
||||
spinner.start()
|
||||
text = _("Checking Ubuntu Pro subscription...")
|
||||
button = cancel_btn(label=_("Cancel"), on_press=self.cancel)
|
||||
|
@ -535,6 +535,7 @@ class UbuntuProView(BaseView):
|
|||
self.remove_overlay()
|
||||
widget = TokenAddedWidget(parent=self, on_continue=show_subscription)
|
||||
self.show_stretchy_overlay(widget)
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
def upgrade_mode_done(self, form: UpgradeModeForm) -> None:
|
||||
"""Open the loading dialog and asynchronously check if the token is
|
||||
|
@ -563,6 +564,7 @@ class UbuntuProView(BaseView):
|
|||
form.validated()
|
||||
elif status == UbuntuProCheckTokenStatus.UNKNOWN_ERROR:
|
||||
self.show_unknown_error()
|
||||
self.request_redraw_if_visible()
|
||||
|
||||
token: str = form.with_contract_token_subform.value["token"]
|
||||
checking_token_overlay = CheckingContractToken(self)
|
||||
|
@ -580,6 +582,7 @@ class UbuntuProView(BaseView):
|
|||
self.controller.contract_selection_initiate(on_initiated=self.cs_initiated)
|
||||
|
||||
self.upgrade_mode_form.set_user_code(user_code)
|
||||
self.request_redraw_if_visible()
|
||||
self.controller.contract_selection_wait(
|
||||
on_contract_selected=self.on_contract_selected,
|
||||
on_timeout=reinitiate,
|
||||
|
|
|
@ -67,6 +67,7 @@ class ZdevList(WidgetWrap):
|
|||
self.parent.controller.chzdev(action, zdevinfo), "Updating..."
|
||||
)
|
||||
self.update(new_zdevinfos)
|
||||
self.parent.request_redraw_if_visible()
|
||||
|
||||
def zdev_action(self, sender, action, zdevinfo):
|
||||
run_bg_task(self._zdev_action(action, zdevinfo))
|
||||
|
|
|
@ -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/>.
|
||||
|
||||
""" SubiquityCore """
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2019 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 asyncio
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2019 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 asyncio
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
# 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/>.
|
||||
|
|
|
@ -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 abc
|
||||
|
@ -663,10 +662,10 @@ class NetworkController(BaseNetworkController, TuiController, NetworkAnswersMixi
|
|||
def done(self):
|
||||
log.debug("NetworkController.done next_screen")
|
||||
self.model.has_network = self.network_event_receiver.has_default_route
|
||||
self.app.next_screen()
|
||||
self.app.request_next_screen()
|
||||
|
||||
def cancel(self):
|
||||
self.app.prev_screen()
|
||||
self.app.request_prev_screen()
|
||||
|
||||
def apply_starting(self):
|
||||
super().apply_starting()
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
# 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/>.
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2023 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
|
||||
|
|
|
@ -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/>.
|
||||
|
||||
|
||||
|
|
|
@ -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 asyncio
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2018-2022 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 contextlib
|
||||
|
@ -70,7 +69,7 @@ def write_file(filename, content, **kwargs):
|
|||
|
||||
|
||||
def generate_timestamped_header() -> str:
|
||||
now = datetime.datetime.utcnow()
|
||||
now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
|
||||
return f"# Autogenerated by Subiquity: {now} UTC\n"
|
||||
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
# Copyright 2017 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/>.
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue