commit e82f35da2a24ea6379947aadbc6837f15fd6f446 Author: Dominic Grimm Date: Sun May 21 18:58:10 2023 +0200 Init diff --git a/.example.env b/.example.env new file mode 100644 index 0000000..8905e12 --- /dev/null +++ b/.example.env @@ -0,0 +1,16 @@ +POSTGRES_USER="gitea_pages" +POSTGRES_PASSWORD="gitea_pages" + +RABBITMQ_USER="gitea_pages" +RABBITMQ_PASSWORD="gitea_pages" + +PAGES_USER="MY_USER" +PAGES_PASSWORD="MY_PASSWORD" +PAGES_GITEA_URL="MY_GITEA_INSTANCE.NET" +PAGES_GITEA_API_TOKEN="MY_API_TOKEN" +PAGES_GITEA_SECRET="MY_WEBHOOK_SECRET" +PAGES_GITEA_PULL_URL="https://MY_GITEA_INSTANCE.NET" +PAGES_GITEA_PULL_BRANCH="pages" +PAGES_NGINX_CONFIG_DIR="/opt/nginx-config" +PAGES_REPOS_DIR="/data/repos" +PAGES_DOMAIN="MY_GITEA_PAGES.NET" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 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. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd8d757 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# gitea_pages + +_Containerized web application for managing public pages of Git repositories within a single Gitea instance._ diff --git a/avatar.xcf b/avatar.xcf new file mode 100644 index 0000000..11568fc Binary files /dev/null and b/avatar.xcf differ diff --git a/backend/.cargo/config.toml b/backend/.cargo/config.toml new file mode 100644 index 0000000..0c38d57 --- /dev/null +++ b/backend/.cargo/config.toml @@ -0,0 +1,3 @@ +[target.x86_64-unknown-linux-gnu] +linker = "clang" +rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] diff --git a/backend/.dockerignore b/backend/.dockerignore new file mode 100644 index 0000000..53821be --- /dev/null +++ b/backend/.dockerignore @@ -0,0 +1,10 @@ +/docs/ +/lib/ +/bin/ +/.shards/ +*.dwarf +*.env +/examples/ +Dockerfile +.dockerignore +README.md diff --git a/backend/.editorconfig b/backend/.editorconfig new file mode 100644 index 0000000..f28b0dc --- /dev/null +++ b/backend/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*.rs] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.sql] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1 @@ +/target diff --git a/backend/.sqlfluff b/backend/.sqlfluff new file mode 100644 index 0000000..0b7e2fa --- /dev/null +++ b/backend/.sqlfluff @@ -0,0 +1,6 @@ +[sqlfluff] +dialect = postgres +exclude_rules = LT05 + +[sqlfluff:indentation] +tab_space_size = 4 diff --git a/backend/Cargo.lock b/backend/Cargo.lock new file mode 100644 index 0000000..d09afb2 --- /dev/null +++ b/backend/Cargo.lock @@ -0,0 +1,3877 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "actix" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3720d0064a0ce5c0de7bd93bdb0a6caebab2a9b5668746145d7b3b0c5da02914" +dependencies = [ + "actix-rt", + "actix_derive", + "bitflags", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot 0.11.2", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util 0.6.10", +] + +[[package]] +name = "actix" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" +dependencies = [ + "actix-rt", + "bitflags", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot 0.12.1", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util 0.7.8", +] + +[[package]] +name = "actix-codec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a7559404a7f3573127aab53c08ce37a6c6a315c374a31070f3c91cd1b4a7fe" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-sink", + "log", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util 0.7.8", +] + +[[package]] +name = "actix-cors" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b340e9cfa5b08690aae90fb61beb44e9b06f44fe3d0f93781aaa58cfba86245e" +dependencies = [ + "actix-utils", + "actix-web", + "derive_more", + "futures-util", + "log", + "once_cell", + "smallvec", +] + +[[package]] +name = "actix-http" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "ahash 0.8.3", + "base64 0.21.0", + "bitflags", + "brotli", + "bytes", + "bytestring", + "derive_more", + "encoding_rs", + "flate2", + "futures-core", + "h2", + "http", + "httparse", + "httpdate", + "itoa", + "language-tags", + "local-channel", + "mime", + "percent-encoding", + "pin-project-lite", + "rand 0.8.5", + "sha1", + "smallvec", + "tokio", + "tokio-util 0.7.8", + "tracing", + "zstd", +] + +[[package]] +name = "actix-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "actix-router" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" +dependencies = [ + "bytestring", + "http", + "regex", + "serde", + "tracing", +] + +[[package]] +name = "actix-rt" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix-server" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "futures-util", + "mio", + "num_cpus", + "socket2", + "tokio", + "tracing", +] + +[[package]] +name = "actix-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" +dependencies = [ + "futures-core", + "paste", + "pin-project-lite", +] + +[[package]] +name = "actix-utils" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" +dependencies = [ + "local-waker", + "pin-project-lite", +] + +[[package]] +name = "actix-web" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-utils", + "actix-web-codegen", + "ahash 0.7.6", + "bytes", + "bytestring", + "cfg-if", + "cookie", + "derive_more", + "encoding_rs", + "futures-core", + "futures-util", + "http", + "itoa", + "language-tags", + "log", + "mime", + "once_cell", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "smallvec", + "socket2", + "time 0.3.21", + "url", +] + +[[package]] +name = "actix-web-actors" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf6e9ccc371cfddbed7aa842256a4abc7a6dcac9f3fce392fe1d0f68cfd136b2" +dependencies = [ + "actix 0.13.0", + "actix-codec", + "actix-http", + "actix-web", + "bytes", + "bytestring", + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util 0.7.8", +] + +[[package]] +name = "actix-web-codegen" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9" +dependencies = [ + "actix-router", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "actix_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d44b8fee1ced9671ba043476deddef739dd0959bf77030b26b738cc591737a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.9", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom 0.2.9", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "amq-protocol" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de7ec72218cc1c9063bdf559a60f40405980ee56bca469ad1e549cc0d76deb46" +dependencies = [ + "amq-protocol-tcp", + "amq-protocol-types", + "amq-protocol-uri", + "cookie-factory", + "nom", + "serde", +] + +[[package]] +name = "amq-protocol-tcp" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fae6d8a492462d268b48b7bc14d76a53e5310414f909c61cb3a509dbe7ca9b" +dependencies = [ + "amq-protocol-uri", + "tcp-stream", + "tracing", +] + +[[package]] +name = "amq-protocol-types" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7891a2fc253f8919d3caa49fccd06d721002e015940c8592f7824c0b4e80a485" +dependencies = [ + "cookie-factory", + "nom", + "serde", + "serde_json", +] + +[[package]] +name = "amq-protocol-uri" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3649e6751a8fb43330f2a442409970f10f51c79b987fcbbfc7093f4edb6a5e" +dependencies = [ + "amq-protocol-types", + "percent-encoding", + "url", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" + +[[package]] +name = "anstyle-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + +[[package]] +name = "anyhow" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +dependencies = [ + "backtrace", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "askama" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47cbc3cf73fa8d9833727bbee4835ba5c421a0d65b72daf9a7b5d0e0f9cfb57e" +dependencies = [ + "askama_derive", + "askama_escape", + "humansize", + "num-traits", + "percent-encoding", +] + +[[package]] +name = "askama_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22fbe0413545c098358e56966ff22cdd039e10215ae213cfbd65032b119fc94" +dependencies = [ + "basic-toml", + "mime", + "mime_guess", + "nom", + "proc-macro2", + "quote", + "serde", + "syn 2.0.15", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "async-channel" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", +] + +[[package]] +name = "async-global-executor-trait" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33dd14c5a15affd2abcff50d84efd4009ada28a860f01c14f9d654f3e81b3f75" +dependencies = [ + "async-global-executor", + "async-trait", + "executor-trait", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix", + "slab", + "socket2", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-reactor-trait" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6012d170ad00de56c9ee354aef2e358359deb1ec504254e0e5a3774771de0e" +dependencies = [ + "async-io", + "async-trait", + "futures-core", + "reactor-trait", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "async_once" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce4f10ea3abcd6617873bae9f91d1c5332b4a778bd9ce34d0cd517474c1de82" + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.6.2", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "basic-toml" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0de75129aa8d0cceaf750b89013f0e08804d6ec61416da787b35ad0d7cddf1" +dependencies = [ + "serde", +] + +[[package]] +name = "bb8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1627eccf3aa91405435ba240be23513eeca466b5dc33866422672264de061582" +dependencies = [ + "async-trait", + "futures-channel", + "futures-util", + "parking_lot 0.12.1", + "tokio", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bson" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0aa578035b938855a710ba58d43cfb4d435f3619f99236fb35922a574d6cb1" +dependencies = [ + "base64 0.13.1", + "chrono", + "hex", + "lazy_static", + "linked-hash-map", + "rand 0.7.3", + "serde", + "serde_json", + "uuid 0.8.2", +] + +[[package]] +name = "bstr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bytestring" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" +dependencies = [ + "bytes", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "celery" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb13ea01bdba539dfe56a2c6b83594a1d01944a89979dd9d0f998cb631b6249c" +dependencies = [ + "async-trait", + "base64 0.21.0", + "celery-codegen", + "chrono", + "colored", + "futures", + "futures-lite", + "globset", + "hostname", + "lapin", + "log", + "once_cell", + "rand 0.8.5", + "redis", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-executor-trait", + "tokio-reactor-trait", + "tokio-stream", + "uuid 1.3.2", +] + +[[package]] +name = "celery-codegen" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9546f0dc45d5d99441c5541eec523e2cc27b8588eb6ff34666838df5cff91544" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "serde", + "time 0.1.45", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "clap" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "clap_lex" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "colored" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" +dependencies = [ + "atty", + "lazy_static", + "winapi", +] + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util 0.7.8", +] + +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" +dependencies = [ + "percent-encoding", + "time 0.3.21", + "version_check", +] + +[[package]] +name = "cookie-factory" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cxx" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.15", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "dataloader" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cb65b97613885f65f677c9b30e4f78c19d8d6b573c103d399ce82ea82f47ae4" +dependencies = [ + "async-std", + "async-trait", +] + +[[package]] +name = "debug-ignore" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "derive_utils" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532b4c15dccee12c7044f1fcad956e98410860b22231e44a3b827464797ca7bf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "des" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" +dependencies = [ + "cipher", +] + +[[package]] +name = "diesel" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72eb77396836a4505da85bae0712fa324b74acfe1876d7c2f7e694ef3d0ee373" +dependencies = [ + "bitflags", + "byteorder", + "chrono", + "diesel_derives", + "itoa", + "pq-sys", + "r2d2", + "uuid 1.3.2", +] + +[[package]] +name = "diesel_derives" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad74fdcf086be3d4fdd142f67937678fe60ed431c3b2f08599e7687269410c4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "envconfig" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea81cc7e21f55a9d9b1efb6816904978d0bfbe31a50347cb24b2e75564bcac9b" +dependencies = [ + "envconfig_derive", +] + +[[package]] +name = "envconfig_derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfca278e5f84b45519acaaff758ebfa01f18e96998bc24b8f1b722dd804b9bf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "executor-trait" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a1052dd43212a7777ec6a69b117da52f5e52f07aec47d00c1a2b33b85d06b08" +dependencies = [ + "async-trait", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide 0.7.1", +] + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project", + "spin 0.9.8", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-enum" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3422d14de7903a52e9dbc10ae05a7e14445ec61890100e098754e120b2bd7b1e" +dependencies = [ + "derive_utils", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" + +[[package]] +name = "git2" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7905cdfe33d31a88bb2e8419ddd054451f5432d1da9eaf2ac7804ee1ea12d5" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "gitea_pages" +version = "0.1.0" +dependencies = [ + "actix-cors", + "actix-web", + "anyhow", + "askama", + "async-trait", + "async_once", + "bb8", + "celery", + "chrono", + "clap", + "dataloader", + "debug-ignore", + "diesel", + "env_logger", + "envconfig", + "git2", + "gritea", + "hex-simd", + "http", + "http-auth-basic", + "juniper", + "juniper_actix", + "lazy_static", + "log", + "ring", + "serde", + "serde_json", + "stdext", + "tikv-jemallocator", + "tokio", + "url", + "urlencoding", + "uuid 1.3.2", + "uuid-simd", +] + +[[package]] +name = "globset" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +dependencies = [ + "aho-corasick 0.7.20", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "graphql-parser" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1abd4ce5247dfc04a03ccde70f87a048458c9356c7e41d21ad8c407b3dde6f2" +dependencies = [ + "combine 3.8.1", + "thiserror", +] + +[[package]] +name = "gritea" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e29d3cc924a168fe15a078c7d4978515df592b82c64d53724807db64a9cfa53" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.13.1", + "chrono", + "hmac 0.11.0", + "http", + "maplit", + "reqwest", + "serde", + "serde_json", + "sha2", + "thiserror", + "tokio", + "url", +] + +[[package]] +name = "h2" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.8", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f7685beb53fc20efc2605f32f5d51e9ba18b8ef237961d1760169d2290d3bee" +dependencies = [ + "outref", + "vsimd", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-auth-basic" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd2e17aacf7f4a2428def798e2ff4f4f883c0987bdaf47dd5c8bc027bc9f1ebc" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +dependencies = [ + "http", + "hyper", + "rustls 0.20.8", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "juniper" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52adf17d43d0b526eed31fac15d9312941c5c2558ffbfb105811690b96d6e2f1" +dependencies = [ + "async-trait", + "bson", + "chrono", + "fnv", + "futures", + "futures-enum", + "graphql-parser", + "indexmap", + "juniper_codegen", + "serde", + "smartstring", + "static_assertions", + "url", + "uuid 0.8.2", +] + +[[package]] +name = "juniper_actix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc44af18ae1f551076171e24eb453c52132a19c219d1f1a1c3068ab363b946b5" +dependencies = [ + "actix 0.12.0", + "actix-http", + "actix-web", + "actix-web-actors", + "anyhow", + "futures", + "http", + "juniper", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "juniper_codegen" +version = "0.15.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee97671061ad50301ba077d054d295e01d31a1868fbd07902db651f987e71db" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "language-tags" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" + +[[package]] +name = "lapin" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd03ea5831b44775e296239a64851e2fd14a80a363d202ba147009ffc994ff0f" +dependencies = [ + "amq-protocol", + "async-global-executor-trait", + "async-reactor-trait", + "async-trait", + "executor-trait", + "flume", + "futures-core", + "futures-io", + "parking_lot 0.12.1", + "pinky-swear", + "reactor-trait", + "serde", + "tracing", + "waker-fn", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "libgit2-sys" +version = "0.15.1+1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4577bde8cdfc7d6a2a4bcb7b049598597de33ffd337276e9c7db6cd4a2cee7" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" + +[[package]] +name = "local-channel" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" +dependencies = [ + "futures-core", + "futures-sink", + "futures-util", + "local-waker", +] + +[[package]] +name = "local-waker" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", + "value-bag", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "object" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "outref" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" + +[[package]] +name = "p12" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4873306de53fe82e7e484df31e1e947d61514b6ea2ed6cd7b45d63006fd9224" +dependencies = [ + "cbc", + "cipher", + "des", + "getrandom 0.2.9", + "hmac 0.12.1", + "lazy_static", + "rc2", + "sha1", + "yasna", +] + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.7", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinky-swear" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d894b67aa7a4bf295db5e85349078c604edaa6fa5c8721e8eca3c7729a27f2ac" +dependencies = [ + "doc-comment", + "flume", + "parking_lot 0.12.1", + "tracing", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pq-sys" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0052426df997c0cbd30789eb44ca097e3541717a7b8fa36b1c464ee7edebd" +dependencies = [ + "vcpkg", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r2d2" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" +dependencies = [ + "log", + "parking_lot 0.12.1", + "scheduled-thread-pool", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.9", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rc2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62c64daa8e9438b84aaae55010a93f396f8e60e3911590fcba770d04643fc1dd" +dependencies = [ + "cipher", +] + +[[package]] +name = "reactor-trait" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "438a4293e4d097556730f4711998189416232f009c137389e0f961d2bc0ddc58" +dependencies = [ + "async-trait", + "futures-core", + "futures-io", +] + +[[package]] +name = "redis" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa8455fa3621f6b41c514946de66ea0531f57ca017b2e6c7cc368035ea5b46df" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "combine 4.6.6", + "futures", + "futures-util", + "itoa", + "percent-encoding", + "pin-project-lite", + "ryu", + "sha1_smol", + "tokio", + "tokio-util 0.7.8", + "url", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +dependencies = [ + "aho-corasick 1.0.1", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + +[[package]] +name = "reqwest" +version = "0.11.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +dependencies = [ + "base64 0.21.0", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.20.8", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-connector" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692d857261c41e2915b8ee70e40265e51010ee5d3c7a9b7d50837bc5cee86207" +dependencies = [ + "log", + "rustls 0.21.1", + "rustls-native-certs", + "rustls-webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] + +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scheduled-thread-pool" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" +dependencies = [ + "parking_lot 0.12.1", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stdext" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3b6b32ae82412fb897ef134867d53a294f57ba5b758f06d71e865352c3e207" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tcp-stream" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6918876e41110757f36b734388e17834e69abf7ca4456ebe8a38af21f5a651d7" +dependencies = [ + "cfg-if", + "p12", + "rustls-connector", + "rustls-pemfile", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.3+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" +dependencies = [ + "itoa", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot 0.12.1", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-executor-trait" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "802ccf58e108fe16561f35348fabe15ff38218968f033d587e399a84937533cc" +dependencies = [ + "async-trait", + "executor-trait", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", +] + +[[package]] +name = "tokio-reactor-trait" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9481a72f36bd9cbb8d6dd349227c4783e234e4332cfe806225bc929c4b92486" +dependencies = [ + "async-trait", + "futures-core", + "futures-io", + "reactor-trait", + "tokio", + "tokio-stream", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.8", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "urlencoding" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +dependencies = [ + "getrandom 0.2.9", + "serde", +] + +[[package]] +name = "uuid-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8" +dependencies = [ + "outref", + "uuid 1.3.2", + "vsimd", +] + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.15", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" + +[[package]] +name = "web-sys" +version = "0.3.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" + +[[package]] +name = "zstd" +version = "0.12.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "6.0.5+zstd.1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.8+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +dependencies = [ + "cc", + "libc", + "pkg-config", +] diff --git a/backend/Cargo.toml b/backend/Cargo.toml new file mode 100644 index 0000000..66531f7 --- /dev/null +++ b/backend/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "gitea_pages" +version = "0.1.0" +edition = "2021" + +[profile.release] +opt-level = 3 +lto = true +codegen-units = 1 + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +actix-cors = "0.6.4" +actix-web = "4.3.1" +anyhow = { version = "1.0.71", features = ["backtrace"] } +askama = "0.12.0" +async-trait = "0.1.68" +async_once = "0.2.6" +bb8 = "0.8.0" +celery = "0.5.3" +chrono = "0.4.24" +clap = { version = "4.2.7", features = ["derive"] } +dataloader = "0.16.0" +debug-ignore = "1.0.5" +diesel = { version = "2.0.4", features = [ + "postgres", + "chrono", + "r2d2", + "uuid", +] } +env_logger = "0.10.0" +envconfig = "0.10.0" +git2 = "0.17.1" +gritea = "0.1.8" +hex-simd = "0.8.0" +http = "0.2.9" +http-auth-basic = "0.3.3" +juniper = { version = "0.15.11", features = ["uuid"] } +juniper_actix = "0.4.0" +lazy_static = "1.4.0" +log = "0.4.17" +ring = "0.16.20" +serde = { version = "1.0.160", features = ["derive"] } +serde_json = "1.0.96" +stdext = "0.3.1" +tokio = { version = "1.28.0", features = ["full"] } +url = "2.3.1" +urlencoding = "2.1.2" +uuid-simd = "0.8.0" +uuidv7 = { version = "1.3.2", package = "uuid", features = ["serde"] } + +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator = "0.5" diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..1e828d1 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,81 @@ +# FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.69.0 as mold +# SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# WORKDIR /tmp +# ARG MOLD_VERSION="1.11.0" +# RUN wget -qO- https://github.com/rui314/mold/archive/refs/tags/v${MOLD_VERSION}.tar.gz | tar zxf - +# WORKDIR /tmp/mold-${MOLD_VERSION}/build +# RUN ../install-build-deps.sh \ +# && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=c++ .. \ +# && cmake --build . -j "$(nproc)" \ +# && cmake --install . + +FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.69.0 as chef +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# hadolint ignore=DL3009 +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + lsb-release=11.1.0 \ + wget=1.21-1+deb11u1 \ + software-properties-common=0.96.20.2-2.1 \ + gnupg=2.2.27-2+deb11u2 \ + clang=1:11.0-51+nmu5 +WORKDIR /tmp +ARG MOLD_VERSION="1.11.0" +RUN wget -qO- https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-${MOLD_VERSION}-x86_64-linux.tar.gz | tar xzf - \ + && cp -RT ./mold-${MOLD_VERSION}-x86_64-linux /usr \ + && rm -rf ./mold-${MOLD_VERSION}-x86_64-linux +WORKDIR / + +FROM chef as diesel +RUN cargo install diesel_cli --version 2.0.1 --no-default-features --features postgres + +FROM chef as planner +WORKDIR /usr/src/gitea_pages +RUN mkdir -p ./src/bin && touch ./src/main.rs +COPY ./Cargo.toml ./Cargo.lock ./ +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef as builder +WORKDIR /usr/src/gitea_pages +COPY ./.cargo ./.cargo +COPY --from=planner /usr/src/gitea_pages/recipe.json . +RUN cargo chef cook --release --recipe-path recipe.json +COPY --from=planner /usr/src/gitea_pages/Cargo.toml /usr/src/gitea_pages/Cargo.lock ./ +# RUN cargo build --release --frozen --offline +COPY ./assets ./assets +COPY ./templates ./templates +COPY ./src ./src +RUN cargo build --release --frozen --offline + +FROM docker.io/debian:bullseye-slim as runner +LABEL maintainer="Dominic Grimm " \ + org.opencontainers.image.description="Gitea Pages" \ + org.opencontainers.image.licenses="GPLv3" \ + org.opencontainers.image.source="https://git.dergrimm.net/dergrimm/gitea_pages" \ + org.opencontainers.image.url="https://git.dergrimm.net/dergrimm/gitea_pages" +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + libpq5=13.10-0+deb11u1 \ + git=1:2.30.2-1+deb11u2 \ + netcat=1.10-46 \ + ca-certificates=20210119 \ + wget=1.21-1+deb11u1 && \ + wget -qO- https://get.docker.com/ | sh && \ + apt-get clean && \ + apt-get autoremove -y && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/lib/apt/ && \ + rm -rf /var/lib/dpkg/ && \ + rm -rf /var/lib/cache/ && \ + rm -rf /var/lib/log/ +WORKDIR /usr/local/bin +COPY --from=diesel /usr/local/cargo/bin/diesel . +WORKDIR /opt/gitea_pages +RUN wget -q --show-progress https://raw.githubusercontent.com/vishnubob/wait-for-it/81b1373f17855a4dc21156cfe1694c31d7d1792e/wait-for-it.sh && \ + chmod +x wait-for-it.sh +COPY ./run.sh ./migrate.sh ./ +RUN chmod +x ./run.sh ./migrate.sh +COPY ./migrations ./migrations +COPY --from=builder /usr/src/gitea_pages/target/release/gitea_pages ./bin/gitea_pages +EXPOSE 8080 8081 diff --git a/backend/assets/logo.txt b/backend/assets/logo.txt new file mode 100644 index 0000000..839b40a --- /dev/null +++ b/backend/assets/logo.txt @@ -0,0 +1,8 @@ + _ _ + (_) | + __ _ _| |_ ___ __ _ _ __ __ _ __ _ ___ ___ + / _` | | __/ _ \/ _` | | '_ \ / _` |/ _` |/ _ \/ __| +| (_| | | || __/ (_| | | |_) | (_| | (_| | __/\__ \ + \__, |_|\__\___|\__,_| | .__/ \__,_|\__, |\___||___/ + __/ | | | __/ | + |___/ |_| |___/ \ No newline at end of file diff --git a/backend/migrate.sh b/backend/migrate.sh new file mode 100644 index 0000000..396087e --- /dev/null +++ b/backend/migrate.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +# -*- coding: utf-8 -*- + +set -e + +DATABASE_URL="$PAGES_DB_URL" diesel migration run \ + --migration-dir ./migrations \ + --locked-schema + +while true; do nc -lv 8881; done diff --git a/backend/migrations/2023-05-02-143642_init/down.sql b/backend/migrations/2023-05-02-143642_init/down.sql new file mode 100644 index 0000000..b9e33f8 --- /dev/null +++ b/backend/migrations/2023-05-02-143642_init/down.sql @@ -0,0 +1,3 @@ +DROP TABLE repositories; + +DROP TABLE users; diff --git a/backend/migrations/2023-05-02-143642_init/up.sql b/backend/migrations/2023-05-02-143642_init/up.sql new file mode 100644 index 0000000..9395cc7 --- /dev/null +++ b/backend/migrations/2023-05-02-143642_init/up.sql @@ -0,0 +1,17 @@ +CREATE EXTENSION IF NOT EXISTS pgcrypto; + +CREATE TABLE users ( + id uuid PRIMARY KEY DEFAULT GEN_RANDOM_UUID(), + name text NOT NULL UNIQUE, + created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at timestamptz +); + +CREATE TABLE repositories ( + id uuid PRIMARY KEY DEFAULT GEN_RANDOM_UUID(), + user_id uuid NOT NULL REFERENCES users (id) ON DELETE CASCADE, + name text NOT NULL, + created_at timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at timestamptz, + UNIQUE (user_id, name) +); diff --git a/backend/run.sh b/backend/run.sh new file mode 100644 index 0000000..f8ffc2e --- /dev/null +++ b/backend/run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +# -*- coding: utf-8 -*- + +set -e + +./wait-for-it.sh migration_runner:8881 --strict -- echo "Migrations were applied" + +RUST_BACKTRACE=1 RUST_LOG=info ./bin/gitea_pages "$1" diff --git a/backend/src/api/context.rs b/backend/src/api/context.rs new file mode 100644 index 0000000..7cf7925 --- /dev/null +++ b/backend/src/api/context.rs @@ -0,0 +1,57 @@ +use dataloader::non_cached::Loader; +use juniper::FieldResult; +use juniper::IntoFieldError; +use uuid_simd::UuidExt; +use uuidv7::Uuid; + +use crate::{ + api::{loaders, Error}, + db, worker, +}; + +#[derive(Clone)] +pub struct Loaders { + pub user: loaders::user::UserLoader, + pub repository: loaders::repository::RepositoryLoader, +} + +impl Default for Loaders { + fn default() -> Self { + Self { + user: Loader::new(loaders::user::UserBatcher) + .with_yield_count(loaders::user::YIELD_COUNT), + repository: Loader::new(loaders::repository::RepositoryBatcher) + .with_yield_count(loaders::repository::YIELD_COUNT), + } + } +} + +pub struct Context { + pub db_pool: db::Pool, + pub worker_pool: worker::Pool, + pub loaders: Loaders, + pub logged_in: bool, +} + +impl Context { + pub fn get_db_conn(&self) -> FieldResult { + self.db_pool + .get() + .map_or(Err(Error::Internal.into_field_error()), Ok) + } + + pub async fn get_worker_conn( + &self, + ) -> FieldResult> { + self.worker_pool + .get() + .await + .map_or(Err(Error::Internal.into_field_error()), Ok) + } + + pub fn parse_uuid(id: &[u8]) -> FieldResult { + Uuid::parse(id).map_err(|_| Error::InvalidUuid.into_field_error()) + } +} + +impl juniper::Context for Context {} diff --git a/backend/src/api/error.rs b/backend/src/api/error.rs new file mode 100644 index 0000000..4de2adb --- /dev/null +++ b/backend/src/api/error.rs @@ -0,0 +1,99 @@ +use juniper::{graphql_value, FieldError, FieldResult, IntoFieldError, ScalarValue}; + +pub enum Error { + Internal, + DoesNotExist, + InvalidUuid, + InvalidCredentials, + Unauthenticated, + + RepoAlreadyExists, + ExternalRepoDoesNotExist, + RepoPullBranchDoesNotExist, +} + +impl IntoFieldError for Error { + fn into_field_error(self) -> FieldError { + match self { + Self::Internal => FieldError::new( + "Internal server error", + graphql_value!({ + "type": "INTERNAL" + }), + ), + Self::DoesNotExist => FieldError::new( + "Record does not exist", + graphql_value!({ + "type": "DOES_NOT_EXIST" + }), + ), + Self::InvalidUuid => FieldError::new( + "Invalid UUID", + graphql_value!({ + "type": "INVALID_UUID", + }), + ), + Self::InvalidCredentials => FieldError::new( + "Invalid credentials", + graphql_value!({ + "type": "INVALID_CREDENTIALS", + }), + ), + Self::Unauthenticated => FieldError::new( + "Unauthenticated", + graphql_value!({ + "type": "UNAUTHENTICATED", + }), + ), + + Self::RepoAlreadyExists => FieldError::new( + "Repository already exists", + graphql_value!({ + "type": "REPO_ALREADY_EXISTS", + }), + ), + Self::ExternalRepoDoesNotExist => FieldError::new( + "Repository does not exist on Git server", + graphql_value!({ + "type": "EXTERNAL_REPO_DOES_NOT_EXIST", + }), + ), + Self::RepoPullBranchDoesNotExist => FieldError::new( + "Repository does not have pages branch", + graphql_value!({ + "type": "REPO_PULL_BRANCH_DOES_NOT_EXIST", + }), + ), + } + } +} + +pub trait QueryResultIntoFieldResult { + fn into_field_result(self) -> FieldResult; +} + +impl QueryResultIntoFieldResult for diesel::QueryResult { + fn into_field_result(self) -> FieldResult { + // match self { + // Ok(x) => Ok(x), + // Err(_) => Err(Error::Internal.into_field_error()), + // } + self.map_err(|_| Error::Internal.into_field_error()) + } +} + +pub trait AsyncResultIntoFieldResult { + fn into_field_result(self) -> FieldResult; +} + +impl AsyncResultIntoFieldResult + for Result +{ + fn into_field_result(self) -> FieldResult { + // match self { + // Ok(x) => Ok(x), + // Err(_) => Err(Error::Internal.into_field_error()), + // } + self.map_err(|_| Error::Internal.into_field_error()) + } +} diff --git a/backend/src/api/loaders/mod.rs b/backend/src/api/loaders/mod.rs new file mode 100644 index 0000000..fc9105e --- /dev/null +++ b/backend/src/api/loaders/mod.rs @@ -0,0 +1,77 @@ +use async_trait::async_trait; +use std::clone::Clone; +use std::fmt::Debug; +use std::hash::Hash; +use std::io::{Error, ErrorKind}; + +pub mod repository; +pub mod user; + +#[async_trait] +pub trait TryOptionLoad: Clone +where + K: Eq + Hash + Clone + Debug + Send + Sync, + V: Clone + Debug + Send, +{ + async fn try_option_load(&self, key: K) -> Result, Error>; +} + +#[async_trait] +impl TryOptionLoad for dataloader::non_cached::Loader +where + K: Eq + Hash + Clone + Debug + Send + Sync, + V: Clone + Debug + Send, + F: dataloader::BatchFn + Send + Sync, +{ + async fn try_option_load(&self, key: K) -> Result, Error> { + async fn internal_try_option_load( + loader: &dataloader::non_cached::Loader, + key: K, + ) -> Result, Error> + where + K: Eq + Hash + Clone + Debug + Send + Sync, + V: Clone + Debug + Send, + F: dataloader::BatchFn + Send + Sync, + { + match loader.try_load(key).await { + Ok(x) => Ok(Some(x)), + Err(e) => match e.kind() { + ErrorKind::NotFound => Ok(None), + _ => Err(e), + }, + } + } + + internal_try_option_load(self, key).await + } +} + +#[async_trait] +impl TryOptionLoad for dataloader::cached::Loader +where + K: Eq + Hash + Clone + Debug + Send + Sync, + V: Clone + Debug + Send, + F: dataloader::BatchFn + Send + Sync, +{ + async fn try_option_load(&self, key: K) -> Result, Error> { + async fn internal_try_option_load( + loader: &dataloader::cached::Loader, + key: K, + ) -> Result, Error> + where + K: Eq + Hash + Clone + Debug + Send + Sync, + V: Clone + Debug + Send, + F: dataloader::BatchFn + Send + Sync, + { + match loader.try_load(key).await { + Ok(x) => Ok(Some(x)), + Err(e) => match e.kind() { + ErrorKind::NotFound => Ok(None), + _ => Err(e), + }, + } + } + + internal_try_option_load(self, key).await + } +} diff --git a/backend/src/api/loaders/repository.rs b/backend/src/api/loaders/repository.rs new file mode 100644 index 0000000..8ebbd7c --- /dev/null +++ b/backend/src/api/loaders/repository.rs @@ -0,0 +1,42 @@ +use async_trait::async_trait; +use dataloader::non_cached::Loader; +use dataloader::BatchFn; +use diesel::prelude::*; +use std::collections::HashMap; +use uuidv7::Uuid; + +use crate::{api::models, db}; + +pub struct RepositoryBatcher; + +#[async_trait] +impl BatchFn for RepositoryBatcher { + async fn load(&mut self, keys: &[Uuid]) -> HashMap { + let db_conn = &mut db::POOL.get().unwrap(); + let mut map = HashMap::new(); + for row in db::schema::repositories::table + .select(( + db::schema::repositories::id, + db::schema::repositories::user_id, + db::schema::repositories::name, + )) + .filter(db::schema::repositories::id.eq_any(keys)) + .load::<(Uuid, Uuid, String)>(db_conn) + .unwrap() + { + let row: (Uuid, Uuid, String) = row; + let data = models::repository::Repository { + id: row.0, + user_id: row.1, + name: row.2, + }; + map.insert(data.id, data); + } + + map + } +} + +pub type RepositoryLoader = Loader; + +pub const YIELD_COUNT: usize = 100; diff --git a/backend/src/api/loaders/user.rs b/backend/src/api/loaders/user.rs new file mode 100644 index 0000000..4ad1e77 --- /dev/null +++ b/backend/src/api/loaders/user.rs @@ -0,0 +1,37 @@ +use async_trait::async_trait; +use dataloader::non_cached::Loader; +use dataloader::BatchFn; +use diesel::prelude::*; +use std::collections::HashMap; +use uuidv7::Uuid; + +use crate::{api::models, db}; + +pub struct UserBatcher; + +#[async_trait] +impl BatchFn for UserBatcher { + async fn load(&mut self, keys: &[Uuid]) -> HashMap { + let db_conn = &mut db::POOL.get().unwrap(); + let mut map = HashMap::new(); + for row in db::schema::users::table + .select((db::schema::users::id, db::schema::users::name)) + .filter(db::schema::users::id.eq_any(keys)) + .load::<(Uuid, String)>(db_conn) + .unwrap() + { + let row: (Uuid, String) = row; + let data = models::user::User { + id: row.0, + name: row.1, + }; + map.insert(data.id, data); + } + + map + } +} + +pub type UserLoader = Loader; + +pub const YIELD_COUNT: usize = 100; diff --git a/backend/src/api/mod.rs b/backend/src/api/mod.rs new file mode 100644 index 0000000..a46cef0 --- /dev/null +++ b/backend/src/api/mod.rs @@ -0,0 +1,227 @@ +use diesel::prelude::*; +use gritea::client::Gritea; +use juniper::{graphql_object, EmptySubscription, FieldResult, IntoFieldError, RootNode}; +use uuidv7::Uuid; + +use crate::{db, gritea_ext::GriteaExt, worker, CONFIG}; + +pub mod context; +pub mod error; +pub mod loaders; +pub mod models; +pub mod scalars; + +pub use context::Context; +pub use error::{AsyncResultIntoFieldResult, Error, QueryResultIntoFieldResult}; + +use loaders::TryOptionLoad; + +pub struct Query; + +#[graphql_object(context = Context)] +impl Query { + fn ping() -> &'static str { + "pong" + } + + fn verify_login(username: String, password: String) -> bool { + username == *CONFIG.user && password == *CONFIG.password + } + + async fn user(context: &Context, id: scalars::Uuid) -> FieldResult { + match context.loaders.user.try_option_load(*id).await { + Ok(Some(user)) => Ok(user), + Ok(None) => Err(Error::DoesNotExist.into_field_error()), + Err(_) => Err(Error::Internal.into_field_error()), + } + } + + async fn user_by_name(context: &Context, name: String) -> FieldResult { + let db_conn = &mut context.get_db_conn()?; + let id = match db::schema::users::table + .select(db::schema::users::id) + .filter(db::schema::users::name.eq(name)) + .first::(db_conn) + .optional() + .into_field_result()? + { + Some(x) => x, + None => return Err(Error::DoesNotExist.into_field_error()), + }; + + context + .loaders + .user + .try_load(id) + .await + .map_err(|_| Error::Internal.into_field_error()) + } + + async fn users(context: &Context) -> FieldResult> { + let db_conn = &mut context.get_db_conn()?; + let ids = db::schema::users::table + .select(db::schema::users::id) + .load::(db_conn) + .into_field_result()?; + + context.loaders.user.try_load_many(ids).await.map_or_else( + |_| Err(Error::Internal.into_field_error()), + |x| Ok(x.into_values().collect()), + ) + } + + async fn repository( + context: &Context, + id: scalars::Uuid, + ) -> FieldResult { + match context.loaders.repository.try_option_load(*id).await { + Ok(Some(user)) => Ok(user), + Ok(None) => Err(Error::DoesNotExist.into_field_error()), + Err(_) => Err(Error::Internal.into_field_error()), + } + } + + async fn repositories(context: &Context) -> FieldResult> { + let db_conn = &mut context.get_db_conn()?; + let ids = db::schema::repositories::table + .select(db::schema::repositories::id) + .load::(db_conn) + .into_field_result()?; + + context + .loaders + .repository + .try_load_many(ids) + .await + .map_or_else( + |_| Err(Error::Internal.into_field_error()), + |x| Ok(x.into_values().collect()), + ) + } +} + +pub struct Mutation; + +#[graphql_object(context = Context)] +impl Mutation { + async fn create_repository( + context: &Context, + input: models::repository::CreateRepositoryInput, + ) -> FieldResult { + if !context.logged_in { + return Err(Error::Unauthenticated.into_field_error()); + } + + let db_conn = &mut context.get_db_conn()?; + + let user_id = db::schema::users::table + .select(db::schema::users::id) + .filter(db::schema::users::name.eq(&input.user)) + .first::(db_conn) + .optional() + .into_field_result()?; + if let Some(id) = user_id { + if diesel::select(diesel::dsl::exists( + db::schema::repositories::table + .filter(db::schema::repositories::user_id.eq(id)) + .filter(db::schema::repositories::name.eq(&input.name)), + )) + .get_result::(db_conn) + .into_field_result()? + { + return Err(Error::RepoAlreadyExists.into_field_error()); + } + } + + let escaped_user = urlencoding::encode(&input.user); + let escaped_name = urlencoding::encode(&input.name); + + match Gritea::builder(&CONFIG.gitea_url) + .token(&*CONFIG.gitea_api_token) + .build() + { + Ok(client) => { + let repo = match client.get_repo(&escaped_user, &escaped_name).await { + Ok(x) => x, + Err(_) => return Err(Error::ExternalRepoDoesNotExist.into_field_error()), + }; + if repo.private { + return Err(Error::ExternalRepoDoesNotExist.into_field_error()); + } + + let branches = match client.get_repo_branches(&escaped_user, &escaped_name).await { + Ok(x) => x, + Err(_) => return Err(Error::Internal.into_field_error()), + }; + if !branches + .into_iter() + .any(|x| x.name == CONFIG.gitea_pull_branch) + { + return Err(Error::RepoPullBranchDoesNotExist.into_field_error()); + } + } + Err(_) => return Err(Error::Internal.into_field_error()), + } + + let user_id = match user_id { + Some(x) => x, + None => diesel::insert_into(db::schema::users::table) + .values(db::models::NewUser { name: &input.user }) + .returning(db::schema::users::id) + .get_result::(db_conn) + .into_field_result()?, + }; + + let id = diesel::insert_into(db::schema::repositories::table) + .values(db::models::NewRepository { + user_id, + name: &input.name, + }) + .returning(db::schema::repositories::id) + .get_result::(db_conn) + .into_field_result()?; + + let worker_conn = context.get_worker_conn().await?; + worker_conn + .send_task(worker::get_repo::get_repo::new(id)) + .await + .into_field_result()?; + + context + .loaders + .repository + .try_load(id) + .await + .map_err(|_| Error::Internal.into_field_error()) + } + + async fn delete_repository(context: &Context, id: scalars::Uuid) -> FieldResult { + if !context.logged_in { + return Err(Error::Unauthenticated.into_field_error()); + } + + let db_conn = &mut context.get_db_conn()?; + if diesel::select(diesel::dsl::not(diesel::dsl::exists( + db::schema::repositories::table.filter(db::schema::repositories::id.eq(*id)), + ))) + .get_result::(db_conn) + .into_field_result()? + { + return Err(Error::DoesNotExist.into_field_error()); + } + + let worker_conn = context.get_worker_conn().await?; + worker_conn + .send_task(worker::delete_repo::delete_repo::new(*id)) + .await + .into_field_result()?; + + Ok(true) + } +} + +pub type Schema = RootNode<'static, Query, Mutation, EmptySubscription>; + +pub fn schema() -> Schema { + Schema::new(Query, Mutation, EmptySubscription::new()) +} diff --git a/backend/src/api/models/mod.rs b/backend/src/api/models/mod.rs new file mode 100644 index 0000000..ebe7792 --- /dev/null +++ b/backend/src/api/models/mod.rs @@ -0,0 +1,2 @@ +pub mod repository; +pub mod user; diff --git a/backend/src/api/models/repository.rs b/backend/src/api/models/repository.rs new file mode 100644 index 0000000..2268ce9 --- /dev/null +++ b/backend/src/api/models/repository.rs @@ -0,0 +1,62 @@ +use juniper::{graphql_object, FieldResult, GraphQLInputObject, IntoFieldError}; +use uuidv7::Uuid; + +use crate::{ + api::{models, scalars, Context, Error}, + CONFIG, +}; + +#[derive(Clone, Debug)] +pub struct Repository { + pub id: Uuid, + pub user_id: Uuid, + pub name: String, +} + +#[graphql_object(context = Context)] +impl Repository { + fn id(&self) -> scalars::Uuid { + scalars::Uuid(self.id) + } + + async fn user(&self, context: &Context) -> FieldResult { + context + .loaders + .user + .try_load(self.user_id) + .await + .map_err(|_| Error::Internal.into_field_error()) + } + + fn name(&self) -> &str { + &self.name + } + + async fn url(&self, context: &Context, scheme: Option) -> FieldResult { + let user_name = context + .loaders + .user + .try_load(self.user_id) + .await + .map_err(|_| Error::Internal.into_field_error())? + .name; + + Ok(format!( + "{}{}.{}/{}", + if scheme.unwrap_or(true) { + "https://" + } else { + "" + }, + user_name, + CONFIG.domain, + self.name + )) + } +} + +#[derive(GraphQLInputObject)] +pub struct CreateRepositoryInput { + pub user: String, + pub name: String, +} diff --git a/backend/src/api/models/user.rs b/backend/src/api/models/user.rs new file mode 100644 index 0000000..5e04678 --- /dev/null +++ b/backend/src/api/models/user.rs @@ -0,0 +1,47 @@ +use diesel::prelude::*; +use juniper::{graphql_object, FieldResult, IntoFieldError}; +use uuidv7::Uuid; + +use crate::{ + api::{models, scalars, Context, Error, QueryResultIntoFieldResult}, + db, +}; + +#[derive(Clone, Debug)] +pub struct User { + pub id: Uuid, + pub name: String, +} + +#[graphql_object(context = Context)] +impl User { + fn id(&self) -> scalars::Uuid { + scalars::Uuid(self.id) + } + + fn name(&self) -> &str { + &self.name + } + + async fn repositories( + &self, + context: &Context, + ) -> FieldResult> { + let db_conn = &mut context.get_db_conn()?; + let ids = db::schema::repositories::table + .select(db::schema::repositories::id) + .filter(db::schema::repositories::user_id.eq(self.id)) + .load::(db_conn) + .into_field_result()?; + + context + .loaders + .repository + .try_load_many(ids) + .await + .map_or_else( + |_| Err(Error::Internal.into_field_error()), + |x| Ok(x.into_values().collect()), + ) + } +} diff --git a/backend/src/api/scalars/mod.rs b/backend/src/api/scalars/mod.rs new file mode 100644 index 0000000..78fd8a8 --- /dev/null +++ b/backend/src/api/scalars/mod.rs @@ -0,0 +1,3 @@ +pub mod uuid; + +pub use uuid::Uuid; diff --git a/backend/src/api/scalars/uuid.rs b/backend/src/api/scalars/uuid.rs new file mode 100644 index 0000000..f200de9 --- /dev/null +++ b/backend/src/api/scalars/uuid.rs @@ -0,0 +1,39 @@ +use std::ops::Deref; + +type Value = uuidv7::Uuid; + +pub struct Uuid(pub Value); + +#[juniper::graphql_scalar(name = "UUID", description = "UUID encoded as a string")] +impl GraphQLScalar for Uuid +where + S: juniper::ScalarValue, +{ + fn resolve(&self) -> juniper::Value { + juniper::Value::scalar(self.0.to_string()) + } + + fn from_input_value(value: &juniper::InputValue) -> Option { + value + .as_string_value() + .and_then(|s| { + use uuid_simd::UuidExt; + use uuidv7::Uuid; + + Uuid::parse(s.as_bytes()).ok() + }) + .map(Uuid) + } + + fn from_str<'a>(value: juniper::ScalarToken<'a>) -> juniper::ParseScalarResult<'a, S> { + >::from_str(value) + } +} + +impl Deref for Uuid { + type Target = Value; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} diff --git a/backend/src/config.rs b/backend/src/config.rs new file mode 100644 index 0000000..e031ec0 --- /dev/null +++ b/backend/src/config.rs @@ -0,0 +1,69 @@ +use anyhow::{bail, Result}; +use debug_ignore::DebugIgnore; +use envconfig::Envconfig; +use lazy_static::lazy_static; +use url::Url; + +#[derive(Envconfig, Debug)] +pub struct Config { + #[envconfig(from = "PAGES_DB_URL")] + pub db_url: DebugIgnore, + + #[envconfig(from = "PAGES_AMQP_URL")] + pub amqp_url: DebugIgnore, + + #[envconfig(from = "PAGES_USER")] + pub user: String, + + #[envconfig(from = "PAGES_PASSWORD")] + pub password: DebugIgnore, + + #[envconfig(from = "PAGES_GITEA_URL")] + pub gitea_url: String, + + #[envconfig(from = "PAGES_GITEA_API_TOKEN")] + pub gitea_api_token: DebugIgnore, + + #[envconfig(from = "PAGES_GITEA_SECRET")] + pub gitea_secret: DebugIgnore, + + #[envconfig(from = "PAGES_GITEA_PULL_URL")] + pub gitea_pull_url: Url, + + #[envconfig(from = "PAGES_GITEA_PULL_BRANCH")] + pub gitea_pull_branch: String, + + #[envconfig(from = "PAGES_NGINX_CONFIG_DIR")] + pub nginx_config_dir: String, + + #[envconfig(from = "PAGES_REPOS_DIR")] + pub repos_dir: String, + + #[envconfig(from = "PAGES_DOMAIN")] + pub domain: String, +} + +pub const PASSWORD_MIN_LEN: usize = 64; + +impl Config { + pub fn validate(&self) -> Result<()> { + if self.password.len() < PASSWORD_MIN_LEN { + bail!( + "Password is too short: {} < {}", + self.password.len(), + PASSWORD_MIN_LEN + ); + } + + Ok(()) + } +} + +#[derive(Debug)] +pub struct DynConfig { + pub cloudflare_zone_name: String, +} + +lazy_static! { + pub static ref CONFIG: Config = Config::init_from_env().unwrap(); +} diff --git a/backend/src/db/mod.rs b/backend/src/db/mod.rs new file mode 100644 index 0000000..b8ee704 --- /dev/null +++ b/backend/src/db/mod.rs @@ -0,0 +1,29 @@ +use anyhow::Result; +use diesel::pg::PgConnection; +use diesel::prelude::*; +use diesel::r2d2::{ConnectionManager, PooledConnection}; +use lazy_static::lazy_static; + +use crate::CONFIG; + +pub mod models; +pub mod schema; + +pub type Pool = diesel::r2d2::Pool>; +pub type Connection = PgConnection; +pub type PoolConnection = PooledConnection>; + +pub fn establish_connection() -> ConnectionResult { + use diesel::Connection; + + PgConnection::establish(&CONFIG.db_url) +} + +pub fn pool() -> Result { + Ok(diesel::r2d2::Pool::builder() + .build(ConnectionManager::::new(&*CONFIG.db_url))?) +} + +lazy_static! { + pub static ref POOL: Pool = pool().unwrap(); +} diff --git a/backend/src/db/models.rs b/backend/src/db/models.rs new file mode 100644 index 0000000..e88231c --- /dev/null +++ b/backend/src/db/models.rs @@ -0,0 +1,37 @@ +use chrono::prelude::*; +use diesel::prelude::*; +use uuidv7::Uuid; + +use crate::db::schema; + +#[derive(Identifiable, Queryable, Debug)] +#[diesel(table_name = schema::users)] +pub struct User { + pub id: Uuid, + pub name: String, + pub created_at: DateTime, + pub updated_at: Option>, +} + +#[derive(Insertable, Debug)] +#[diesel(table_name = schema::users)] +pub struct NewUser<'a> { + pub name: &'a str, +} + +#[derive(Identifiable, Queryable, Debug)] +#[diesel(table_name = schema::repositories)] +pub struct Repository { + pub id: Uuid, + pub user_id: Uuid, + pub name: String, + pub created_at: DateTime, + pub updated_at: Option>, +} + +#[derive(Insertable, Debug)] +#[diesel(table_name = schema::repositories)] +pub struct NewRepository<'a> { + pub user_id: Uuid, + pub name: &'a str, +} diff --git a/backend/src/db/schema.rs b/backend/src/db/schema.rs new file mode 100644 index 0000000..ade0fd6 --- /dev/null +++ b/backend/src/db/schema.rs @@ -0,0 +1,18 @@ +diesel::table! { + users { + id -> Uuid, + name -> Text, + created_at -> Timestamptz, + updated_at -> Nullable, + } +} + +diesel::table! { + repositories { + id -> Uuid, + user_id -> Uuid, + name -> Text, + created_at -> Timestamptz, + updated_at -> Nullable, + } +} diff --git a/backend/src/gritea_ext.rs b/backend/src/gritea_ext.rs new file mode 100644 index 0000000..c24c9f8 --- /dev/null +++ b/backend/src/gritea_ext.rs @@ -0,0 +1,68 @@ +use async_trait::async_trait; +use chrono::prelude::*; +use gritea::{ + client::{resp_json, Gritea}, + Result, +}; +use http::Method; +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +pub struct PayloadUser { + pub email: String, + pub name: String, + pub username: String, +} + +#[derive(Deserialize, Debug)] +pub struct PayloadCommitVerification { + pub payload: String, + pub reason: String, + pub signature: String, + pub signer: Option, + pub verified: bool, +} + +#[derive(Deserialize, Debug)] +pub struct PayloadCommit { + pub added: Option>, + pub author: PayloadUser, + pub committer: PayloadUser, + pub id: String, + pub message: String, + pub modified: Option>, + pub removed: Option>, + pub timestamp: DateTime, + pub url: String, + pub verfification: Option, +} + +#[derive(Deserialize, Debug)] +pub struct Branch { + pub commit: PayloadCommit, + pub effective_branch_protection_name: String, + pub enable_status_check: bool, + pub name: String, + pub protected: bool, + pub required_approvals: i64, + pub status_check_contexts: Vec, + pub user_can_merge: bool, + pub user_can_push: bool, +} + +#[async_trait] +pub trait GriteaExt { + async fn get_repo_branches(&self, owner: &str, repo: &str) -> Result>; +} + +#[async_trait] +impl GriteaExt for Gritea { + async fn get_repo_branches(&self, owner: &str, repo: &str) -> Result> { + let resp = self + .request(Method::GET, &format!("repos/{}/{}/branches", owner, repo))? + .send() + .await?; + + resp_json(resp, "get repo branches failed").await + } +} diff --git a/backend/src/lib.rs b/backend/src/lib.rs new file mode 100644 index 0000000..450f7b9 --- /dev/null +++ b/backend/src/lib.rs @@ -0,0 +1,35 @@ +use anyhow::Result; +use askama::Template; +use std::fs; + +pub mod api; +pub mod config; +pub mod db; +pub mod gritea_ext; +pub mod templates; +pub mod worker; + +pub use config::CONFIG; + +pub const ASCII_LOGO: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/logo.txt")); + +pub fn init() -> Result<()> { + println!("{}\n", ASCII_LOGO); + CONFIG.validate()?; + + Ok(()) +} + +pub fn init_nginx() -> Result<()> { + let config = templates::NginxConfig { + domain_segments: CONFIG.domain.split('.').collect(), + } + .render()?; + log::info!("Updating Nginx config"); + fs::write( + format!("{}/gitea_pages.conf", CONFIG.nginx_config_dir), + config, + )?; + + Ok(()) +} diff --git a/backend/src/main.rs b/backend/src/main.rs new file mode 100644 index 0000000..33e9140 --- /dev/null +++ b/backend/src/main.rs @@ -0,0 +1,221 @@ +#[cfg(not(target_env = "msvc"))] +use tikv_jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + +use anyhow::Result; +use clap::{Parser, Subcommand}; +use diesel::prelude::*; +use uuidv7::Uuid; + +use gitea_pages::{api, db, init, init_nginx, worker, CONFIG}; + +#[derive(Debug, Parser)] +#[clap(author, version, about, long_about = None)] +struct Cli { + #[clap(subcommand)] + commands: Commands, +} + +#[derive(Debug, Subcommand)] +enum Commands { + #[clap(about = "Starts Celery worker")] + Worker, + + #[clap(about = "Starts beat for Celery worker")] + Beat, + + #[clap(about = "Starts API")] + Api, +} + +#[tokio::main] +async fn main() -> Result<()> { + let args = Cli::parse(); + + env_logger::init(); + + init()?; + + match args.commands { + Commands::Worker => { + init_nginx()?; + + let worker_conn = &worker::POOL.get().await.get().await?; + worker_conn.display_pretty().await; + worker_conn.consume_from(&[worker::QUEUE_NAME]).await?; + } + Commands::Beat => { + worker::beat().await?.start().await?; + } + Commands::Api => { + use actix_cors::Cors; + use actix_web::{ + http::header, middleware, web, App, HttpRequest, HttpResponse, HttpServer, + }; + use anyhow::Result; + use juniper_actix::graphql_handler; + use serde::Deserialize; + use std::str::FromStr; + + async fn not_found() -> &'static str { + "Not found!" + } + + #[derive(Deserialize, Debug)] + struct Owner { + username: String, + } + + #[derive(Deserialize, Debug)] + struct Repository { + owner: Owner, + name: String, + } + + #[derive(Deserialize, Debug)] + struct Payload { + repository: Repository, + } + + async fn webhook(req: HttpRequest, body: web::Bytes) -> HttpResponse { + if let Some(content_type) = req.headers().get(header::CONTENT_TYPE) { + if content_type.as_bytes() != b"application/json" { + return HttpResponse::BadRequest() + .body("Content-Type not application/json"); + } + } + + let key = + ring::hmac::Key::new(ring::hmac::HMAC_SHA256, CONFIG.gitea_secret.as_bytes()); + + let signature = match req.headers().get("X-Gitea-Signature") { + Some(x) => x, + None => return HttpResponse::BadRequest().body("X-Gitea-Signature not given"), + }; + let mut tag = vec![0u8; signature.len() / 2]; + if hex_simd::decode(signature.as_bytes(), hex_simd::Out::from_slice(&mut tag)) + .is_err() + { + return HttpResponse::BadRequest().body("Could not decode signature"); + } + + if ring::hmac::verify(&key, body.as_ref(), &tag).is_err() { + return HttpResponse::BadRequest().body("Invalid signature"); + } + + let payload = match serde_json::from_slice::(body.as_ref()) { + Ok(x) => x, + Err(_) => return HttpResponse::BadRequest().body("Payload has invalid JSON"), + }; + + let db_conn = &mut match db::POOL.get() { + Ok(x) => x, + Err(_) => return HttpResponse::InternalServerError().finish(), + }; + let user_id = match db::schema::users::table + .select(db::schema::users::id) + .filter(db::schema::users::name.eq(payload.repository.owner.username)) + .first::(db_conn) + .optional() + { + Ok(x) => match x { + Some(y) => y, + None => { + return HttpResponse::BadRequest().body("Repository is not allowed") + } + }, + Err(_) => return HttpResponse::InternalServerError().finish(), + }; + let repo_id = match db::schema::repositories::table + .select(db::schema::repositories::id) + .filter(db::schema::repositories::user_id.eq(user_id)) + .filter(db::schema::repositories::name.eq(payload.repository.name)) + .first::(db_conn) + .optional() + { + Ok(x) => match x { + Some(y) => y, + None => { + return HttpResponse::BadRequest().body("Repository is not allowed") + } + }, + Err(_) => return HttpResponse::InternalServerError().finish(), + }; + + let worker_conn = match worker::POOL.get().await.get().await { + Ok(x) => x, + Err(_) => return HttpResponse::InternalServerError().finish(), + }; + if worker_conn + .send_task(worker::get_repo::get_repo::new(repo_id)) + .await + .is_err() + { + return HttpResponse::InternalServerError().finish(); + } + + HttpResponse::Ok().finish() + } + + async fn graphql_route( + req: HttpRequest, + payload: web::Payload, + schema: web::Data, + ) -> Result { + let logged_in = match req + .headers() + .get(header::AUTHORIZATION) + .and_then(|x| x.to_str().ok()) + { + Some(x) => match http_auth_basic::Credentials::from_str(x) { + Ok(cred) => { + cred.user_id == CONFIG.user && cred.password == *CONFIG.password + } + Err(_) => false, + }, + None => false, + }; + + let context = api::Context { + db_pool: db::POOL.clone(), + worker_pool: worker::POOL.get().await.clone(), + loaders: api::context::Loaders::default(), + logged_in, + }; + + graphql_handler(&schema, &context, req, payload).await + } + + HttpServer::new(move || { + App::new() + .app_data(web::Data::new(api::schema())) + .wrap(middleware::Logger::default()) + .wrap(middleware::Compress::default()) + .wrap( + Cors::default() + .allow_any_origin() + .allowed_methods(["POST", "GET"]) + .allowed_headers([header::AUTHORIZATION, header::ACCEPT]) + .allowed_header(header::CONTENT_TYPE) + .supports_credentials() + .max_age(3600), + ) + .service(web::resource("/webhook").route(web::post().to(webhook))) + .service( + web::resource("/graphql") + .route(web::post().to(graphql_route)) + .route(web::get().to(graphql_route)), + ) + .default_service(web::to(not_found)) + }) + .bind(("0.0.0.0", 8080))? + .run() + .await?; + } + } + + Ok(()) +} diff --git a/backend/src/templates.rs b/backend/src/templates.rs new file mode 100644 index 0000000..171a97a --- /dev/null +++ b/backend/src/templates.rs @@ -0,0 +1,7 @@ +use askama::Template; + +#[derive(Template)] +#[template(path = "gitea_pages.conf", escape = "none")] +pub struct NginxConfig<'a> { + pub domain_segments: Vec<&'a str>, +} diff --git a/backend/src/worker/delete_repo.rs b/backend/src/worker/delete_repo.rs new file mode 100644 index 0000000..bf44700 --- /dev/null +++ b/backend/src/worker/delete_repo.rs @@ -0,0 +1,53 @@ +use anyhow::Result; +use celery::{error::TaskError, task::TaskResult}; +use diesel::prelude::*; +use std::fs; +use uuidv7::Uuid; + +use crate::{db, CONFIG}; + +fn do_task(db_conn: &mut db::Connection, id: Uuid) -> Result<()> { + let (user_id, name) = db::schema::repositories::table + .select(( + db::schema::repositories::user_id, + db::schema::repositories::name, + )) + .filter(db::schema::repositories::id.eq(id)) + .first::<(Uuid, String)>(db_conn)?; + let user_name = db::schema::users::table + .select(db::schema::users::name) + .filter(db::schema::users::id.eq(user_id)) + .first::(db_conn)?; + + diesel::delete(db::schema::repositories::table.filter(db::schema::repositories::id.eq(id))) + .execute(db_conn)?; + + if db::schema::repositories::table + .filter(db::schema::repositories::user_id.eq(user_id)) + .count() + .get_result::(db_conn)? + == 0 + { + diesel::delete(db::schema::users::table.filter(db::schema::users::id.eq(user_id))) + .execute(db_conn)?; + fs::remove_dir_all(format!("{}/{}", CONFIG.repos_dir, user_name))?; + } else { + fs::remove_dir_all(format!("{}/{}/{}", CONFIG.repos_dir, user_name, name))?; + } + + Ok(()) +} + +#[celery::task] +pub fn delete_repo(id: Uuid) -> TaskResult<()> { + let db_conn = &mut match db::POOL.get() { + Ok(x) => x, + Err(e) => return Err(TaskError::UnexpectedError(format!("{:?}", e))), + }; + + if let Err(e) = do_task(db_conn, id) { + return Err(TaskError::UnexpectedError(format!("{:?}", e))); + } + + Ok(()) +} diff --git a/backend/src/worker/get_repo.rs b/backend/src/worker/get_repo.rs new file mode 100644 index 0000000..36a0243 --- /dev/null +++ b/backend/src/worker/get_repo.rs @@ -0,0 +1,100 @@ +use anyhow::{bail, Context, Result}; +use celery::{error::TaskError, task::TaskResult}; +use diesel::prelude::*; +use std::{fs, path::Path}; +use url::Url; +use uuidv7::Uuid; + +use crate::{db, CONFIG}; + +fn get_repo_name(db_conn: &mut db::Connection, id: Uuid) -> Result<(String, String)> { + let (user_id, name) = db::schema::repositories::table + .select(( + db::schema::repositories::user_id, + db::schema::repositories::name, + )) + .filter(db::schema::repositories::id.eq(id)) + .first::<(Uuid, String)>(db_conn)?; + let user_name = db::schema::users::table + .select(db::schema::users::name) + .filter(db::schema::users::id.eq(user_id)) + .first::(db_conn)?; + + Ok((user_name, name)) +} + +fn repo_dir(user: &str, repo: &str) -> (String, String, String) { + let parent = format!("{}/{}", CONFIG.repos_dir, user); + let dir = format!("{}/{}", parent, repo); + + (parent, dir, format!("{}/{}.git", user, repo)) +} + +fn do_task(parent_dir: &str, repo_dir: &str, full_name_path: &str) -> Result<()> { + let path = Path::new(repo_dir); + if path.exists() && path.is_dir() { + let repo = git2::Repository::open(repo_dir)?; + + repo.find_remote("origin")? + .fetch(&[&CONFIG.gitea_pull_branch], None, None)?; + + let fetch_head = repo.find_reference("FETCH_HEAD")?; + let fetch_commit = repo.reference_to_annotated_commit(&fetch_head)?; + let analysis = repo.merge_analysis(&[&fetch_commit])?; + + if !analysis.0.is_up_to_date() { + if analysis.0.is_fast_forward() { + let refname = format!("refs/heads/{}", CONFIG.gitea_pull_branch); + let mut reference = repo.find_reference(&refname)?; + reference.set_target(fetch_commit.id(), "Fast-Forward")?; + repo.set_head(&refname)?; + repo.checkout_head(Some(git2::build::CheckoutBuilder::default().force()))?; + } else { + bail!("Fast-forward only!"); + } + } + } else { + fs::create_dir_all(parent_dir)?; + + let repo = git2::Repository::clone( + Url::parse(CONFIG.gitea_pull_url.as_str())? + .join(full_name_path)? + .as_str(), + repo_dir, + )?; + + let (object, reference) = + repo.revparse_ext(&format!("remotes/origin/{}", CONFIG.gitea_pull_branch))?; + repo.checkout_tree(&object, None)?; + match reference { + Some(gref) => repo.set_head(gref.name().context("Could not get ref name")?), + None => repo.set_head_detached(object.id()), + } + .context("Failed to set HEAD")?; + }; + + Ok(()) +} + +#[celery::task] +pub async fn get_repo(id: Uuid) -> TaskResult<()> { + let db_conn = &mut match db::POOL.get() { + Ok(x) => x, + Err(e) => return Err(TaskError::UnexpectedError(format!("{:?}", e))), + }; + + let (user_name, repo_name) = match get_repo_name(db_conn, id) { + Ok(x) => x, + Err(e) => return Err(TaskError::UnexpectedError(format!("{:?}", e))), + }; + + let (parent_dir, repo_dir, full_name_path) = repo_dir(&user_name, &repo_name); + if let Err(e) = do_task(&parent_dir, &repo_dir, &full_name_path) { + if let Err(err) = fs::remove_dir_all(repo_dir) { + return Err(TaskError::UnexpectedError(format!("{:?}", err))); + } + return Err(TaskError::UnexpectedError(format!("{:?}", e))); + } + + Ok(()) +} diff --git a/backend/src/worker/mod.rs b/backend/src/worker/mod.rs new file mode 100644 index 0000000..888aa7f --- /dev/null +++ b/backend/src/worker/mod.rs @@ -0,0 +1,89 @@ +use anyhow::Result; +use async_once::AsyncOnce; +use async_trait::async_trait; +use celery::beat::{Beat, DeltaSchedule, LocalSchedulerBackend}; +use celery::prelude::*; +use celery::Celery; +use lazy_static::lazy_static; +use std::sync::Arc; +use std::time::Duration; +use stdext::duration::DurationExt; + +pub mod delete_repo; +pub mod get_repo; +pub mod update_repos; + +use crate::CONFIG; + +pub const QUEUE_NAME: &str = "gitea_pages"; + +pub async fn app() -> Result, CeleryError> { + celery::app!( + broker = AMQPBroker { &CONFIG.amqp_url }, + tasks = [ + get_repo::get_repo, + delete_repo::delete_repo, + update_repos::update_repos, + ], + task_routes = [ + "*" => QUEUE_NAME, + ], + prefetch_count = 2, + heartbeat = Some(10) + ) + .await +} + +pub async fn beat() -> Result, BeatError> { + celery::beat!( + broker = AMQPBroker { &CONFIG.amqp_url }, + tasks = [ + // "cleanup_tokens" => { + // cleanup_tokens::cleanup_tokens, + // schedule = DeltaSchedule::new(Duration::from_hours(1)), + // args = (), + // } + "update_repos" => { + update_repos::update_repos, + schedule = DeltaSchedule::new(Duration::from_days(1)), + args = (), + }, + ], + task_routes = [ + "*" => QUEUE_NAME, + ] + ) + .await +} + +pub type Connection = Arc; + +pub struct ConnectionManager; + +#[async_trait] +impl bb8::ManageConnection for ConnectionManager { + type Connection = Connection; + type Error = CeleryError; + + async fn connect(&self) -> Result { + app().await + } + + async fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Error> { + Ok(()) + } + + fn has_broken(&self, _: &mut Self::Connection) -> bool { + false + } +} + +pub type Pool = bb8::Pool; + +pub async fn pool() -> Result { + Ok(bb8::Pool::builder().build(ConnectionManager).await?) +} + +lazy_static! { + pub static ref POOL: AsyncOnce = AsyncOnce::new(async { pool().await.unwrap() }); +} diff --git a/backend/src/worker/update_repos.rs b/backend/src/worker/update_repos.rs new file mode 100644 index 0000000..bfb5d3e --- /dev/null +++ b/backend/src/worker/update_repos.rs @@ -0,0 +1,31 @@ +use anyhow::Result; +use celery::prelude::*; +use diesel::prelude::*; +use uuidv7::Uuid; + +use crate::{db, worker}; + +async fn do_task() -> Result<()> { + let db_conn = &mut db::POOL.get()?; + let repo_ids = db::schema::repositories::table + .select(db::schema::repositories::id) + .load::(db_conn)?; + + let worker_conn = worker::POOL.get().await.get().await?; + for id in repo_ids { + worker_conn + .send_task(worker::get_repo::get_repo::new(id)) + .await?; + } + + Ok(()) +} + +#[celery::task] +pub async fn update_repos() -> TaskResult<()> { + if let Err(e) = do_task().await { + return Err(TaskError::UnexpectedError(format!("{:?}", e))); + } + + Ok(()) +} diff --git a/backend/templates/gitea_pages.conf b/backend/templates/gitea_pages.conf new file mode 100644 index 0000000..a26ff1c --- /dev/null +++ b/backend/templates/gitea_pages.conf @@ -0,0 +1,28 @@ +map $host $subdomain { + ~^(?P.+)\.{{ domain_segments|join("\\.") }}$ $sub; +} + +server { + listen 80; + server_name *.{{ domain_segments|join(".") }}; + + root /var/www/repos/$subdomain; + + location = / { + autoindex on; + } + + location / { + try_files $uri $uri/ /index.html; + index index.html index.htm; + + if (!-e $request_filename) { + return 404; + } + } + + location ~ /\.git { + deny all; + return 404; + } +} diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf new file mode 100644 index 0000000..64b4a84 --- /dev/null +++ b/config/nginx/nginx.conf @@ -0,0 +1,84 @@ +events { + worker_connections 1024; +} + +http { + server_tokens off; + more_clear_headers Server; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + sendfile on; + tcp_nopush on; + + include /opt/nginx-config/*.conf; + + server { + listen 81; + + location / { + proxy_pass http://frontend; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location = /robots.txt { + add_header Content-Type text/plain; + return 200 "User-agent: *\nDisallow: /\n"; + } + + location /graphql { + proxy_pass http://api:8080; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /webhook { + proxy_pass http://api:8080; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + + server { + listen 8080; + + location /adminer { + proxy_pass http://adminer:8080/; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location ~* /rabbitmq/api/(.*?)/(.*) { + proxy_pass http://rabbitmq:15672/api/$1/%2F/$2?$query_string; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location ~* /rabbitmq/(.*) { + rewrite ^/rabbitmq/(.*)$ /$1 break; + proxy_pass http://rabbitmq:15672; + proxy_buffering off; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..252686e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,156 @@ +version: "3" + +x-backend: + &backend + image: git.dergrimm.net/dergrimm/gitea_pages_backend:latest + build: + context: ./backend + restart: always + environment: + PAGES_DB_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_USER} + PAGES_AMQP_URL: amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@rabbitmq:5672 + PAGES_USER: ${PAGES_USER} + PAGES_PASSWORD: ${PAGES_PASSWORD} + PAGES_GITEA_URL: ${PAGES_GITEA_URL} + PAGES_GITEA_API_TOKEN: ${PAGES_GITEA_API_TOKEN} + PAGES_GITEA_SECRET: ${PAGES_GITEA_SECRET} + PAGES_GITEA_PULL_URL: ${PAGES_GITEA_PULL_URL} + PAGES_GITEA_PULL_BRANCH: ${PAGES_GITEA_PULL_BRANCH} + PAGES_NGINX_CONFIG_DIR: ${PAGES_NGINX_CONFIG_DIR} + PAGES_REPOS_DIR: ${PAGES_REPOS_DIR} + PAGES_DOMAIN: ${PAGES_DOMAIN} + +services: + nginx: + image: docker.io/byjg/nginx-extras:1.23 + restart: always + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - nginx-config:/opt/nginx-config:ro + - repos:/var/www/repos:ro + ports: + - 80:80 + - 81:81 + - 8080:8080 + depends_on: + - api + - adminer + - rabbitmq + + db: + image: docker.io/postgres:15-alpine + restart: always + environment: + TZ: Europe/Berlin + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - db:/var/lib/postgresql/data + + # pgbackups: + # image: docker.io/prodrigestivill/postgres-backup-local:15-alpine + # restart: always + # user: postgres:postgres + # volumes: + # - pgbackups:/backups + # links: + # - db + # depends_on: + # - db + # environment: + # POSTGRES_HOST: db + # POSTGRES_DB: ${POSTGRES_USER} + # POSTGRES_USER: ${POSTGRES_USER} + # POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + # POSTGRES_EXTRA_OPTS: "-Z6 --schema=public --blobs" + # SCHEDULE: "@daily" + # BACKUP_KEEP_DAYS: 7 + # BACKUP_KEEP_WEEKS: 4 + # BACKUP_KEEP_MONTHS: 6 + + adminer: + image: docker.io/adminer:standalone + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + depends_on: + - db + + rabbitmq: + image: docker.io/rabbitmq:3-management-alpine + restart: always + environment: + RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER} + RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD} + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - rabbitmq:/var/lib/rabbitmq + + migration_runner: + <<: *backend + command: ./migrate.sh + depends_on: + - db + + worker: + <<: *backend + command: ./run.sh worker + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + - nginx-config:/opt/nginx-config + - repos:/data/repos + depends_on: + - db + - rabbitmq + - migration_runner + + beat: + <<: *backend + command: ./run.sh beat + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + depends_on: + - db + - rabbitmq + - worker + - migration_runner + + api: + <<: *backend + command: ./run.sh api + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + depends_on: + - db + - rabbitmq + - worker + - migration_runner + + frontend: + image: git.dergrimm.net/dergrimm/gitea_pages_frontend:latest + build: + context: ./frontend + restart: always + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + depends_on: + - api + +volumes: + nginx-config: + db: # pgbackups: + + rabbitmq: + repos: diff --git a/frontend/.cargo/config b/frontend/.cargo/config new file mode 100644 index 0000000..a4c154f --- /dev/null +++ b/frontend/.cargo/config @@ -0,0 +1,3 @@ +[build] +target = "wasm32-unknown-unknown" +rustflags = ["--cfg=web_sys_unstable_apis"] diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..53821be --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,10 @@ +/docs/ +/lib/ +/bin/ +/.shards/ +*.dwarf +*.env +/examples/ +Dockerfile +.dockerignore +README.md diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1 @@ +/target diff --git a/frontend/Cargo.lock b/frontend/Cargo.lock new file mode 100644 index 0000000..5fbe97d --- /dev/null +++ b/frontend/Cargo.lock @@ -0,0 +1,2212 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "anymap" +version = "1.0.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" + +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-trait" +version = "0.1.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive", + "hashbrown", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bounce" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6d93ceff05b2939e6656d2a7a091f8a9e4ccabb2c52c74f15a666526abb944" +dependencies = [ + "anymap2", + "bounce-macros", + "futures", + "gloo", + "once_cell", + "serde", + "tracing", + "wasm-bindgen", + "web-sys", + "yew", +] + +[[package]] +name = "bounce-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1452ffe40563716a2ba1e0ccf47fce0b714df33cdf2ad474b1d5595ecff5766" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bumpalo" +version = "3.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cargo-emit" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1582e1c9e755dd6ad6b224dcffb135d199399a4568d454bd89fe515ca8425695" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "counter" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d458e66999348f56fd3ffcfbb7f7951542075ca8359687c703de6500c1ddccd" +dependencies = [ + "num-traits", +] + +[[package]] +name = "cynic" +version = "2.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1afa0591b1021e427e548a1f0f147fe6168f6c7c7f7006bace77f28856051b8" +dependencies = [ + "cynic-proc-macros", + "reqwest", + "serde", + "serde_json", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cynic-codegen" +version = "2.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a1bb05cc554f46079d0fa72abe995a2d32d0737d410a41da75b31e3f7ef768" +dependencies = [ + "counter", + "darling", + "graphql-parser", + "once_cell", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "cynic-proc-macros" +version = "2.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa595c4ed7a5374e0e58c5c34f9d93bd6b7d45062790963bd4b4c3c0bf520c4d" +dependencies = [ + "cynic-codegen", + "syn 1.0.109", +] + +[[package]] +name = "cynic-querygen" +version = "2.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5816b312e83a0dbb013cc229d0cc9492b99ceefb85f7d4d697ab71b5a2c8d5e0" +dependencies = [ + "Inflector", + "graphql-parser", + "once_cell", + "rust_decimal", + "thiserror", + "uuid 0.8.2", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "frontend" +version = "0.1.0" +dependencies = [ + "bounce", + "cargo-emit", + "cynic", + "cynic-querygen", + "gloo", + "implicit-clone", + "lazy_static", + "log", + "paste", + "reqwest", + "serde", + "serde_json", + "wasm-logger", + "web-sys", + "wee_alloc", + "yew", + "yew-router", + "yewdux", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "gloo" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a4bef6b277b3ab073253d4bca60761240cf8d6998f4bd142211957b69a61b20" +dependencies = [ + "gloo-console", + "gloo-dialogs", + "gloo-events", + "gloo-file", + "gloo-history", + "gloo-net", + "gloo-render", + "gloo-storage", + "gloo-timers", + "gloo-utils", + "gloo-worker", +] + +[[package]] +name = "gloo-console" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-file" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "futures-channel", + "gloo-events", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-history" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd451019e0b7a2b8a7a7b23e74916601abf1135c54664e57ff71dcc26dfcdeb7" +dependencies = [ + "gloo-events", + "gloo-utils", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-worker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" +dependencies = [ + "anymap2", + "bincode", + "gloo-console", + "gloo-utils", + "js-sys", + "serde", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "h2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "implicit-clone" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" +dependencies = [ + "indexmap", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnet" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" + +[[package]] +name = "linux-raw-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.45.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "openssl" +version = "0.10.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pinned" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a829027bd95e54cfe13e3e258a1ae7b645960553fb82b75ff852c29688ee595b" +dependencies = [ + "futures", + "rustversion", + "thiserror", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" +dependencies = [ + "futures", + "gloo", + "num_cpus", + "once_cell", + "pin-project", + "pinned", + "tokio", + "tokio-stream", + "wasm-bindgen-futures", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rend" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rkyv" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +dependencies = [ + "bitvec", + "bytecheck", + "hashbrown", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid 1.3.3", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + +[[package]] +name = "rust_decimal" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" +dependencies = [ + "arrayvec", + "borsh", + "bytecheck", + "byteorder", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustix" +version = "0.37.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustversion" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "security-framework" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.163" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "slab" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.45.0", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +dependencies = [ + "autocfg", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "uuid" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.16", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" + +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yew" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" +dependencies = [ + "console_error_panic_hook", + "futures", + "gloo", + "implicit-clone", + "indexmap", + "js-sys", + "prokio", + "rustversion", + "serde", + "slab", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro", +] + +[[package]] +name = "yew-macro" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" +dependencies = [ + "boolinator", + "once_cell", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "yew-router" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "426ee0486d2572a6c5e39fbdbc48b58d59bb555f3326f54631025266cf04146e" +dependencies = [ + "gloo", + "js-sys", + "route-recognizer", + "serde", + "serde_urlencoded", + "tracing", + "wasm-bindgen", + "web-sys", + "yew", + "yew-router-macro", +] + +[[package]] +name = "yew-router-macro" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b249cdb39e0cddaf0644dedc781854524374664793479fdc01e6a65d6e6ae3" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "yewdux" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653ba356bc60d1804c28ec6cc8ddac2741c686bde2a65074d07faba735914464" +dependencies = [ + "anymap", + "async-trait", + "log", + "serde", + "serde_json", + "slab", + "thiserror", + "wasm-bindgen", + "web-sys", + "yew", + "yewdux-macros", +] + +[[package]] +name = "yewdux-macros" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25bcd923aceaa85cb4affad8657cc36e3d6b6932740e711574182f7817492739" +dependencies = [ + "darling", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml new file mode 100644 index 0000000..9d11671 --- /dev/null +++ b/frontend/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "frontend" +version = "0.1.0" +edition = "2021" +build = "build.rs" + +[profile.release] +lto = true +codegen-units = 1 +opt-level = "z" +panic = "abort" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +bounce = { version = "0.6.1", features = ["helmet"] } +cynic = { version = "2.2.8", features = ["http-reqwest"] } +gloo = "0.8.0" +implicit-clone = "0.3.5" +lazy_static = "1.4.0" +log = "0.4.17" +paste = "1.0.12" +reqwest = "0.11.18" +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" +wasm-logger = "0.2.0" +web-sys = { version = "0.3.63", features = ["Window", "Location"] } +wee_alloc = "0.4.5" +yew = { version = "0.20.0", features = ["csr"] } +yew-router = "0.17.0" +yewdux = "0.9.2" + +[build-dependencies] +cynic-querygen = "2.2.8" +cargo-emit = "0.2.1" diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..67f5ab4 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,59 @@ +FROM docker.io/alpine:3.18.0 as alpine + +FROM docker.io/lukemathwalker/cargo-chef:latest-rust-1.69.0 as chef + +FROM codycraven/sassc:3.6.1 as css +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] +ENV PYTHONUNBUFFERED=1 +RUN apk add --update --no-cache python3=3.7.10-r0 +WORKDIR /usr/src/scss +COPY ./compile_css.py . +RUN chmod +x ./compile_css.py +COPY ./scss ./src +RUN ./compile_css.py ./src ./dist + +FROM chef as planner +WORKDIR /usr/src/frontend +RUN mkdir src && touch src/main.rs +COPY ./Cargo.toml ./Cargo.lock ./ +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef as builder +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +WORKDIR /usr/local/bin +ARG TRUNK_VERSION="v0.16.0" +RUN wget -qO- https://github.com/thedodd/trunk/releases/download/${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- +RUN rustup target add wasm32-unknown-unknown +WORKDIR /usr/src/frontend +COPY ./.cargo ./.cargo +COPY --from=planner /usr/src/frontend/recipe.json . +RUN cargo chef cook --release --recipe-path recipe.json +COPY ./build.rs . +COPY ./schema.graphql ./query.graphql ./ +RUN cargo build --release --frozen --offline +COPY ./src ./src +RUN cargo build --release --frozen --offline +COPY --from=css /usr/src/scss/dist ./css +COPY ./index.html ./index.html +RUN trunk build --release + +FROM git.dergrimm.net/dergrimm/minify:2.12.5 as public +WORKDIR /usr/src/public +COPY --from=builder /usr/src/frontend/dist . +RUN minify . -r -o . + +FROM alpine as binaryen +SHELL ["/bin/ash", "-eo", "pipefail", "-c"] +WORKDIR /tmp +ARG BINARYEN_VERSION="110" +RUN wget -qO- https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz | tar -xzf- +RUN cp ./binaryen-version_${BINARYEN_VERSION}/bin/wasm-opt /usr/local/bin && \ + rm -rf ./binaryen-version_${BINARYEN_VERSION} +WORKDIR /usr/src/public +COPY --from=public /usr/src/public . +RUN find . -name "*.wasm" -type f -print0 | xargs -0 -I % wasm-opt % -o % -O --intrinsic-lowering -Oz + +FROM docker.io/openresty/openresty:1.21.4.1-0-alpine as runner +COPY ./nginx.conf /usr/local/openresty/nginx/conf/nginx.conf +COPY --from=binaryen /usr/src/public /var/www/html +EXPOSE 80 diff --git a/frontend/build.rs b/frontend/build.rs new file mode 100644 index 0000000..1c8e7e6 --- /dev/null +++ b/frontend/build.rs @@ -0,0 +1,28 @@ +use std::env; +use std::fs; +use std::path::Path; + +fn main() { + let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + let out_dir = env::var("OUT_DIR").unwrap(); + + let schema = fs::read_to_string(Path::new(&manifest_dir).join("schema.graphql")).unwrap(); + let query = fs::read_to_string(Path::new(&manifest_dir).join("query.graphql")).unwrap(); + + let code = cynic_querygen::document_to_fragment_structs( + query, + schema, + &cynic_querygen::QueryGenOptions { + schema_path: "schema.graphql".to_string(), + query_module: "schema".to_string(), + }, + ) + .unwrap(); + let patched_code = code + .replace("mod queries", "pub mod queries") + .replace("mod schema", "pub mod schema"); + + fs::write(Path::new(&out_dir).join("graphql.rs"), patched_code).unwrap(); + + cargo_emit::rerun_if_changed!("schema.graphql", "query.graphql"); +} diff --git a/frontend/compile_css.py b/frontend/compile_css.py new file mode 100644 index 0000000..4471d09 --- /dev/null +++ b/frontend/compile_css.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import glob +import sys +from pathlib import Path + +EXTENSIONS = ("*.css", "*.sass", "*.scss") + + +def compile(p): + print("==========") + print(f"{p}:") + dist = Path(sys.argv[2], *p.with_suffix(".css").parts[1:]) + print(f"\tWriting to: {dist}") + print(f"\tCreating dir: {dist.parent}") + dist.parent.mkdir(parents=True, exist_ok=True) + prompt = f"sassc {p} > {dist}" + print(f"\tInvoking sassc: {prompt}") + os.system(prompt) + + +for ext in EXTENSIONS: + for p in Path(sys.argv[1]).rglob(ext): + compile(p) diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..2bed0b9 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..5e6cc19 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,24 @@ +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + tcp_nopush on; + + server_tokens off; + more_clear_headers Server; + + server { + listen 80; + + root /var/www/html; + + location / { + try_files $uri /index.html; + } + } +} diff --git a/frontend/query.graphql b/frontend/query.graphql new file mode 100644 index 0000000..fd1077b --- /dev/null +++ b/frontend/query.graphql @@ -0,0 +1,33 @@ +query Users { + users { + name + repositories { + id + name + url + } + } +} + +query UserByName($name: String!) { + userByName(name: $name) { + repositories { + name + url + } + } +} + +query VerifyLogin($username: String!, $password: String!) { + verifyLogin(username: $username, password: $password) +} + +mutation CreateRepository($user: String!, $name: String!) { + createRepository(input: { user: $user, name: $name }) { + id + } +} + +mutation DeleteRepository($id: UUID!) { + deleteRepository(id: $id) +} diff --git a/frontend/schema.graphql b/frontend/schema.graphql new file mode 100644 index 0000000..77d8859 --- /dev/null +++ b/frontend/schema.graphql @@ -0,0 +1,37 @@ +input CreateRepositoryInput { + user: String! + name: String! +} + +type Mutation { + createRepository(input: CreateRepositoryInput!): Repository! + deleteRepository(id: UUID!): Boolean! +} + +type Query { + ping: String! + verifyLogin(username: String!, password: String!): Boolean! + user(id: UUID!): User! + userByName(name: String!): User! + users: [User!]! + repository(id: UUID!): Repository! + repositories: [Repository!]! +} + +type Repository { + id: UUID! + user: User! + name: String! + url(scheme: Boolean): String! +} + +type User { + id: UUID! + name: String! + repositories: [Repository!]! +} + +""" +UUID encoded as a string +""" +scalar UUID diff --git a/frontend/scss/styles.scss b/frontend/scss/styles.scss new file mode 100644 index 0000000..824a480 --- /dev/null +++ b/frontend/scss/styles.scss @@ -0,0 +1,58 @@ +body { + display: flex; + flex-direction: column; + overflow-x: hidden; + min-height: 100vh; +} + +#wrapper { + flex: 1; +} + +#main { + margin: 2vh 0; +} + +#notifications { + overflow: hidden; + position: fixed; + right: 0; + z-index: 100; +} + +#notifications-column { + width: 100%; + margin: 5% 0 0 auto; +} + +.notification-slide-from-right { + position: relative; + animation-name: slideFromRight; + animation-duration: 0.5s; + animation-timing-function: ease; + transition: all 1s ease-out; + margin-right: 5%; +} + +@keyframes slideFromRight { + from { + opacity: 0; + transform: translateX(100%); + } + + to { + opacity: 1; + transform: translateX(0); + } +} + +// .loader { +// width: 48px; +// height: 48px; +// border: 5px solid black; +// border-bottom-color: transparent; +// border-radius: 50%; +// display: inline-block; +// box-sizing: border-box; +// animation: rotation 1s linear infinite; +// } diff --git a/frontend/src/components/footer.rs b/frontend/src/components/footer.rs new file mode 100644 index 0000000..dab7c58 --- /dev/null +++ b/frontend/src/components/footer.rs @@ -0,0 +1,51 @@ +use yew::prelude::*; + +pub struct Footer; + +impl Component for Footer { + type Message = (); + type Properties = (); + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, _ctx: &Context) -> Html { + html! { + + } + } +} diff --git a/frontend/src/components/loading.rs b/frontend/src/components/loading.rs new file mode 100644 index 0000000..2d8173a --- /dev/null +++ b/frontend/src/components/loading.rs @@ -0,0 +1,18 @@ +use yew::prelude::*; + +pub struct Loading; + +impl Component for Loading { + type Message = (); + type Properties = (); + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, _ctx: &Context) -> Html { + html! { +

