diff --git a/.gitattributes b/.gitattributes index dfe0770..4b350ac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ # Auto detect text files and perform LF normalization * text=auto + +# SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/Dockerfile b/Dockerfile index ff86675..24eb5a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,171 +1,327 @@ -# syntax=docker/dockerfile:1 # SPDX-License-Identifier: AGPL-3.0-or-later -# This file is part of Wolfree. -# 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. -FROM alpine +FROM alpine AS stage-alpine + +# alpine - Official Image | Docker Hub +# https://hub.docker.com/_/alpine WORKDIR /app/ -# Install all dependencies. +# Install all dependencies, including Wget, Rust, Docusaurus, and other required packages. RUN \ - apk add \ - -- \ - wget \ - npm \ - gcc \ - rustup \ - ; +apk \ +-- \ +add \ +wget \ +gcc \ +rustup \ +npm \ +; -RUN \ - rustup-init -y +# Install the dependencies of Docusaurus and Typescript. COPY \ - ./docusaurus/package.json \ - ./docusaurus/package.json +./docusaurus/package.json \ +./docusaurus/package.json RUN \ - npm install \ - --prefix ./docusaurus/ \ - -- \ - ; - -# WolframAlpha LLC prebuilt the website and kindly deployed it on the Internet. -# We can run Wget to download the web pages and save them as static pages. +npm \ +--prefix ./docusaurus/ \ +-- \ +install \ +; RUN \ - wget \ - --directory-prefix=./docusaurus/static/ \ - --no-host-directories \ - --page-requisites \ - --convert-links \ - --no-verbose \ - -- \ - 'https://www.wolframalpha.com/input/index.html' \ - 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js' \ - 'https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.5/purify.min.js' \ - ; \ - : \ - ; - -RUN \ - sed \ - -e 's|.*js...static.chunks...........||' \ - -e 's|"........js.....miniCssF.*|.js\n|' \ - -e 's|:"|.|g' \ - -e 's|",|.js\n|g' \ - -- \ - ./docusaurus/static/_next/static/chunks/webpack-*.js \ - | \ - wget \ - --directory-prefix=./docusaurus/static/ \ - --no-host-directories \ - --page-requisites \ - --convert-links \ - --no-verbose \ - --input-file=- \ - --base=https://www.wolframalpha.com/_next/static/chunks/ \ - -- \ - ; \ - : \ - ; - -RUN \ - sed \ - -e 's|.*return.static.css.....||' \ - -e 's|.........css.......function.*|.css\n|' \ - -e 's|[0-9]*:"||g' \ - -e 's|",|.css\n|g' \ - -- \ - ./docusaurus/static/_next/static/chunks/webpack-*.js \ - | \ - wget \ - --directory-prefix=./docusaurus/static/ \ - --no-host-directories \ - --page-requisites \ - --convert-links \ - --no-verbose \ - --input-file=- \ - --base=https://www.wolframalpha.com/_next/static/css/ \ - -- \ - ; \ - : \ - ; - -# Delete unused large files on the static website. - -RUN \ - truncate \ - -s 0 \ - -- \ - ./docusaurus/static/_next/static/images/* \ - ; - -# Build the Docusaurus static website. +npm \ +--prefix ./docusaurus/ \ +-- \ +audit \ +fix \ +; COPY \ - ./docusaurus/ \ - ./docusaurus/ +./typescript/package.json \ +./typescript/package.json RUN \ - npm run \ - --prefix ./docusaurus/ \ - -- \ - build \ - ; +npm \ +--prefix ./typescript/ \ +-- \ +install \ +; -# Lint the source code and run the Rust program. -# The Rust program customizes the static pages. +RUN \ +npm \ +--prefix ./typescript/ \ +-- \ +audit \ +fix \ +; + +# Set up the Rust compiler. + +RUN \ +rustup-init \ +-y \ +-- \ +; + +# Download the necessary dependencies for the Rust programs. COPY \ - ./rust/ \ - ./rust/ +./rust/wolfree_download_dependencies/ \ +./rust/wolfree_download_dependencies/ RUN \ - PATH="$HOME/.cargo/bin:$PATH" \ - cargo clippy \ - --manifest-path ./rust/wolfree_libredirect_patch/Cargo.toml \ - -- \ - --warn clippy::all \ - --warn clippy::cargo \ - --warn clippy::nursery \ - --warn clippy::pedantic \ - --warn clippy::restriction \ - ; +PATH="$HOME/.cargo/bin:$PATH" \ +cargo \ +-- \ +clippy \ +--manifest-path ./rust/wolfree_download_dependencies/Cargo.toml \ +-- \ +--warn clippy::all \ +--warn clippy::cargo \ +--warn clippy::nursery \ +--warn clippy::pedantic \ +--warn clippy::restriction \ +; RUN \ - PATH="$HOME/.cargo/bin:$PATH" \ - cargo clippy \ - --manifest-path ./rust/wolfree_sed_in_place/Cargo.toml \ - -- \ - --warn clippy::all \ - --warn clippy::cargo \ - --warn clippy::nursery \ - --warn clippy::pedantic \ - --warn clippy::restriction \ - ; +PATH="$HOME/.cargo/bin:$PATH" \ +cargo \ +run \ +--manifest-path ./rust/wolfree_download_dependencies/Cargo.toml \ +-- \ +; -# Optionally, customize Wolfree instances to suit LibRedirect. -# https://github.com/libredirect/browser_extension/issues/425 -# To integrate Wolfree with LibRedirect, please delete the number sign at the beginning of the following line. -# RUN PATH="$HOME/.cargo/bin:$PATH" cargo run --manifest-path ./rust/wolfree_libredirect_patch/Cargo.toml -- ; +# Cloudflare and WolframAlpha are invaluable tools for web developers, +# providing easy access to prebuilt JavaScript files. +# To effortlessly obtain these files, you can utilize the Wget command-line utility. +# Cloudflare's web servers offer a vast collection of popular JavaScript libraries. +# On the other hand, +# WolframAlpha's web servers specifically host the essential JavaScript files for the 2-dimensional math input editor. -RUN PATH="$HOME/.cargo/bin:$PATH" cargo run --manifest-path ./rust/wolfree_sed_in_place/Cargo.toml -- ; +RUN \ +wget \ +--directory-prefix=./docusaurus/static/ \ +--no-host-directories \ +--page-requisites \ +--convert-links \ +--no-verbose \ +--input-file=- \ +--base= \ +-- \ +'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js' \ +'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.map' \ +'https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.5/purify.min.js' \ +'https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.5/purify.min.js.map' \ +'https://www.wolframalpha.com/input/index.html' \ +; \ +: \ +; + +# We use the Sed command to extract the pathnames from the "Webpack" and "buildManifest" files. +# After successfully parsing the pathnames, we proceed to download the files using the Wget command. + +RUN \ +sed \ +-e 's|.*js...static.chunks...........||' \ +-e 's|"........js.....miniCssF.*|.js\n|' \ +-e 's|:"|.|g' \ +-e 's|",|.js\n|g' \ +-- \ +./docusaurus/static/_next/static/chunks/webpack-*.js \ +| \ +wget \ +--directory-prefix=./docusaurus/static/ \ +--no-host-directories \ +--page-requisites \ +--convert-links \ +--no-verbose \ +--input-file=- \ +--base=https://www.wolframalpha.com/_next/static/chunks/ \ +-- \ +; \ +: \ +; + +RUN \ +sed \ +-e 's|.*return.static.css.....||' \ +-e 's|.........css.......function.*|.css\n|' \ +-e 's|[0-9]*:"||g' \ +-e 's|",|.css\n|g' \ +-- \ +./docusaurus/static/_next/static/chunks/webpack-*.js \ +| \ +wget \ +--directory-prefix=./docusaurus/static/ \ +--no-host-directories \ +--page-requisites \ +--convert-links \ +--no-verbose \ +--input-file=- \ +--base=https://www.wolframalpha.com/_next/static/css/ \ +-- \ +; \ +: \ +; + +RUN \ +sed \ +-e 's|.*sortedPages.*}..||' \ +-e 's|...self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB.*||' \ +-e 's|","|\n|g' \ +-- \ +./docusaurus/static/_next/static/*/_buildManifest.js \ +| \ +wget \ +--directory-prefix=./docusaurus/static/ \ +--no-host-directories \ +--page-requisites \ +--convert-links \ +--no-verbose \ +--input-file=- \ +--base=https://www.wolframalpha.com/_next/ \ +-- \ +; \ +: \ +; + +# Remove unused large files, +# such as decorative images, +# from the static website. + +RUN \ +truncate \ +-s 0 \ +-- \ +./docusaurus/static/_next/static/images/* \ +./docusaurus/static/_next/static/media/*.png \ +./docusaurus/static/_next/static/media/*.gif \ +; + +# Compile and execute the Rust program. +# The Rust program allows customization of the static pages downloaded with Wget. + +COPY \ +./rust/wolfree_sed_in_place/ \ +./rust/wolfree_sed_in_place/ + +RUN \ +PATH="$HOME/.cargo/bin:$PATH" \ +cargo \ +-- \ +clippy \ +--manifest-path ./rust/wolfree_sed_in_place/Cargo.toml \ +-- \ +--warn clippy::all \ +--warn clippy::cargo \ +--warn clippy::nursery \ +--warn clippy::pedantic \ +--warn clippy::restriction \ +; + +RUN \ +PATH="$HOME/.cargo/bin:$PATH" \ +cargo run \ +--manifest-path ./rust/wolfree_sed_in_place/Cargo.toml \ +-- \ +; + +# Compile the Typescript files and output the JavaScript files. + +COPY \ +./typescript/ \ +./typescript/ + +RUN \ +npm \ +--prefix ./typescript/ \ +-- \ +exec \ +tsc \ +--project ./typescript/ \ +; + +# Preprocess MDX files. + +COPY \ +./docusaurus/ \ +./docusaurus/ + +# Run the Rust program to customize the Docusaurus pages. + +COPY \ +./rust/wolfree_patch_libredirect/ \ +./rust/wolfree_patch_libredirect/ + +RUN \ +PATH="$HOME/.cargo/bin:$PATH" \ +cargo \ +-- \ +clippy \ +--manifest-path ./rust/wolfree_patch_libredirect/Cargo.toml \ +-- \ +--warn clippy::all \ +--warn clippy::cargo \ +--warn clippy::nursery \ +--warn clippy::pedantic \ +--warn clippy::restriction \ +; + +RUN \ +PATH="$HOME/.cargo/bin:$PATH" \ +cargo run \ +--manifest-path ./rust/wolfree_patch_libredirect/Cargo.toml \ +-- \ +; + +# Create a webpage that lists all repositories and instructions for self-hosting web services. + +COPY \ +./README.md \ +./README.md + +RUN \ +cat \ +-- \ +./README.md \ +>> \ +./docusaurus/docs/source.mdx \ +; + +# Use Docusaurus to build the static website. + +RUN \ +npm \ +--prefix ./docusaurus/ \ +-- \ +run \ +build \ +; + +# Host the static content with a webserver. + +CMD \ +npm \ +--prefix ./docusaurus/ \ +-- \ +run \ +serve \ +--host localhost \ +--port 80 \ +; + +EXPOSE 80 + +# TODO: multi-stage +# https://docs.docker.com/build/building/multi-stage/ +# https://docs.docker.com/build/guide/multi-stage/ # Optimizing builds with cache management | Docker Documentation # https://docs.docker.com/build/cache/ # Because a change causes a rebuild for steps that follow, # try to make expensive steps appear near the beginning of the Dockerfile. # Steps that change often should appear near the end of the Dockerfile to avoid triggering rebuilds of layers that haven't changed. - -CMD \ - npm run \ - --prefix ./docusaurus/ \ - -- \ - serve \ - --port 80 \ - --host localhost \ - ; - -EXPOSE 80 diff --git a/LICENSE b/LICENSE index bf5868c..be3f7b2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,235 +1,661 @@ -GNU AFFERO GENERAL PUBLIC LICENSE -Version 3, 19 November 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 -Copyright (C) 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. Preamble -The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. + The 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 -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. -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. + 1. Source Code. -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. -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - -8. Termination. - -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - -9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - -11. Patents. - -A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - -In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - -A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - -12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - -13. Remote Network Interaction; Use with the GNU General Public License. - -Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. - -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. - -14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - -15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. + 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. - wolfree-dockerfile - Copyright (C) 2023 wolfree + + Copyright (C) - 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 . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . 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 . + 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 +. diff --git a/README.md b/README.md index 6d20724..ebca2c4 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,109 @@ -# Wolfree Dockerfile: Self-Host a Mirror Site of Wolfree Instances +# Self-hosting Wolfree instances with Docker Engine -This repository provides a Dockerfile and instructions for self-hosting a mirror site of Wolfree instances. +This guide provides a step-by-step procedure for self-hosting Wolfree. You will use Docker CLI to interact with the Docker daemon through a terminal emulator. Docker Engine automates the execution of the static site generator and running the web server. -Follow the instructions below to control Docker through terminal emulators. Docker will automatically execute the static site generator and run the web server. +## How to self-host Wolfree -## Prerequisites +To self-host a mirror site of Wolfree instances using Docker Engine, follow these steps: -Before getting started, make sure you have the following prerequisites installed on your computer: +1. Install a terminal emulator. If you are unfamiliar with terminal emulators, refer to the "[Command line crash course](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line)" for guidance. -1. **Terminal Emulator**: If you are unfamiliar with terminal emulators, you can learn how to use them in [Command Line Crash Course - Learn Web Development | MDN](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line). +2. Install [Git](https://git-scm.com/) and [Docker Engine](https://docs.docker.com/). -2. **Docker**: If you don't have Docker installed, download it from [docker.com](https://www.docker.com/). - -## Instructions - -Follow the steps below to self-host a mirror site of Wolfree instances: - -1. **Build the Docker Image**: - - Open your terminal emulator and execute one of the following commands to build the Docker image. Each command downloads the source code from a different web server. If one of the commands fails, try the next one in the list until the build succeeds. +3. Download the source code by executing one of the following commands. Each command will download the source code from a different web server. If one of the commands fails, try the next one until the download succeeds. ```shell - docker build -t wolfree https://try.gitea.io/wolfree/wolfree-dockerfile.git - docker build -t wolfree https://codeberg.org/wolfree/wolfree-dockerfile.git - docker build -t wolfree https://git.disroot.org/wolfree/wolfree-dockerfile.git - docker build -t wolfree https://next.forgejo.org/wolfree/wolfree-dockerfile.git - docker build -t wolfree https://git.kiwifarms.net/wolfree/wolfree-dockerfile.git - docker build -t wolfree http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree/wolfree-dockerfile.git + git clone https://gitea.com/wolfree/wolfree-dockerfile.git ``` -2. **Run the Docker Container**: - - Execute the following command in your terminal emulator to run the Docker container: - ```shell - docker run -p 80:80 wolfree + git clone https://try.gitea.io/wolfree/wolfree-dockerfile.git ``` -3. **Wait for Success Messages**: + ```shell + git clone https://codeberg.org/wolfree/wolfree-dockerfile.git + ``` - Wait until Docker outputs success messages similar to the following: + ```shell + git clone https://git.disroot.org/wolfree/wolfree-dockerfile.git + ``` + + ```shell + git clone https://next.forgejo.org/wolfree/wolfree-dockerfile.git + ``` + + ```shell + git clone https://git.kiwifarms.net/wolfree/wolfree-dockerfile.git + ``` + + ```shell + git clone http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree/wolfree-dockerfile.git + ``` + + Reference: [git clone](https://git-scm.com/docs/git-clone) + +4. Wait until Git outputs the resolving message similar to the following: + + ```shell + Receiving objects: 100% (100/100), 1.00 KiB | 1.00 KiB/s, done. + Resolving deltas: 100% (100/100), done. + ``` + +5. Build a Docker image by executing the following command: + + ```shell + docker build --progress=plain --tag wolfree wolfree-dockerfile + ``` + + This command will generate the website using a static site generator. + + Reference: [docker build](https://docs.docker.com/engine/reference/commandline/build/) + +6. Wait until Docker Engine outputs the exporting message similar to the following: + + ```shell + #35 exporting to image + #35 exporting layers done + #35 writing image sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef done + #35 naming to docker.io/library/wolfree done + #35 DONE 0.0s + ``` + +7. Run a Docker container by executing the following command: + + ```shell + docker run --publish 80:80 wolfree + ``` + + This command will host the website using a web server. + + Reference: [docker run](https://docs.docker.com/engine/reference/commandline/run/) + +8. Wait until the web server outputs the success message similar to the following: ```shell > docusaurus@0.0.0 serve - > docusaurus serve --port 80 --host localhost + > docusaurus serve --host localhost --port 80 [SUCCESS] Serving "build" directory at: http://localhost:80/ ``` -4. **Access Your Mirror Site**: +9. Access the mirror site locally on the same computer where the Docker container runs. Open a web browser and navigate to [http://localhost/](http://localhost/). - You can access your mirror site locally on the same computer where the Docker container runs. Open a web browser, navigate to [http://localhost/](http://localhost/) to access your mirror site, and enter math problems in the text box. +10. On the home page of the mirror site, enter a math problem in the text box and click the submit button. -Congratulations! You have successfully self-hosted a mirror site of Wolfree instances. +Congratulations! You have successfully self-hosted Wolfree. -## Local Development +## How to self-host Libredirect-compatible instances -If you wish to contribute to the development of Wolfree instances, follow these steps: +By default, Wolfree instances are paywall-bypassing and incompatible with Libredirect. To make them Libredirect-compatible and respect paywalls, follow these steps: -1. **Prepare the Development Environment**: +1. Install [Git](https://git-scm.com/) and [Docker Engine](https://docs.docker.com/). - Install Git and Docker on your local machine. You can download them from the following official websites: - - - [Git Official Website](https://git-scm.com/) - - [Docker Official Website](https://www.docker.com/) - -2. **Clone the Repository**: - - Run one of the following commands to clone the repository from one of the Gitea and Forgejo servers: +2. Download the source code with Git: ```shell + git clone https://gitea.com/wolfree/wolfree-dockerfile.git git clone https://try.gitea.io/wolfree/wolfree-dockerfile.git git clone https://codeberg.org/wolfree/wolfree-dockerfile.git git clone https://git.disroot.org/wolfree/wolfree-dockerfile.git @@ -78,60 +112,80 @@ If you wish to contribute to the development of Wolfree instances, follow these git clone http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree/wolfree-dockerfile.git ``` -3. **Run the Docker Container**: +3. Open the following file with a text editor: - After cloning the repository, navigate to the project directory: + `rust/wolfree_patch_libredirect/src/main.rs` + +4. Remove the line containing the `return` keyword. Save the change. The changed code should look like this: + + ```rust + // Remove the following line to make the instances Libredirect-compatible. + // Remove the previous line to make the instances Libredirect-compatible. + ``` + +5. Build the image and run the container with Docker Engine: ```shell - cd wolfree-dockerfile + docker build --progress=plain --tag wolfree wolfree-dockerfile + docker run --publish 80:80 wolfree ``` - Then, run the following commands to build the image and run the container: +6. Browse [http://localhost/](http://localhost/). Your instances should have become Libredirect-compatible and respect paywalls. If they remain paywall-bypassing and incompatible with Libredirect, please report the problem in the issue trackers of the repositories. + +## Troubleshooting dependency graphs + +To regenerate `docusaurus/package.json`, follow these steps: + +1. Install [NPM](https://docs.npmjs.com/). + +2. Initialize a Docusaurus project with the classic template and the TypeScript variant: ```shell - docker build --tag wolfree --progress=plain . - docker run --publish 80:80 --rm wolfree + npm --yes -- init docusaurus docusaurus classic . --typescript ``` -## Configuring Wolfree Instances for LibRedirect +3. Install MUI, a React component library: -To configure Wolfree instances to integrate with LibRedirect, follow these steps: - -1. Clone the Git repository and open the Dockerfile in a text editor. - -2. In the Dockerfile, remove the number sign (#) at the beginning of the `RUN` command. After removing the number sign, the `RUN` command should look like this: - - ```dockerfile - # Optionally, customize Wolfree instances to suit LibRedirect. - # https://github.com/libredirect/browser_extension/issues/425 - # To integrate Wolfree with LibRedirect, please delete the number sign at the beginning of the following line. - RUN PATH="$HOME/.cargo/bin:$PATH" cargo run --manifest-path ./rust/wolfree_libredirect_patch/Cargo.toml -- ; + ```shell + npm --prefix ./docusaurus/ -- install @mui/material @emotion/react @emotion/styled ``` -3. Build a Docker image and run a container. +## Glossary of file extensions -## Helpful Resources for New Developers +- `.md`/`.mdx`: [MarkDown XML](https://mdxjs.com/docs/) +- `.js`/`.jsx`: [JavaScript XML](https://react.dev/learn/writing-markup-with-jsx) +- `.ts`/`.tsx`: [TypeScript XML](https://www.typescriptlang.org/docs/handbook/jsx.html) +- `.rs`: [Rust Programming Language](https://www.rust-lang.org/learn) -If you're new to web development, here are some helpful websites and tools to get you started: +## Helpful resources for new developers -- [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Learn): MDN is a comprehensive resource for web developers. It offers guides, tutorials, and references for various web technologies. It's a great place to learn and explore web development concepts. +If you're new to web development, here are some websites and tools to get you started: -- [Web Dev](https://web.dev/learn/): Web Dev is a learning platform by Google that offers web development courses. It provides practical examples to help you improve your skills. +- [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Learn): A comprehensive resource for web developers, offering guides, tutorials, and references for various web technologies. -- [Chrome DevTools - Chrome Developers](https://developer.chrome.com/docs/devtools/): Chrome DevTools is a set of web developer tools built directly into the Google Chrome browser. It provides powerful features to inspect and debug web applications. +- [Chrome DevTools - Chrome Developers](https://developer.chrome.com/docs/devtools/): A set of web developer tools built directly into the Google Chrome browser, providing practical features to inspect and debug web applications. -- [TypeScript: JavaScript With Syntax For Types.](https://www.typescriptlang.org/): TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. +- [TypeScript: JavaScript With Syntax For Types.](https://www.typescriptlang.org/): A strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. -- [Writing Markup with JSX – React](https://react.dev/learn/writing-markup-with-jsx): JSX is a syntax extension for JavaScript that allows you to write HTML-like markup inside a JavaScript file. +- [Web.Dev](https://web.dev/learn/): A learning platform by Google that offers web development courses, providing practical examples to help you improve your skills. -- [Markdown for the component era | MDX](https://mdxjs.com/docs/): MDX is a format that combines markdown, JSX, JavaScript expressions, and import/export statements in JavaScript modules. +- [Desktop/PC - Privacy Guides](https://www.privacyguides.org/en/desktop/): A list of recommended Linux distributions with powerful terminal emulators pre-installed by default, empowering you with automating deployment, scaling, and management of containerized applications. -- [Desktop/PC - Privacy Guides](https://www.privacyguides.org/en/desktop/): Most Linux distributions have a terminal available by default. You can check out this guide for recommended distributions. +These resources will help you get started. Happy learning! -These resources will help you get started and enhance your skills as a web developer. Happy learning! +## UX writing tips + +- [Style guide: UX writing best practices](https://m3.material.io/foundations/content-design/style-guide/ux-writing-best-practices): Writing UI text that anyone can understand. + +- [UX writing: study guide](https://www.nngroup.com/articles/ux-writing-study-guide/): How to write and present information that aligns with users' needs and online reading behaviors. + +- [UX basics: study guide](https://www.nngroup.com/articles/ux-basics-study-guide/): The basics of user experience. + +- [Web UX: study guide](https://www.nngroup.com/articles/web-ux-study-guide/): How users interact with the web and how to design web user experiences. ## License -SPDX-License-Identifier: AGPL-3.0-or-later - -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. diff --git a/docusaurus/.dockerignore b/docusaurus/.dockerignore index 019391a..ecec047 100644 --- a/docusaurus/.dockerignore +++ b/docusaurus/.dockerignore @@ -1,7 +1,3 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -# This file is part of Wolfree. -# 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. - # Dependencies /node_modules @@ -24,3 +20,5 @@ yarn-debug.log* yarn-error.log* package-lock.json + +# SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/docusaurus/.gitignore b/docusaurus/.gitignore index 019391a..ecec047 100644 --- a/docusaurus/.gitignore +++ b/docusaurus/.gitignore @@ -1,7 +1,3 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -# This file is part of Wolfree. -# 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. - # Dependencies /node_modules @@ -24,3 +20,5 @@ yarn-debug.log* yarn-error.log* package-lock.json + +# SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/docusaurus/babel.config.js b/docusaurus/babel.config.js index e4fb2e2..6b4342b 100644 --- a/docusaurus/babel.config.js +++ b/docusaurus/babel.config.js @@ -1,9 +1,4 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ // @ts-check diff --git a/docusaurus/docs/acknowledgment.mdx b/docusaurus/docs/acknowledgment.mdx index e711148..3e10178 100644 --- a/docusaurus/docs/acknowledgment.mdx +++ b/docusaurus/docs/acknowledgment.mdx @@ -1,87 +1,94 @@ +--- +title: Acknowledgment +hide_title: true +--- + + + # Acknowledgment -We extend our heartfelt gratitude to the communities and projects that promote diversity, equity, and inclusion on the Internet. Their efforts have been instrumental in distributing our free and open-source software. +Wolfree developers extend heartfelt gratitude to the communities and projects that promote diversity, equity, and inclusion on the Internet. Their efforts have been instrumental in distributing free and open-source software for Wolfree developers. ## The Fediverse -Our community distributes source code on the Fediverse. +Wolfree developers distribute source code on the Fediverse. The Fediverse is a federation of numerous independently hosted servers that connect various social media platforms. It enables seamless interactions across compatible platforms, encompassing social media services for blogging, photo sharing, and video sharing. Discover the Fediverse with these resources: -- [**Fediverse Info**](https://fediverse.info/): A beginner-friendly introduction to the Fediverse. -- [**FediDB**](https://fedidb.org/): Visualized network statistics of the Fediverse. -- [**Mastodon Documentation**](https://docs.joinmastodon.org/): Comprehensive documentation for Mastodon, a self-hosted social networking service similar to Twitter. -- [**JoinFediverse Wiki**](https://joinfediverse.wiki/): An informative encyclopedia for the Fediverse. -- [**FediList**](http://demo.fedilist.com/): A simple website to explore instances on the Fediverse and facilitate discovery and connections. -- [**The Federation**](https://the-federation.info/): Indexed instances and statistics for the Fediverse. +- [Fediverse Info](https://fediverse.info/): A beginner-friendly introduction to the Fediverse. +- [Mastodon Documentation](https://docs.joinmastodon.org/): Comprehensive documentation for Mastodon, a self-hosted social networking service similar to Twitter. +- [JoinFediverse Wiki](https://joinfediverse.wiki/): An informative encyclopedia for the Fediverse. +- [FediDB](https://fedidb.org/): Visualized network statistics of the Fediverse. +- [FediList](http://demo.fedilist.com/): A simple website to explore instances on the Fediverse and facilitate discovery and connections. +- [The Federation](https://the-federation.info/): Indexed instances and statistics for the Fediverse. ## ForgeFed -Our community hosts source code on web services compatible with ForgeFed. +Wolfree developers host source code on web services compatible with ForgeFed. ForgeFed specifies an essential federation protocol for version control services, promoting collaboration and cooperation. Explore ForgeFed and related projects: -- [**ForgeFed**](https://forgefed.org/): The canonical website to learn more about the benefits and workings of ForgeFed. -- [**Gitea**](https://about.gitea.com/): A self-hosted Git service powering numerous instances across the Fediverse. -- [**Forgejo**](https://forgejo.org/): A soft fork of Gitea maintained by an inclusive community. +- [ForgeFed](https://forgefed.org/): The canonical website to learn more about the benefits and workings of ForgeFed. +- [Gitea](https://about.gitea.com/): A self-hosted Git service powering numerous instances across the Fediverse. +- [Forgejo](https://forgejo.org/): A soft fork of Gitea maintained by an inclusive community. ## Copyleft -Our community releases source code under a copyleft license. +Wolfree developers release source code under a copyleft license. Copyleft is a legal technique that safeguards the freedom to copy and modify derivative works. Discover the significance of copyleft through these resources: -- [**Blue Oak Council**](https://blueoakcouncil.org/primer): A comprehensive guide to open software licensing, making it accessible and understandable. -- [**What is Copyleft**](https://www.gnu.org/licenses/copyleft.html.en): An explanation of copyleft, reinforcing the importance of free software. -- [**Why Copyleft**](https://www.gnu.org/philosophy/why-copyleft.html.en): A showcase of the benefits of copyleft licenses to inspire more creators to embrace copyleft licensing. -- [**Why I Use the GPL and Not Cuck Licenses**](https://lukesmith.xyz/articles/why-i-use-the-gpl-and-not-cuck-licenses/): An elaboration on the advantages of copyleft. +- [Blue Oak Council](https://blueoakcouncil.org/primer): A comprehensive guide to open software licensing, making it accessible and understandable. +- [What is Copyleft](https://www.gnu.org/licenses/copyleft.html.en): An explanation of copyleft, reinforcing the importance of free software. +- [Why Copyleft](https://www.gnu.org/philosophy/why-copyleft.html.en): A showcase of the benefits of copyleft licenses to inspire more creators to embrace copyleft licensing. +- [Why I Use the GPL and Not Cuck Licenses](https://lukesmith.xyz/articles/why-i-use-the-gpl-and-not-cuck-licenses/): An elaboration on the advantages of copyleft. ## Anna's Archive Anna's Archive is a non-profit online shadow library metasearch engine that provides access to a curated collection of book resources managed by anonymous archivists. Anna's Archive keeps backups of popular shadow libraries like Sci-Hub, Library Genesis, and Z-Library. -- [**Anna's Archive - Wikipedia**](https://en.wikipedia.org/wiki/Anna's_Archive): A wiki page about Anna's Archive on the free encyclopedia. +- [Anna's Archive - Wikipedia](https://en.wikipedia.org/wiki/Anna's_Archive): A wiki page about Anna's Archive on the free encyclopedia. ## The Internet Archive -Our community archives source code on the Internet Archive. +Wolfree developers archive source code on the Internet Archive. The Internet Archive is a non-profit library that lends digital copies of books. Despite facing challenges related to copyright issues, they continue to fight for the rights of libraries to own and lend ebooks. Learn more about their ongoing efforts through these articles: -- [**Hachette v. Internet Archive**](https://www.eff.org/cases/hachette-v-Internet-archive) -- [**Fair Use Creep Is A Feature, Not a Bug**](https://www.eff.org/deeplinks/2023/01/fair-use-creep-feature-not-bug) -- [**The Fight Continues**](https://blog.archive.org/2023/03/25/the-fight-continues/) +- [Hachette v. Internet Archive](https://www.eff.org/cases/hachette-v-internet-archive) +- [Fair Use Creep Is A Feature, Not a Bug](https://www.eff.org/deeplinks/2023/01/fair-use-creep-feature-not-bug) +- [Internet Archive Seeks Summary Judgment in Federal Lawsuit Filed By Publishing Companies](https://blog.archive.org/2022/07/08/internet-archive-seeks-summary-judgment-in-federal-lawsuit-filed-by-publishing-companies/) +- [What the Hachette v. Internet Archive Decision Means for Our Library](https://blog.archive.org/2023/08/17/what-the-hachette-v-internet-archive-decision-means-for-our-library/) -## Censorship Circumvention +## Censorship circumvention Safely circumventing censorship is crucial in fostering diversity, equity, and inclusion on the Internet. Enhance your knowledge of safety measures for censorship circumvention with these resources: -- [**Privacy Guides**](https://privacyguides.org/): A user-friendly guide promoting data security and privacy. -- [**Mullvad Browser**](https://mullvad.net/en/browser): A privacy-focused web browser developed in collaboration between Mullvad VPN and the Tor Project. -- [**Tor Browser**](https://torproject.org/): A web browser capable of accessing the Tor network. -- [**Tails**](https://tails.net/): A Linux distribution aimed at preserving privacy and anonymity. -- [**Qubes OS**](https://qubes-os.org/): A Linux distribution that provides security through isolation. -- [**The Hitchhiker's Guide to Online Anonymity**](https://anonymousplanet.org/): An in-depth guide detailing online anonymity methods. +- [Privacy Guides](https://privacyguides.org/): A user-friendly guide promoting data security and privacy. +- [Mullvad Browser](https://mullvad.net/en/browser): A privacy-focused web browser developed in collaboration between Mullvad VPN and the Tor Project. +- [Tor Browser](https://torproject.org/): A web browser capable of accessing the Tor network. +- [Tails](https://tails.net/): A Linux distribution aimed at preserving privacy and anonymity. +- [Qubes OS](https://qubes-os.org/): A Linux distribution that provides security through isolation. +- [The Hitchhiker's Guide to Online Anonymity](https://anonymousplanet.org/): An in-depth guide detailing online anonymity methods. -## Net Neutrality +## Net neutrality -Upholding net neutrality is pivotal in nurturing diversity, equity, and inclusion on the Internet. It ensures that broadband Internet access services do not impair or degrade lawful Internet traffic based on content, application, or service, subject to reasonable network management. +Upholding net neutrality is pivotal in nurturing diversity, equity, and inclusion on the Internet. Net neutrality ensures that broadband Internet access services do not impair or degrade lawful Internet traffic based on content, application, or service, subject to reasonable network management. Learn more about net neutrality and its importance through these articles: -- [**We Need to Talk About Infrastructure**](https://www.eff.org/deeplinks/2022/12/we-need-talk-about-infrastructure): The importance of content-neutral essential Internet infrastructure and the challenges in defining what falls under this category. -- [**The Internet Is Not Facebook: Why Infrastructure Providers Should Stay Out of Content Policing**](https://www.eff.org/deeplinks/2022/10/Internet-not-facebook-why-infrastructure-providers-should-stay-out-content): The content policing of infrastructure providers due to complex challenges and potential harm to marginalized communities. -- [**International Coalition of Rights Groups Call on Internet Infrastructure Providers to Avoid Content Policing**](https://www.eff.org/press/releases/international-coalition-rights-groups-call-Internet-infrastructure-providers-avoid): Urging Internet infrastructure providers to avoid content policing, citing harm to users and human rights risks. -- [**Where the Sidewalk Ends: The Death of the Internet**](https://madattheInternet.substack.com/p/where-the-sidewalk-ends-the-death): The fragmenting of the Internet as national borders and government regulations stifle its openness and connectivity. - - +- [We Need to Talk About Infrastructure](https://www.eff.org/deeplinks/2022/12/we-need-talk-about-infrastructure): The importance of content-neutral essential Internet infrastructure and the challenges in defining what falls under this category. +- [The Internet Is Not Facebook: Why Infrastructure Providers Should Stay Out of Content Policing](https://www.eff.org/deeplinks/2022/10/Internet-not-facebook-why-infrastructure-providers-should-stay-out-content): The content policing of infrastructure providers due to complex challenges and potential harm to marginalized communities. +- [International Coalition of Rights Groups Call on Internet Infrastructure Providers to Avoid Content Policing](https://www.eff.org/press/releases/international-coalition-rights-groups-call-Internet-infrastructure-providers-avoid): Urging Internet infrastructure providers to avoid content policing, citing harm to users and human rights risks. +- [ISPs Should Not Police Online Speech - No Matter How Awful It Is.](https://www.eff.org/deeplinks/2023/08/isps-should-not-police-online-speech-no-matter-how-awful-it): Why ISPs should not be responsible for policing online speech, regardless of how offensive or harmful it may be. How endorsing censorship by ISPs sets a dangerous precedent against marginalized speakers and forums. +- [Where the Sidewalk Ends: The Death of the Internet](https://madattheInternet.substack.com/p/where-the-sidewalk-ends-the-death): The fragmenting of the Internet as national borders and government regulations stifle its openness and connectivity. diff --git a/docusaurus/docs/community.mdx b/docusaurus/docs/community.mdx index aebf053..4d848b9 100644 --- a/docusaurus/docs/community.mdx +++ b/docusaurus/docs/community.mdx @@ -1,21 +1,17 @@ -# Community +--- +title: Community +hide_title: true +--- -Welcome to our diverse and inclusive community! We encourage open discussions and warmly invite you to join the conversations. 🎉 + -:::note +# Wolfree community -Our community thrives on the Fediverse, a decentralized social network that encompasses various platforms such as: +Welcome to the Wolfree community, a diverse and inclusive space where we encourage open discussions and invite you to join the conversations. 🎉 -- [Mastodon](https://joinmastodon.org/) -- [Pleroma](https://pleroma.social/) -- [Gitea](https://about.gitea.com/) -- [Forgejo](https://forgejo.org/) +## Mastodon / Pleroma -::: - -## Mastodon and Pleroma - -We would love to hear your thoughts! Express yourself freely on Mastodon and Pleroma. +We would love to hear your thoughts. Express yourself freely on Mastodon and Pleroma. 1. https://poa.st/@wolfree 2. https://sb.bae.st/@wolfree @@ -23,19 +19,25 @@ We would love to hear your thoughts! Express yourself freely on Mastodon and Ple 4. https://spinster.xyz/@wolfree 5. https://freespeechextremist.com/wolfree -## Gitea and Forgejo +## Gitea / Forgejo -Feel free to contribute and [report issues](https://docs.github.com/en/issues) on Gitea and Forgejo. +Feel free to [report issues](https://docs.github.com/en/issues) on Gitea and Forgejo. -1. https://try.gitea.io/wolfree/issues/issues -2. https://codeberg.org/wolfree/issues/issues -3. https://git.disroot.org/wolfree/issues/issues -4. https://next.forgejo.org/wolfree/issues/issues -5. https://git.kiwifarms.net/wolfree/issues/issues -6. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree/issues/issues +1. https://gitea.com/wolfree/issues/issues +2. https://try.gitea.io/wolfree/issues/issues +3. https://codeberg.org/wolfree/issues/issues +4. https://git.disroot.org/wolfree/issues/issues +5. https://next.forgejo.org/wolfree/issues/issues +6. https://git.kiwifarms.net/wolfree/issues/issues +7. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree/issues/issues -## Diversity, Equity, and Inclusion +## Embracing diversity, equity, and inclusion -At our core, we strive to cultivate an environment that celebrates diversity, promotes equity, and upholds inclusion on the Internet. ❤️ We value and respect every voice. Let's connect and build a healthy, supportive community! +The Wolfree community thrives on the Fediverse, a decentralized social network that encompasses various platforms such as: - +- [Mastodon](https://joinmastodon.org/) +- [Pleroma](https://pleroma.social/) +- [Gitea](https://about.gitea.com/) +- [Forgejo](https://forgejo.org/) + +Wolfree developers strive to cultivate an environment that celebrates diversity, promotes equity, and upholds inclusion on the Internet. Let's connect and build a healthy, supportive community. ❤️ diff --git a/docusaurus/docs/dmca.mdx b/docusaurus/docs/dmca.mdx deleted file mode 100644 index 4bffc1e..0000000 --- a/docusaurus/docs/dmca.mdx +++ /dev/null @@ -1,12 +0,0 @@ -# DMCA takedown - -Below are some of the DMCA takedown notices issued by Wolfram Alpha LLC: - -1. [2021-08-11-wolfram.md](https://github.com/github/dmca/blob/master/2021/08/2021-08-11-wolfram.md) -2. [2021-08-16-wolfram.md](https://github.com/github/dmca/blob/master/2021/08/2021-08-16-wolfram.md) -3. [2022-09-22-wolfram.md](https://github.com/github/dmca/blob/master/2022/09/2022-09-22-wolfram.md) - -If you believe someone is using your copyrighted content unauthorizedly on GitHub or npm.js, please fill out the [Copyright claims form](https://github.com/contact/dmca) to submit a DMCA takedown notice to request that the content be changed or removed. -Before you begin, please read [GitHub's Copyright - DMCA Takedown Policy](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy). - -As with all legal matters, it is always best to consult a professional about your questions or situation. We strongly encourage you to do so before taking action that might impact your rights. This guide isn't legal advice. diff --git a/docusaurus/docs/index.mdx b/docusaurus/docs/index.mdx index 487c0b8..c6c6673 100644 --- a/docusaurus/docs/index.mdx +++ b/docusaurus/docs/index.mdx @@ -1,97 +1,90 @@ --- -slug: / title: Home page +hide_title: true +slug: / --- -#
Free Wolfram Alpha Step-by-Step Solutions + + +import FormCTA from "../src/components/FormCTA.tsx"; +import submitMathInputForm from "../src/functions/submitMathInputForm.ts"; +import InputMathProblems from "../src/components/InputMathProblems.tsx"; +import SubmitButton from "../src/components/SubmitButton.tsx"; +import ButtonLink from "../src/components/ButtonLink.tsx"; + +# Free Wolfram Alpha step-by-step solutions Get free access to **step-by-step** solutions. Unlock the power of **Wolfram|Alpha Pro** for free. Wolfree is **free** and **open-source** software. Thousands of learners use Wolfree to bypass paywalls. -import FormCTA from "../src/components/FormCTA.tsx"; -import FormQuickStart from "../src/components/FormQuickStart.tsx"; -import ButtonLink from "../src/components/ButtonLink.tsx"; + - +## How to get Wolfram Alpha step-by-step solutions for free -
-
+
-## How To Use Wolfree +1. Type your math problem in the text box. - + -
-
+2. Click the "Show Steps" button. -## Mirror Sites + -Wolfree operates through a network of mirror sites to ensure uninterrupted access to step-by-step solutions. If you can't access this web page, visit one of our [mirror sites](/mirror) to continue your learning journey. +3. Explore the step-by-step solution provided. 🎉 -

