Test commit
816
LICENSE
|
@ -1,235 +1,661 @@
|
||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
Version 3, 19 November 2007
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
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 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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
0. Definitions.
|
0. Definitions.
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
"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.
|
"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.
|
"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.
|
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.
|
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 "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.
|
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.
|
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.
|
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 "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.
|
||||||
|
|
||||||
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.
|
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 "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
|
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.
|
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 need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
The Corresponding Source for a work in source code form is that same work.
|
Source.
|
||||||
|
|
||||||
2. Basic Permissions.
|
The Corresponding Source for a work in source code form is that
|
||||||
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.
|
same work.
|
||||||
|
|
||||||
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.
|
2. Basic Permissions.
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
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.
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
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.
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
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 make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
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.
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
5. Conveying Modified Source Versions.
|
with facilities for running those works, provided that you comply with
|
||||||
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:
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
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".
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
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.
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
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.
|
makes it unnecessary.
|
||||||
|
|
||||||
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.
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
No covered work shall be deemed part of an effective technological
|
||||||
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:
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
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.
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
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.
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
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.
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
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.
|
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
|
||||||
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.
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
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.
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
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.
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
"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.
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
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).
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
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.
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
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.
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
7. Additional Terms.
|
and you may offer support or warranty protection for a fee.
|
||||||
"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.
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
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.
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
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:
|
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) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
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
|
it, and giving a relevant date.
|
||||||
|
|
||||||
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
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
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.
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
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.
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
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.
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
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.
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
8. Termination.
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
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).
|
work need not make them do so.
|
||||||
|
|
||||||
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.
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
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.
|
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
|
||||||
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.
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
9. Acceptance Not Required for Having Copies.
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
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.
|
parts of the aggregate.
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
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.
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
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.
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
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.
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
11. Patents.
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
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".
|
customarily used for software interchange.
|
||||||
|
|
||||||
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.
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
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.
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
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.
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
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
|
product that is covered by this License, on a durable physical
|
||||||
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.
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
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.
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
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.
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
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.
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
12. No Surrender of Others' Freedom.
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
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.
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
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.
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
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.
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
14. Revised Versions of this License.
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
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.
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
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.
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
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.
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
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.
|
charge under subsection 6d.
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
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.
|
included in conveying the object code work.
|
||||||
|
|
||||||
16. Limitation of Liability.
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
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.
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
17. Interpretation of Sections 15 and 16.
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
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.
|
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
|
||||||
END OF TERMS AND CONDITIONS
|
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
|
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.
|
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.
|
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.
|
||||||
|
|
||||||
hectabit-oauth2
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
Copyright (C) 2024 arzumify
|
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 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.
|
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/>.
|
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.
|
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.
|
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/>.
|
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,5 @@
|
||||||
|
[config]
|
||||||
|
HOST = 0.0.0.0
|
||||||
|
PORT = 8080
|
||||||
|
SECRET_KEY = superdupersecretkey
|
||||||
|
MAX_STORAGE = 25000000
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import sqlite3
|
||||||
|
import os
|
||||||
|
|
||||||
|
def generatedb():
|
||||||
|
connection = sqlite3.connect("database.db")
|
||||||
|
|
||||||
|
with open("schema.sql") as f:
|
||||||
|
connection.executescript(f.read())
|
||||||
|
|
||||||
|
cur = connection.cursor()
|
||||||
|
|
||||||
|
connection.commit()
|
||||||
|
connection.close()
|
||||||
|
|
||||||
|
print("[INFO] Generated database")
|
||||||
|
|
||||||
|
if not os.path.exists("database.db"):
|
||||||
|
generatedb()
|
||||||
|
else:
|
||||||
|
answer = input("Proceeding will overwrite the database. Proceed? (y/N)")
|
||||||
|
if "y" in answer.lower():
|
||||||
|
generatedb()
|
||||||
|
elif "n" in answer.lower():
|
||||||
|
print("Stopped")
|
||||||
|
elif ":3" in answer:
|
||||||
|
print(":3")
|
||||||
|
else:
|
||||||
|
print("Stopped")
|
|
@ -0,0 +1,354 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import os
|
||||||
|
import sqlite3
|
||||||
|
import time
|
||||||
|
import secrets
|
||||||
|
import configparser
|
||||||
|
import asyncio
|
||||||
|
from hypercorn.config import Config
|
||||||
|
from hypercorn.asyncio import serve
|
||||||
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
|
from quart import Quart, render_template, request, url_for, flash, redirect, session, make_response, send_from_directory, stream_with_context, Response, request
|
||||||
|
|
||||||
|
# Parse configuration file, and check if anything is wrong with it
|
||||||
|
if not os.path.exists("config.ini"):
|
||||||
|
print("config.ini does not exist")
|
||||||
|
quit(1)
|
||||||
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read("config.ini")
|
||||||
|
|
||||||
|
HOST = config["config"]["HOST"]
|
||||||
|
PORT = config["config"]["PORT"]
|
||||||
|
SECRET_KEY = config["config"]["SECRET_KEY"]
|
||||||
|
MAX_STORAGE = config["config"]["MAX_STORAGE"]
|
||||||
|
|
||||||
|
if SECRET_KEY == "supersecretkey" or SECRET_KEY == "placeholder":
|
||||||
|
print("[WARNING] Secret key not set")
|
||||||
|
|
||||||
|
# Define Quart
|
||||||
|
app = Quart(__name__)
|
||||||
|
app.config["SECRET_KEY"] = SECRET_KEY
|
||||||
|
|
||||||
|
# Database functions
|
||||||
|
def get_db_connection():
|
||||||
|
conn = sqlite3.connect("database.db")
|
||||||
|
conn.row_factory = sqlite3.Row
|
||||||
|
return conn
|
||||||
|
|
||||||
|
def get_user(id):
|
||||||
|
conn = get_db_connection()
|
||||||
|
post = conn.execute("SELECT * FROM users WHERE id = ?",
|
||||||
|
(id,)).fetchone()
|
||||||
|
conn.close()
|
||||||
|
if post is None:
|
||||||
|
return None
|
||||||
|
return post
|
||||||
|
|
||||||
|
def get_session(id):
|
||||||
|
conn = get_db_connection()
|
||||||
|
post = conn.execute("SELECT * FROM sessions WHERE session = ?",
|
||||||
|
(id,)).fetchone()
|
||||||
|
conn.close()
|
||||||
|
if post is None:
|
||||||
|
return None
|
||||||
|
return post
|
||||||
|
|
||||||
|
def get_session_from_sessionid(id):
|
||||||
|
conn = get_db_connection()
|
||||||
|
post = conn.execute("SELECT * FROM sessions WHERE sessionid = ?",
|
||||||
|
(id,)).fetchone()
|
||||||
|
conn.close()
|
||||||
|
if post is None:
|
||||||
|
return None
|
||||||
|
return post
|
||||||
|
|
||||||
|
def check_username_taken(username):
|
||||||
|
conn = get_db_connection()
|
||||||
|
post = conn.execute("SELECT * FROM users WHERE lower(username) = ?",
|
||||||
|
(username.lower(),)).fetchone()
|
||||||
|
conn.close()
|
||||||
|
if post is None:
|
||||||
|
return None
|
||||||
|
return post["id"]
|
||||||
|
|
||||||
|
# Disable CORS
|
||||||
|
@app.after_request
|
||||||
|
async def add_cors_headers(response):
|
||||||
|
response.headers.add("Access-Control-Allow-Origin", "*")
|
||||||
|
response.headers.add("Access-Control-Allow-Headers", "*")
|
||||||
|
response.headers.add("Access-Control-Allow-Methods", "*")
|
||||||
|
return response
|
||||||
|
|
||||||
|
@app.route("/api/version", methods=("GET", "POST"))
|
||||||
|
async def apiversion():
|
||||||
|
return "Burgerauth Version 1.2"
|
||||||
|
|
||||||
|
@app.route("/api/signup", methods=("GET", "POST"))
|
||||||
|
async def apisignup():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
username = data["username"]
|
||||||
|
password = data["password"]
|
||||||
|
|
||||||
|
if username == "":
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
if len(username) > 20:
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
if not username.isalnum():
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
if password == "":
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
if len(password) < 14:
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
if not check_username_taken(username) == None:
|
||||||
|
return {}, 409
|
||||||
|
|
||||||
|
hashedpassword = generate_password_hash(password)
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("INSERT INTO users (username, password, created) VALUES (?, ?, ?)",
|
||||||
|
(username, hashedpassword, str(time.time())))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
userID = check_username_taken(username)
|
||||||
|
user = get_user(userID)
|
||||||
|
|
||||||
|
randomCharacters = secrets.token_hex(512)
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("INSERT INTO sessions (session, id, device) VALUES (?, ?, ?)",
|
||||||
|
(randomCharacters, userID, request.headers.get("user-agent")))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"key": randomCharacters
|
||||||
|
}, 200
|
||||||
|
|
||||||
|
@app.route("/api/login", methods=("GET", "POST"))
|
||||||
|
async def apilogin():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
username = data["username"]
|
||||||
|
password = data["password"]
|
||||||
|
passwordchange = data["passwordchange"]
|
||||||
|
newpass = data["newpass"]
|
||||||
|
|
||||||
|
check_username_thing = check_username_taken(username)
|
||||||
|
|
||||||
|
if check_username_thing == None:
|
||||||
|
return {}, 401
|
||||||
|
|
||||||
|
userID = check_username_taken(username)
|
||||||
|
user = get_user(userID)
|
||||||
|
|
||||||
|
if not check_password_hash(user["password"], (password)):
|
||||||
|
return {}, 401
|
||||||
|
|
||||||
|
randomCharacters = secrets.token_hex(512)
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("INSERT INTO sessions (session, id, device) VALUES (?, ?, ?)",
|
||||||
|
(randomCharacters, userID, request.headers.get("user-agent")))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
if passwordchange == "yes":
|
||||||
|
hashedpassword = generate_password_hash(newpass)
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("UPDATE users SET password = ? WHERE username = ?", (hashedpassword, username))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
return {
|
||||||
|
"key": randomCharacters,
|
||||||
|
}, 200
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/api/userinfo", methods=("GET", "POST"))
|
||||||
|
async def apiuserinfo():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
datatemplate = {
|
||||||
|
"username": user["username"],
|
||||||
|
"id": user["id"],
|
||||||
|
"created": user["created"]
|
||||||
|
}
|
||||||
|
return datatemplate
|
||||||
|
|
||||||
|
@app.route("/api/auth", methods=("GET", "POST"))
|
||||||
|
async def apiauthenticate():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
appId = data["appId"]
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
conn = get_db_connection()
|
||||||
|
secretkey = conn.execute("SELECT secret FROM userdata WHERE appId = ? AND creator = ? LIMIT 1", (appId,user))
|
||||||
|
if secretkey:
|
||||||
|
return secretkey
|
||||||
|
else:
|
||||||
|
return {}, 400
|
||||||
|
|
||||||
|
@app.route("/api/newauth", methods=("GET", "POST"))
|
||||||
|
async def apicreateauth():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
appId = data["appId"]
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
secret = secrets.token_hex(512)
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("INSERT INTO userdata (appId, creator, secret) VALUES (?, ?, ?)",
|
||||||
|
(appId,user,secret))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
return secret, 200
|
||||||
|
|
||||||
|
@app.route("/api/deleteaccount", methods=("GET", "POST"))
|
||||||
|
async def apideleteaccount():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("DELETE FROM userdata WHERE creator = ?", (userCookie["id"],))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("DELETE FROM users WHERE id = ?", (userCookie["id"],))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
return {}, 200
|
||||||
|
|
||||||
|
@app.route("/api/sessions/list", methods=("GET", "POST"))
|
||||||
|
async def apisessionslist():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
sessions = conn.execute("SELECT * FROM sessions WHERE id = ? ORDER BY id DESC;", (user["id"],)).fetchall()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
datatemplate = []
|
||||||
|
|
||||||
|
for x in sessions:
|
||||||
|
device = x["device"]
|
||||||
|
thisSession = False
|
||||||
|
if (x["session"] == secretKey):
|
||||||
|
thisSession = True
|
||||||
|
sessiontemplate = {
|
||||||
|
"id": x["sessionid"],
|
||||||
|
"thisSession": thisSession,
|
||||||
|
"device": device
|
||||||
|
}
|
||||||
|
datatemplate.append(sessiontemplate)
|
||||||
|
|
||||||
|
return datatemplate, 200
|
||||||
|
|
||||||
|
@app.route("/api/sessions/remove", methods=("GET", "POST"))
|
||||||
|
async def apisessionsremove():
|
||||||
|
if request.method == "POST":
|
||||||
|
data = await request.get_json()
|
||||||
|
secretKey = data["secretKey"]
|
||||||
|
sessionId = data["sessionId"]
|
||||||
|
|
||||||
|
userCookie = get_session(secretKey)
|
||||||
|
user = get_user(userCookie["id"])
|
||||||
|
|
||||||
|
session = get_session_from_sessionid(sessionId)
|
||||||
|
|
||||||
|
if (session != None):
|
||||||
|
if (user["id"] == session["id"]):
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("DELETE FROM sessions WHERE sessionid = ?", (session["sessionid"],))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
return {}, 200
|
||||||
|
else:
|
||||||
|
return {}, 403
|
||||||
|
else:
|
||||||
|
return {}, 422
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/listusers/<secretkey>", methods=("GET", "POST"))
|
||||||
|
def listusers(secretkey):
|
||||||
|
if secretkey == SECRET_KEY:
|
||||||
|
conn = get_db_connection()
|
||||||
|
users = conn.execute("SELECT * FROM users").fetchall()
|
||||||
|
conn.close()
|
||||||
|
thing = ""
|
||||||
|
for x in users:
|
||||||
|
thing = str(x["id"]) + " - " + x["username"] + " - " + str(get_space(x["id"])) + "<br>" + thing
|
||||||
|
|
||||||
|
return thing
|
||||||
|
else:
|
||||||
|
return redirect("/")
|
||||||
|
|
||||||
|
@app.errorhandler(500)
|
||||||
|
async def burger(e):
|
||||||
|
return {}, 500
|
||||||
|
|
||||||
|
@app.errorhandler(404)
|
||||||
|
async def burger(e):
|
||||||
|
return {}, 404
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
async def index():
|
||||||
|
return redirect("/login", code=302)
|
||||||
|
|
||||||
|
@app.route("/login")
|
||||||
|
async def login():
|
||||||
|
return await render_template("login.html")
|
||||||
|
|
||||||
|
@app.route("/signup")
|
||||||
|
async def signup():
|
||||||
|
return await render_template("signup.html")
|
||||||
|
|
||||||
|
@app.route("/logout")
|
||||||
|
async def logout():
|
||||||
|
return await render_template("logout.html")
|
||||||
|
|
||||||
|
@app.route("/homeserver")
|
||||||
|
async def homeserver():
|
||||||
|
return await render_template("homeserver.html")
|
||||||
|
|
||||||
|
@app.route("/app")
|
||||||
|
async def mainapp():
|
||||||
|
return await render_template("main.html")
|
||||||
|
|
||||||
|
# Start server
|
||||||
|
hypercornconfig = Config()
|
||||||
|
hypercornconfig.bind = (HOST + ":" + PORT)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("[INFO] Server started")
|
||||||
|
asyncio.run(serve(app, hypercornconfig))
|
||||||
|
print("[INFO] Server stopped")
|
|
@ -0,0 +1,23 @@
|
||||||
|
DROP TABLE IF EXISTS users;
|
||||||
|
DROP TABLE IF EXISTS userdata;
|
||||||
|
DROP TABLE IF EXISTS sessions;
|
||||||
|
|
||||||
|
CREATE TABLE users (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
created TEXT NOT NULL,
|
||||||
|
username TEXT NOT NULL,
|
||||||
|
password TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE userdata (
|
||||||
|
creator INTEGER NOT NULL,
|
||||||
|
appId TEXT NOT NULL,
|
||||||
|
secret TEXT NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE sessions (
|
||||||
|
sessionid INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
session TEXT NOT NULL,
|
||||||
|
id INTEGER NOT NULL,
|
||||||
|
device TEXT NOT NULL DEFAULT "?"
|
||||||
|
);
|
|
@ -0,0 +1,186 @@
|
||||||
|
@import url("../fonts/inter.css");
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--contrast: #eee;
|
||||||
|
--contrast2: #fff;
|
||||||
|
--invertdm: 0%;
|
||||||
|
--bar: #f4f4f4;
|
||||||
|
--editor: #ffffff;
|
||||||
|
--text-color: #000000;
|
||||||
|
--border-color: #dadada;
|
||||||
|
--theme-color: #157efb;
|
||||||
|
--theme-text-color: #ffffff;
|
||||||
|
--exit-color: #e9e9e9;
|
||||||
|
--session-color: #f4f4f4;
|
||||||
|
--note-button: #ffffff;
|
||||||
|
--note-button-text-color: #ffffff;
|
||||||
|
--unselected-note-button-text-color: #000000;
|
||||||
|
--option-background: #ffffff;
|
||||||
|
--invert: 100%;
|
||||||
|
--bottomBarHover: #e4e4e4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* dark mode */
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root {
|
||||||
|
--invertdm: 100%;
|
||||||
|
--contrast: #2d2f21;
|
||||||
|
--contrast2: #2d2f21;
|
||||||
|
--bar: #2d2f31;
|
||||||
|
--editor: #202124;
|
||||||
|
--text-color: #ffffff;
|
||||||
|
--border-color: #393b3d;
|
||||||
|
--theme-color: #157efb;
|
||||||
|
--theme-text-color: #ffffff;
|
||||||
|
--exit-color: #454649;
|
||||||
|
--session-color: #2d2f31;
|
||||||
|
--note-button: #202124;
|
||||||
|
--note-button-text-color: #ffffff;
|
||||||
|
--unselected-note-button-text-color: #ffffff;
|
||||||
|
--option-background: #202124;
|
||||||
|
--invert: 100%;
|
||||||
|
--bottomBarHover: #e4e4e4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv p {
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv a {
|
||||||
|
color: #969696 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv input {
|
||||||
|
color: white;
|
||||||
|
background-color: var(--editor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
li,
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
color: var(--text-color);
|
||||||
|
white-space: break-spaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
h7 {
|
||||||
|
display: block;
|
||||||
|
font-size: 20px;
|
||||||
|
margin-top: 0.67em;
|
||||||
|
margin-bottom: 0.67em;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
background-color: var(--editor);
|
||||||
|
font-family: "Inter", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sign up/log in div */
|
||||||
|
|
||||||
|
.inoutdiv {
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 10%;
|
||||||
|
padding: 30px;
|
||||||
|
border: solid 1px var(--border-color);
|
||||||
|
background-color: var(--bar);
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv input {
|
||||||
|
width: calc(100% - 120px);
|
||||||
|
height: 30px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
|
|
||||||
|
border: solid;
|
||||||
|
border-color: var(--border-color);
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv button {
|
||||||
|
background-color: var(--theme-color);
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
margin-right: 5px;
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.inoutdiv a {
|
||||||
|
color: grey;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.background {
|
||||||
|
position: fixed;
|
||||||
|
z-index: -2;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.credit {
|
||||||
|
position: fixed;
|
||||||
|
left: 5px;
|
||||||
|
color: white;
|
||||||
|
z-index: -1;
|
||||||
|
margin: 0;
|
||||||
|
bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w100 {
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w200 {
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w300 {
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w400 {
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w500 {
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w600 {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w700 {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w800 {
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.w900 {
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
/* Variable fonts usage:
|
||||||
|
:root { font-family: "Inter", sans-serif; }
|
||||||
|
@supports (font-variation-settings: normal) {
|
||||||
|
:root { font-family: "InterVariable", sans-serif; font-optical-sizing: auto; }
|
||||||
|
} */
|
||||||
|
@font-face {
|
||||||
|
font-family: InterVariable;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("InterVariable.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: InterVariable;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 100 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("InterVariable-Italic.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* static fonts */
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100; font-display: swap; src: url("Inter-Thin.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100; font-display: swap; src: url("Inter-ThinItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 200; font-display: swap; src: url("Inter-ExtraLight.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 200; font-display: swap; src: url("Inter-ExtraLightItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300; font-display: swap; src: url("Inter-Light.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 300; font-display: swap; src: url("Inter-LightItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("Inter-Regular.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("Inter-Italic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("Inter-Medium.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 500; font-display: swap; src: url("Inter-MediumItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("Inter-SemiBold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 600; font-display: swap; src: url("Inter-SemiBoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("Inter-Bold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 700; font-display: swap; src: url("Inter-BoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("Inter-ExtraBold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 800; font-display: swap; src: url("Inter-ExtraBoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url("Inter-Black.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "Inter"; font-style: italic; font-weight: 900; font-display: swap; src: url("Inter-BlackItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 100; font-display: swap; src: url("InterDisplay-Thin.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 100; font-display: swap; src: url("InterDisplay-ThinItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 200; font-display: swap; src: url("InterDisplay-ExtraLight.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 200; font-display: swap; src: url("InterDisplay-ExtraLightItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 300; font-display: swap; src: url("InterDisplay-Light.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 300; font-display: swap; src: url("InterDisplay-LightItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 400; font-display: swap; src: url("InterDisplay-Regular.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 400; font-display: swap; src: url("InterDisplay-Italic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 500; font-display: swap; src: url("InterDisplay-Medium.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 500; font-display: swap; src: url("InterDisplay-MediumItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 600; font-display: swap; src: url("InterDisplay-SemiBold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 600; font-display: swap; src: url("InterDisplay-SemiBoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 700; font-display: swap; src: url("InterDisplay-Bold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 700; font-display: swap; src: url("InterDisplay-BoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 800; font-display: swap; src: url("InterDisplay-ExtraBold.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 800; font-display: swap; src: url("InterDisplay-ExtraBoldItalic.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: normal; font-weight: 900; font-display: swap; src: url("InterDisplay-Black.woff2") format("woff2"); }
|
||||||
|
@font-face { font-family: "InterDisplay"; font-style: italic; font-weight: 900; font-display: swap; src: url("InterDisplay-BlackItalic.woff2") format("woff2"); }
|
After Width: | Height: | Size: 1.4 MiB |
|
@ -0,0 +1,54 @@
|
||||||
|
let homeserverBox = document.getElementById("homeserverBox")
|
||||||
|
let statusBox = document.getElementById("statusBox")
|
||||||
|
let changeButton = document.getElementById("changeButton")
|
||||||
|
|
||||||
|
function showElements(yesorno) {
|
||||||
|
if (!yesorno) {
|
||||||
|
homeserverBox.classList.add("hidden")
|
||||||
|
changeButton.classList.add("hidden")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
homeserverBox.classList.remove("hidden")
|
||||||
|
changeButton.classList.remove("hidden")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
changeButton.addEventListener("click", (event) => {
|
||||||
|
async function doStuff() {
|
||||||
|
let remote = homeserverBox.value
|
||||||
|
|
||||||
|
if (remote == "") {
|
||||||
|
statusBox.innerText = "A homeserver is required!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
showElements(false)
|
||||||
|
statusBox.innerText = "Connecting to homeserver..."
|
||||||
|
|
||||||
|
fetch(remote + "/api/version")
|
||||||
|
.then((response) => response)
|
||||||
|
.then((response) => {
|
||||||
|
async function doStuff() {
|
||||||
|
if (response.status == 200) {
|
||||||
|
localStorage.setItem("homeserverURL", remote)
|
||||||
|
|
||||||
|
if (document.referrer !== "") {
|
||||||
|
window.location.href = document.referrer;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.location.href = "../login";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (response.status == 404) {
|
||||||
|
statusBox.innerText = "Not a valid homeserver!"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statusBox.innerText = "Something went wrong!"
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
});
|
|
@ -0,0 +1,199 @@
|
||||||
|
if (localStorage.getItem("DONOTSHARE-secretkey") !== null) {
|
||||||
|
window.location.replace("../app")
|
||||||
|
document.body.innerHTML = "Redirecting..."
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
||||||
|
window.location.replace("../app")
|
||||||
|
document.body.innerHTML = "Redirecting..."
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
|
||||||
|
let remote = localStorage.getItem("homeserverURL")
|
||||||
|
if (remote == null) {
|
||||||
|
localStorage.setItem("homeserverURL", "https://auth.hectabit.org")
|
||||||
|
remote = "https://auth.hectabit.org"
|
||||||
|
}
|
||||||
|
|
||||||
|
let usernameBox = document.getElementById("usernameBox")
|
||||||
|
let passwordBox = document.getElementById("passwordBox")
|
||||||
|
let statusBox = document.getElementById("statusBox")
|
||||||
|
let signupButton = document.getElementById("signupButton")
|
||||||
|
let inputNameBox = document.getElementById("inputNameBox")
|
||||||
|
let backButton = document.getElementById("backButton")
|
||||||
|
|
||||||
|
usernameBox.classList.remove("hidden")
|
||||||
|
inputNameBox.innerText = "Username:"
|
||||||
|
|
||||||
|
let currentInputType = 0
|
||||||
|
|
||||||
|
function showInput(inputType) {
|
||||||
|
if (inputType == 0) {
|
||||||
|
usernameBox.classList.remove("hidden")
|
||||||
|
passwordBox.classList.add("hidden")
|
||||||
|
backButton.classList.add("hidden")
|
||||||
|
inputNameBox.innerText = "Username:"
|
||||||
|
statusBox.innerText = "Login to your Hectabit account!"
|
||||||
|
currentInputType = 0
|
||||||
|
} else if (inputType == 1) {
|
||||||
|
usernameBox.classList.add("hidden")
|
||||||
|
passwordBox.classList.remove("hidden")
|
||||||
|
backButton.classList.remove("hidden")
|
||||||
|
inputNameBox.innerText = "Password:"
|
||||||
|
currentInputType = 1
|
||||||
|
} else if (inputType == 2) {
|
||||||
|
usernameBox.classList.add("hidden")
|
||||||
|
passwordBox.classList.add("hidden")
|
||||||
|
signupButton.classList.add("hidden")
|
||||||
|
backButton.classList.add("hidden")
|
||||||
|
inputNameBox.classList.add("hidden")
|
||||||
|
inputNameBox.innerText = "Password:"
|
||||||
|
currentInputType = 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function showElements(yesorno) {
|
||||||
|
if (!yesorno) {
|
||||||
|
usernameBox.classList.add("hidden")
|
||||||
|
passwordBox.classList.add("hidden")
|
||||||
|
signupButton.classList.add("hidden")
|
||||||
|
backButton.classList.add("hidden")
|
||||||
|
inputNameBox.classList.add("hidden")
|
||||||
|
showInput(currentInputType)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
usernameBox.classList.remove("hidden")
|
||||||
|
passwordBox.classList.remove("hidden")
|
||||||
|
signupButton.classList.remove("hidden")
|
||||||
|
backButton.classList.remove("hidden")
|
||||||
|
inputNameBox.classList.remove("hidden")
|
||||||
|
showInput(currentInputType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.getElementById("homeserver").innerText = "Your homeserver is: " + remote + ". "
|
||||||
|
});
|
||||||
|
|
||||||
|
signupButton.addEventListener("click", (event) => {
|
||||||
|
if (passwordBox.classList.contains("hidden")) {
|
||||||
|
if (usernameBox.value == "") {
|
||||||
|
statusBox.innerText = "A username is required!"
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
statusBox.innerText = "Welcome back, " + usernameBox.value + "!"
|
||||||
|
}
|
||||||
|
showInput(1)
|
||||||
|
} else {
|
||||||
|
async function doStuff() {
|
||||||
|
let username = usernameBox.value
|
||||||
|
let password = passwordBox.value
|
||||||
|
|
||||||
|
if (password == "") {
|
||||||
|
statusBox.innerText = "A password is required!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
showInput(2)
|
||||||
|
showElements(true)
|
||||||
|
statusBox.innerText = "Signing in..."
|
||||||
|
|
||||||
|
async function hashpassold(pass) {
|
||||||
|
const key = await hashwasm.argon2id({
|
||||||
|
password: pass,
|
||||||
|
salt: await hashwasm.sha512(pass),
|
||||||
|
parallelism: 1,
|
||||||
|
iterations: 256,
|
||||||
|
memorySize: 512,
|
||||||
|
hashLength: 32,
|
||||||
|
outputType: "encoded"
|
||||||
|
});
|
||||||
|
return key
|
||||||
|
};
|
||||||
|
|
||||||
|
async function hashpass(pass) {
|
||||||
|
let key = pass
|
||||||
|
for (let i = 0; i < 128; i++) {
|
||||||
|
key = await hashwasm.sha3(key)
|
||||||
|
}
|
||||||
|
return key
|
||||||
|
};
|
||||||
|
|
||||||
|
fetch(remote + "/api/login", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
username: username,
|
||||||
|
password: await hashpass(password),
|
||||||
|
passwordchange: "no",
|
||||||
|
newpass: "null"
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => response)
|
||||||
|
.then((response) => {
|
||||||
|
async function doStuff() {
|
||||||
|
let responseData = await response.json()
|
||||||
|
if (response.status == 200) {
|
||||||
|
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
|
||||||
|
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
|
||||||
|
|
||||||
|
window.location.href = "../app"
|
||||||
|
}
|
||||||
|
else if (response.status == 401) {
|
||||||
|
console.log("Trying oldhash")
|
||||||
|
fetch(remote + "/api/login", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
username: username,
|
||||||
|
password: await hashpassold(password),
|
||||||
|
passwordchange: "yes",
|
||||||
|
newpass: await hashpass(password)
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => response)
|
||||||
|
.then((response) => {
|
||||||
|
async function doStuff2() {
|
||||||
|
let responseData = await response.json()
|
||||||
|
if (response.status == 200) {
|
||||||
|
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
|
||||||
|
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
|
||||||
|
|
||||||
|
window.location.href = "../app/"
|
||||||
|
}
|
||||||
|
else if (response.status == 401) {
|
||||||
|
statusBox.innerText = "Wrong username or password..."
|
||||||
|
showInput(1)
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statusBox.innerText = "Something went wrong! (error code: " + response.status + ")"
|
||||||
|
showInput(1)
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doStuff2()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statusBox.innerText = "Something went wrong! (error code: " + response.status + ")"
|
||||||
|
showInput(1)
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
backButton.addEventListener("click", (event) => {
|
||||||
|
showInput(0)
|
||||||
|
});
|
||||||
|
|
||||||
|
showInput(0)
|
|
@ -0,0 +1,109 @@
|
||||||
|
if (localStorage.getItem("DONOTSHARE-secretkey") !== null) {
|
||||||
|
window.location.replace("../app")
|
||||||
|
document.body.innerHTML = "Redirecting..."
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
||||||
|
window.location.replace("../app")
|
||||||
|
document.body.innerHTML = "Redirecting..."
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
|
||||||
|
let remote = localStorage.getItem("homeserverURL")
|
||||||
|
if (remote == null) {
|
||||||
|
localStorage.setItem("homeserverURL", "https://auth.hectabit.org")
|
||||||
|
remote = "https://auth.hectabit.org"
|
||||||
|
}
|
||||||
|
|
||||||
|
let usernameBox = document.getElementById("usernameBox")
|
||||||
|
let passwordBox = document.getElementById("passwordBox")
|
||||||
|
let statusBox = document.getElementById("statusBox")
|
||||||
|
let signupButton = document.getElementById("signupButton")
|
||||||
|
|
||||||
|
function showElements(yesorno) {
|
||||||
|
if (!yesorno) {
|
||||||
|
usernameBox.classList.add("hidden")
|
||||||
|
passwordBox.classList.add("hidden")
|
||||||
|
signupButton.classList.add("hidden")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
usernameBox.classList.remove("hidden")
|
||||||
|
passwordBox.classList.remove("hidden")
|
||||||
|
signupButton.classList.remove("hidden")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
document.getElementById("homeserver").innerText = "Your homeserver is: " + remote + ". "
|
||||||
|
});
|
||||||
|
|
||||||
|
signupButton.addEventListener("click", (event) => {
|
||||||
|
async function doStuff() {
|
||||||
|
let username = usernameBox.value
|
||||||
|
let password = passwordBox.value
|
||||||
|
|
||||||
|
if (username == "") {
|
||||||
|
statusBox.innerText = "A username is required!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((username).length > 20) {
|
||||||
|
statusBox.innerText = "Username cannot be more than 20 characters!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (password == "") {
|
||||||
|
statusBox.innerText = "A password is required!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ((password).length < 8) {
|
||||||
|
statusBox.innerText = "8 or more characters are required!"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
showElements(false)
|
||||||
|
statusBox.innerText = "Creating account, please hold on..."
|
||||||
|
|
||||||
|
async function hashpass(pass) {
|
||||||
|
let key = pass
|
||||||
|
for (let i = 0; i < 128; i++) {
|
||||||
|
key = await hashwasm.sha3(key)
|
||||||
|
}
|
||||||
|
return key
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
fetch(remote + "/api/signup", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
username: username,
|
||||||
|
password: await hashpass(password)
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((response) => response)
|
||||||
|
.then((response) => {
|
||||||
|
async function doStuff() {
|
||||||
|
let responseData = await response.json()
|
||||||
|
|
||||||
|
if (response.status == 200) {
|
||||||
|
statusBox.innerText == "redirecting.."
|
||||||
|
localStorage.setItem("DONOTSHARE-secretkey", responseData["key"])
|
||||||
|
localStorage.setItem("DONOTSHARE-password", await hashwasm.sha512(password))
|
||||||
|
|
||||||
|
window.location.href = "../app"
|
||||||
|
}
|
||||||
|
else if (response.status == 409) {
|
||||||
|
statusBox.innerText = "Username already taken!"
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
statusBox.innerText = "Something went wrong!"
|
||||||
|
showElements(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
doStuff()
|
||||||
|
});
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M450-450H200v-60h250v-250h60v250h250v60H510v250h-60v-250Z"/></svg>
|
After Width: | Height: | Size: 163 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M320-240 80-480l240-240 57 57-184 184 183 183-56 56Zm320 0-57-57 184-184-183-183 56-56 240 240-240 240Z"/></svg>
|
After Width: | Height: | Size: 209 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>
|
After Width: | Height: | Size: 300 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="m361-299 119-121 120 121 47-48-119-121 119-121-47-48-120 121-119-121-48 48 120 121-120 121 48 48ZM261-120q-24 0-42-18t-18-42v-570h-41v-60h188v-30h264v30h188v60h-41v570q0 24-18 42t-42 18H261Zm438-630H261v570h438v-570Zm-438 0v570-570Z"/></svg>
|
After Width: | Height: | Size: 338 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M70-120q-12.75 0-21.375-8.675Q40-137.351 40-150.175 40-163 48.625-171.5T70-180h820q12.75 0 21.375 8.675 8.625 8.676 8.625 21.5 0 12.825-8.625 21.325T890-120H70Zm70-120q-24 0-42-18t-18-42v-480q0-24 18-42t42-18h680q24 0 42 18t18 42v480q0 24-18 42t-42 18H140Zm0-60h680v-480H140v480Zm0 0v-480 480Z"/></svg>
|
After Width: | Height: | Size: 399 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M140-160q-24 0-42-18t-18-42v-520q0-24 18-42t42-18h680q24 0 42 18t18 42v520q0 24-18 42t-42 18H140Zm0-60h680v-436H140v436Zm160-72-42-42 103-104-104-104 43-42 146 146-146 146Zm190 4v-60h220v60H490Z"/></svg>
|
After Width: | Height: | Size: 300 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M260-40q-24 0-42-18t-18-42v-760q0-24 18-42t42-18h440q24 0 42 18t18 42v760q0 24-18 42t-42 18H260Zm0-90v30h440v-30H260Zm0-60h440v-580H260v580Zm0-640h440v-30H260v30Zm0 0v-30 30Zm0 700v30-30Z"/></svg>
|
After Width: | Height: | Size: 293 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M480-313 287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193ZM220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Z"/></svg>
|
After Width: | Height: | Size: 249 B |
|
@ -0,0 +1,55 @@
|
||||||
|
<svg width="527" height="533" viewBox="0 0 527 533" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_6_27)">
|
||||||
|
<path d="M451 352.333C451 375.896 431.896 395 408.333 395H152.333C128.771 395 109.667 375.896 109.667 352.333V142.339C109.667 118.776 171.437 75 195 75H393.667C426.669 75 451 99.6613 451 132.333V352.333Z" fill="#226699"/>
|
||||||
|
<path d="M429.667 395C429.667 418.563 410.563 437.667 387 437.667H173.667C150.104 437.667 131 418.563 131 395V139C131 95.064 130.776 96.3333 184.333 96.3333H387C410.563 96.3333 429.667 115.437 429.667 139V395Z" fill="url(#paint0_linear_6_27)"/>
|
||||||
|
<path d="M408.333 405.667C408.333 423.341 394.008 437.667 376.333 437.667H141.667C123.992 437.667 109.667 423.341 109.667 405.667V149.667C109.667 131.992 123.992 117.667 141.667 117.667H376.333C394.008 117.667 408.333 131.992 408.333 149.667V405.667Z" fill="#E1E8ED"/>
|
||||||
|
<path d="M158.115 426.776C158.115 434.264 151 440.333 142.221 440.333C133.453 440.333 126.339 434.264 126.339 426.776C126.339 419.299 133.453 413.219 142.221 413.219C151 413.219 158.115 419.288 158.115 426.776Z" fill="#662113"/>
|
||||||
|
<path d="M140.536 419.224C135.416 419.811 132.088 423.224 129.688 427C126.413 432.173 118.947 437.667 109.667 437.667C97.8906 437.667 88.3333 430.509 88.3333 421.667C88.3333 412.824 97.8906 405.667 109.667 405.667V384.376C86.552 384.6 67.8853 401.176 67.8853 421.667C67.8853 442.296 86.7866 459 110.104 459C129.88 459 145.805 447.853 151.715 431.597C154.669 423.501 146.712 418.541 140.536 419.224Z" fill="url(#paint1_linear_6_27)"/>
|
||||||
|
<path d="M158.115 341.443C158.115 348.931 151 355 142.221 355C133.453 355 126.339 348.931 126.339 341.443C126.339 333.965 133.453 327.885 142.221 327.885C151 327.885 158.115 333.955 158.115 341.443Z" fill="#662113"/>
|
||||||
|
<path d="M140.536 333.891C135.416 334.477 132.088 337.891 129.688 341.667C126.413 346.84 118.947 352.333 109.667 352.333C97.8906 352.333 88.3333 345.176 88.3333 336.333C88.3333 327.491 97.8906 320.333 109.667 320.333V299.043C86.552 299.267 67.8853 315.843 67.8853 336.333C67.8853 356.963 86.7866 373.667 110.104 373.667C129.88 373.667 145.805 362.52 151.715 346.264C154.669 338.168 146.712 333.208 140.536 333.891Z" fill="url(#paint2_linear_6_27)"/>
|
||||||
|
<path d="M158.115 256.109C158.115 263.597 151 269.667 142.221 269.667C133.453 269.667 126.339 263.597 126.339 256.109C126.339 248.632 133.453 242.552 142.221 242.552C151 242.552 158.115 248.621 158.115 256.109Z" fill="#662113"/>
|
||||||
|
<path d="M140.536 248.557C135.416 249.144 132.088 252.557 129.688 256.333C126.413 261.507 118.947 267 109.667 267C97.8906 267 88.3333 259.843 88.3333 251C88.3333 242.157 97.8906 235 109.667 235V213.709C86.552 213.933 67.8853 230.509 67.8853 251C67.8853 271.629 86.7866 288.333 110.104 288.333C129.88 288.333 145.805 277.187 151.715 260.931C154.669 252.835 146.712 247.875 140.536 248.557Z" fill="url(#paint3_linear_6_27)"/>
|
||||||
|
<path d="M158.115 170.776C158.115 178.264 151 184.333 142.221 184.333C133.453 184.333 126.339 178.264 126.339 170.776C126.339 163.299 133.453 157.219 142.221 157.219C151 157.219 158.115 163.288 158.115 170.776Z" fill="#662113"/>
|
||||||
|
<path d="M140.536 163.224C135.416 163.811 132.088 167.224 129.688 171C126.413 176.173 118.947 181.667 109.667 181.667C97.8906 181.667 88.3333 174.509 88.3333 165.667C88.3333 156.824 97.8906 149.667 109.667 149.667V128.376C86.5626 128.589 67.8853 145.176 67.8853 165.667C67.8853 186.296 86.7866 203 110.104 203C129.88 203 145.805 191.853 151.715 175.597C154.669 167.501 146.712 162.541 140.536 163.224Z" fill="url(#paint4_linear_6_27)"/>
|
||||||
|
<path d="M281 300.771C192.496 300.771 120.756 298.646 120.756 361.47C120.756 424.266 192.496 438.556 281 438.556C369.504 438.556 441.244 424.266 441.244 361.47C441.244 298.655 369.504 300.771 281 300.771Z" fill="#D99E82"/>
|
||||||
|
<path d="M436.55 305.54C436.55 305.54 358.926 296.247 281 295.85C203.074 296.247 125.45 305.54 125.45 305.54C117.772 366.683 181.522 391.872 281 391.872C380.478 391.872 444.228 366.683 436.55 305.54Z" fill="#662113"/>
|
||||||
|
<path d="M431.035 281.098L130.182 287.199C119.793 287.199 111.095 308.251 122.116 313.757C204.358 339.332 270.47 365.21 270.47 365.21C279.555 370.234 282.625 370.253 291.72 365.238C291.72 365.238 383.009 328.707 441.65 313.36C449.971 311.188 441.414 281.098 431.035 281.098Z" fill="#FFCC4D"/>
|
||||||
|
<path d="M438.958 281.891C421.014 265.354 422.053 274.156 408.302 270.274C403.079 268.801 365.707 220.493 280.528 220.493H280.339C195.159 220.493 157.788 268.801 152.565 270.274C138.814 274.156 139.853 265.354 121.908 281.891C113.673 289.484 111.444 293.432 120.133 295.397C133.223 298.353 132.033 306.277 141.411 309.034C152.763 312.368 157.429 306.277 175.732 308.77C191.344 310.895 192.364 331.144 208.117 331.144C223.871 331.144 223.871 323.588 239.614 323.588C255.358 323.588 264.671 343.856 280.424 343.856C296.177 343.856 305.48 323.588 321.233 323.588C336.987 323.588 336.987 331.144 352.731 331.144C368.484 331.144 369.504 310.895 385.116 308.77C403.419 306.286 408.094 312.368 419.437 309.034C428.815 306.277 427.625 298.362 440.715 295.397C449.423 293.442 447.203 289.484 438.958 281.891Z" fill="#77B255"/>
|
||||||
|
<path d="M432.838 264.022C432.838 292.204 364.857 305.512 281 305.512C197.143 305.512 129.162 292.204 129.162 264.022C129.162 212.994 138.285 212.994 281 212.994C423.715 212.994 432.838 213.003 432.838 264.022Z" fill="#DD2E44"/>
|
||||||
|
<path d="M281 112.949C192.496 112.949 120.756 154.419 120.756 217.234C120.756 275.082 192.496 277.443 281 277.443C369.504 277.443 441.244 275.082 441.244 217.234C441.244 154.41 369.504 112.949 281 112.949Z" fill="#D99E82"/>
|
||||||
|
<path d="M212.849 142.897C208.146 139.884 201.903 141.263 198.899 145.967C195.896 150.67 197.266 156.922 201.969 159.916C206.672 162.929 218.591 165.177 221.604 160.473C224.607 155.77 217.552 145.901 212.849 142.897ZM304.781 133.122C299.473 134.841 290.152 142.623 291.88 147.931C293.608 153.239 305.707 154.051 311.014 152.332C316.322 150.613 319.222 144.909 317.493 139.601C315.774 134.303 310.07 131.394 304.781 133.122ZM407.811 199.564C403.542 195.975 392.841 201.689 389.243 205.958C385.654 210.236 386.211 216.602 390.48 220.191C394.749 223.779 401.124 223.222 404.713 218.953C408.311 214.675 412.089 203.153 407.811 199.564ZM373.404 152.342C368.701 149.338 362.458 150.717 359.446 155.421C356.442 160.124 357.821 166.367 362.524 169.37C367.228 172.383 379.147 174.631 382.15 169.927C385.163 165.214 378.108 155.345 373.404 152.342ZM231.738 218.453C227.034 215.449 220.792 216.828 217.779 221.532C214.776 226.226 216.154 232.478 220.858 235.472C225.561 238.484 237.48 240.742 240.483 236.029C243.496 231.326 236.441 221.456 231.738 218.453ZM260.506 173.044C257.332 177.634 254.65 189.468 259.249 192.641C263.839 195.814 273.954 189.109 277.128 184.519C280.301 179.929 279.139 173.639 274.549 170.466C269.969 167.292 263.669 168.454 260.506 173.044ZM335.627 218.453C330.923 215.449 324.681 216.828 321.668 221.532C318.664 226.226 320.043 232.487 324.747 235.472C329.45 238.484 341.369 240.742 344.372 236.029C347.385 231.326 340.33 221.456 335.627 218.453ZM157.731 181.742C154.01 185.907 149.864 197.307 154.029 201.028C158.175 204.749 169.055 199.384 172.776 195.219C176.507 191.064 176.148 184.679 171.992 180.949C167.846 177.228 161.452 177.587 157.731 181.742Z" fill="#FFE8B6"/>
|
||||||
|
</g>
|
||||||
|
<path d="M408.333 416.333C408.333 439.896 389.229 459 365.667 459H163C139.437 459 120.333 439.896 120.333 416.333V181.667C120.333 158.104 139.437 139 163 139H365.667C389.229 139 408.333 158.104 408.333 181.667V416.333Z" fill="#3B88C3"/>
|
||||||
|
<path d="M387 416.333C387 439.896 367.896 459 344.333 459H163C139.437 459 120.333 439.896 120.333 416.333V203C120.333 179.437 139.437 160.333 163 160.333H347.907C371.469 160.333 387 175.864 387 199.427V416.333Z" fill="url(#paint5_linear_6_27)"/>
|
||||||
|
<path d="M163 139C144.995 139 144.536 118.499 152.333 109.667C161.208 99.6293 175 96.3333 199.672 96.3333H216.333V75H187.331C144.995 75 109.667 101.667 109.667 132.333V416.333C109.667 439.896 128.771 459 152.333 459H173.667V139H163Z" fill="#226699"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_6_27" x1="280.333" y1="96.3295" x2="280.333" y2="437.667" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#CCD6DD"/>
|
||||||
|
<stop offset="1" stop-color="#CCD6DD" stop-opacity="0"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint1_linear_6_27" x1="110.118" y1="384.376" x2="110.118" y2="459" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#66757F"/>
|
||||||
|
<stop offset="1" stop-color="#50585C"/>
|
||||||
|
<stop offset="1" stop-color="#50585C"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint2_linear_6_27" x1="110.118" y1="299.043" x2="110.118" y2="373.667" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#66757F"/>
|
||||||
|
<stop offset="1" stop-color="#50585C"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint3_linear_6_27" x1="110.118" y1="213.709" x2="110.118" y2="288.333" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#66757F"/>
|
||||||
|
<stop offset="1" stop-color="#50585C"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint4_linear_6_27" x1="110.118" y1="128.376" x2="110.118" y2="203" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#66757F"/>
|
||||||
|
<stop offset="1" stop-color="#50585C"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="paint5_linear_6_27" x1="253.667" y1="160.333" x2="253.667" y2="459" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#55ACEE"/>
|
||||||
|
<stop offset="1" stop-color="#55ACEE" stop-opacity="0"/>
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="clip0_6_27">
|
||||||
|
<rect width="384" height="384" fill="white" transform="translate(67 75)"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 8.1 KiB |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M280-240q-17 0-28.5-11.5T240-280v-80h520v-360h80q17 0 28.5 11.5T880-680v600L720-240H280ZM80-280v-560q0-17 11.5-28.5T120-880h520q17 0 28.5 11.5T680-840v360q0 17-11.5 28.5T640-440H240L80-280Zm520-240v-280H160v280h440Zm-440 0v-280 280Z"/></svg>
|
After Width: | Height: | Size: 338 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
|
After Width: | Height: | Size: 516 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M290-620v-60h550v60H290Zm0 170v-60h550v60H290Zm0 170v-60h550v60H290ZM150-620q-12 0-21-9t-9-21.5q0-12.5 9-21t21.5-8.5q12.5 0 21 8.625T180-650q0 12-8.625 21T150-620Zm0 170q-12 0-21-9t-9-21.5q0-12.5 9-21t21.5-8.5q12.5 0 21 8.625T180-480q0 12-8.625 21T150-450Zm0 170q-12 0-21-9t-9-21.5q0-12.5 9-21t21.5-8.5q12.5 0 21 8.625T180-310q0 12-8.625 21T150-280Z"/></svg>
|
After Width: | Height: | Size: 455 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M180-120q-24 0-42-18t-18-42v-600q0-24 18-42t42-18h299v60H180v600h299v60H180Zm486-185-43-43 102-102H360v-60h363L621-612l43-43 176 176-174 174Z"/></svg>
|
After Width: | Height: | Size: 247 B |
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M634-320q-14 0-24-10t-10-24v-132q0-14 10-24t24-10h6v-40q0-33 23.5-56.5T720-640q33 0 56.5 23.5T800-560v40h6q14 0 24 10t10 24v132q0 14-10 24t-24 10H634Zm46-200h80v-40q0-17-11.5-28.5T720-600q-17 0-28.5 11.5T680-560v40ZM280-40q-33 0-56.5-23.5T200-120v-720q0-33 23.5-56.5T280-920h400q33 0 56.5 23.5T760-840v160h-80v-40H280v480h400v-40h80v160q0 33-23.5 56.5T680-40H280Zm0-120v40h400v-40H280Zm0-640h400v-40H280v40Zm0 0v-40 40Zm0 640v40-40Z"/></svg>
|
After Width: | Height: | Size: 538 B |
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Change homeserver</title>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../static/css/style.css">
|
||||||
|
<link rel="icon" href="./static/svg/favicon.svg">
|
||||||
|
<script src="../static/js/hash-wasm.js"></script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
background-image: url("/static/svg/grid.svg");
|
||||||
|
background-repeat: repeat;
|
||||||
|
background-size: 312px
|
||||||
|
}
|
||||||
|
.inoutdiv {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p class="credit">Image by perga (@pergagreen on discord)</p>
|
||||||
|
<img src="/static/img/background.jpg" class="background">
|
||||||
|
<div class="inoutdiv">
|
||||||
|
<h2 class="w300">Homeserver</h2>
|
||||||
|
<p>Change your homeserver</p>
|
||||||
|
<p id="statusBox"></p>
|
||||||
|
|
||||||
|
<input type="text" value="https://" id="homeserverBox"><br>
|
||||||
|
<button id="changeButton">Change</button><br><br>
|
||||||
|
<p>Please put in the URL in standard format; https://, http://, etc.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../static/js/homeserver.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -0,0 +1,42 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Login - Hectabit</title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
|
||||||
|
<script src="../static/js/hash-wasm.js"></script>
|
||||||
|
<link rel="icon" href="../static/svg/favicon.svg">
|
||||||
|
<script>
|
||||||
|
if (window.location.href.endsWith('/index.html')) {
|
||||||
|
if (window.location.origin !== null) {
|
||||||
|
var currentUrl = window.location.href;
|
||||||
|
var newUrl = currentUrl.replace('/index.html', '');
|
||||||
|
window.location.href = newUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p class="credit">Image by perga (@pergagreen on discord)</p>
|
||||||
|
<img src="/static/img/background.jpg" class="background">
|
||||||
|
<div class="inoutdiv">
|
||||||
|
<h2 class="w300">Login</h2>
|
||||||
|
<p id="statusBox"></p>
|
||||||
|
<span id="inputNameBox" style="margin-right: 10px;color: var(--text-color);"></span>
|
||||||
|
<input id="usernameBox" class="hidden" type="text" placeholder="Enter your username">
|
||||||
|
<input id="passwordBox" class="hidden" type="password" placeholder="Enter your password">
|
||||||
|
<button id="signupButton">Next</button>
|
||||||
|
<button id="backButton" class="hidden">Back</button>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<p>Don't have an account? If so, <a href="../signup">Create one here!</a></p>
|
||||||
|
<div style="display: flex;"><p id="homeserver">Your homeserver is loading... </p><div style="display: flex;flex-direction: column;justify-content: center;"><a href="/homeserver">Change</a></div></div>
|
||||||
|
<a href="../privacy/index.html">Privacy & Terms</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="../static/js/login.js"></script>
|
||||||
|
</body>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Burgernotes</title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<link rel="icon" href="../static/svg/favicon.svg">
|
||||||
|
<script>
|
||||||
|
if (window.location.href.endsWith('/index.html')) {
|
||||||
|
if (window.location.origin !== null) {
|
||||||
|
var currentUrl = window.location.href;
|
||||||
|
var newUrl = currentUrl.replace('/index.html', '');
|
||||||
|
window.location.href = newUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<head>
|
||||||
|
Logging out..
|
||||||
|
<script>
|
||||||
|
localStorage.removeItem("DONOTSHARE-secretkey")
|
||||||
|
localStorage.removeItem("DONOTSHARE-password")
|
||||||
|
localStorage.removeItem("CACHE-username")
|
||||||
|
window.location.replace("../login")
|
||||||
|
</script>
|
|
@ -0,0 +1 @@
|
||||||
|
Ok, logged in
|
|
@ -0,0 +1,39 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Signup - Hectabit</title>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../static/css/style.css" />
|
||||||
|
<script src="../static/js/hash-wasm.js"></script>
|
||||||
|
<link rel="icon" href="../static/svg/favicon.svg">
|
||||||
|
<script>
|
||||||
|
if (window.location.href.endsWith('/index.html')) {
|
||||||
|
if (window.location.origin !== null) {
|
||||||
|
var currentUrl = window.location.href;
|
||||||
|
var newUrl = currentUrl.replace('/index.html', '');
|
||||||
|
window.location.href = newUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<p class="credit">Image by perga (@pergagreen on discord)</p>
|
||||||
|
<img src="/static/img/background.jpg" class="background">
|
||||||
|
<div class="inoutdiv">
|
||||||
|
<h2 class="w300">Signup</h2>
|
||||||
|
<p>Signup for an account</p>
|
||||||
|
<p id="statusBox"></p>
|
||||||
|
<input id="usernameBox" type="text" placeholder="Username">
|
||||||
|
<input id="passwordBox" type="password" placeholder="Password"><br>
|
||||||
|
<button id="signupButton">Signup</button><br><br>
|
||||||
|
<p>Already have an account? If so, <a href="../login">Login</a> instead!</p>
|
||||||
|
<p>Please note that it's impossible to reset your password, do not forget it!</p>
|
||||||
|
<div style="display: flex;"><p id="homeserver">Your homeserver is loading... </p><div style="display: flex;flex-direction: column;justify-content: center;"><a href="/homeserver">Change</a></div></div>
|
||||||
|
<a href="../privacy/index.html">Privacy & Terms</a>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript" src="../static/js/signup.js"></script>
|
||||||
|
</body>
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import sqlite3
|
||||||
|
import os
|
||||||
|
|
||||||
|
def get_db_connection():
|
||||||
|
conn = sqlite3.connect("database.db")
|
||||||
|
conn.row_factory = sqlite3.Row
|
||||||
|
return conn
|
||||||
|
|
||||||
|
if os.path.exists("database.db"):
|
||||||
|
print("vacuuming..")
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("VACUUM")
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
print("success")
|
||||||
|
else:
|
||||||
|
print("database not found")
|