{ "Loading..." }

+ } + } +} diff --git a/frontend/src/components/mod.rs b/frontend/src/components/mod.rs new file mode 100644 index 0000000..727fb25 --- /dev/null +++ b/frontend/src/components/mod.rs @@ -0,0 +1,13 @@ +pub mod footer; +pub mod loading; +pub mod navbar; +pub mod notification; +pub mod notification_listing; +pub mod user_pane; + +pub use footer::Footer; +pub use loading::Loading; +pub use navbar::Navbar; +pub use notification::Notification; +pub use notification_listing::NotificationListing; +pub use user_pane::UserPane; diff --git a/frontend/src/components/navbar.rs b/frontend/src/components/navbar.rs new file mode 100644 index 0000000..1aefc46 --- /dev/null +++ b/frontend/src/components/navbar.rs @@ -0,0 +1,124 @@ +use std::rc::Rc; +use yew::prelude::*; +use yew_router::prelude::*; +use yewdux::prelude::*; + +use crate::{routes, stores}; + +pub enum Msg { + UpdateUser(Rc), + BurgerClicked, + Logout, +} + +pub struct Navbar { + user: Rc, + user_dispatch: Dispatch, + burger_active: bool, +} + +impl Component for Navbar { + type Message = Msg; + type Properties = (); + + fn create(ctx: &Context) -> Self { + let user_dispatch = Dispatch::subscribe(ctx.link().callback(Msg::UpdateUser)); + + Self { + user: user_dispatch.get(), + user_dispatch, + burger_active: false, + } + } + + fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::UpdateUser(x) => { + self.user = x; + + true + } + Msg::BurgerClicked => { + self.burger_active = !self.burger_active; + + true + } + Msg::Logout => { + self.user_dispatch.set(stores::User(None)); + + true + } + } + } + + fn view(&self, ctx: &Context) -> Html { + html! { +
+ +
+ } + } +} diff --git a/frontend/src/components/notification.rs b/frontend/src/components/notification.rs new file mode 100644 index 0000000..5647e25 --- /dev/null +++ b/frontend/src/components/notification.rs @@ -0,0 +1,126 @@ +use gloo::timers::callback::Interval; +use std::rc::Rc; +use yew::prelude::*; + +use crate::{graphql, stores}; + +pub enum Msg { + Remove, +} + +#[derive(Clone, PartialEq)] +pub enum NotificationType { + Dark, + Primary, + Link, + Info, + Success, + Warning, + Danger, +} + +pub fn class_from_notification_type(x: &NotificationType) -> &'static str { + match x { + NotificationType::Dark => "is-dark", + NotificationType::Primary => "is-primary", + NotificationType::Link => "is-link", + NotificationType::Info => "is-info", + NotificationType::Success => "is-success", + NotificationType::Warning => "is-warning", + NotificationType::Danger => "is-danger", + } +} + +pub fn name_from_notification_type(x: &NotificationType) -> &'static str { + match x { + NotificationType::Dark => "Info", + NotificationType::Primary => "Info", + NotificationType::Link => "Info", + NotificationType::Info => "Info", + NotificationType::Success => "Success", + NotificationType::Warning => "Warning", + NotificationType::Danger => "Error", + } +} + +#[derive(Clone, PartialEq)] +pub enum NotificationMessage { + Text(Vec), + GraphQLError(graphql::GraphQLError), +} + +#[derive(Properties, PartialEq)] +pub struct Props { + pub notifications: Rc, + pub index: usize, + pub remove: Rc>, +} + +pub struct Notification { + _interval: Interval, +} + +impl Component for Notification { + type Message = Msg; + type Properties = Props; + + fn create(ctx: &Context) -> Self { + Self { + _interval: { + let link = ctx.link().clone(); + + Interval::new(15_000, move || link.send_message(Msg::Remove)) + }, + } + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::Remove => { + ctx.props().remove.emit(ctx.props().index); + + true + } + } + } + + fn view(&self, ctx: &Context) -> Html { + let notif = &ctx.props().notifications.notifications[&ctx.props().index]; + + html! { +
+
+
+