- -

+ -
-
+## Mirror sites -## Source Code +If you can't access this web page, visit one of the [mirror sites](/mirror) to continue your learning journey. Wolfree operates through a network of mirror sites to ensure uninterrupted access to step-by-step solutions. -Wolfree is **free** and **open-source** software. Our inclusive community welcomes individuals from diverse backgrounds to collaborate on our [source code](/source). Let's foster diversity, equity, and inclusion on the Internet. ❤️ + -

- -

+## Source code -
-
+Wolfree is **free** and **open-source** software built on transparency and openness, welcoming individuals from diverse backgrounds to collaborate on [source code](/source). Let's foster diversity, equity, and inclusion on the Internet. ❤️ -## How Wolfree Works + + +## How Wolfree works Here's a simplified breakdown of how Wolfree works: 1. Programmers distribute the Dockerfile on Fediverse, including platforms compatible with ForgeFed, like Forgejo and Gitea. -2. Website operators install and run Docker. -3. Docker automatically downloads the Dockerfile from Fediverse and builds a Docker image. +2. Website operators install and run Docker Engine. +3. Docker Engine automatically downloads the Dockerfile from Fediverse and builds a Docker image. 4. Web hosting service providers deploy Wolfree mirror sites. 5. Internet service providers allow your web browser to connect to Wolfree mirror sites. -6. You gain **free** access to the computational capabilities of **Wolfram|Alpha Pro**. 🎉 +6. You gain access to the computational capabilities of **Wolfram|Alpha Pro**. 🎉 Wolfree leverages a [shadow library](https://en.wikipedia.org/wiki/Shadow_library) that shares **step-by-step** solutions, ensuring you have free access to the learning resources you need. -
-
- -## Testimonials - -Here's what our community has to say about Wolfree: +## Trusted by thousands of learners > "Wolfree has been a transformative addition to my academic journey. The **step-by-step** solutions powered by **Wolfram|Alpha Pro** have profoundly enriched my understanding of complex math concepts. Thanks to Wolfree, my grades have seen remarkable improvement. I now approach math confidently." - Olivia (they/them), Student. -> "As a math teacher, I wholeheartedly endorse Wolfree for my students. The **step-by-step** solutions promote genuine comprehension of math concepts. By incorporating the computational capabilities of **Wolfram|Alpha Pro** into my classroom, Wolfree has significantly elevated my students' learning experiences." - Mx. Smith (they/them), Educator. +> "As a math teacher, I wholeheartedly endorse Wolfree for my students. The **step-by-step** solutions promote genuine comprehension of math concepts. By incorporating the computational capabilities of **Wolfram|Alpha Pro** into my classroom, Wolfree has measurably enhanced my students' learning outcomes." - Mx. Smith, Educator. -
-
+## What you'll get with Wolfree -## What You'll Get with Wolfree +By using Wolfree, you'll get **free** access to the full power of **Wolfram|Alpha Pro**, including: -By using Wolfree, you'll get **free** access to the full potential of **Wolfram|Alpha Pro**, including: - -- Get answers and hints for your math homework problems. -- Use **step-by-step** calculators for chemistry, calculus, algebra, trigonometry, and equation solving. -- Develop a deeper understanding of your homework with detailed steps and hints guiding you from problems to answers. +- **Step-by-step** calculators for calculus, differential equations, and linear algebra. +- Immediate feedback and guidance hints for your math homework problems. +- Detailed, comprehensible steps guiding you from problems to answers. Unleash the full potential of your learning with Wolfree and elevate your studies to a whole new level. 🚀 -It's **free**! Type your math problem and click "**Show Steps**" now! +It's **free**. Type your math problem and click "**Show Steps**" now. - - -
-
+ + + @@ -105,5 +98,3 @@ It's **free**! Type your math problem and click "**Show Steps**" now! My pronouns are: they/them • Pronouns.page https://en.pronouns.page/they --> - - diff --git a/docusaurus/docs/mirror.mdx b/docusaurus/docs/mirror.mdx index 8af5f77..1bf5d88 100644 --- a/docusaurus/docs/mirror.mdx +++ b/docusaurus/docs/mirror.mdx @@ -1,10 +1,13 @@ --- title: Mirror site +hide_title: true --- -# Mirror Sites: Alternative Instances + -Wolfree operates through a network of mirror sites to ensure uninterrupted access to step-by-step solutions. If you can't access this web page, visit one of our mirror sites to continue your learning journey. +# Mirror sites: alternative instances + +Wolfree operates through a network of mirror sites. If you can't access this web page, visit the mirror sites. 1. https://wolfree.chickenkiller.com/ 2. https://wolfree.crabdance.com/ @@ -38,13 +41,16 @@ Wolfree operates through a network of mirror sites to ensure uninterrupted acces 30. https://wolfreealpha.twilightparadox.com/ 31. https://wolfreealpha.uk.to/ 32. https://wolfreealpha.us.to/ +33. https://wf.opnxng.com/ + +## Bookmarking all mirror sites -:::note Please note that Internet Service Providers may block access to this website without prior notice. Therefore, we recommend bookmarking the mirror sites in advance to ensure easier access. -::: -If you cannot access any of the mirror sites, we recommend installing the [Tor Browser](https://www.torproject.org/) to bypass censorship. +## Fetching JSON list of instances If you have programming knowledge, you can deserialize the [instances.json](pathname://../instances.json) file. - +## Accessing Wolfree in censored countries + +If you cannot access any of the mirror sites, we recommend installing the [Tor Browser](https://www.torproject.org/) to bypass censorship. diff --git a/docusaurus/docs/source.mdx b/docusaurus/docs/source.mdx index e9d0192..8314422 100644 --- a/docusaurus/docs/source.mdx +++ b/docusaurus/docs/source.mdx @@ -1,32 +1,37 @@ --- title: Source code +hide_title: true --- -# Access and Download the Source Code of Wolfree + -Wolfree is free and open-source software. You can access and download the source code from the following websites: +# Accessing the source code of Wolfree -1. https://try.gitea.io/wolfree -2. https://codeberg.org/wolfree -3. https://git.disroot.org/wolfree -4. https://next.forgejo.org/wolfree -5. https://git.kiwifarms.net/wolfree -6. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree +Wolfree is **free** and **open-source** software. You can access and download the source code from the following websites: -## The Unreliability of GitHub +1. https://gitea.com/wolfree +2. https://try.gitea.io/wolfree +3. https://codeberg.org/wolfree +4. https://git.disroot.org/wolfree +5. https://next.forgejo.org/wolfree +6. https://git.kiwifarms.net/wolfree +7. http://it7otdanqu7ktntxzm427cba6i53w6wlanlh23v5i3siqmos47pzhvyd.onion/wolfree + +## The unreliability of GitHub We do not recommend pushing the source code to GitHub. Their [DMCA Takedown Policy](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy) makes storing the source code on GitHub unreliable. -## The High Availability of ForgeFed +## The high availability of ForgeFed For a more reliable and collaborative development experience, we recommend using [Gitea](https://about.gitea.com/) and [Forgejo](https://forgejo.org/). These platforms support [ActivityPub](https://www.w3.org/TR/activitypub/) and [ForgeFed](https://forgefed.org/) protocols, enabling seamless collaboration and communication among developers. -:::note -If you cannot access Gitea or Forgejo, we recommend installing the [Tor Browser](https://www.torproject.org/). The Tor Browser is a reputable tool designed to bypass censorship. -::: +## Accessing the source code in censored countries -## License +If you cannot access Gitea or Forgejo, we recommend installing the [Tor Browser](https://www.torproject.org/) to bypass censorship. -SPDX-License-Identifier: AGPL-3.0-or-later +## Submitting a DMCA takedown notice -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. +If you believe someone is using your copyrighted content unauthorizedly on GitHub or npm.js, please fill out the [Copyright claims form](https://github.com/contact/dmca) to submit a DMCA takedown notice to request that the content be changed or removed. +Before you begin, please read [GitHub's Copyright - DMCA Takedown Policy](https://docs.github.com/en/site-policy/content-removal-policies/dmca-takedown-policy). + +As with all legal matters, it is always best to consult a professional about your questions or situation. We strongly encourage you to do so before taking action that might impact your rights. This guide isn't legal advice. diff --git a/docusaurus/docusaurus.config.js b/docusaurus/docusaurus.config.js index 1cb19b7..0c1833c 100644 --- a/docusaurus/docusaurus.config.js +++ b/docusaurus/docusaurus.config.js @@ -1,15 +1,17 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ // @ts-check +/** @type { { config: { libredirect: false } } } */ +const wolfree = require("./wolfree.config.js"); +const lightCodeTheme = require("prism-react-renderer/themes/github"); +const darkCodeTheme = require("prism-react-renderer/themes/dracula"); + /** @type {import('@docusaurus/types').Config} */ module.exports = { - title: "Wolfree - Free WolframAlpha step-by-step solution", + title: wolfree.config.libredirect + ? "Paywall-respecting instances: Wolfree instances that do not bypass paywalls" + : "Wolfree - Free WolframAlpha step-by-step solution", url: "http://example.com", baseUrl: "/", favicon: "data:,", @@ -19,7 +21,7 @@ module.exports = { /** @type {import('@docusaurus/preset-classic').Options} */ { docs: { - sidebarPath: require.resolve("./sidebars.js"), + sidebarPath: require.resolve("./sidebars.config.js"), routeBasePath: "/", breadcrumbs: false, }, @@ -46,7 +48,9 @@ module.exports = { items: [ { to: "/", - label: "Wolfree", + label: wolfree.config.libredirect + ? "Paywall-respecting instances" + : "Wolfree", position: "left", }, { @@ -55,16 +59,6 @@ module.exports = { position: "right", target: "_self", }, - { - to: "/mirror", - label: "Mirror", - position: "right", - }, - { - to: "/source", - label: "Source", - position: "right", - }, ], }, footer: { @@ -92,11 +86,12 @@ module.exports = { label: "Acknowledgment", href: "/acknowledgment", }, - { - label: "DMCA takedown", - href: "/dmca", - }, ], + copyright: "SPDX-License-Identifier: AGPL-3.0-or-later", + }, + prism: { + theme: lightCodeTheme, + darkTheme: darkCodeTheme, }, }, }; diff --git a/docusaurus/package.json b/docusaurus/package.json index 2e58a5e..a27490d 100644 --- a/docusaurus/package.json +++ b/docusaurus/package.json @@ -15,21 +15,19 @@ "typecheck": "tsc" }, "dependencies": { - "@docusaurus/core": "2.4.1", - "@docusaurus/preset-classic": "2.4.1", + "@docusaurus/core": "2.4.3", + "@docusaurus/preset-classic": "2.4.3", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mdx-js/react": "^1.6.22", - "@mui/material": "^5.14.1", - "@types/dompurify": "^3.0.2", - "@types/jquery": "^3.5.16", + "@mui/material": "^5.14.10", "clsx": "^1.2.1", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { - "@docusaurus/module-type-aliases": "2.4.1", + "@docusaurus/module-type-aliases": "2.4.3", "@tsconfig/docusaurus": "^1.0.5", "typescript": "^4.7.4" }, diff --git a/docusaurus/sidebars.config.js b/docusaurus/sidebars.config.js new file mode 100644 index 0000000..7d4711a --- /dev/null +++ b/docusaurus/sidebars.config.js @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +// @ts-check + +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +module.exports = { + sidebarId: [ + "index", + { + type: "html", + value: 'Input math problems', + className: "menu__list-item", + }, + "mirror", + "source", + "community", + "acknowledgment", + ], +}; diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js deleted file mode 100644 index 3a62009..0000000 --- a/docusaurus/sidebars.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ - -// @ts-check - -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -module.exports = { - sidebarId: [ - "index", - { - type: "html", - value: 'Input math problems', - className: "menu__list-item", - }, - "mirror", - "source", - { - type: "category", - label: "Detail", - collapsible: true, - collapsed: true, - items: ["community", "acknowledgment", "dmca"], - }, - ], -}; diff --git a/docusaurus/src/components/ButtonLink.tsx b/docusaurus/src/components/ButtonLink.tsx index 12fc559..5fd69e1 100644 --- a/docusaurus/src/components/ButtonLink.tsx +++ b/docusaurus/src/components/ButtonLink.tsx @@ -1,25 +1,26 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ -import React from "react"; +import Button from "@mui/material/Button"; import Link from "@docusaurus/Link"; -import { Button } from "@mui/material"; +import React from "react"; -const ButtonLink = ({ to = String(), text = String() }) => ( - - - +export default ({ + to = "", + text = "", +}: Readonly<{ + to: string; + text: string; +}>): React.JSX.Element => ( +

+ + + +

); -export default ButtonLink; - // Typography - MUI System // https://mui.com/system/typography/ diff --git a/docusaurus/src/components/FormCTA.tsx b/docusaurus/src/components/FormCTA.tsx index 1b5a81e..0912dec 100644 --- a/docusaurus/src/components/FormCTA.tsx +++ b/docusaurus/src/components/FormCTA.tsx @@ -1,23 +1,20 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ -import React from "react"; -import submitMathInputForm from "../functions/submitMathInputForm"; import InputMathProblems from "./InputMathProblems"; -import ShowStepButton from "./ShowStepButton"; +import React from "react"; +import SubmitButton from "./SubmitButton"; +import submitMathInputForm from "../functions/submitMathInputForm"; -const FormCTA = ({ autoFocus = Boolean() }) => ( +export default ({ + autoFocus = false, + submitText = "", +}: Readonly<{ + autoFocus: boolean; + submitText: string; +}>): React.JSX.Element => (
+

- -

- -

+ ); - -export default FormCTA; diff --git a/docusaurus/src/components/FormQuickStart.tsx b/docusaurus/src/components/FormQuickStart.tsx deleted file mode 100644 index 60589fb..0000000 --- a/docusaurus/src/components/FormQuickStart.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ - -import React from "react"; -import submitMathInputForm from "../functions/submitMathInputForm"; -import InputMathProblems from "./InputMathProblems"; -import ShowStepButton from "./ShowStepButton"; - -const FormQuickStart = () => ( -
-
    -
  1. -

    Type your math problem in the text box.

    - -
  2. -
  3. -

    - Click the "Show Steps" button. -

    - -
  4. -
  5. -

    - Explore the step-by-step solution provided. 🎉 -

    -
  6. -
-
-); - -export default FormQuickStart; diff --git a/docusaurus/src/components/InputMathProblems.tsx b/docusaurus/src/components/InputMathProblems.tsx index c7b49ce..27313d2 100644 --- a/docusaurus/src/components/InputMathProblems.tsx +++ b/docusaurus/src/components/InputMathProblems.tsx @@ -1,19 +1,15 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ import React from "react"; import TextField from "@mui/material/TextField"; -// TextField API - Material UI -// https://mui.com/material-ui/api/text-field/ -const InputMathProblems = ({ - autoFocus = Boolean(), - defaultValue = String(), -}) => ( +export default ({ + autoFocus = false, + defaultValue = "", +}: Readonly<{ + autoFocus: boolean; + defaultValue: string; +}>): React.JSX.Element => ( ); -export default InputMathProblems; +// TextField API - Material UI +// https://mui.com/material-ui/api/text-field/ + +// : The Input (Form Input) element - HTML: HyperText Markup Language | MDN +// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input diff --git a/docusaurus/src/components/ShowStepButton.tsx b/docusaurus/src/components/ShowStepButton.tsx deleted file mode 100644 index 3ae7ba3..0000000 --- a/docusaurus/src/components/ShowStepButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ - -import React from "react"; -import { Button } from "@mui/material"; - -const ShowStepButton = () => ( - -); - -export default ShowStepButton; - -// Typography - MUI System -// https://mui.com/system/typography/ diff --git a/docusaurus/src/components/SubmitButton.tsx b/docusaurus/src/components/SubmitButton.tsx new file mode 100644 index 0000000..e9b1c72 --- /dev/null +++ b/docusaurus/src/components/SubmitButton.tsx @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +import Button from "@mui/material/Button"; +import React from "react"; + +export default ({ + text = "", +}: Readonly<{ text: string }>): React.JSX.Element => ( +