{ name_from_notification_type(¬if.notification_type) }

+
+
+ if let Some(message) = ¬if.message { + { + match message { + NotificationMessage::Text(x) => html! { + { + for x.iter().map(|s| html! { + <> + { s } +
+ + }) + } + }, + NotificationMessage::GraphQLError(x) => html! { + { x } + }, + } + } + } +
+
+
+ } + } +} diff --git a/frontend/src/components/notification_listing.rs b/frontend/src/components/notification_listing.rs new file mode 100644 index 0000000..e0d78f6 --- /dev/null +++ b/frontend/src/components/notification_listing.rs @@ -0,0 +1,58 @@ +use std::rc::Rc; +use yew::prelude::*; +use yewdux::prelude::*; + +use crate::{components, stores}; + +pub enum Msg { + UpdateNotifications(Rc), + Remove(usize), +} + +pub struct NotificationListing { + notifications: Rc, + notifications_dispatch: Dispatch, +} + +impl Component for NotificationListing { + type Message = Msg; + type Properties = (); + + fn create(ctx: &Context) -> Self { + let notifications_dispatch = + Dispatch::subscribe(ctx.link().callback(Msg::UpdateNotifications)); + + Self { + notifications: notifications_dispatch.get(), + notifications_dispatch, + } + } + + fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::UpdateNotifications(x) => { + self.notifications = x; + + true + } + Msg::Remove(i) => { + self.notifications_dispatch + .reduce_mut(|notifs| notifs.notifications.remove(&i)); + + true + } + } + } + + fn view(&self, ctx: &Context) -> Html { + let remove = Rc::new(ctx.link().callback(Msg::Remove)); + + html! { + { + for self.notifications.notifications.iter().rev().map(|(i, _)| html! { + + }) + } + } + } +} diff --git a/frontend/src/components/user_pane.rs b/frontend/src/components/user_pane.rs new file mode 100644 index 0000000..dfdc2f6 --- /dev/null +++ b/frontend/src/components/user_pane.rs @@ -0,0 +1,76 @@ +use yew::prelude::*; + +#[derive(PartialEq)] +pub struct Repository { + pub name: String, + pub url: Option, +} + +#[derive(Properties, PartialEq)] +pub struct Props { + pub name: AttrValue, + pub repositories: Vec, + pub on_click: Option>, +} + +pub enum Msg { + Emit(usize), +} + +pub struct UserPane; + +impl Component for UserPane { + type Message = Msg; + type Properties = Props; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::Emit(i) => { + ctx.props().on_click.as_ref().unwrap().emit(i); + + false + } + } + } + + fn view(&self, ctx: &Context) -> Html { + html! { + + } + } +} diff --git a/frontend/src/graphql.rs b/frontend/src/graphql.rs new file mode 100644 index 0000000..759ae49 --- /dev/null +++ b/frontend/src/graphql.rs @@ -0,0 +1,99 @@ +use lazy_static::lazy_static; +use serde::Deserialize; +use std::future::Future; +use std::pin::Pin; + +use crate::stores; + +lazy_static! { + pub static ref URL: String = format!( + "{}/graphql", + web_sys::window().unwrap().location().origin().unwrap() + ); +} + +type BoxFuture<'a, T> = Pin + 'a>>; + +pub trait ReqwestExt { + fn run_graphql( + self, + operation: cynic::Operation, + ) -> BoxFuture< + 'static, + Result, cynic::http::CynicReqwestError>, + > + where + Vars: serde::Serialize, + ResponseData: serde::de::DeserializeOwned + 'static, + Extensions: serde::de::DeserializeOwned + 'static; +} + +impl ReqwestExt for reqwest::RequestBuilder { + fn run_graphql( + self, + operation: cynic::Operation, + ) -> BoxFuture< + 'static, + Result, cynic::http::CynicReqwestError>, + > + where + Vars: serde::Serialize, + ResponseData: serde::de::DeserializeOwned + 'static, + Extensions: serde::de::DeserializeOwned + 'static, + { + let builder = self.json(&operation); + Box::pin(async move { + match builder.send().await { + Ok(response) => { + let status = response.status(); + if !status.is_success() { + let body_string = response.text().await?; + + match serde_json::from_str::>( + &body_string, + ) { + Ok(response) => return Ok(response), + Err(_) => { + return Err(cynic::http::CynicReqwestError::ErrorResponse( + status, + body_string, + )); + } + }; + } + + response + .json::>() + .await + .map_err(cynic::http::CynicReqwestError::ReqwestError) + } + Err(e) => Err(cynic::http::CynicReqwestError::ReqwestError(e)), + } + }) + } +} + +pub fn client(user: Option<&stores::UserData>) -> reqwest::RequestBuilder { + let client = reqwest::Client::new().post(URL.as_str()); + + if let Some(x) = user { + client.basic_auth(&x.username, Some(&x.password)) + } else { + client + } +} + +#[derive(Deserialize, Clone, PartialEq, Eq, Debug)] +pub struct ErrorExtensions { + #[serde(rename = "type")] + pub error_type: String, +} + +pub type GraphQLError = cynic::GraphQlError; +pub type GraphQLResponse = cynic::GraphQlResponse; +pub type GraphQLResult = Result, cynic::http::CynicReqwestError>; + +include!(concat!(env!("OUT_DIR"), "/graphql.rs")); + +pub struct Uuid(pub String); +cynic::impl_scalar!(Uuid, schema::UUID); diff --git a/frontend/src/layouts/base.rs b/frontend/src/layouts/base.rs new file mode 100644 index 0000000..a9e76f9 --- /dev/null +++ b/frontend/src/layouts/base.rs @@ -0,0 +1,32 @@ +use yew::prelude::*; + +use crate::components; + +#[derive(Properties, PartialEq)] +pub struct Props { + #[prop_or_default] + pub children: Children, +} + +pub struct Base; + +impl Component for Base { + type Message = (); + type Properties = Props; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + html! { + <> +
+ + { for ctx.props().children.iter() } +
+ + + } + } +} diff --git a/frontend/src/layouts/logged_in.rs b/frontend/src/layouts/logged_in.rs new file mode 100644 index 0000000..24b4732 --- /dev/null +++ b/frontend/src/layouts/logged_in.rs @@ -0,0 +1,63 @@ +use std::rc::Rc; +use yew::prelude::*; +use yew_router::prelude::*; +use yewdux::prelude::*; + +use crate::{routes, stores}; + +pub enum Msg { + UpdateUser(Rc), +} + +#[derive(Properties, PartialEq)] +pub struct Props { + #[prop_or_default] + pub children: Children, +} + +pub struct LoggedIn { + user: Rc, + _user_dispatch: Dispatch, +} + +impl Component for LoggedIn { + type Message = Msg; + type Properties = Props; + + fn create(ctx: &Context) -> Self { + let user_dispatch = Dispatch::subscribe(ctx.link().callback(Msg::UpdateUser)); + let user = user_dispatch.get(); + + if !user.logged_in() { + ctx.link().navigator().unwrap().push(&routes::Route::Login); + } + + Self { + user, + _user_dispatch: user_dispatch, + } + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::UpdateUser(x) => { + let prev = self.user.logged_in(); + self.user = x; + + if !self.user.logged_in() { + ctx.link().navigator().unwrap().push(&routes::Route::Login); + } + + prev != self.user.logged_in() + } + } + } + + fn view(&self, ctx: &Context) -> Html { + html! { + if self.user.logged_in() { + { for ctx.props().children.iter() } + } + } + } +} diff --git a/frontend/src/layouts/main.rs b/frontend/src/layouts/main.rs new file mode 100644 index 0000000..11062a3 --- /dev/null +++ b/frontend/src/layouts/main.rs @@ -0,0 +1,39 @@ +use yew::prelude::*; + +use crate::{components, layouts}; + +#[derive(Properties, PartialEq)] +pub struct Props { + #[prop_or_default] + pub children: Children, +} + +pub struct Main; + +impl Component for Main { + type Message = (); + type Properties = Props; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + html! { + <> + +
+
+ { for ctx.props().children.iter() } +
+
+
+
+
+ +
+
+ + } + } +} diff --git a/frontend/src/layouts/mod.rs b/frontend/src/layouts/mod.rs new file mode 100644 index 0000000..db21fd8 --- /dev/null +++ b/frontend/src/layouts/mod.rs @@ -0,0 +1,9 @@ +pub mod base; +pub mod logged_in; +pub mod main; +pub mod not_found; + +pub use base::Base; +pub use logged_in::LoggedIn; +pub use main::Main; +pub use not_found::NotFound; diff --git a/frontend/src/layouts/not_found.rs b/frontend/src/layouts/not_found.rs new file mode 100644 index 0000000..37e71ae --- /dev/null +++ b/frontend/src/layouts/not_found.rs @@ -0,0 +1,49 @@ +use bounce::helmet::Helmet; +use yew::prelude::*; +use yew_router::prelude::*; + +use crate::routes; + +#[derive(Properties, PartialEq)] +pub struct Props { + pub message: AttrValue, + #[prop_or(true)] + pub ellipsis: bool, +} + +pub struct NotFound; + +impl Component for NotFound { + type Message = (); + type Properties = Props; + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, ctx: &Context) -> Html { + html! { + <> + + { &ctx.props().message } + + +
+