+ +

+); + +// Typography - MUI System +// https://mui.com/system/typography/ diff --git a/docusaurus/src/css/custom.css b/docusaurus/src/css/custom.css index a027863..ce621e1 100644 --- a/docusaurus/src/css/custom.css +++ b/docusaurus/src/css/custom.css @@ -1,15 +1,51 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +.markdown { + --ifm-h2-vertical-rhythm-top: 4; +} :root { --ifm-menu-link-padding-vertical: calc(var(--ifm-menu-link-padding-horizontal) * 1.5); + --ifm-toc-padding-vertical: calc(var(--ifm-toc-padding-horizontal) * 2); --ifm-color-primary: blue; - --ifm-color-gray-900: var(--ifm-color-gray-900); - --ifm-color-secondary-contrast-foreground: var(--ifm-color-gray-900); + --ifm-color-gray-700: black; + --ifm-color-gray-800: black; + --ifm-color-gray-900: black; + --ifm-color-secondary-contrast-foreground: black; + --ifm-color-content-secondary: black; +} + +.markdown>h1 { + /* Style the

on http://localhost/source */ + margin-top: calc(var(--ifm-h2-vertical-rhythm-top) * var(--ifm-leading)); +} + +:root { + --wolfree-heading-zoom: 0.75; +} + +h1 { + font-size: calc(max(1rem, var(--ifm-h1-font-size) * var(--wolfree-heading-zoom))); +} + +h2 { + font-size: calc(max(1rem, var(--ifm-h2-font-size) * var(--wolfree-heading-zoom))); +} + +h3 { + font-size: calc(max(1rem, var(--ifm-h3-font-size) * var(--wolfree-heading-zoom))); +} + +h4 { + font-size: calc(max(1rem, var(--ifm-h4-font-size) * var(--wolfree-heading-zoom))); +} + +h5 { + font-size: calc(max(1rem, var(--ifm-h5-font-size) * var(--wolfree-heading-zoom))); +} + +h6 { + font-size: calc(max(1rem, var(--ifm-h6-font-size) * var(--wolfree-heading-zoom))); } .footer__link-item { diff --git a/docusaurus/src/functions/submitMathInputForm.ts b/docusaurus/src/functions/submitMathInputForm.ts new file mode 100644 index 0000000..cf3294b --- /dev/null +++ b/docusaurus/src/functions/submitMathInputForm.ts @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +import React from "react"; + +export default (event: React.FormEvent): void => { + event.preventDefault(); + const htmlFormElement = event.currentTarget; + const formData = new FormData(htmlFormElement); + const i = formData.get("i"); + + const url = new URL("/input/", window.location.href); + + if (typeof i === "string") { + url.searchParams.set("i", i); + } else if (i instanceof File) { + console.warn({ i }); + } else { + const typescriptExhaustivenessCheck: never = i; + console.warn({ typescriptExhaustivenessCheck }); + } + + window.location.assign(url); +}; diff --git a/docusaurus/src/functions/submitMathInputForm.tsx b/docusaurus/src/functions/submitMathInputForm.tsx deleted file mode 100644 index a90894e..0000000 --- a/docusaurus/src/functions/submitMathInputForm.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ - -import { FormEventHandler } from "react"; - -const submitMathInputForm: FormEventHandler = (event) => { - event.preventDefault(); - const form = event.currentTarget; - const formData = new FormData(form); - - const i = formData.get("i") || ""; - if (i instanceof File) return; - - const url = new URL("/input/", window.location.href); - url.searchParams.set("i", i); - window.location.href = url.href; -}; - -export default submitMathInputForm; diff --git a/docusaurus/src/functions/typescriptNever.ts b/docusaurus/src/functions/typescriptNever.ts new file mode 100644 index 0000000..42becd5 --- /dev/null +++ b/docusaurus/src/functions/typescriptNever.ts @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ + +export default (typescriptNeverValue: never): never => { + console.warn({ typescriptNeverValue }); + + return typescriptNeverValue; +}; + +// How do I check that a switch block is exhaustive in TypeScript? - Stack Overflow +// https://stackoverflow.com/questions/39419170/how-do-i-check-that-a-switch-block-is-exhaustive-in-typescript diff --git a/docusaurus/src/theme/Footer/InputPreloader.tsx b/docusaurus/src/theme/Footer/InputPreloader.tsx index 325f8a7..2ba2e19 100644 --- a/docusaurus/src/theme/Footer/InputPreloader.tsx +++ b/docusaurus/src/theme/Footer/InputPreloader.tsx @@ -1,35 +1,31 @@ -/** - * @license - * SPDX-License-Identifier: AGPL-3.0-or-later - * This file is part of Wolfree. - * 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. - */ +/* SPDX-License-Identifier: AGPL-3.0-or-later */ -import React, { useEffect, useState } from "react"; +import React from "react"; -const InputPreloader = () => { - const [showIframe, setShowIframe] = useState(false); +export default (): React.JSX.Element => { + const [insertIframe, setInsertIframe] = React.useState(false); - useEffect(() => { - const handleIframeLoad = () => { - // Show the iframe after a 3000ms delay - const timerId = setTimeout(() => setShowIframe(true), 3000); - // Cleanup the timer when the component unmounts - return () => clearTimeout(timerId); + React.useEffect((): (() => void) => { + const handleIframeLoad = (): (() => void) => { + // Insert the iframe after a 3000ms delay. + const timerId = setTimeout((): void => setInsertIframe(true), 3000); + + // Cleanup the timer when the component unmounts. + return (): void => clearTimeout(timerId); }; - window.scroll(0, 0); - window.addEventListener("load", handleIframeLoad); - // Cleanup the event listener when the component unmounts - return () => window.removeEventListener("load", handleIframeLoad); - }, []); // Empty dependency array means the effect runs only once after initial render + window.scroll(0, 0); + + // Cleanup the event listener when the component unmounts. + return (): void => window.removeEventListener("load", handleIframeLoad); + }, []); // Empty dependency array means the effect runs only once after initial render. return ( <> {/* Use a descriptive title for accessibility */} - {showIframe && ( + {insertIframe && (