+ + { &ctx.props().message } + if ctx.props().ellipsis { + { "..." } + } + +

+

+ to={routes::Route::Index}> + { "Back to home" } + > +

+
+ + } + } +} diff --git a/frontend/src/lib.rs b/frontend/src/lib.rs new file mode 100644 index 0000000..e111669 --- /dev/null +++ b/frontend/src/lib.rs @@ -0,0 +1,5 @@ +pub mod components; +pub mod graphql; +pub mod layouts; +pub mod routes; +pub mod stores; diff --git a/frontend/src/main.rs b/frontend/src/main.rs new file mode 100644 index 0000000..4fe4b8d --- /dev/null +++ b/frontend/src/main.rs @@ -0,0 +1,46 @@ + + +use bounce::{helmet::HelmetBridge, BounceRoot}; +use implicit_clone::unsync::IString; +use yew::prelude::*; +use yew_router::prelude::*; + +#[global_allocator] +static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; + +use frontend::{layouts, routes}; + +pub const DEFAULT_TITLE: &str = "Gitea Pages"; + +fn format_title(title: IString) -> IString { + IString::from(format!("{} | {}", title, DEFAULT_TITLE)) +} + +struct App; + +impl Component for App { + type Message = (); + type Properties = (); + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, _ctx: &Context) -> Html { + html! { + + + + + render={routes::switch} /> + + + + } + } +} + +fn main() { + wasm_logger::init(wasm_logger::Config::default()); + yew::Renderer::::new().render(); +} diff --git a/frontend/src/routes/index.rs b/frontend/src/routes/index.rs new file mode 100644 index 0000000..4bb5112 --- /dev/null +++ b/frontend/src/routes/index.rs @@ -0,0 +1,429 @@ +use bounce::helmet::Helmet; +use cynic::{MutationBuilder, QueryBuilder}; +use std::rc::Rc; +use web_sys::HtmlInputElement; +use yew::prelude::*; +use yewdux::prelude::*; + +use crate::{ + components, + graphql::{self, ReqwestExt}, + stores, +}; + +pub enum Msg { + Void, + + UpdateUser(Rc), + LoadUsers, + UsersDone(graphql::GraphQLResult), + + OpenNewModal, + CloseNewModal, + NewModalSubmit, + NewModalSubmitDone(graphql::GraphQLResult), + + OpenEditModal(usize, usize), + CloseEditModal, + Delete, + DeleteDone(graphql::GraphQLResult), +} + +pub struct Index { + notifications_dispatch: Dispatch, + user: Rc, + _user_dispatch: Dispatch, + loading: bool, + users: Vec, + + new_modal: bool, + new_modal_save_loading: bool, + new_modal_user: NodeRef, + new_modal_repo: NodeRef, + + delete_modal: Option<(usize, usize)>, + delete_modal_delete_loading: bool, +} + +impl Component for Index { + type Message = Msg; + type Properties = (); + + fn create(ctx: &Context) -> Self { + let notifications_dispatch = Dispatch::subscribe(ctx.link().callback(|_| Msg::Void)); + let user_dispatch = Dispatch::subscribe(ctx.link().callback(Msg::UpdateUser)); + + ctx.link().send_message(Msg::LoadUsers); + + Self { + notifications_dispatch, + user: user_dispatch.get(), + _user_dispatch: user_dispatch, + loading: false, + users: vec![], + + new_modal: false, + new_modal_save_loading: false, + new_modal_user: NodeRef::default(), + new_modal_repo: NodeRef::default(), + + delete_modal: None, + delete_modal_delete_loading: false, + } + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::Void => false, + + Msg::UpdateUser(x) => { + self.user = x; + + true + } + Msg::LoadUsers => { + self.loading = true; + + let client = graphql::client(None); + let operation = graphql::queries::Users::build(()); + ctx.link().send_future(async move { + Msg::UsersDone(client.run_graphql(operation).await) + }); + + true + } + Msg::UsersDone(x) => { + self.loading = false; + + match x { + Ok(resp) => { + if let Some(errors) = resp.errors { + self.notifications_dispatch.reduce_mut(|notifs| { + for e in errors { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::GraphQLError( + e, + ), + ))); + } + }); + + false + } else { + let data = resp.data.unwrap(); + self.users = data.users; + + true + } + } + Err(e) => { + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::Text(vec![ + e.to_string() + ]), + ))); + }); + + false + } + } + } + + Msg::OpenNewModal => { + self.new_modal = true; + + true + } + Msg::CloseNewModal => { + self.new_modal = false; + self.new_modal_save_loading = false; + ctx.link().send_message(Msg::LoadUsers); + + true + } + Msg::NewModalSubmit => { + let user = match self.new_modal_user.cast::() { + Some(x) => x.value(), + None => return false, + }; + let name = match self.new_modal_repo.cast::() { + Some(x) => x.value(), + None => return false, + }; + + self.new_modal_save_loading = true; + let operation = graphql::queries::CreateRepository::build( + graphql::queries::CreateRepositoryVariables { user, name }, + ); + let client = graphql::client(self.user.0.as_ref()); + ctx.link().send_future(async move { + Msg::NewModalSubmitDone(client.run_graphql(operation).await) + }); + + true + } + Msg::NewModalSubmitDone(x) => { + self.new_modal_save_loading = false; + + match x { + Ok(resp) => { + if let Some(errors) = resp.errors { + self.notifications_dispatch.reduce_mut(|notifs| { + for e in errors { + notifs.push(stores::Notification { + notification_type: components::notification::NotificationType::Danger, + message: Some(components::notification::NotificationMessage::GraphQLError(e)), + }); + } + }); + + true + } else { + ctx.link().send_message(Msg::CloseNewModal); + + true + } + } + Err(e) => { + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::Text(vec![ + e.to_string() + ]), + ))); + }); + + false + } + } + } + + Msg::OpenEditModal(i, j) => { + self.delete_modal = Some((i, j)); + + true + } + Msg::CloseEditModal => { + self.delete_modal = None; + self.delete_modal_delete_loading = false; + ctx.link().send_message(Msg::LoadUsers); + + true + } + Msg::Delete => { + let modal = self.delete_modal.unwrap(); + + self.delete_modal_delete_loading = true; + let operation = graphql::queries::DeleteRepository::build( + graphql::queries::DeleteRepositoryVariables { + id: self.users[modal.0].repositories[modal.1].id.to_owned(), + }, + ); + let client = graphql::client(self.user.0.as_ref()); + ctx.link().send_future(async move { + Msg::DeleteDone(client.run_graphql(operation).await) + }); + + true + } + Msg::DeleteDone(x) => match x { + Ok(_) => { + self.delete_modal = None; + self.delete_modal_delete_loading = false; + ctx.link().send_message(Msg::LoadUsers); + + true + } + Err(e) => { + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification { + notification_type: components::notification::NotificationType::Danger, + message: Some(components::notification::NotificationMessage::Text( + vec![e.to_string()], + )), + }); + }); + + false + } + }, + } + } + + fn view(&self, ctx: &Context) -> Html { + html! { + <> + + { "Home" } + + +
+
+
+
+ +
+ + if self.loading { +
+ +
+ } else { + { + for self.users.iter().enumerate().map(|(i, user)| html! { +
+ >() + } + on_click={ctx.link().callback(move |j| Msg::OpenEditModal(i, j))} + /> +
+ }) + } + } +
+
+
+ + if self.new_modal { +
+
+ +
+
+

+ { "Edit" } +

+
+
+ + + + + + + + + + + +
{ "User" } + +
{ "Repository" } + +
+
+
+
+

+ +

+

+ +

+
+
+
+
+ } + + if let Some(modal) = &self.delete_modal { +
+
+ +
+
+

+ { "Edit" } +

+
+
+

+ { &self.users[modal.0].name } + { "/" } + { &self.users[modal.0].repositories[modal.1].name } +

+
+
+
+

+ +

+

+ +

+
+
+
+
+ } + + } + } +} diff --git a/frontend/src/routes/login.rs b/frontend/src/routes/login.rs new file mode 100644 index 0000000..e087538 --- /dev/null +++ b/frontend/src/routes/login.rs @@ -0,0 +1,237 @@ +use bounce::helmet::Helmet; +use cynic::QueryBuilder; +use std::rc::Rc; +use web_sys::HtmlInputElement; +use yew::prelude::*; +use yew_router::prelude::*; +use yewdux::prelude::*; + +use crate::{ + components, + graphql::{self, ReqwestExt}, + routes, stores, +}; + +pub enum Msg { + UpdateUser(Rc), + UpdateNotifications(Rc), + Login, + LoginDone { + user_data: stores::UserData, + result: graphql::GraphQLResult, + }, +} + +pub struct Login { + user: Rc, + user_dispatch: Dispatch, + notifications: Rc, + notifications_dispatch: Dispatch, + username: NodeRef, + password: NodeRef, + loading: bool, + error: Option<&'static str>, +} + +impl Component for Login { + type Message = Msg; + type Properties = (); + + fn create(ctx: &Context) -> Self { + let user_dispatch = Dispatch::subscribe(ctx.link().callback(Msg::UpdateUser)); + let notifications_dispatch = + Dispatch::subscribe(ctx.link().callback(Msg::UpdateNotifications)); + + Self { + user: user_dispatch.get(), + user_dispatch, + notifications: notifications_dispatch.get(), + notifications_dispatch, + username: NodeRef::default(), + password: NodeRef::default(), + loading: false, + error: None, + } + } + + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::UpdateUser(x) => { + self.error = None; + + let prev = self.user.logged_in(); + self.user = x; + + prev != self.user.logged_in() + } + Msg::UpdateNotifications(x) => { + self.notifications = x; + + false + } + Msg::Login => { + self.error = None; + + let username = match self.username.cast::().map(|x| x.value()) { + Some(x) => { + if x.is_empty() { + return false; + } else { + x + } + } + None => { + return false; + } + }; + let password = match self.password.cast::().map(|x| x.value()) { + Some(x) => { + if x.is_empty() { + return false; + } else { + x + } + } + None => { + return false; + } + }; + + self.loading = true; + let operation = + graphql::queries::VerifyLogin::build(graphql::queries::VerifyLoginVariables { + username: username.to_owned(), + password: password.to_owned(), + }); + ctx.link().send_future(async move { + Msg::LoginDone { + user_data: stores::UserData { username, password }, + result: graphql::client(None).run_graphql(operation).await, + } + }); + + true + } + Msg::LoginDone { user_data, result } => { + self.loading = false; + + match result { + Ok(resp) => { + if let Some(errors) = resp.errors { + self.notifications_dispatch.reduce_mut(|notifs| { + for e in errors { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::GraphQLError( + e, + ), + ))); + } + }); + + true + } else if resp.data.unwrap().verify_login { + self.error = None; + self.user_dispatch.set(stores::User(Some(user_data))); + + false + } else { + const MESSAGE: &str = "Username or password not correct"; + + self.error = Some(MESSAGE); + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification { + notification_type: + components::notification::NotificationType::Danger, + message: Some( + components::notification::NotificationMessage::Text(vec![ + MESSAGE.to_string(), + ]), + ), + }); + }); + + true + } + } + Err(e) => { + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification { + notification_type: + components::notification::NotificationType::Danger, + message: Some(components::notification::NotificationMessage::Text( + vec![e.to_string()], + )), + }); + }); + + false + } + } + } + } + } + + fn view(&self, ctx: &Context) -> Html { + if self.user.logged_in() { + ctx.link().navigator().unwrap().push(&routes::Route::Index); + } + + html! { + <> + + { "Login" } + + +
+
+
+
+
+

+ + + + +

+
+
+

+ + + + +

+
+
+

+ +

+
+ if let Some(message) = self.error { +

+ { message } +

+ } + +
+
+
+ + } + } +} diff --git a/frontend/src/routes/mod.rs b/frontend/src/routes/mod.rs new file mode 100644 index 0000000..761659c --- /dev/null +++ b/frontend/src/routes/mod.rs @@ -0,0 +1,48 @@ +use yew::prelude::*; +use yew_router::prelude::*; + +use crate::layouts; + +pub mod index; +pub mod login; +pub mod not_found; +pub mod user; + +pub use index::Index; +pub use login::Login; +pub use not_found::NotFound; +pub use user::User; + +#[derive(Clone, Routable, PartialEq, Eq, Debug)] +pub enum Route { + #[at("/")] + Index, + + // #[at("/user/:name")] + // User { name: String }, + #[at("/login")] + Login, + + #[not_found] + #[at("/404")] + NotFound, +} + +pub fn switch(route: Route) -> Html { + match route { + Route::Index => html! { + + + + }, + // Route::User { name } => html! { + // + // }, + Route::Login => html! { + + }, + Route::NotFound => html! { + + }, + } +} diff --git a/frontend/src/routes/not_found.rs b/frontend/src/routes/not_found.rs new file mode 100644 index 0000000..0e61dca --- /dev/null +++ b/frontend/src/routes/not_found.rs @@ -0,0 +1,20 @@ +use yew::prelude::*; + +use crate::layouts; + +pub struct NotFound; + +impl Component for NotFound { + type Message = (); + type Properties = (); + + fn create(_ctx: &Context) -> Self { + Self + } + + fn view(&self, _ctx: &Context) -> Html { + html! { + + } + } +} diff --git a/frontend/src/routes/user.rs b/frontend/src/routes/user.rs new file mode 100644 index 0000000..a2f0341 --- /dev/null +++ b/frontend/src/routes/user.rs @@ -0,0 +1,143 @@ +use bounce::helmet::Helmet; +use cynic::QueryBuilder; +use yew::prelude::*; +use yewdux::prelude::*; + +use crate::{ + components, + graphql::{self, ReqwestExt}, + stores, +}; + +#[derive(Properties, PartialEq)] +pub struct Props { + pub name: AttrValue, +} + +pub enum Msg { + Void, + Done(graphql::GraphQLResult), +} + +struct Repository { + name: String, + url: String, +} + +pub struct User { + notifications_dispatch: Dispatch, + loading: bool, + repositories: Vec, +} + +impl Component for User { + type Message = Msg; + type Properties = Props; + + fn create(ctx: &Context) -> Self { + let operation = + graphql::queries::UserByName::build(graphql::queries::UserByNameVariables { + name: ctx.props().name.to_string(), + }); + let client = graphql::client(None); + ctx.link() + .send_future(async move { Msg::Done(client.run_graphql(operation).await) }); + + Self { + notifications_dispatch: Dispatch::subscribe(ctx.link().callback(|_| Msg::Void)), + loading: true, + repositories: vec![], + } + } + + fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { + match msg { + Msg::Void => false, + Msg::Done(x) => { + self.loading = false; + + match x { + Ok(resp) => { + if let Some(errors) = resp.errors { + self.notifications_dispatch.reduce_mut(|notifs| { + for e in errors { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::GraphQLError( + e, + ), + ))); + } + }); + + false + } else { + self.repositories = resp + .data + .unwrap() + .user_by_name + .repositories + .into_iter() + .map(|repo| Repository { + name: repo.name, + url: repo.url, + }) + .collect(); + + true + } + } + Err(e) => { + self.notifications_dispatch.reduce_mut(|notifs| { + notifs.push(stores::Notification::danger(Some( + components::notification::NotificationMessage::Text(vec![ + e.to_string() + ]), + ))); + }); + + false + } + } + } + } + } + + fn view(&self, ctx: &Context) -> Html { + let name = &ctx.props().name; + + html! { + <> + + { name } + + +
+
+
+ if self.loading { +
+ +
+ } else { +
+ >() + } + /> +
+ } +
+
+
+ + } + } +} diff --git a/frontend/src/stores.rs b/frontend/src/stores.rs new file mode 100644 index 0000000..9070bbd --- /dev/null +++ b/frontend/src/stores.rs @@ -0,0 +1,67 @@ +use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; +use std::num::Wrapping; +use yewdux::prelude::*; + +use crate::components; + +#[derive(PartialEq, Serialize, Deserialize, Debug)] +pub struct UserData { + pub username: String, + pub password: String, +} + +#[derive(Default, PartialEq, Serialize, Deserialize, Store, Debug)] +#[store(storage = "local")] +pub struct User(pub Option); + +impl User { + pub fn logged_in(&self) -> bool { + self.0.is_some() + } +} + +#[derive(Clone, PartialEq)] +pub struct Notification { + pub notification_type: components::notification::NotificationType, + pub message: Option, +} + +macro_rules! from_notification_types { + ($($type:ident),*) => { + $( + paste::item! { + pub fn [<$type:snake>](message: Option) -> Self { + Self { + notification_type: components::notification::NotificationType::$type, + message, + } + } + } + )* + }; +} + +impl Notification { + from_notification_types!(Dark, Primary, Link, Info, Success, Warning, Danger); +} + +#[derive(Default, Clone, PartialEq, Store)] +pub struct Notifications { + counter: Wrapping, + pub notifications: BTreeMap, +} + +impl Notifications { + fn inc(&mut self) { + self.counter += 1; + } + + pub fn push(&mut self, notif: Notification) -> usize { + let id = self.counter.0; + self.notifications.insert(id, notif); + self.inc(); + + id + } +}