commit 7b754475018765f2eaf30b3ab4d3b0a03ac68f4a Author: husky Date: Fri Mar 7 17:13:57 2025 -0800 public release of asklyphe-frontend diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/ASSET_LICENSE b/ASSET_LICENSE new file mode 100644 index 0000000..064d7e9 --- /dev/null +++ b/ASSET_LICENSE @@ -0,0 +1,454 @@ +AskLyphe data/media assets under /static and /templates are licensed under CC-BY-NC-SA-4.0 except where otherwise specified. + +The AskLyphe Character, "Lyphe", and the design of this character are also licensed under CC-BY-NC-SA-4.0 + +-- INFO FOR FAN ARTISTS -- +Please visit https://creativecommons.org/licenses/by-nc-sa/4.0/ for a simplified version of this license. +You are free to create whatever AskLyphe fan-art you'd like, as long as you +- Give us credit for the character design +- Don't use the art for commercial purposes +- Release the art under the same license (i.e. people must follow the same terms if sharing your art) +- - This is mostly in order to allow for modified AskLyphe art assets to be licensed similarly to our AGPL code +- Don't add additional legal restrictions that would restrict others from doing something that our license allows + +You are encouraged to read the license below in full, the information above should not substitute doing so. + +Attribution-NonCommercial-ShareAlike 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International +Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution-NonCommercial-ShareAlike 4.0 International Public License +("Public License"). To the extent this Public License may be +interpreted as a contract, You are granted the Licensed Rights in +consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the +Licensor receives from making the Licensed Material available under +these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. BY-NC-SA Compatible License means a license listed at + creativecommons.org/compatiblelicenses, approved by Creative + Commons as essentially the equivalent of this Public License. + + d. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + e. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + f. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + g. License Elements means the license attributes listed in the name + of a Creative Commons Public License. The License Elements of this + Public License are Attribution, NonCommercial, and ShareAlike. + + h. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + i. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + j. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + k. NonCommercial means not primarily intended for or directed towards + commercial advantage or monetary compensation. For purposes of + this Public License, the exchange of the Licensed Material for + other material subject to Copyright and Similar Rights by digital + file-sharing or similar means is NonCommercial provided there is + no payment of monetary compensation in connection with the + exchange. + + l. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + m. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + n. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part, for NonCommercial purposes only; and + + b. produce, reproduce, and Share Adapted Material for + NonCommercial purposes only. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. Additional offer from the Licensor -- Adapted Material. + Every recipient of Adapted Material from You + automatically receives an offer from the Licensor to + exercise the Licensed Rights in the Adapted Material + under the conditions of the Adapter's License You apply. + + c. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties, including when + the Licensed Material is used other than for NonCommercial + purposes. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + b. ShareAlike. + + In addition to the conditions in Section 3(a), if You Share + Adapted Material You produce, the following conditions also apply. + + 1. The Adapter's License You apply must be a Creative Commons + license with the same License Elements, this version or + later, or a BY-NC-SA Compatible License. + + 2. You must include the text of, or the URI or hyperlink to, the + Adapter's License You apply. You may satisfy this condition + in any reasonable manner based on the medium, means, and + context in which You Share Adapted Material. + + 3. You may not offer or impose any additional or different terms + or conditions on, or apply any Effective Technological + Measures to, Adapted Material that restrict exercise of the + rights granted under the Adapter's License You apply. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database for NonCommercial purposes + only; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material, + including for purposes of Section 3(b); and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. + + diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..cf2cd22 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,10 @@ +127.0.0.1 { + route /static/* { + uri strip_prefix /static + file_server { + root ./static + } + } + + reverse_proxy 127.0.0.1:5842 +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..e9f36cd --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2996 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", + "humansize", + "num-traits", + "percent-encoding", +] + +[[package]] +name = "askama_axum" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41603f7cdbf5ac4af60760f17253eb6adf6ec5b6f14a7ed830cf687d375f163" +dependencies = [ + "askama", + "axum-core", + "http 1.0.0", +] + +[[package]] +name = "askama_derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.48", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] + +[[package]] +name = "asklyphe-common" +version = "0.1.0" +source = "git+ssh://git@git.voremicrocomputers.com:2222/voremicrocomputers/asklyphe/asklyphe-common.git#d9fdc1b7b248789c19aa266c6bb8f429bddd33c6" +dependencies = [ + "async-nats", + "chrono", + "foundationdb", + "futures", + "log", + "rmp-serde", + "serde", + "ulid", +] + +[[package]] +name = "asklyphe-frontend" +version = "0.1.0" +dependencies = [ + "askama", + "askama_axum", + "asklyphe-common", + "async-nats", + "axum", + "chrono", + "futures", + "html-escape", + "isahc", + "once_cell", + "rmp-serde", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-loki", + "tracing-subscriber", + "ulid", + "unit_converter", +] + +[[package]] +name = "astro-float" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04332153bbd5ab28465a0a13fe47623bddba3b45add9141a61991169af391136" +dependencies = [ + "astro-float-macro", + "astro-float-num", +] + +[[package]] +name = "astro-float-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04735a8f96f001b08d638843d0bd8f904f4d67d3f1231ac3eaeb8b2198b6afc9" +dependencies = [ + "astro-float-num", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "astro-float-num" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9d76f4900f7acd7ecc1699b62548acf472d51ab40f7497c058d650fedc179f0" +dependencies = [ + "itertools", + "lazy_static", + "rand", + "serde", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-nats" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc1f1a75fd07f0f517322d103211f12d757658e91676def9a2e688774656c60" +dependencies = [ + "base64", + "bytes", + "futures", + "http 0.2.11", + "memchr", + "nkeys", + "nuid", + "once_cell", + "rand", + "regex", + "ring", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "rustls-webpki", + "serde", + "serde_json", + "serde_nanos", + "serde_repr", + "thiserror", + "time", + "tokio", + "tokio-retry", + "tokio-rustls", + "tracing", + "url", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.1.0", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "basic-toml" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.48", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[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 = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "castaway" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[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.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", +] + +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[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 = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2 0.4.10", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.70+curl-8.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0333d8849afe78a4c8102a429a446bfdd055832af071945520e835ae2d841e" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "windows-sys 0.48.0", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2", + "signature", + "subtle", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fiat-crypto" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + +[[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.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "foundationdb" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8696fd1be198f101eb58aeecf0f504fc02b28c7afcc008b4e4a998a91b305108" +dependencies = [ + "async-recursion", + "async-trait", + "foundationdb-gen", + "foundationdb-macros", + "foundationdb-sys", + "futures", + "memchr", + "rand", + "serde", + "serde_bytes", + "serde_json", + "static_assertions", + "uuid", +] + +[[package]] +name = "foundationdb-gen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62239700f01b041b6372aaeb847c52f960e1a69fd2b1025dc995ea3dd90e3308" +dependencies = [ + "xml-rs", +] + +[[package]] +name = "foundationdb-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8d52fe8b46ab822b4decdcc0d6d85aeedfc98f0d52ba2bd4aec4a97807516" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "try_map", +] + +[[package]] +name = "foundationdb-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98e49545f5393d276b7b888c77e3f9519fd33727435f8244344be72c3284256f" +dependencies = [ + "bindgen", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +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.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.11", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.0.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.11", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.0.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.5", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.2", + "http 1.0.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.28", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdea9aac0dbe5a9240d68cfd9501e2db94222c6dc06843e06640b9e07f0fdc67" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "hyper 1.1.0", + "pin-project-lite", + "socket2 0.5.5", + "tokio", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "isahc" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "334e04b4d781f436dc315cb1e7515bd96826426345d498149e4bde36b67f8ee9" +dependencies = [ + "async-channel", + "castaway", + "crossbeam-utils", + "curl", + "curl-sys", + "encoding_rs", + "event-listener", + "futures-lite", + "http 0.2.11", + "log", + "mime", + "once_cell", + "polling", + "slab", + "sluice", + "tracing", + "tracing-futures", + "url", + "waker-fn", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +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 = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "libloading" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libnghttp2-sys" +version = "0.1.9+1.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b57e858af2798e167e709b9d969325b6d8e9d50232fcbc494d7d54f976854a64" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libz-sys" +version = "1.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "loki-api" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56d36f573486ba7f462b62cbae597fef7d5d93665e7047956b457531b8a1ced" +dependencies = [ + "prost", + "prost-types", +] + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[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.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.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 = "nkeys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aad178aad32087b19042ee36dfd450b73f5f934fbfb058b59b198684dfec4c47" +dependencies = [ + "byteorder", + "data-encoding", + "ed25519", + "ed25519-dalek", + "getrandom", + "log", + "rand", + "signatory", +] + +[[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 = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "nuid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc895af95856f929163a0aa20c26a78d26bfdc839f51b9d5aa7a5b79e52b7e83" +dependencies = [ + "rand", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "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.48", +] + +[[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.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[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", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[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.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[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.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "rmp" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[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.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.112" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_nanos" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae801b7733ca8d6a2b580debe99f67f36826a0f5b8a36055dc6bc40f8d6bc71" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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 = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[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 = "signatory" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31" +dependencies = [ + "pkcs8", + "rand_core", + "signature", + "zeroize", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "sluice" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" +dependencies = [ + "async-channel", + "futures-core", + "futures-io", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[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.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand 2.0.1", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +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.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "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.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[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.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-loki" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49bbc87d08020d7c2a9f4bb0b7d10da5381d3867f8ae57fcc54621b34567e963" +dependencies = [ + "loki-api", + "reqwest", + "serde", + "serde_json", + "snap", + "tokio", + "tokio-stream", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-serde", + "tracing-subscriber", + "url", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log 0.2.0", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "try_map" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb1626d07cb5c1bb2cf17d94c0be4852e8a7c02b041acec9a8c5bdda99f9d580" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "ulid" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e37c4b6cbcc59a8dcd09a6429fbc7890286bcbb79215cea7b38a3c4c0921d93" +dependencies = [ + "rand", +] + +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unit_converter" +version = "0.1.0" +source = "git+ssh://git@git.voremicrocomputers.com:2222/voremicrocomputers/asklyphe/unit_converter.git#4b995f25ec96d6fea98b52d4e2d41fa71ba8d089" +dependencies = [ + "astro-float", + "once_cell", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[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 = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[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-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[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.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..455d515 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "asklyphe-frontend" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +asklyphe-common = { git = "https://forge.voremicrocomputers.com/asklyphe-public/asklyphe-common.git", branch = "main" } +unit_converter = { git = "https://forge.voremicrocomputers.com/asklyphe-public/unit_converter.git" } + +tokio = { version = "1.35.1", features = ["full"] } + +axum = "0.7.4" +axum-extra = { version = "0.9.2", features = [ "cookie" ] } +tower-http = { version = "0.5.2", features = ["cors"] } +time = "0.3.34" + +askama = { version = "0.12.1", features = ["default", "with-axum"] } +askama_axum = "0.4.0" + +tracing = "0.1.40" +tracing-subscriber = "0.3.18" +tracing-loki = "0.2.4" + +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +async-nats = "0.38.0" +rmp-serde = "1.1.2" +ulid = "1.1.0" +futures = "0.3.30" + +html-escape = "0.2.13" +isahc = "1.7.2" +once_cell = "1.19.0" +chrono = "0.4.33" +rand = "0.8.5" +url_encoded_data = "0.6.1" + +env_logger = "*" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5b06359 --- /dev/null +++ b/LICENSE @@ -0,0 +1,181 @@ +GNU AFFERO GENERAL PUBLIC LICENSE +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + +Preamble + +The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. + +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. + +A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. + +The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. + +An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. + +The precise terms and conditions for copying, distribution and modification follow. + +TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based on the Program. + + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. + 1. Source Code. + The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. + + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those + subprograms and other parts of the work. + + The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. + + The Corresponding Source for a work in source code form is that same work. + 2. Basic Permissions. + All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. + + When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. + 4. Conveying Verbatim Copies. + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. + 5. Conveying Modified Source Versions. + You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: + a) The work must carry prominent notices stating that you modified it, and giving a relevant date. + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. + 6. Conveying Non-Source Forms. + You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: + a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. + 7. Additional Terms. + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: + a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. + 8. Termination. + + You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). + + However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. + + Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent + license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may + not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. + + Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. + + Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. + diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..4f9cfda --- /dev/null +++ b/build.rs @@ -0,0 +1,36 @@ +/* + * asklyphe-frontend build.rs + * - build script + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::process::Command; +fn main() { + let output = Command::new("git") + .args(["rev-parse", "--short", "HEAD"]) + .output() + .expect("Failed to execute git command"); + let git_commit = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=GIT_COMMIT={}", git_commit); + + let output = Command::new("date") + .args(["-u", "+%Y-%m-%d"]) + .output() + .expect("Failed to execute date command"); + let built_on = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=BUILT_ON={}", built_on); + + let output = Command::new("date") + .args(["-u", "+%Y"]) + .output() + .expect("Failed to execute date command"); + let year = String::from_utf8(output.stdout).unwrap(); + println!("cargo:rustc-env=YEAR={}", year); +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..2e398fb --- /dev/null +++ b/src/main.rs @@ -0,0 +1,165 @@ +/* + * asklyphe-frontend main.rs + * - entrypoint for the asklyphe frontend + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +pub mod searchbot; +pub mod wikipedia; +pub mod unit_converter; +pub mod routes; + +use std::{env, process}; +use std::collections::HashMap; +use std::net::SocketAddr; +use std::ops::Deref; +use std::sync::Arc; +use std::sync::atomic::{AtomicU64, Ordering}; +use std::time::Duration; +use askama::Template; +use asklyphe_common::nats; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::searchservice::{SearchSrvcQuery, SearchSrvcRequest, SearchSrvcResponse}; +use asklyphe_common::rustflake::Snowflake; +use async_nats::jetstream; +use axum::{Extension, Router}; +use axum::extract::Query; +use axum::http::{HeaderValue, Method}; +use axum::response::IntoResponse; +use axum::routing::{get, post}; +use serde::Serialize; +use tokio::sync::Mutex; +use tower_http::cors::{AllowOrigin, CorsLayer}; +use tracing::error; +use tracing_loki::url::Url; +use tracing_subscriber::layer::SubscriberExt; +use tracing_subscriber::util::SubscriberInitExt; +use crate::routes::admin::{admin_announcement, admin_announcement_post, admin_home, admin_invitecode, admin_invitecode_post, admin_user_list}; +use crate::routes::announcement::announcement_full; +use crate::routes::index::{frontpage, index, logout}; +use crate::routes::search::{image_proxy, search, search_json}; +use crate::routes::semaphore::semaphore; +use crate::routes::user_settings::{theme_change_post, user_settings}; +use crate::unit_converter::UnitConversion; +use crate::wikipedia::WikipediaSummary; + +const ALPHA: bool = { + let alpha = option_env!("ALPHA"); + alpha.is_some() +}; +const VERSION: &str = env!("CARGO_PKG_VERSION"); +const GIT_COMMIT: &str = env!("GIT_COMMIT"); +const BUILT_ON: &str = env!("BUILT_ON"); +const YEAR: &str = env!("YEAR"); + +#[derive(Clone)] +pub struct Opts { + pub bind_addr: SocketAddr, + pub nats_addr: SocketAddr, + nats_cert: String, + nats_key: String, + auth_url: String, + pub loki_addr: Option, + pub datacenter_id: i64, + pub emergency: bool, +} + +pub static WEBSITE_COUNT: AtomicU64 = AtomicU64::new(0); + +async fn website_count_update_thread(nats: Arc) { + loop { + searchbot::update_website_counter(nats.clone()).await; + tokio::time::sleep(Duration::from_secs(30)).await; + } +} + +#[tokio::main] +async fn main() { + env_logger::init(); + let opts = Opts { + bind_addr: env::var("BIND_ADDR").unwrap_or("0.0.0.0:5842".to_string()).parse().expect("Badly formed BIND_ADDR (Needs to be SocketAddr)"), + nats_addr: env::var("NATS_ADDR").unwrap_or("127.0.0.1:4222".to_string()).parse().expect("Badly formed NATS_ADDR (Needs to be SocketAddr)"), + nats_cert: env::var("NATS_CERT").expect("NATS_CERT needs to be set"), + nats_key: env::var("NATS_KEY").expect("NATS_KEY needs to be set"), + auth_url: env::var("AUTH_URL").unwrap_or("https://auth.asklyphe.com".to_string()), + loki_addr: match env::var("LOKI_ADDR") { + Ok(url) => { + Some(Url::parse(&url).expect("Badly formed LOKI_ADDR (Needs to be Url)")) + } + Err(_) => { + None + } + }, + datacenter_id: env::var("DATACENTER_ID").unwrap_or("1".to_string()).parse().expect("Badly formed DATACENTER_ID (Need to be i64)"), + emergency: env::var("EMERGENCY").unwrap_or("0".to_string()).eq("1"), + }; + + let mut snowflake_factory = Snowflake { + worker_id: process::id() as i64, + datacenter_id: opts.datacenter_id, + ..Default::default() + }; + + if opts.loki_addr.is_some() { + //let (layer, task) = tracing_loki::builder() + // .label("environment", "dev").unwrap() + // .extra_field("pid", process::id().to_string()).unwrap() + // .extra_field("run_id", snowflake_factory.generate().to_string()).unwrap() + // .build_url(opts.loki_addr.clone().unwrap()).unwrap(); + + //// Register Loki layer + //tracing_subscriber::registry() + // .with(layer) + // .init(); + + //// Spawn Loki background task + //tokio::spawn(task); + } else { + //tracing_subscriber::fmt::init() + } + + let nats = async_nats::ConnectOptions::new() + .add_client_certificate(opts.nats_cert.as_str().into(), opts.nats_key.as_str().into()) + .connect(opts.nats_addr.to_string()) + .await; + if let Err(e) = nats { + eprintln!("FATAL ERROR, COULDN'T CONNECT TO NATS: {}", e); + return; + } + let nats = nats.unwrap(); + let nats = jetstream::new(nats); + let nats = Arc::new(nats); + + tokio::spawn(website_count_update_thread(nats.clone())); + + let app = Router::new() + .route("/", get(index)) + .route("/semaphore", get(semaphore)) + .route("/frontpage", get(frontpage)) + .route("/ask", get(search)) + .route("/ask_json", get(search_json)) + .route("/imgproxy", get(image_proxy)) + .route("/logout", post(logout)) + .route("/user_settings", get(user_settings)) + .route("/user_settings/set_theme", post(theme_change_post)) + .route("/admin", get(admin_home)) + .route("/admin/invitecode", get(admin_invitecode).post(admin_invitecode_post)) + .route("/admin/announcement", get(admin_announcement).post(admin_announcement_post)) + .route("/admin/allusers", get(admin_user_list)) + .route("/announcements/:slug", get(announcement_full)) + .layer(CorsLayer::new().allow_methods([Method::GET, Method::POST]).allow_origin(AllowOrigin::exact(HeaderValue::from_str("localhost").unwrap()))) + .layer(Extension(Arc::new(Mutex::new(snowflake_factory)))) + .layer(Extension(nats.clone())) + .layer(Extension(opts.clone())) + .fallback(routes::not_found); + + let listener = tokio::net::TcpListener::bind(opts.bind_addr).await.expect("Failed to get listener"); + axum::serve(listener, app).await.expect("Failed to serve"); +} diff --git a/src/routes/admin.rs b/src/routes/admin.rs new file mode 100644 index 0000000..4e93d30 --- /dev/null +++ b/src/routes/admin.rs @@ -0,0 +1,629 @@ +/* + * asklyphe-frontend routes/admin.rs + * - http routes for the admin panel + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::sync::Arc; +use askama::Template; +use asklyphe_common::nats::authservice::{AuthServiceQuery, AuthServiceRequest, AuthServiceResponse}; +use asklyphe_common::nats::authservice::admin::{AdminCreateAnnouncementRequest, AdminCreateAnnouncementResponse, AdminInviteCodeGenerateRequest, AdminInviteCodeGenerateResponse, AdminListAllUsersRequest, AdminListAllUsersResponse, AdminListInviteCodesRequest, AdminListInviteCodesResponse, InviteCodeSerialized, Stats, StatsRequest, StatsResponse, UserSerialized}; +use asklyphe_common::nats::authservice::profile::{UserInfoRequest, UserInfoResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::comms::ServiceResponse; +use async_nats::jetstream; +use axum::{Extension, Form}; +use axum::response::{IntoResponse, Redirect}; +use axum_extra::extract::CookieJar; +use rand::Rng; +use serde::Deserialize; +use tracing::{debug, error}; +use crate::Opts; +use crate::routes::{authenticate_user, UserInfo}; + +const MOTD: &[&str] = &[ + "be evil :3c", + "pong", + ">:o", + "\" UNION SELECT username, password FROM users; -- ", +]; + +#[derive(Template)] +#[template(path = "admin/error.html")] +pub struct AdminErrorTemplate { + motd: &'static str, + + error: String, +} + +#[derive(Template)] +#[template(path = "admin/home.html")] +pub struct AdminHomeTemplate { + motd: &'static str, + + last_ten_users: Vec, + user_count: usize, + admin_count: usize, + active_verification_requests: usize, +} + +fn motd() -> &'static str { + let mut rng = rand::thread_rng(); + MOTD[rng.gen_range(0..MOTD.len())] +} + +fn adminerror(message: String) -> impl IntoResponse { + AdminErrorTemplate { + motd: motd(), + error: message, + } +} + +async fn stats(nats: Arc, token: String) -> Result { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::StatsRequest(StatsRequest { + token, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + Err(adminerror(format!("nats error: {:?}", e)).into_response()) + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent search service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent bing service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::StatsResponse(stats) => { + match stats { + StatsResponse::Success(stats) => { + Ok(stats) + } + StatsResponse::InternalServerError(e) => { + Err(adminerror(format!("internal server error: {e}")).into_response()) + } + StatsResponse::Logout => { + Err(Redirect::to("/").into_response()) + } + StatsResponse::AccessDenied => { + Err(Redirect::to("/").into_response()) + } + } + } + x => { + error!("auth service gave {} to our user info request!", x); + Err(adminerror(format!("auth service gave {} to our user info request!", x)).into_response()) + } + }, + } + } +} + +async fn list_invite_codes(nats: Arc, token: String, show_used: bool) -> Result, impl IntoResponse> { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::AdminListInviteCodesRequest(AdminListInviteCodesRequest { + token, + show_used, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + Err(adminerror(format!("nats error: {:?}", e)).into_response()) + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent search service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent bing service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::AdminListInviteCodesResponse(v) => { + match v { + AdminListInviteCodesResponse::Success(v) => { + Ok(v) + } + AdminListInviteCodesResponse::InternalServerError(e) => { + Err(adminerror(format!("internal server error: {e}")).into_response()) + } + AdminListInviteCodesResponse::Logout => { + Err(Redirect::to("/").into_response()) + } + AdminListInviteCodesResponse::AccessDenied => { + Err(Redirect::to("/").into_response()) + } + } + } + x => { + error!("auth service gave {} to our list invite codes request!", x); + Err(adminerror(format!("auth service gave {} to our list invite codes request!", x)).into_response()) + } + }, + } + } +} + +async fn list_all_users(nats: Arc, token: String) -> Result, impl IntoResponse> { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::AdminListAllUsersRequest(AdminListAllUsersRequest { + token, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + Err(adminerror(format!("nats error: {:?}", e)).into_response()) + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent search service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent bing service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::AdminListAllUsersResponse(v) => { + match v { + AdminListAllUsersResponse::Success(v) => { + Ok(v) + } + AdminListAllUsersResponse::InternalServerError(e) => { + Err(adminerror(format!("internal server error: {e}")).into_response()) + } + AdminListAllUsersResponse::Logout => { + Err(Redirect::to("/").into_response()) + } + AdminListAllUsersResponse::AccessDenied => { + Err(Redirect::to("/").into_response()) + } + } + } + x => { + error!("auth service gave {} to our list users request!", x); + Err(adminerror(format!("auth service gave {} to our list users request!", x)).into_response()) + } + }, + } + } +} + +async fn gen_invite_code(nats: Arc, token: String, code: String, comment: String) -> Result<(), impl IntoResponse> { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::AdminInviteCodeGenerateRequest(AdminInviteCodeGenerateRequest { + token, + invite_code: code, + comment, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + Err(adminerror(format!("nats error: {:?}", e)).into_response()) + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent search service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + Err(adminerror("sent bing service response when asking auth service!".to_string()).into_response()) + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::AdminInviteCodeGenerateResponse(res) => { + match res { + AdminInviteCodeGenerateResponse::Success => { + Ok(()) + } + AdminInviteCodeGenerateResponse::InternalServerError(e) => { + Err(adminerror(format!("internal server error: {e}")).into_response()) + } + AdminInviteCodeGenerateResponse::Logout => { + Err(Redirect::to("/").into_response()) + } + AdminInviteCodeGenerateResponse::AccessDenied => { + Err(Redirect::to("/").into_response()) + } + AdminInviteCodeGenerateResponse::CodeAlreadyExists => { + Err(adminerror("code already exists".to_string()).into_response()) + } + } + } + x => { + error!("auth service gave {} to our user info request!", x); + Err(adminerror(format!("auth service gave {} to our geninvitecode request!", x)).into_response()) + } + }, + } + } +} + +pub async fn admin_home( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + let stats = match stats(nats.clone(), token).await { + Ok(s) => s, + Err(e) => { + return e.into_response(); + } + }; + + AdminHomeTemplate { + motd: motd(), + last_ten_users: stats.last_ten_users, + user_count: stats.user_count, + admin_count: stats.admin_count, + active_verification_requests: stats.active_verification_requests, + }.into_response() + } else { + Redirect::to("/").into_response() + } +} + + +#[derive(Template)] +#[template(path = "admin/invitecode.html")] +pub struct AdminInviteCodeTemplate { + motd: &'static str, + + username: String, + active_codes: Vec, + used_codes: Vec, +} + +pub async fn admin_invitecode( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + let active_codes = match list_invite_codes(nats.clone(), token.clone(), false).await { + Ok(v) => v, + Err(e) => { + return e.into_response(); + } + }; + + let used_codes = match list_invite_codes(nats.clone(), token.clone(), true).await { + Ok(v) => v.into_iter().map(|mut v| if v.used_at.is_none() { v.used_at = Some(String::from("unset")); v } else { v }).collect(), + Err(e) => { + return e.into_response(); + } + }; + + AdminInviteCodeTemplate { + motd: motd(), + username: info.username, + active_codes, + used_codes, + }.into_response() + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Deserialize, Debug)] +pub struct InviteCodeForm { + code: Option, + comment: Option, +} + +pub async fn admin_invitecode_post( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, + Form(input): Form, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + if input.code.is_none() || input.comment.is_none() { + return adminerror("code and comment required".to_string()).into_response(); + } + if input.code.as_ref().unwrap().is_empty() || input.comment.as_ref().unwrap().is_empty() { + return adminerror("code and comment required".to_string()).into_response(); + } + + match gen_invite_code(nats.clone(), token, input.code.unwrap(), input.comment.unwrap()).await { + Ok(_) => { + Redirect::to("/admin/invitecode").into_response() + } + Err(e) => { + e.into_response() + } + } + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Template)] +#[template(path = "admin/announcement.html")] +pub struct AdminAnnouncementTemplate { + motd: &'static str, + + error: Option, + + username: String, + + slug: String, + title: String, + short_content: String, + full_content: String, +} + +pub async fn admin_announcement( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + AdminAnnouncementTemplate { + motd: motd(), + error: None, + username: info.username, + slug: "the-post-like-this".to_string(), + title: "Changes Happened!".to_string(), + short_content: "we made some changes!".to_string(), + full_content: "we made some changes! here are the details!".to_string(), + }.into_response() + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Deserialize, Debug, Clone)] +pub struct AnnouncementForm { + slug: Option, + title: Option, + short_content: Option, + full_content: Option, + send_emails: Option, +} + +pub async fn admin_announcement_post( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, + Form(input): Form, +) -> impl IntoResponse { + fn announcement_error(error: &str, username: String, form: AnnouncementForm) -> impl IntoResponse { + AdminAnnouncementTemplate { + motd: motd(), + error: Some(error.to_string()), + username, + slug: form.slug.unwrap_or_default(), + title: form.title.unwrap_or_default(), + short_content: form.short_content.unwrap_or_default(), + full_content: form.full_content.unwrap_or_default(), + } + } + + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + if input.slug.is_none() || input.slug.as_ref().unwrap().is_empty() { + return announcement_error("slug required", info.username, input).into_response(); + } + if input.title.is_none() || input.title.as_ref().unwrap().is_empty() { + return announcement_error("title required", info.username, input).into_response(); + } + if input.short_content.is_none() || input.short_content.as_ref().unwrap().is_empty() { + return announcement_error("short content required", info.username, input).into_response(); + } + if input.full_content.is_none() || input.full_content.as_ref().unwrap().is_empty() { + return announcement_error("full content required", info.username, input).into_response(); + } + + debug!("sendemails: {:?}", input.send_emails); + + let input_og = input.clone(); + let response = comms::query_service(comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::AdminCreateAnnouncementRequest(AdminCreateAnnouncementRequest { + token: token.clone(), + title: input.title.unwrap(), + slug: input.slug.unwrap(), + short_text: input.short_content.unwrap(), + full_markdown_text: input.full_content.unwrap(), + send_emails: !input.send_emails.unwrap_or("".to_string()).is_empty(), + }), + replyto: "".to_string(), + }), &nats, false).await; + + if let Err(e) = response { + error!("nats error: {:?}", e); + announcement_error(&format!("nats error: {:?}", e), info.username, input_og).into_response() + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + announcement_error("auth service error", info.username, input_og).into_response() + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + announcement_error("auth service error", info.username, input_og).into_response() + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::AdminCreateAnnouncementResponse(r) => { + match r { + AdminCreateAnnouncementResponse::Success => { + AdminAnnouncementTemplate { + motd: motd(), + error: Some("success!".to_string()), + username: info.username, + slug: "".to_string(), + title: "".to_string(), + short_content: "".to_string(), + full_content: "".to_string(), + }.into_response() + } + AdminCreateAnnouncementResponse::SlugTaken => { + announcement_error("slug taken!", info.username, input_og).into_response() + } + AdminCreateAnnouncementResponse::InternalServerError(e) => { + announcement_error(&format!("internal server error: {}", e), info.username, input_og).into_response() + } + AdminCreateAnnouncementResponse::Logout => { + Redirect::to("/").into_response() + } + AdminCreateAnnouncementResponse::AccessDenied => { + Redirect::to("/").into_response() + } + } + } + x => { + error!("auth survace gave {} to our create announcement request!", x); + announcement_error(&format!("auth service gave {x} to our create announcement request!"), info.username, input_og).into_response() + } + } + } + } + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Template)] +#[template(path = "admin/allusers.html")] +pub struct AdminUserListTemplate { + motd: &'static str, + + users: Vec +} + +pub async fn admin_user_list( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return Redirect::to("/").into_response(); + } + }; + + if !info.administrator { + return Redirect::to("/").into_response(); + } + + match list_all_users(nats.clone(), token).await { + Ok(mut v) => { + for v in &mut v { + if v.username.len() > 32 { + v.username = format!("{}...", &v.username[0..32]); + } + } + AdminUserListTemplate { + motd: motd(), + users: v, + }.into_response() + } + Err(e) => { + e.into_response() + } + } + } else { + Redirect::to("/").into_response() + } +} \ No newline at end of file diff --git a/src/routes/announcement.rs b/src/routes/announcement.rs new file mode 100644 index 0000000..37865f6 --- /dev/null +++ b/src/routes/announcement.rs @@ -0,0 +1,118 @@ +/* + * asklyphe-frontend routes/announcement.rs + * - http routes for announcements + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::sync::Arc; +use askama::Template; +use asklyphe_common::nats::authservice::{AuthServiceQuery, AuthServiceRequest, AuthServiceResponse}; +use asklyphe_common::nats::authservice::announcements::{AnnouncementFullRequest, AnnouncementFullResponse, LatestAnnouncementRequest, LatestAnnouncementResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::comms::ServiceResponse; +use async_nats::jetstream; +use axum::Extension; +use axum::extract::Path; +use axum::http::StatusCode; +use axum::response::IntoResponse; +use serde::Serialize; +use tracing::{debug, error}; +use tracing::log::warn; +use crate::{Opts, ALPHA, BUILT_ON, GIT_COMMIT, VERSION, YEAR}; +use crate::routes::index::FrontpageAnnouncement; + +#[derive(Serialize, Debug)] +struct FullAnnouncement { + title: String, + date: String, + creator: String, + full: String +} + +async fn announcement(nats: Arc, slug: String) -> Option { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::AnnouncementFullRequest(AnnouncementFullRequest { slug }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + None + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + None + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + None + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::AnnouncementFullResponse(v) => { + match v { + AnnouncementFullResponse::Some(v) => { + Some(FullAnnouncement { + title: v.title, + date: chrono::DateTime::from_timestamp(v.created_on, 0).unwrap().to_rfc2822(), + creator: v.creator, + full: v.markdown_text.replace("\n", "
"), + }) + } + AnnouncementFullResponse::NotFound => { + None + } + AnnouncementFullResponse::InternalServerError(e) => { + warn!("internal server error while getting announcement: {}", e); + None + } + } + } + x => { + error!("auth service gave {} to our user info request!", x); + None + } + }, + } + } +} + +#[derive(Template)] +#[template(path = "announcement.html")] +pub struct AnnouncementTemplate { + version: String, + git_commit: String, + built_on: String, + year: String, + alpha: bool, + theme: String, + announcement: FullAnnouncement, +} + +pub async fn announcement_full(Extension(nats): Extension>, Extension(opts): Extension, Path(slug): Path) -> impl IntoResponse { + debug!("looking up {slug}"); + if let Some(announcement) = announcement(nats.clone(), slug.clone()).await { + AnnouncementTemplate { + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme: "default".to_string(), + announcement, + }.into_response() + } else { + StatusCode::NOT_FOUND.into_response() + } +} \ No newline at end of file diff --git a/src/routes/index.rs b/src/routes/index.rs new file mode 100644 index 0000000..e1938e0 --- /dev/null +++ b/src/routes/index.rs @@ -0,0 +1,268 @@ +/* + * asklyphe-frontend routes/index.rs + * - http routes for homepages + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::sync::Arc; +use std::sync::atomic::Ordering; +use askama::Template; +use askama_axum::IntoResponse; +use asklyphe_common::nats::authservice::{AuthError, AuthRequest, AuthResponse, AuthServiceQuery, AuthServiceRequest, AuthServiceResponse, LogoutRequest, LogoutResponse}; +use asklyphe_common::nats::authservice::admin::{Stats, StatsRequest, StatsResponse}; +use asklyphe_common::nats::authservice::announcements::{LatestAnnouncementRequest, LatestAnnouncementResponse}; +use asklyphe_common::nats::authservice::profile::{UserInfoRequest, UserInfoResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::comms::{ServiceError, ServiceResponse}; +use asklyphe_common::rustflake::Snowflake; +use async_nats::jetstream; +use axum::Extension; +use axum::response::Redirect; +use axum_extra::extract::CookieJar; +use serde::Serialize; +use tokio::sync::Mutex; +use tracing::error; +use tracing::log::warn; +use crate::{BUILT_ON, GIT_COMMIT, Opts, ALPHA, VERSION, WEBSITE_COUNT, YEAR}; +use crate::routes::{authenticate_user, UserInfo}; + +#[derive(Serialize, Debug)] +pub struct FrontpageAnnouncement { + pub url: String, + pub title: String, + pub content: String, + pub date: String, +} + +async fn latest_announcement(nats: Arc) -> Option { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::LatestAnnouncementRequest(LatestAnnouncementRequest {}), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + None + } else { + let response = response.unwrap(); + match response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + None + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + None + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::LatestAnnouncementResponse(v) => { + match v { + LatestAnnouncementResponse::Some(v) => { + Some(FrontpageAnnouncement { + url: format!("/announcements/{}", v.slug), + title: v.title, + content: v.short_text, + date: chrono::DateTime::from_timestamp(v.date, 0).unwrap().to_rfc2822(), + }) + } + LatestAnnouncementResponse::None => { + None + } + LatestAnnouncementResponse::InternalServerError(e) => { + warn!("internal server error during latest announcement request! {e}"); + None + } + } + } + x => { + error!("auth service gave {} to our user info request!", x); + None + } + }, + } + } +} + +pub fn frontpage_error(error: &str, auth_url: String) -> FrontpageTemplate { + FrontpageTemplate { + authurl: auth_url, + error: Some(error.to_string()), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme: "default".to_string(), + announcement: None, + } +} + +pub async fn logout( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::LogoutRequest(LogoutRequest { + token, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + frontpage_error("internal server error", opts.auth_url.clone()).into_response() + } else { + let response = response.unwrap(); + let mut internal_server_error = false; + match &response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + internal_server_error = true; + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + internal_server_error = true; + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::LogoutResponse(_) => {} + x => { + error!("auth service gave {} to our user info request!", x); + internal_server_error = true; + } + } + } + if internal_server_error { + frontpage_error("internal server error", opts.auth_url.clone()).into_response() + } else { + match response { + ServiceResponse::AuthService(AuthServiceResponse::LogoutResponse(r)) => match r { + LogoutResponse::Success => { + (jar.remove("token"), + Redirect::to("/").into_response()).into_response() + } + LogoutResponse::InternalServerError(e) => { + error!("internal server error {e} returned from auth service during logout! investigate ASAP!!!"); + frontpage_error("internal server error", opts.auth_url.clone()).into_response() + } + LogoutResponse::BadTokenError => { + (jar.remove("token"), + Redirect::to("/").into_response()).into_response() + } + } + _ => unreachable!() + } + } + } + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Template)] +#[template(path = "frontpage.html")] +pub struct FrontpageTemplate { + authurl: String, + error: Option, + version: String, + git_commit: String, + built_on: String, + year: String, + alpha: bool, + count: u64, + theme: String, + announcement: Option, +} + +pub async fn frontpage( + Extension(nats): Extension>, + Extension(opts): Extension) -> impl IntoResponse { + let announcement = latest_announcement(nats.clone()).await; + FrontpageTemplate { + authurl: opts.auth_url.clone(), + error: None, + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme: "default".to_string(), + announcement, + } +} + +#[derive(Template)] +#[template(path = "home.html")] +struct IndexTemplate { + info: UserInfo, + version: String, + git_commit: String, + built_on: String, + year: String, + alpha: bool, + count: u64, + theme: String, + announcement: Option, +} + +pub async fn index( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return (jar.remove("token"), frontpage_error(e.as_str(), opts.auth_url.clone())).into_response(); + } + }; + let theme = info.theme.clone(); + + let announcement = latest_announcement(nats.clone()).await; + + IndexTemplate { + info, + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme, + announcement, + }.into_response() + } else { + let announcement = latest_announcement(nats.clone()).await; + FrontpageTemplate { + authurl: opts.auth_url.clone(), + error: None, + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme: "default".to_string(), + announcement, + }.into_response() + } +} diff --git a/src/routes/mod.rs b/src/routes/mod.rs new file mode 100644 index 0000000..445859b --- /dev/null +++ b/src/routes/mod.rs @@ -0,0 +1,117 @@ +/* + * asklyphe-frontend routes/mod.rs + * - module file for http routes + some commonly used functions + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::sync::Arc; +use askama::Template; +use askama_axum::IntoResponse; +use asklyphe_common::nats::authservice::{AuthServiceQuery, AuthServiceRequest, AuthServiceResponse}; +use asklyphe_common::nats::authservice::profile::{UserInfoRequest, UserInfoResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::comms::ServiceResponse; +use async_nats::jetstream; +use axum::http::StatusCode; +use serde::Serialize; +use tracing::error; + +pub mod search; +pub mod index; +pub mod semaphore; +pub mod user_settings; +pub mod admin; +pub mod announcement; + +#[derive(Serialize)] +pub struct UserInfo { + pub username: String, + pub email: String, + pub new_email: Option, + pub theme: String, + pub administrator: bool, +} + +pub async fn authenticate_user(nats: Arc, token: String) -> Result { + let response = comms::query_service( + comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::UserInfoRequest(UserInfoRequest { + token, + }), + replyto: "".to_string(), + }), + &nats, + false, + ).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + Err("internal server error".to_string()) + } else { + let response = response.unwrap(); + let mut internal_server_error = false; + match &response { + ServiceResponse::SearchService(_) => { + error!("sent search service response when asking for auth service!! investigate ASAP!!!"); + internal_server_error = true; + } + ServiceResponse::BingService(_) => { + error!("sent bing service response when asking for auth service!! investigate ASAP!!!"); + internal_server_error = true; + } + ServiceResponse::AuthService(r) => match r { + AuthServiceResponse::UserInfoResponse(_) => {} + x => { + error!("auth service gave {} to our user info request!", x); + internal_server_error = true; + } + }, + } + let info = if internal_server_error { + return Err("internal server error".to_string()); + } else { + match response { + ServiceResponse::AuthService(AuthServiceResponse::UserInfoResponse(r)) => match r { + UserInfoResponse::Success(ui) => { + UserInfo { + username: ui.username, + email: ui.email, + new_email: ui.new_email, + theme: ui.theme, + administrator: ui.administrator, + } + } + UserInfoResponse::InternalServerError(e) => { + error!("internal server error while querying user data! {e}"); + return Err("internal server error".to_string()); + } + UserInfoResponse::TokenExpired => { + return Err("your session has expired! please log in and try again!".to_string()); + } + UserInfoResponse::TokenInvalid => { + return Err("your session has expired! please log in and try again!".to_string()); + } + UserInfoResponse::AccountSuspended => { + return Err("unfortunately your account has been suspended, please check our support pages for more info".to_string()); + } + } + _ => unreachable!() + } + }; + Ok(info) + } +} + +#[derive(Template)] +#[template(path = "404.html")] +pub struct NotFoundTemplate; + +pub async fn not_found() -> impl IntoResponse { + (StatusCode::NOT_FOUND, NotFoundTemplate).into_response() +} \ No newline at end of file diff --git a/src/routes/search.rs b/src/routes/search.rs new file mode 100644 index 0000000..2553874 --- /dev/null +++ b/src/routes/search.rs @@ -0,0 +1,609 @@ +/* + * asklyphe-frontend routes/search.rs + * - http routes for web searching + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use crate::routes::index::frontpage_error; +use crate::routes::{authenticate_user, UserInfo}; +use crate::searchbot::{gather_image_results, gather_search_results}; +use crate::unit_converter; +use crate::unit_converter::UnitConversion; +use crate::wikipedia::WikipediaSummary; +use crate::{wikipedia, Opts, ALPHA, BUILT_ON, GIT_COMMIT, VERSION, YEAR}; +use askama::Template; +use asklyphe_common::nats; +use asklyphe_common::nats::bingservice::{ + BingServiceQuery, BingServiceRequest, BingServiceResponse, +}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::searchservice::{ + SearchSrvcQuery, SearchSrvcRequest, SearchSrvcResponse, +}; +use asklyphe_common::rustflake::Snowflake; +use async_nats::jetstream; +use axum::extract::Query; +use axum::http::StatusCode; +use axum::response::{IntoResponse, Redirect}; +use axum::Extension; +use axum_extra::extract::CookieJar; +use isahc::config::{IpVersion, RedirectPolicy}; +use isahc::RequestExt; +use serde::Serialize; +use std::collections::{BTreeMap, BTreeSet, HashMap}; +use std::ops::Deref; +use std::sync::Arc; +use std::time::Duration; +use tokio::sync::{Mutex, RwLock}; +use tracing::error; + +#[derive(Serialize)] +pub struct SearchResult { + pub title: Option, + pub description: Option, + pub url: String, + pub percentage: String, + pub value: String, + pub asklyphe: bool, + pub bing: bool, + pub google: bool, +} + +#[derive(Serialize)] +pub struct ImageSearchResult { + pub src: String, + pub url: String, + pub bing: bool, + pub google: bool, +} + +#[derive(Debug, Default)] +pub struct Complications { + disabled: bool, + wikipedia: Option, + unit_converter: Option, +} + +pub async fn search( + jar: CookieJar, + Query(params): Query>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + let stype = params + .get("stype") + .unwrap_or(&"web".to_string()) + .to_string(); + if stype == "image" { + return image_search(jar, Query(params), Extension(nats), Extension(opts)) + .await + .into_response(); + } + let use_javascript = params.get("js").unwrap_or(&"0".to_string()).to_string(); + if use_javascript != *"1" { + search_nojs(jar, Query(params), Extension(nats), Extension(opts)) + .await + .into_response() + } else { + search_js(jar, Query(params), Extension(nats), Extension(opts)) + .await + .into_response() + } +} + +#[derive(Template)] +#[template(path = "search_js.html")] +struct SearchTemplateJavascript { + info: UserInfo, + error: Option, + complications: Complications, + search_query: String, + websearch_url: String, + imagesearch_url: String, + version: String, + git_commit: String, + built_on: String, + year: String, + alpha: bool, + theme: String, +} + +pub async fn search_js( + jar: CookieJar, + Query(params): Query>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + fn error_response(query: String, info: UserInfo, error: &str) -> SearchTemplateJavascript { + let theme = info.theme.clone(); + let querystr = url_encoded_data::stringify(&[("q", query.as_str())]); + SearchTemplateJavascript { + info, + error: Some(format!( + "internal server error ({})! report to developers (:", + error + )), + complications: Default::default(), + search_query: query, + websearch_url: format!("/ask?{querystr}&js=1"), + imagesearch_url: format!("/ask?{querystr}&js=1&stype=image"), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } + } + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return ( + jar.remove("token"), + frontpage_error(e.as_str(), opts.auth_url.clone()), + ) + .into_response(); + } + }; + let mut query = params.get("q").unwrap_or(&"Deez".to_string()).to_string(); + let og_query = query.clone(); + let mut complications = Complications::default(); + // todo: better way of specifying that user doesn't want complications + if !query.contains("-complications") { + let mut wikiquery = query.clone().to_lowercase(); + wikiquery.retain(|c| c.is_alphanumeric() || c.is_ascii_whitespace()); + wikiquery = wikiquery.replace(' ', "%20"); + // todo: proper url escaping + let wikipedia_comp = + tokio::spawn(async move { wikipedia::get_wikipedia_page(&wikiquery, 20).await }); + complications.wikipedia = wikipedia_comp.await.unwrap_or_default(); + + let mut unit_query = query.clone().to_lowercase(); + unit_query = unit_query.replace("metre", "meter"); + let unit_comp = unit_converter::convert_unit(&unit_query); + complications.unit_converter = unit_comp; + } else { + complications.disabled = true; + query = query.replace("-complications", ""); + } + + let theme = info.theme.clone(); + let querystr = url_encoded_data::stringify(&[("q", og_query.as_str())]); + SearchTemplateJavascript { + info, + error: None, + complications, + search_query: og_query, + websearch_url: format!("/ask?{querystr}&js=1"), + imagesearch_url: format!("/ask?{querystr}&js=1&stype=image"), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } + .into_response() + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Template)] +#[template(path = "search.html")] +pub struct SearchTemplate { + pub info: UserInfo, + pub error: Option, + pub note: Option, + pub complications: Complications, + pub search_query: String, + pub query_time: f64, + pub page_rank_time: f64, + pub max_relevance: String, + pub search_results: Vec, + pub blocked: Vec<(String, String)>, + pub websearch_url: String, + pub imagesearch_url: String, + pub version: String, + pub git_commit: String, + pub built_on: String, + pub year: String, + pub alpha: bool, + pub theme: String, +} + +pub async fn search_nojs( + jar: CookieJar, + Query(params): Query>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + fn error_response(query: String, info: UserInfo, error: &str) -> SearchTemplate { + let theme = info.theme.clone(); + let querystr = url_encoded_data::stringify(&[("q", query.as_str())]); + SearchTemplate { + info, + error: Some(format!( + "internal server error ({})! report to developers (:", + error + )), + note: None, + complications: Default::default(), + search_query: query, + query_time: 0.0, + page_rank_time: 0.0, + max_relevance: "".to_string(), + search_results: vec![], + blocked: vec![], + websearch_url: format!("/ask?{querystr}&js=0"), + imagesearch_url: format!("/ask?{querystr}&js=0&stype=image"), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } + } + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return ( + jar.remove("token"), + frontpage_error(e.as_str(), opts.auth_url.clone()), + ) + .into_response(); + } + }; + let mut query = params.get("q").unwrap_or(&"Deez".to_string()).to_string(); + let og_query = query.clone(); + let mut complications = Complications::default(); + // todo: better way of specifying that user doesn't want complications + if !query.contains("-complications") { + let mut wikiquery = query.clone().to_lowercase(); + wikiquery.retain(|c| c.is_alphanumeric() || c.is_ascii_whitespace()); + wikiquery = wikiquery.replace(' ', "%20"); + // todo: proper url escaping + let wikipedia_comp = + tokio::spawn(async move { wikipedia::get_wikipedia_page(&wikiquery, 20).await }); + complications.wikipedia = wikipedia_comp.await.unwrap_or_default(); + + let mut unit_query = query.clone().to_lowercase(); + unit_query = unit_query.replace("metre", "meter"); + let unit_comp = unit_converter::convert_unit(&unit_query); + complications.unit_converter = unit_comp; + } else { + complications.disabled = true; + query = query.replace("-complications", ""); + } + + let engines = params + .get("engines") + .unwrap_or(&"asklyphe,bing,google".to_string()) + .to_string(); + let mut engines = engines + .split(",") + .map(|v| v.to_string()) + .collect::>(); + if opts.emergency { + // disable asklyphe backend + engines.retain(|v| v != "asklyphe"); + } + + gather_search_results(nats, query.as_str(), info, complications, Some(engines)) + .await + .into_response() + } else { + Redirect::to("/").into_response() + } +} + +#[derive(Serialize)] +struct BlockedResult { + url: String, + reason: String, +} + +#[derive(Serialize)] +struct SearchJsonInner { + #[serde(skip_serializing_if = "Option::is_none")] + note: Option, + query_time: f64, + page_rank_time: f64, + max_relevance: String, + search_results: Vec, + blocked: Vec, +} + +#[derive(Serialize)] +struct SearchJson { + #[serde(skip_serializing_if = "Option::is_none")] + error: Option, + #[serde(skip_serializing_if = "Option::is_none")] + results: Option, +} + +pub async fn search_json( + jar: CookieJar, + Query(params): Query>, + Extension(_snowflake_factory): Extension>>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> String { + fn json(input: SearchJson) -> String { + serde_json::to_string(&input).expect("failed to serialise!") + } + + fn error_response(error: &str) -> String { + json(SearchJson { + error: Some(error.to_string()), + results: None, + }) + } + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return error_response("not authenticated"); + } + }; + let query = params.get("q").unwrap_or(&"Deez".to_string()).to_string(); + let engines = params + .get("engines") + .unwrap_or(&"asklyphe,bing,google".to_string()) + .to_string(); + let mut engines = engines + .split(",") + .map(|v| v.to_string()) + .collect::>(); + if opts.emergency { + // disable asklyphe backend + engines.retain(|v| v != "asklyphe"); + } + + let result = gather_search_results( + nats, + query.as_str(), + info, + Complications::default(), + Some(engines), + ) + .await; + + json(SearchJson { + error: None, + results: Some(SearchJsonInner { + note: result.note, + query_time: result.query_time, + page_rank_time: result.page_rank_time, + max_relevance: result.max_relevance, + search_results: result.search_results, + blocked: result + .blocked + .into_iter() + .map(|(url, reason)| BlockedResult { url, reason }) + .collect(), + }), + }) + } else { + error_response("not authenticated") + } +} + +#[derive(Template)] +#[template(path = "image_search.html")] +pub struct ImageSearchTemplate { + pub info: UserInfo, + pub error: Option, + pub note: Option, + pub search_query: String, + pub search_results: Vec, + pub blocked: Vec<(String, String)>, + pub websearch_url: String, + pub imagesearch_url: String, + pub version: String, + pub git_commit: String, + pub built_on: String, + pub year: String, + pub alpha: bool, + pub theme: String, +} +pub async fn image_search( + jar: CookieJar, + Query(params): Query>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + fn error_response(query: String, info: UserInfo, error: &str) -> ImageSearchTemplate { + let theme = info.theme.clone(); + let querystr = url_encoded_data::stringify(&[("q", query.as_str())]); + ImageSearchTemplate { + info, + error: Some(format!( + "internal server error ({})! report to developers (:", + error + )), + note: None, + search_query: query, + search_results: vec![], + blocked: vec![], + websearch_url: format!("/ask?{querystr}&js=0"), + imagesearch_url: format!("/ask?{querystr}&js=0&stype=image"), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } + } + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return ( + jar.remove("token"), + frontpage_error(e.as_str(), opts.auth_url.clone()), + ) + .into_response(); + } + }; + let query = params.get("q").unwrap_or(&"Deez".to_string()).to_string(); + let js = params.get("js").unwrap_or(&"0".to_string()).to_string(); + let engines = params + .get("engines") + .unwrap_or(&"bing,google".to_string()) + .to_string(); + let engines = engines + .split(",") + .map(|v| v.to_string()) + .collect::>(); + + gather_image_results(nats, &query, info, Some(engines), js == "1") + .await + .into_response() + } else { + Redirect::to("/").into_response() + } +} + +pub async fn image_proxy( + jar: CookieJar, + Query(params): Query>, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + static PROXY_TOKEN_CACHE: RwLock> = RwLock::const_new(BTreeSet::new()); + static IMAGE_CACHE: RwLock>> = RwLock::const_new(BTreeMap::new()); + const TOKEN_CACHE_TTL_MINS: u64 = 10; + const IMAGE_CACHE_TTL_MINS: u64 = 10; + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let mut authenticated = false; + { + let cache = PROXY_TOKEN_CACHE.read().await; + authenticated = cache.contains(&token); + } + if !authenticated { + let _info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return StatusCode::UNAUTHORIZED.into_response(); + } + }; + { + let mut cache = PROXY_TOKEN_CACHE.write().await; + cache.insert(token.clone()); + tokio::spawn(async move { + tokio::time::sleep(Duration::from_secs(TOKEN_CACHE_TTL_MINS * 60)).await; + let mut cache = PROXY_TOKEN_CACHE.write().await; + cache.remove(&token); + }); + } + authenticated = true; + } + if !authenticated { + return StatusCode::UNAUTHORIZED.into_response(); + } + use isahc::prelude::*; + let url = params.get("url"); + if url.is_none() { + return StatusCode::BAD_REQUEST.into_response(); + } + let mut url = url.unwrap().to_string(); + + let mut host = url.split("://"); + let host = host.nth(1).unwrap_or(&url); + // fixme: we really need a better solution + const BLOCKED_HOSTS: &[&str] = &[ + "0", + "10", + "100.6", + "100.7", + "100.8", + "100.9", + "100.10", + "100.11", + "100.12", + "127", + "169.254", + "172.1", + "172.2", + "172.30", + "172.31", + "192.168", + "198.18", + "198.19", + "localhost", + ]; + for blocked in BLOCKED_HOSTS { + if host.starts_with(blocked) { + return StatusCode::NO_CONTENT.into_response(); + } + } + + if !(url.starts_with("http://") || url.starts_with("https://")) { + url.insert_str(0, "http://"); + } + // fixme: replace with actual smart encoding system + url = url.replace(" ", "%20"); + + { + let cache = IMAGE_CACHE.read().await; + if let Some(cached_image) = cache.get(&url).cloned() { + return cached_image.into_response(); + } + } + + let response = isahc::Request::get(url.clone()) + .ip_version(IpVersion::V4) + .header("user-agent", "AskLyphe Image Proxy (+https://asklyphe.com)") + .timeout(Duration::from_secs(10)) + .redirect_policy(RedirectPolicy::Limit(6)) + .body(()) + .unwrap() + .send_async() + .await; + if response.is_err() { + return StatusCode::NO_CONTENT.into_response(); + } + let mut response = response.unwrap(); + let data = response.bytes().await; + if data.is_err() { + return StatusCode::NO_CONTENT.into_response(); + } + let data = data.unwrap(); + const MAX_IMAGE_SIZE_IN_CACHE_MB: usize = 512; + if !data.is_empty() && data.len() < MAX_IMAGE_SIZE_IN_CACHE_MB * 1024 * 1024 { + let mut cache = IMAGE_CACHE.write().await; + const MAX_CACHE_SIZE_GB: usize = 10; + const MAX_CACHE_SIZE_MB: usize = MAX_CACHE_SIZE_GB * 1024 * 1024; + const MAX_CACHE_ENTRIES: usize = + MAX_CACHE_SIZE_MB / MAX_IMAGE_SIZE_IN_CACHE_MB; + if cache.len() < MAX_CACHE_ENTRIES { + cache.insert(url.clone(), data.clone()); + tokio::spawn(async move { + tokio::time::sleep(Duration::from_secs(IMAGE_CACHE_TTL_MINS * 60)).await; + let mut cache = IMAGE_CACHE.write().await; + cache.remove(&url); + }); + } + } + data.into_response() + } else { + StatusCode::UNAUTHORIZED.into_response() + } +} diff --git a/src/routes/semaphore.rs b/src/routes/semaphore.rs new file mode 100644 index 0000000..b20c3b9 --- /dev/null +++ b/src/routes/semaphore.rs @@ -0,0 +1,42 @@ +/* + * asklyphe-frontend routes/semaphore.rs + * - communication between asklyphe-frontend and asklyphe-auth-frontend + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use axum::extract::Query; +use axum::response::{IntoResponse, Redirect}; +use axum_extra::extract::cookie::{Cookie, Expiration, SameSite}; +use axum_extra::extract::CookieJar; +use serde::Deserialize; + +#[derive(Debug, Deserialize)] +pub struct SemaphoreQuery { + one_time_token: Option, +} + +pub async fn semaphore( + jar: CookieJar, + Query(params): Query, +) -> impl IntoResponse { + if params.one_time_token.is_none() { + return Redirect::to("/").into_response(); + } + let ott = params.one_time_token.unwrap(); + (jar.add(Cookie::build(("token", ott)) + .permanent() + .max_age(time::Duration::days(30)) + .secure(true) + .http_only(true) + // we can "safely" set lax because anything that could mess up stuff should be behind post requests with tokens + .same_site(SameSite::Lax) + .build() + ), Redirect::to("/")).into_response() +} diff --git a/src/routes/user_settings.rs b/src/routes/user_settings.rs new file mode 100644 index 0000000..908d40d --- /dev/null +++ b/src/routes/user_settings.rs @@ -0,0 +1,204 @@ +/* + * asklyphe-frontend routes/user_settings.rs + * - http routes for the settings page + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::sync::Arc; +use std::sync::atomic::Ordering; +use askama::Template; +use askama_axum::IntoResponse; +use asklyphe_common::nats::authservice::{AuthError, AuthRequest, AuthResponse, AuthServiceQuery, AuthServiceRequest, AuthServiceResponse, LogoutRequest, LogoutResponse}; +use asklyphe_common::nats::authservice::profile::{ThemeChangeRequest, ThemeChangeResponse, UserInfoRequest, UserInfoResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::comms::{ServiceError, ServiceResponse}; +use asklyphe_common::rustflake::Snowflake; +use async_nats::jetstream; +use axum::{Extension, Form}; +use axum::response::Redirect; +use axum_extra::extract::CookieJar; +use serde::Deserialize; +use tokio::sync::Mutex; +use tracing::error; +use crate::{BUILT_ON, GIT_COMMIT, Opts, ALPHA, VERSION, WEBSITE_COUNT, YEAR}; +use crate::routes::{authenticate_user, UserInfo}; + +pub struct Theme<'a> { + pub value: &'a str, + pub name: &'a str, +} + +pub static THEMES: &[Theme] = &[ + Theme { + value: "default", + name: "default theme", + }, + Theme { + value: "dark", + name: "dark theme", + }, + Theme { + value: "oled", + name: "lights out", + }, + Theme { + value: "classic", + name: "classic", + }, + Theme { + value: "freaky", + name: "freaky", + }, + Theme { + value: "water", + name: "water", + }, + Theme { + value: "gloss", + name: "gloss", + }, +]; + +#[derive(Template)] +#[template(path = "user_settings.html")] +pub struct SettingsTemplate { + themes: &'static [Theme<'static>], + + error: Option, + + info: UserInfo, + search_query: String, + version: String, + git_commit: String, + built_on: String, + year: String, + alpha: bool, + count: u64, + theme: String, +} + +pub async fn user_settings( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, +) -> impl IntoResponse { + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token).await { + Ok(i) => i, + Err(e) => { + return (jar.remove("token"), crate::routes::index::frontpage_error(e.as_str(), opts.auth_url.clone())).into_response(); + } + }; + let theme = info.theme.clone(); + SettingsTemplate { + themes: THEMES, + error: None, + info, + search_query: "".to_string(), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme, + }.into_response() + } else { + Redirect::temporary("/").into_response() + } +} + +#[derive(Deserialize, Debug)] +pub struct ThemeChangeForm { + pub theme: Option, +} + +pub async fn theme_change_post( + jar: CookieJar, + Extension(nats): Extension>, + Extension(opts): Extension, + Form(input): Form, +) -> impl IntoResponse { + fn settings_error(info: UserInfo, theme: String, error: String) -> impl IntoResponse { + SettingsTemplate { + themes: THEMES, + error: Some(error), + info, + search_query: "".to_string(), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + count: WEBSITE_COUNT.load(Ordering::Relaxed), + theme, + }.into_response() + } + + if let Some(token) = jar.get("token") { + let token = token.value().to_string(); + let info = match authenticate_user(nats.clone(), token.clone()).await { + Ok(i) => i, + Err(e) => { + return (jar.remove("token"), crate::routes::index::frontpage_error(e.as_str(), opts.auth_url.clone())).into_response(); + } + }; + + let theme = info.theme.clone(); + + if !THEMES.iter().map(|v| v.value.to_string()).collect::>().contains(&input.theme.clone().unwrap_or("default".to_string())) { + return settings_error(info, theme, "invalid input, please try again!".to_string()).into_response(); + } + + let response = comms::query_service(comms::Query::AuthService(AuthServiceQuery { + request: AuthServiceRequest::ThemeChangeRequest(ThemeChangeRequest { + token, + theme: input.theme.unwrap_or("default".to_string()), + }), + replyto: "".to_string(), + }), &nats, false).await; + if let Err(e) = response { + error!("nats error: {:?}", e); + settings_error(info, theme, "internal server error occurred! if the error persists, contact a developer!".to_string()).into_response() + } else { + let response = response.unwrap(); + match response { + ServiceResponse::AuthService(r) => { + match r { + AuthServiceResponse::ThemeChangeResponse(r) => { + match r { + ThemeChangeResponse::Success => { + Redirect::to("/user_settings").into_response() + } + ThemeChangeResponse::Logout => { + (jar.remove("token"), crate::routes::index::frontpage_error("your session token was invalid, please try logging in again", opts.auth_url.clone())).into_response() + } + ThemeChangeResponse::InternalServerError => { + settings_error(info, theme, "internal server error occurred! if the error persists, contact a developer!".to_string()).into_response() + } + } + } + x => { + error!("ERROR! RECV WRONG AUTHSERVICE RESPONSE WHEN ASKING FOR THEME CHANGE! INVESTIGATE ASAP! {x}"); + settings_error(info, theme, "internal server error occurred! if the error persists, contact a developer!".to_string()).into_response() + } + } + } + x => { + error!("ERROR! RECV WRONG SERVICE RESPONSE WHEN ASKING AUTHSERVICE! INVESTIGATE ASAP!"); + settings_error(info, theme, "internal server error occurred! if the error persists, contact a developer!".to_string()).into_response() + } + } + } + } else { + Redirect::to("/").into_response() + } +} \ No newline at end of file diff --git a/src/searchbot.rs b/src/searchbot.rs new file mode 100644 index 0000000..ca43ef9 --- /dev/null +++ b/src/searchbot.rs @@ -0,0 +1,509 @@ +/* + * asklyphe-frontend searchbot.rs + * - commonly used functions for querying the searchservice + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::collections::{BTreeMap, BTreeSet}; +use std::ops::Deref; +use std::sync::Arc; +use std::sync::atomic::Ordering; +use asklyphe_common::nats; +use asklyphe_common::nats::bingservice::{BingServiceQuery, BingServiceRequest, BingServiceResponse}; +use asklyphe_common::nats::comms; +use asklyphe_common::nats::searchservice::{SearchSrvcQuery, SearchSrvcRequest, SearchSrvcResponse}; +use async_nats::jetstream; +use async_nats::jetstream::consumer::PullConsumer; +use async_nats::jetstream::stream::RetentionPolicy; +use futures::StreamExt; +use tokio::sync::Mutex; +use tracing::log::error; +use tracing::warn; +use ulid::Ulid; +use crate::routes::search::{Complications, ImageSearchResult, ImageSearchTemplate, SearchResult, SearchTemplate}; +use crate::routes::UserInfo; +use crate::{BUILT_ON, GIT_COMMIT, ALPHA, VERSION, WEBSITE_COUNT, YEAR}; + +pub async fn update_website_counter(nats: Arc) { + let result = comms::query_service(comms::Query::SearchService(SearchSrvcQuery { + request: SearchSrvcRequest::SiteCountRequest, + replyto: "".to_string(), + }), nats.deref(), false).await; + + if let Ok(comms::ServiceResponse::SearchService(result)) = result { + match result { + SearchSrvcResponse::OtherError(e) => { + warn!("received error while asking for website count {e}"); + } + SearchSrvcResponse::SiteCountResponse(count) => { + WEBSITE_COUNT.store(count.count, Ordering::Relaxed); + } + _ => { + warn!("received invalid response while asking for website count"); + } + } + } +} + +pub async fn gather_search_results(nats: Arc, query: &str, user_info: UserInfo, complications: Complications, engines: Option>) -> SearchTemplate { + let mut search_results = vec![]; + let mut note = None; + + let asklyphe = if let Some(engines) = &engines { engines.contains(&"asklyphe".to_string()) } else { true }; + let bing = if let Some(engines) = &engines { engines.contains(&"bing".to_string()) } else { true }; + let google = if let Some(engines) = &engines { engines.contains(&"google".to_string()) } else { true }; + + // bing + + if bing { + let result = comms::query_service(comms::Query::BingService(BingServiceQuery { + request: BingServiceRequest::SearchRequest(nats::bingservice::BingSearchRequest { + query: query.to_lowercase(), + }), + replyto: "".to_string(), + }), nats.deref(), true).await; + + if let Ok(comms::ServiceResponse::BingService(result)) = result { + match result { + BingServiceResponse::InvalidRequest => { + note = Some("invalid request! report to developers!".to_string()); + } + BingServiceResponse::OtherError(e) => { + error!("bing service gave unknown error {e}!!"); + note = Some("internal server error! report to developers!".to_string()); + } + BingServiceResponse::SearchResponse(results) => { + let result_count = results.results.len(); + + search_results.extend(results.results.into_iter().enumerate().map(|(i, v)| { + const MAX_LENGTH: usize = 800; + const MAX_URL_LENGTH: usize = 100; + SearchResult { + url: v.url, + title: v.title.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_URL_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_URL_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + description: v.description.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + percentage: format!("{:.2}", ((1.0 - (i as f64 / result_count as f64)) * 50.0) + 40.0), + value: format!("{}", i), + asklyphe: false, + bing: true, + google: false, + } + })); + } + BingServiceResponse::ImageResponse(_) => { + error!("bing service gave image response to search request!!"); + note = Some("internal server error! report to developers!".to_string()); + } + } + } + } + + // google + + if google { + let result = comms::query_service(comms::Query::GoogleService(BingServiceQuery { + request: BingServiceRequest::SearchRequest(nats::bingservice::BingSearchRequest { + query: query.to_lowercase(), + }), + replyto: "".to_string(), + }), nats.deref(), true).await; + + if let Ok(comms::ServiceResponse::BingService(result)) = result { + match result { + BingServiceResponse::InvalidRequest => { + note = Some("invalid request! report to developers!".to_string()); + } + BingServiceResponse::OtherError(e) => { + error!("google service gave unknown error {e}!!"); + note = Some("internal server error! report to developers!".to_string()); + } + BingServiceResponse::SearchResponse(results) => { + let result_count = results.results.len(); + + search_results.extend(results.results.into_iter().enumerate().map(|(i, v)| { + const MAX_LENGTH: usize = 800; + const MAX_URL_LENGTH: usize = 100; + SearchResult { + url: v.url, + title: v.title.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_URL_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_URL_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + description: v.description.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + percentage: format!("{:.2}", ((1.0 - (i as f64 / result_count as f64)) * 50.0) + 40.0), + value: format!("{}", i), + asklyphe: false, + bing: false, + google: true, + } + })); + } + BingServiceResponse::ImageResponse(_) => { + error!("google service gave image response to search request!!"); + note = Some("internal server error! report to developers!".to_string()); + } + } + } + } + + // raw lyphe + let mut query_time = 0.0; + let mut page_rank_time = 0.0; + let mut max_relevance = 0.0; + let mut blocked = vec![]; + + if asklyphe { + let result = comms::query_service(comms::Query::SearchService(SearchSrvcQuery { + request: SearchSrvcRequest::SearchRequest(nats::searchservice::SearchRequest { + query: query.to_lowercase(), + }), + replyto: "".to_string(), + }), nats.deref(), true).await; + + + if let Ok(comms::ServiceResponse::SearchService(result)) = result { + match result { + SearchSrvcResponse::InvalidRequest => { + note = Some("invalid request! report to developers!".to_string()); + } + SearchSrvcResponse::OtherError(e) => { + error!("search service gave unknown error {e}!!"); + note = Some("unknown error! report to developers!".to_string()); + } + SearchSrvcResponse::SearchResponse(results) => { + if note.is_none() { + note = if !results.exact_phrase_found { + Some("didn't find exact phrase, returning sites containing requested words".to_string()) + } else { + None + }; + } + + query_time = results.total_query_seconds; + page_rank_time = results.pagerank_time_seconds; + max_relevance = results.max_relevance; + + blocked = results.blocked; + + search_results.extend(results.results.into_iter().map(|v| { + const MAX_LENGTH: usize = 800; + const MAX_URL_LENGTH: usize = 100; + SearchResult { + title: v.title.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_URL_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_URL_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + description: v.description.map(|v| { + let initial = html_escape::decode_html_entities(&v).to_string(); + let mut shortened = String::new(); + if initial.len() > MAX_LENGTH { + for (i, c) in initial.chars().enumerate() { + shortened.push(c); + if i > MAX_LENGTH { + break; + } + } + shortened.push_str("..."); + } else { + shortened = initial; + } + shortened + }), + url: v.url, + percentage: format!("{:.2}", (v.relevance / results.max_relevance) * 100.0), + value: format!("{:.2}", v.relevance), + asklyphe: true, + bing: false, + google: false, + } + })); + } + _ => { + note = Some("bad response! report to developers!".to_string()); + } + } + } else { + note = Some("unknown! report to developers!".to_string()); + } + } + + search_results.sort_by(|a, b| { + b.percentage.parse::().unwrap().total_cmp(&a.percentage.parse::().unwrap()) + }); + + let mut already_included = BTreeMap::new(); + + let mut remove = vec![]; + + let mut add_bing = vec![]; + let mut add_google = vec![]; + + for (i, result) in search_results.iter().enumerate() { + let mut trimmed_url = result.url.clone(); + trimmed_url = trimmed_url.trim_end_matches('/').to_string(); + if already_included.contains_key(&trimmed_url) && !result.asklyphe { + remove.push(i); + let main = already_included.get(&trimmed_url).unwrap(); + if result.bing { + add_bing.push(*main); + } + if result.google { + add_google.push(*main); + } + } + already_included.insert(trimmed_url, i); + } + + for i in add_bing { + search_results[i].bing = true; + } + for i in add_google { + search_results[i].google = true; + } + + for (i, rm) in remove.into_iter().enumerate() { + search_results.remove(rm - i); + } + + let theme = user_info.theme.clone(); + let querystr = url_encoded_data::stringify(&[("q", query)]); + SearchTemplate { + info: user_info, + error: None, + note, + complications, + search_query: query.to_string(), + query_time, + page_rank_time, + max_relevance: format!("{:.2}", max_relevance), + search_results, + blocked, + websearch_url: format!("/ask?{querystr}&js=0"), + imagesearch_url: format!("/ask?{querystr}&js=0&stype=image"), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } +} + +pub async fn gather_image_results(nats: Arc, query: &str, user_info: UserInfo, engines: Option>, js: bool) -> ImageSearchTemplate { + let mut search_results = vec![]; + let mut note = None; + + let bing = if let Some(engines) = &engines { engines.contains(&"bing".to_string()) } else { true }; + let google = if let Some(engines) = &engines { engines.contains(&"google".to_string()) } else { true }; + + // google + + if google { + let result = comms::query_service(comms::Query::GoogleService(BingServiceQuery { + request: BingServiceRequest::ImageRequest(nats::bingservice::BingImageRequest { + query: query.to_lowercase(), + }), + replyto: "".to_string(), + }), nats.deref(), true).await; + + if let Ok(comms::ServiceResponse::BingService(result)) = result { + match result { + BingServiceResponse::InvalidRequest => { + note = Some("invalid request! report to developers!".to_string()); + } + BingServiceResponse::OtherError(e) => { + error!("google service gave unknown error {e}!!"); + note = Some("internal server error! report to developers!".to_string()); + } + BingServiceResponse::ImageResponse(results) => { + search_results.extend(results.into_iter().enumerate().map(|(i, v)| { + const MAX_LENGTH: usize = 800; + const MAX_URL_LENGTH: usize = 100; + ImageSearchResult { + src: v.url.clone(), + url: v.url, + bing: false, + google: true, + } + })); + } + BingServiceResponse::SearchResponse(_) => { + error!("google service gave search response for image response!!"); + note = Some("internal server error! report to developers!".to_string()); + } + } + } + } + + // bing + + if bing { + let result = comms::query_service(comms::Query::BingService(BingServiceQuery { + request: BingServiceRequest::ImageRequest(nats::bingservice::BingImageRequest { + query: query.to_lowercase(), + }), + replyto: "".to_string(), + }), nats.deref(), true).await; + + if let Ok(comms::ServiceResponse::BingService(result)) = result { + match result { + BingServiceResponse::InvalidRequest => { + note = Some("invalid request! report to developers!".to_string()); + } + BingServiceResponse::OtherError(e) => { + error!("bing service gave unknown error {e}!!"); + note = Some("internal server error! report to developers!".to_string()); + } + BingServiceResponse::ImageResponse(results) => { + search_results.extend(results.into_iter().enumerate().map(|(i, v)| { + const MAX_LENGTH: usize = 800; + const MAX_URL_LENGTH: usize = 100; + ImageSearchResult { + src: v.url.clone(), + url: v.url, + bing: true, + google: false, + } + })); + } + BingServiceResponse::SearchResponse(_) => { + error!("bing service gave search response for image response!!"); + note = Some("internal server error! report to developers!".to_string()); + } + } + } + } + + let mut already_included = BTreeMap::new(); + + let mut remove = vec![]; + + let mut add_bing = vec![]; + let mut add_google = vec![]; + + for (i, result) in search_results.iter().enumerate() { + let mut trimmed_url = result.url.clone(); + trimmed_url = trimmed_url.trim_end_matches('/').to_string(); + if already_included.contains_key(&trimmed_url) { + remove.push(i); + let main = already_included.get(&trimmed_url).unwrap(); + if result.bing { + add_bing.push(*main); + } + if result.google { + add_google.push(*main); + } + } + already_included.insert(trimmed_url, i); + } + + for i in add_bing { + search_results[i].bing = true; + } + for i in add_google { + search_results[i].google = true; + } + + for (i, rm) in remove.into_iter().enumerate() { + search_results.remove(rm - i); + } + + for result in &mut search_results { + let url = url_encoded_data::stringify(&[("url", &result.url)]); + result.src = format!("/imgproxy?{}", url); + } + + let theme = user_info.theme.clone(); + ImageSearchTemplate { + info: user_info, + error: None, + note, + search_query: query.to_string(), + search_results, + blocked: vec![], + websearch_url: format!("/ask?q={query}&js={}", if js { 1 } else { 0 }), + imagesearch_url: format!("/ask?q={query}&js={}&stype=image", if js { 1 } else { 0 }), + version: VERSION.to_string(), + git_commit: GIT_COMMIT.to_string(), + built_on: BUILT_ON.to_string(), + year: YEAR.to_string(), + alpha: ALPHA, + theme, + } +} diff --git a/src/unit_converter.rs b/src/unit_converter.rs new file mode 100644 index 0000000..68f1a1c --- /dev/null +++ b/src/unit_converter.rs @@ -0,0 +1,59 @@ +/* + * asklyphe-frontend unit_converter.rs + * - wrapper for the unit converter library + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::str::FromStr; +use unit_converter::length_units::{LengthUnit, LENGTH_NAMES}; +use unit_converter::unit_defs::{BestUnit, ConvertTo, FromUnitName, UnitName}; +use unit_converter::{parse_number, remove_leading_conversion_word}; + +#[derive(Clone, Debug)] +pub struct UnitConversion { + pub value: String, + pub unit_a: String, + pub equals: String, + pub unit_b: String, +} + +pub fn convert_unit(query_text: &str) -> Option { + let (number, remainder) = parse_number(query_text); + if number.is_nan() { + return None; + } + let og_number = number.clone(); + let unit = LengthUnit::parse(remainder); + unit.as_ref()?; + let (unit_a, remainder) = unit.unwrap(); + let remainder = remove_leading_conversion_word(&remainder); + if let Some((unit_b, _)) = LengthUnit::parse(remainder) { + let conversion = unit_a.convert_to(number, unit_b); + let approx = f64::from_str(&format!("{}", conversion)).unwrap(); + let approx_og = f64::from_str(&format!("{}", og_number)).unwrap(); + Some(UnitConversion { + value: format!("{}", approx_og), + unit_a: unit_a.unit_name(og_number), + equals: format!("{}", approx), + unit_b: unit_b.unit_name(conversion), + }) + } else { + let best_unit = LengthUnit::best_unit(unit_a, number.clone()); + let conversion = unit_a.convert_to(number, best_unit); + let approx = f64::from_str(&format!("{}", conversion)).unwrap(); + let approx_og = f64::from_str(&format!("{}", og_number)).unwrap(); + Some(UnitConversion { + value: format!("{}", approx_og), + unit_a: unit_a.unit_name(og_number), + equals: format!("{}", approx), + unit_b: best_unit.unit_name(conversion), + }) + } +} diff --git a/src/wikipedia.rs b/src/wikipedia.rs new file mode 100644 index 0000000..f1430af --- /dev/null +++ b/src/wikipedia.rs @@ -0,0 +1,152 @@ +/* + * asklyphe-frontend wikipedia.rs + * - wikipedia helper functions + * + * Copyright (C) 2025 Real Microsoft, LLC + * + * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License along with this program. If not, see . +*/ + +use std::collections::{BTreeMap, HashMap}; +use std::sync::atomic::{AtomicI64, Ordering}; +use std::sync::Mutex; +use std::time::Duration; +use isahc::auth::Authentication; +use isahc::config::RedirectPolicy; +use isahc::{HttpClient, Request}; +use isahc::prelude::*; +use once_cell::sync::Lazy; +use serde::Deserialize; +use tracing::{error, warn}; + +#[derive(Clone, Debug, Deserialize)] +pub struct WikipediaPage { + pub title: String, + pub description: String, + pub extract: String, + pub thumbnail: Option, + pub content_urls: WikipediaContentUrls, +} +#[derive(Clone, Debug, Deserialize)] +pub struct WikipediaThumbnail { + pub source: Option, +} +#[derive(Clone, Debug, Deserialize)] +pub struct WikipediaContentUrls { + pub desktop: WikipediaUrls, +} +#[derive(Clone, Debug, Deserialize)] +pub struct WikipediaUrls { + pub page: String, +} + + + +pub static USER_AGENT: Lazy = Lazy::new(|| format!("AskLyphe/{} (https://asklyphe.com; nikocs@voremicrocomputers.com)", env!("CARGO_PKG_VERSION"))); + +pub static WIKIPEDIA_CACHE: Lazy>> = Lazy::new(|| Mutex::new(BTreeMap::new())); +pub static WIKIPEDIA_TIMEOUT: AtomicI64 = AtomicI64::new(0); + +#[derive(Clone, Debug)] +pub struct WikipediaSummary { + pub title: String, + pub description: String, + pub extract: String, + pub image: Option, + pub url: String, +} + +pub async fn get_wikipedia_page(query_text: &str, timeout_secs: u64) -> Option { + if let Some(cached) = { + let cache = WIKIPEDIA_CACHE.lock().unwrap(); + cache.get(query_text).cloned() + } { + let compare = "may refer to:"; + if cached.extract.ends_with(compare) { + return None; + } + Some(cached) + } else { + if WIKIPEDIA_TIMEOUT.load(Ordering::Relaxed) > 0 { + if WIKIPEDIA_TIMEOUT.load(Ordering::Relaxed) > chrono::Utc::now().timestamp() { + return None; + } else { + WIKIPEDIA_TIMEOUT.store(0, Ordering::Relaxed); + } + } + + let url = format!( + r#"https://en.wikipedia.org/api/rest_v1/page/summary/{}?redirect=true"#, query_text); + + let client = HttpClient::builder() + .redirect_policy(RedirectPolicy::Limit(10)) + .timeout(Duration::from_secs(timeout_secs)) + .build(); + if let Err(e) = client { + error!("failed to build client for fetching wikipedia: {e}"); + return None; + } + let client = client.unwrap(); + let request = Request::get(url.clone()) + .header("user-agent", USER_AGENT.as_str()) + .header("accept", "*/*") + .body(()); + if let Err(e) = request { + error!("failed to fetch wikipedia api: {e}"); + return None; + } + let request = request.unwrap(); + let response = client.send_async(request).await; + if let Err(e) = response { + error!("failed to fetch wikipedia api: {e}"); + return None; + } + let mut response = response.unwrap(); + if response.status() != 200 && response.status() != 302 { + return None; + } + let body = response.text().await; + if let Err(e) = body { + error!("failed to fetch wikipedia api: {e}"); + return None; + } + let body = body.unwrap(); + let wikiresult = serde_json::from_str::(&body); + if let Err(e) = wikiresult { + error!("failed to deserialise wikipedia api: {e}"); + return None; + } + let wikiresult = wikiresult.unwrap(); + let mut wiki = WikipediaSummary { + title: wikiresult.title.clone(), + description: wikiresult.description.clone(), + extract: wikiresult.extract.clone(), + image: None, + url: wikiresult.content_urls.desktop.page.clone(), + }; + let compare = "may refer to:"; + if wiki.extract.ends_with(compare) { + WIKIPEDIA_CACHE.lock().unwrap().insert(query_text.to_string(), wiki.clone()); + return None; + } + const MAX_LENGTH: usize = 800; + if wiki.description.len() > MAX_LENGTH { + let mut shortened = String::new(); + for (i, c) in wiki.description.chars().enumerate() { + shortened.push(c); + if i > MAX_LENGTH { + break; + } + } + shortened.push_str("..."); + wiki.description = shortened; + } + wiki.image = wikiresult.thumbnail.as_ref().and_then(|v| v.source.clone()); + WIKIPEDIA_CACHE.lock().unwrap().insert(query_text.to_string(), wiki.clone()); + Some(wiki) + } +} \ No newline at end of file diff --git a/static/admin/css/shell.css b/static/admin/css/shell.css new file mode 100644 index 0000000..7257d36 --- /dev/null +++ b/static/admin/css/shell.css @@ -0,0 +1,166 @@ +* { + transition: inherit; +} + +body { + background-image: url("/static/admin/img/bg.png"); + padding: 0; + margin: 0; +} + +#header { + background-image: url("/static/admin/img/bg.png"); + margin: 0; + padding: 10px; + height: 200px; +} + +#header > img { + float: left; + max-height: 200px; +} + +#content-area { + display: flex; + flex-direction: row; + margin: auto; +} + +#navbar { + box-shadow: inset 6px 6px 6px -6px rgba(0, 0, 0, 0.6); + border-right: 1px solid #6f6f6f; + border-bottom: 1px solid #6f6f6f; + width: 320px; + min-height: 100vh; + background-color: #e5e5e5; + margin: 0; + padding: 0; + display: flex; + flex-direction: column; +} + +#navbar > a { + display: block; + background-image: url("/static/admin/img/column/bg.png"); + color: black; + margin: 0; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); + border-radius: 0; + border: 1px solid #6f6f6f; + border-right: none; + min-height: 20px; + padding: 3px 10px; + font-size: 16px; + transition: all 0.2s linear; + font-weight: normal; +} + +#navbar > a:first-child { + box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, 0.6); +} + +#navbar > a:hover { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); +} + +#navbar > a:active { + background: url("/static/admin/img/column/bg_clicked.png"); + color: #474747; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); +} + +a, button { + text-decoration: none; + color: inherit; + background-image: url("/static/admin/img/button/bg.png"); + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); + color: white; + min-height: 20px; + border: 1px solid #56929f; + border-radius: 10px; + padding: 3px 10px; + margin: 3px; + font-size: 16px; + transition: all 0.2s linear; + font-family: sans-serif; + font-weight: bold; +} + +a:hover, button:hover { + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); +} + +a:active, button:active { + background-image: url("/static/admin/img/button/bg_clicked.png"); + color: #e0e0e0; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); +} + +input[type="text"] { + border-radius: 10px; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); + min-height: 20px; + border: 1px solid #9f9f9f; + padding: 3px 10px; + margin: 3px; + font-size: 16px; + transition: all 0.2s linear; +} + +#panel-content { + background-color: #e5e5e5; + width: 100%; + box-shadow: inset 0 0 6px 0 rgba(0, 0, 0, 0.6); + padding: 10px; +} + +form { + display: flex; + flex-direction: column; + width: 35%; +} + +table { + background-color: white; + border-spacing: 0; +} + +tbody { + margin: 0; + padding: 0; + width: 100%; +} + +th { + background-image: url("/static/admin/img/column/bg.png"); + margin: 0; + border: 1px solid #6f6f6f; + border-right: none; + border-radius: 0; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); + box-shadow: inset 0 6px 6px -6px rgba(0, 0, 0, 0.6); + padding: 3px 10px; +} + +th:last-child { + border-right: 1px solid #6f6f6f; +} + +td { + border: 1px solid #6f6f6f; + border-right: none; + border-top: none; +} + +td:last-child { + border-right: 1px solid #6f6f6f; +} + +tr:nth-child(odd) { + background-color: rgba(150, 212, 212, 0.2); +} + +tr:nth-child(odd),td:nth-child(even) { + background-color: rgba(150, 212, 212, 0.2); +} diff --git a/static/admin/img/bg.png b/static/admin/img/bg.png new file mode 100644 index 0000000..1e1a9af Binary files /dev/null and b/static/admin/img/bg.png differ diff --git a/static/admin/img/button/bg.png b/static/admin/img/button/bg.png new file mode 100644 index 0000000..c4dea4e Binary files /dev/null and b/static/admin/img/button/bg.png differ diff --git a/static/admin/img/button/bg_clicked.png b/static/admin/img/button/bg_clicked.png new file mode 100644 index 0000000..73a52a3 Binary files /dev/null and b/static/admin/img/button/bg_clicked.png differ diff --git a/static/admin/img/column/bg.png b/static/admin/img/column/bg.png new file mode 100644 index 0000000..f5a6da3 Binary files /dev/null and b/static/admin/img/column/bg.png differ diff --git a/static/admin/img/column/bg_clicked.png b/static/admin/img/column/bg_clicked.png new file mode 100644 index 0000000..2e8003b Binary files /dev/null and b/static/admin/img/column/bg_clicked.png differ diff --git a/static/admin/logo.png b/static/admin/logo.png new file mode 100644 index 0000000..8469499 Binary files /dev/null and b/static/admin/logo.png differ diff --git a/static/bluestars.gif b/static/bluestars.gif new file mode 100644 index 0000000..9ddb845 Binary files /dev/null and b/static/bluestars.gif differ diff --git a/static/creature.css b/static/creature.css new file mode 100644 index 0000000..823e4c4 --- /dev/null +++ b/static/creature.css @@ -0,0 +1,4 @@ +.response { + background: url("/static/img/creature.png"); + background-size: 128px 128px; +} diff --git a/static/docs/about/index.html b/static/docs/about/index.html new file mode 100644 index 0000000..84a2e10 --- /dev/null +++ b/static/docs/about/index.html @@ -0,0 +1,66 @@ + + + + + AskLyphe Docs - About + + + + +
+ WARNING! askLyphe is in pre-alpha! user experience is in no way representative of the final product! + +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+ back +

about askLyphe and its creators

+ +

+ askLyphe is a search engine currently being developed by the Vore Microcomputers Team at + Real Microsoft, LLC. (not affiliated with the Microsoft Corporation or its products). + this currently consists of Niko Viau-Chow-Stuart, as well as our volunteers. +

+
+
+

+ our goal is to create a search engine that is fast, accurate, and ad-free; while also being + well-built with features that we find useful, and with leadership that both respects its users and + supports the safety of the people that made it possible. +

+

+ in order to follow these goals, Real Microsoft, LLC will never accept investments, + VC funding, or any income beyond that earned through profit and donations. +

+

+ we will strive to keep these goals and values as the foundation of our company til either the day + that the downfall of capitalism removes the need for us to run a company in order to make the IRS + happy; or when microsoft sues us out of existence. +

+ +

pricing and availability

+

+ currently, askLyphe is only available to those who have been given invite codes. we are planning on + soon allowing our liberapay donators to get free invite codes, and in the future switch to a public + subscription model (with all previous users getting free lifetime access). +

+

+ our plan for pricing in the future is probably around $5USD a month. no particular reason, it just + seems like a good number (: we may change it in the future. +

+
+
+
+
+ + \ No newline at end of file diff --git a/static/docs/complications/index.html b/static/docs/complications/index.html new file mode 100644 index 0000000..395867e --- /dev/null +++ b/static/docs/complications/index.html @@ -0,0 +1,60 @@ + + + + + AskLyphe Docs - Complications + + + + +
+ WARNING! askLyphe is in pre-alpha! user experience is in no way representative of the final product! + +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+ back +

complications guide / info

+ +

+ complications are the little panels that show up on certain searches. + some examples are the wikipedia complication, which will show you wikipedia results + for searches that result in wikipedia pages; or the unit converter complication, which will + attempt to convert units when given a query such as "5 km to miles". +

+
+
+

+ we currently have only implemented the wikipedia and unit converter complications, we plan to add + more in the future but for now this is all. furthermore, the unit converter complication only + currently supports length units. +

+
+
+

+ an additional note on the unit converter is that it, if given a single unit such as "5km", will + attempt to automatically find the simplest alternate unit to represent the value as. +

+
+
+

+ you can disable complications by adding "-complications" to your search query. in the future, this + will be a setting in your user settings area. +

+ +
+
+
+
+ + \ No newline at end of file diff --git a/static/docs/index.html b/static/docs/index.html new file mode 100644 index 0000000..3df33f6 --- /dev/null +++ b/static/docs/index.html @@ -0,0 +1,52 @@ + + + + + AskLyphe Docs - Index + + + + +
+ WARNING! askLyphe is in pre-alpha! user experience is in no way representative of the final product! + +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+

askLyphe documentation

+ +

+ as askLyphe is currently in alpha, we cannot guarantee that every feature or notable + issue will be properly documented. however, we will try our best to catalog as much + as we can here. +

+
+
+

+ if you find any issues or have any suggestions, please email us at + devnull@voremicrocomputers.com. +

+ + +

table of contents

+ +
+
+
+
+ + \ No newline at end of file diff --git a/static/docs/roadmap/index.html b/static/docs/roadmap/index.html new file mode 100644 index 0000000..01f4b0f --- /dev/null +++ b/static/docs/roadmap/index.html @@ -0,0 +1,110 @@ + + + + + AskLyphe Docs - Roadmap + + + + +
+ WARNING! askLyphe is in pre-alpha! user experience is in no way representative of the final product! + +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+ back +

askLyphe development roadmap

+ +

+ this page will be used to list and categorise some present and future goals, + mainly to list features that we want to implement either soon or in the further future. +

+
+
+

+ bugs will not be listed here. for now, bugs should be reported to our email + (devnull@voremicrocomputers.com), + and once we release the source code, on our git. +

+
+
+

+ this page will likely be replaced with an actual issue tracker in the future +

+ +

+ search engine +

+
    +
  • + more backends (currently we have askLyphe and bing) +
  • +
  • + result caching; (not implemented) +
  • +
  • + search suggestions; (not implemented, needs research) +
  • +
+ +

+ complications +

+
    +
  • + calculator; (not implemented, medium priority) +
  • +
  • + stack overflow; (not implemented, low priority) +
  • +
+ +

+ unit converter +

+
    +
  • + weight units; (not implemented, medium priority) +
  • +
  • + currency; (not implemented, low priority) +
  • +
+ +

+ user backend +

+
    +
  • + automated email changes / reverification; (not implemented, high priority) +
  • +
  • + password changes; (not implemented, high priority) +
  • +
+ +

+ general +

+
    +
  • + open source (will be done after git audit for copyrighted content / private information) +
  • +
+
+
+
+
+ + \ No newline at end of file diff --git a/static/font/AtkinsonHyperlegible-Bold.ttf b/static/font/AtkinsonHyperlegible-Bold.ttf new file mode 100644 index 0000000..c72b488 Binary files /dev/null and b/static/font/AtkinsonHyperlegible-Bold.ttf differ diff --git a/static/font/AtkinsonHyperlegible-BoldItalic.ttf b/static/font/AtkinsonHyperlegible-BoldItalic.ttf new file mode 100644 index 0000000..ff966b1 Binary files /dev/null and b/static/font/AtkinsonHyperlegible-BoldItalic.ttf differ diff --git a/static/font/AtkinsonHyperlegible-Italic.ttf b/static/font/AtkinsonHyperlegible-Italic.ttf new file mode 100644 index 0000000..1cf113a Binary files /dev/null and b/static/font/AtkinsonHyperlegible-Italic.ttf differ diff --git a/static/font/AtkinsonHyperlegible-Regular.ttf b/static/font/AtkinsonHyperlegible-Regular.ttf new file mode 100644 index 0000000..23614a4 Binary files /dev/null and b/static/font/AtkinsonHyperlegible-Regular.ttf differ diff --git a/static/font/NanumGothicCoding-Bold.ttf b/static/font/NanumGothicCoding-Bold.ttf new file mode 100644 index 0000000..36bd220 Binary files /dev/null and b/static/font/NanumGothicCoding-Bold.ttf differ diff --git a/static/font/NanumGothicCoding-Bold.woff b/static/font/NanumGothicCoding-Bold.woff new file mode 100644 index 0000000..2f1b9cb Binary files /dev/null and b/static/font/NanumGothicCoding-Bold.woff differ diff --git a/static/font/NanumGothicCoding-Bold.woff2 b/static/font/NanumGothicCoding-Bold.woff2 new file mode 100644 index 0000000..b99441f Binary files /dev/null and b/static/font/NanumGothicCoding-Bold.woff2 differ diff --git a/static/font/NanumGothicCoding-Regular.ttf b/static/font/NanumGothicCoding-Regular.ttf new file mode 100644 index 0000000..990066a Binary files /dev/null and b/static/font/NanumGothicCoding-Regular.ttf differ diff --git a/static/font/NanumGothicCoding.woff b/static/font/NanumGothicCoding.woff new file mode 100644 index 0000000..1f26953 Binary files /dev/null and b/static/font/NanumGothicCoding.woff differ diff --git a/static/font/NanumGothicCoding.woff2 b/static/font/NanumGothicCoding.woff2 new file mode 100644 index 0000000..3813615 Binary files /dev/null and b/static/font/NanumGothicCoding.woff2 differ diff --git a/static/font/OFL.txt b/static/font/OFL.txt new file mode 100644 index 0000000..9872707 --- /dev/null +++ b/static/font/OFL.txt @@ -0,0 +1,97 @@ +Copyright (c) 2010, NHN Corporation (http://www.nhncorp.com), +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver +NanumGothic, NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver +NanumBrush, NanumPen, Naver NanumPen. + + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/static/img/404.png b/static/img/404.png new file mode 100644 index 0000000..6175399 Binary files /dev/null and b/static/img/404.png differ diff --git a/static/img/announcement.png b/static/img/announcement.png new file mode 100644 index 0000000..e024da2 Binary files /dev/null and b/static/img/announcement.png differ diff --git a/static/img/borderbent.png b/static/img/borderbent.png new file mode 100644 index 0000000..bb276e6 Binary files /dev/null and b/static/img/borderbent.png differ diff --git a/static/img/button.png b/static/img/button.png new file mode 100644 index 0000000..ddf11c7 Binary files /dev/null and b/static/img/button.png differ diff --git a/static/img/creature.png b/static/img/creature.png new file mode 100644 index 0000000..45e1c01 Binary files /dev/null and b/static/img/creature.png differ diff --git a/static/img/darkened_paper.jpg b/static/img/darkened_paper.jpg new file mode 100644 index 0000000..b579a27 Binary files /dev/null and b/static/img/darkened_paper.jpg differ diff --git a/static/img/imagesearch.png b/static/img/imagesearch.png new file mode 100644 index 0000000..d92b8d3 Binary files /dev/null and b/static/img/imagesearch.png differ diff --git a/static/img/imagesearch_selected.png b/static/img/imagesearch_selected.png new file mode 100644 index 0000000..ec078b9 Binary files /dev/null and b/static/img/imagesearch_selected.png differ diff --git a/static/img/logo.png b/static/img/logo.png new file mode 100644 index 0000000..1b3ff32 Binary files /dev/null and b/static/img/logo.png differ diff --git a/static/img/lyphe-hardhat.png b/static/img/lyphe-hardhat.png new file mode 100644 index 0000000..f403f8d Binary files /dev/null and b/static/img/lyphe-hardhat.png differ diff --git a/static/img/lyphebent-alpha.png b/static/img/lyphebent-alpha.png new file mode 100644 index 0000000..48e573f Binary files /dev/null and b/static/img/lyphebent-alpha.png differ diff --git a/static/img/lyphebent-christmas.png b/static/img/lyphebent-christmas.png new file mode 100644 index 0000000..f72d80a Binary files /dev/null and b/static/img/lyphebent-christmas.png differ diff --git a/static/img/lyphebent-prealpha.png b/static/img/lyphebent-prealpha.png new file mode 100644 index 0000000..9fe4f65 Binary files /dev/null and b/static/img/lyphebent-prealpha.png differ diff --git a/static/img/lyphebent.old b/static/img/lyphebent.old new file mode 100644 index 0000000..a80a824 Binary files /dev/null and b/static/img/lyphebent.old differ diff --git a/static/img/lyphebent.png b/static/img/lyphebent.png new file mode 100644 index 0000000..f72d80a Binary files /dev/null and b/static/img/lyphebent.png differ diff --git a/static/img/paper.jpg b/static/img/paper.jpg new file mode 100644 index 0000000..7087b35 Binary files /dev/null and b/static/img/paper.jpg differ diff --git a/static/img/paper_slightly_darker.jpg b/static/img/paper_slightly_darker.jpg new file mode 100644 index 0000000..f9181a1 Binary files /dev/null and b/static/img/paper_slightly_darker.jpg differ diff --git a/static/img/textbox.png b/static/img/textbox.png new file mode 100644 index 0000000..9562d55 Binary files /dev/null and b/static/img/textbox.png differ diff --git a/static/img/tinybutterfly.png b/static/img/tinybutterfly.png new file mode 100644 index 0000000..42d0130 Binary files /dev/null and b/static/img/tinybutterfly.png differ diff --git a/static/img/tinyletter.png b/static/img/tinyletter.png new file mode 100644 index 0000000..00f6856 Binary files /dev/null and b/static/img/tinyletter.png differ diff --git a/static/img/tinylyphe.png b/static/img/tinylyphe.png new file mode 100644 index 0000000..2240591 Binary files /dev/null and b/static/img/tinylyphe.png differ diff --git a/static/img/websearch.png b/static/img/websearch.png new file mode 100644 index 0000000..6bdf9ea Binary files /dev/null and b/static/img/websearch.png differ diff --git a/static/img/websearch_selected.png b/static/img/websearch_selected.png new file mode 100644 index 0000000..7907e82 Binary files /dev/null and b/static/img/websearch_selected.png differ diff --git a/static/js/search.js b/static/js/search.js new file mode 100644 index 0000000..a756bb6 --- /dev/null +++ b/static/js/search.js @@ -0,0 +1,190 @@ +const loading_message = "results are loading..."; +const kinda_long = "results are still loading..."; +const elapsed_message = "time elapsed"; + +let time_elapsed = 0.0; +let timer_interval; + +function updateTimer() { + if (document.getElementById("stopwatch") !== null) { + const timer_element = document.getElementById("stopwatch") + time_elapsed += 1 / 100; + timer_element.innerHTML = time_elapsed.toString(); + if (time_elapsed > 5) { + const notice1 = document.getElementById("loading_message"); + notice1.innerHTML = kinda_long; + } + } +} + +function startLoading() { + if (document.getElementById("loading") === null) { + const results_area = document.getElementById("results-area"); + const loading_element = document.createElement("div"); + loading_element.id = "loading"; + + const notice1 = document.createElement("span"); + notice1.id = "loading_message"; + notice1.innerHTML = loading_message; + loading_element.appendChild(notice1); + + const timer_notice = document.createElement("span"); + timer_notice.id = "timer_message"; + timer_notice.innerHTML = elapsed_message; + + const timer_element = document.createElement("div"); + timer_element.id = "stopwatch"; + loading_element.appendChild(timer_element); + results_area.appendChild(loading_element); + timer_interval = setInterval(updateTimer, 10); + } +} + +function stopLoading() { + if (document.getElementById("loading") !== null) { + clearInterval(timer_interval); + + const results_area = document.getElementById("results-area"); + const loading_element = document.getElementById("loading"); + results_area.removeChild(loading_element); + } +} + +startLoading(); + +function process(result) { + stopLoading(); + const json = result; //JSON.parse(result); + if (json.hasOwnProperty( "error") || !json.hasOwnProperty( "results")) { + const response_element = document.getElementsByClassName("response")[0]; + const results_area = document.getElementById("results-area"); + response_element.removeChild(results_area); + + const error_element = document.createElement("div"); + error_element.classList.add("error"); + if (json.hasOwnProperty( "error")) { + error_element.innerText = json.error; + } else { + error_element.innerText = "unknown serverside error occurred! please try your request again, and contact an administrator if the error persists!"; + } + response_element.appendChild(error_element); + } else { + const search_results = json.results; + const response_element = document.getElementsByClassName("response")[0]; + const search_result_list = document.createElement("ol"); + const results_area = document.getElementById("results-area"); + const stats_element = document.createElement("div"); + stats_element.classList.add("stats"); + stats_element.innerText = `found ${search_results.search_results.length} results in ${search_results.query_time} seconds (${search_results.page_rank_time} was pageranking)`; + results_area.appendChild(stats_element); + + if (search_results.hasOwnProperty( "note")) { + const note_element = document.createElement("div"); + note_element.classList.add("note"); + note_element.innerText = search_results.note; + results_area.insertBefore(note_element, stats_element); + } + + search_result_list.classList.add("search-result-list"); + + for (const result_obj of search_results.search_results) { + const li = document.createElement("li"); + const a = document.createElement("a"); + a.classList.add("search-result"); + a.href = result_obj.url; + const h2 = document.createElement("h2"); + h2.classList.add("search-title"); + if (result_obj.hasOwnProperty( "title")) { + h2.innerText = result_obj.title; + } else { + h2.innerText = result_obj.url; + } + a.appendChild(h2); + const resultstat = document.createElement("span"); + resultstat.classList.add("resultstat"); + if (result_obj.hasOwnProperty( "title")) { + const search_url = document.createElement("span"); + search_url.classList.add("search-url"); + search_url.innerText = result_obj.url + " "; + resultstat.appendChild(search_url); + } + const relevance = document.createElement("span"); + relevance.classList.add("search-relevance"); + relevance.innerText = `(${result_obj.percentage}%, ${result_obj.value} / ${search_results.max_relevance})`; + const enginelist = document.createElement("span"); + enginelist.classList.add("enginelist"); + if (result_obj.hasOwnProperty("asklyphe")) { + if (result_obj.asklyphe === true) { + const tinylyphe = document.createElement("img"); + tinylyphe.src = "/static/img/tinylyphe.png"; + tinylyphe.title = "from askLyphe database"; + enginelist.appendChild(tinylyphe); + } + } + if (result_obj.hasOwnProperty("bing")) { + if (result_obj.bing === true) { + const tinybutterfly = document.createElement("img"); + tinybutterfly.src = "/static/img/tinybutterfly.png"; + tinybutterfly.title = "from external search engine"; + enginelist.appendChild(tinybutterfly); + } + } + if (result_obj.hasOwnProperty("google")) { + if (result_obj.google === true) { + const tinyletter = document.createElement("img"); + tinyletter.src = "/static/img/tinyletter.png"; + tinyletter.title = "from external search engine"; + enginelist.appendChild(tinyletter); + } + } + resultstat.appendChild(relevance); + resultstat.appendChild(enginelist); + a.appendChild(resultstat); + if (result_obj.hasOwnProperty( "description")) { + const desc = document.createElement("span"); + desc.classList.add("search-description"); + desc.innerText = result_obj.description; + a.appendChild(desc); + } + li.appendChild(a); + search_result_list.appendChild(li); + } + + results_area.appendChild(search_result_list); + + if (search_results.blocked.length > 0) { + const blocked_header = document.createElement("span"); + blocked_header.classList.add("blocked-header"); + blocked_header.innerText = `${search_results.blocked.length} results were pruned from search results for the following reasons:`; + results_area.appendChild(blocked_header); + const blocked_results = document.createElement("ol"); + blocked_results.classList.add("blocked-results"); + for (const blocked of search_results.blocked) { + const li = document.createElement("li"); + li.innerText = `"${blocked.url}" because "${blocked.reason}"`; + blocked_results.appendChild(li); + } + results_area.appendChild(blocked_results); + } + } +} + +let xml_http = new XMLHttpRequest(); + +xml_http.onload = (e) => { + process(xml_http.response); +} + +let query = "Deez"; +let engines = ""; +let params = (new URL(document.location)).searchParams; +if (params.has("q")) { + query = params.get("q"); +} +if (params.has("engines")) { + engines = `&engines=${params.get("engines")}`; +} + +xml_http.open("GET", `${window.location.origin}/ask_json?q=${encodeURIComponent(query)}${engines}`); +xml_http.responseType = "json"; +xml_http.send(); \ No newline at end of file diff --git a/static/lyphe-christmas.png b/static/lyphe-christmas.png new file mode 100644 index 0000000..545fdbe Binary files /dev/null and b/static/lyphe-christmas.png differ diff --git a/static/lyphe.png b/static/lyphe.png new file mode 100644 index 0000000..7e89311 Binary files /dev/null and b/static/lyphe.png differ diff --git a/static/osd.xml b/static/osd.xml new file mode 100644 index 0000000..c60efc7 --- /dev/null +++ b/static/osd.xml @@ -0,0 +1,10 @@ + + + AskLyphe + the best search engine! + UTF-8 + https://asklyphe.com/favicon.ico + + https://asklyphe.com/ + + diff --git a/static/privacy_policy.html b/static/privacy_policy.html new file mode 100644 index 0000000..63710f2 --- /dev/null +++ b/static/privacy_policy.html @@ -0,0 +1,321 @@ + + + + + AskLyphe - Privacy Policy + + + + + +
+ +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+

PRIVACY POLICY

+

Last updated 2024-11-11

+ +

+ This Privacy Policy for Real Microsoft, LLC ("Real Microsoft", "we", "us", or "our"), describes how + and why we might access, collect, store, and/or use your personal information when you use the askLyphe software (the "Service"). +

+

+ Reading this Privacy Policy will help you understand your privacy rights and choices. We are responsible + for making decisions about how your personal information is processed. + If you do not agree with our policies and practices, please do not use our Service. +

+ +

SUMMARY OF KEY POINTS

+

+ + This summary provides key points from our Privacy Policy, but you can find out more details about + any of these topics by using the table of contents below to find the section you are looking for. + +

+

+ What personal information do we process? + Usage of the Service in its current form requires the collection and processing of only the data + you explicitly provide (such as but not limited to your username and email address), as well as your + IP address which may be used for additional account safety. You may read more about this below. +

+

+ Do we process any sensitive personal information? + Some of the information may be considered "special" or "sensitive" in certain jurisdictions, for + example your racial or ethnic origins, sexual orientation, and religious beliefs. We do not collect or + process any information of this kind. +

+

+ Do we collect any information from third parties? + We do not collect any information from third parties. +

+

+ How do we process your information? + Your information is used to provide you our Service, as well as to verify account ownership. + We may use your provided information to communicate with you, for security and fraud prevention, and + to comply with law. We process your information only when we have a valid legal reason to do so. +

+

+ In what situations and with which parties do we share personal information? + Searches are sent to the third-party search-engines which you have enabled on your account or + per-search. Otherwise, your information will only be shared with a third party in the event that we + are legally required to do so in order to comply with law. +

+

+ How do we keep your information safe? + We take information security seriously, and to the best of our efforts follow industry-standard practices + and procedures to protect your information from both malicious third parties and malicious actors + within Real Microsoft. However, no electronic transmission or information storage technology can be + guaranteed to be 100% secure, and as such we cannot promise or guarantee that unauthorized parties + will not be able to defeat our security and improperly collect, access, steal, or modify your information. +

+

+ What are your rights? + Depending on where you are located geographically, the applicable privacy law may mean you have + certain rights regarding your personal information. +

+

+ How do you exercise your rights? + The easiest way to exercise your rights is to contact us at devnull@voremicrocomputers.com via email. + We will consider and act upon any request in accordance with applicable data protection laws. +

+ +

TABLE OF CONTENTS

+ + +

1. WHAT INFORMATION DO WE COLLECT?

+

+ We collect personal information that you voluntarily provide to us when you register on the Service, + or otherwise when you contact us. +

+

+ The personal information may include the following: +

    +
  • email addresses
  • +
  • usernames
  • +
  • passwords
  • +
  • IP addresses
  • +
+

+

+ We do not collect or process "sensitive" information. +

+ +

2. HOW DO WE PROCESS YOUR INFORMATION?

+

+ We process your information in order to provide you with the Service, and to protect your private + information and security. +

+

+ The information given to us is used to facilitate account creation and otherwise account management. + We may also use the email address associated with your account in order to notify you of important + account notices, legal information, or notices in relation to the Service. +

+ +

3. WHAT LEGAL BASES DO WE RELY ON TO PROCESS YOUR INFORMATION?

+

+ This paragraph applies to you if you are located in the EU or UK. + The General Data Protection Regulation (GDPR) and UK GDPR require us to explain the valid legal bases + we rely on in order to process your information. As such, we may rely on the following legal bases + to process your personal information: +

    +
  • Consent. We may process your information if you have given us permission (i.e., consent) + to use your personal information for a specific purpose. You have the right to withdraw your consent + at any time, and may do so by contacting us at devnull@voremicrocomputers.com
  • +
  • Legal Obligations. We may process your information where we believe it is necessary + for compliance with our legal obligations, such as to cooperate with a law enforcement body or regulatory agency, + exercise or defend our legal rights, or disclose your information as evidence in litigation in which + we are involved.
  • +
  • Vital Interests. We may process your information where we believe it is necessary + to protect your vital interests or the vital interests of a third party, such as situations involving + potential threats to the safety of any person.
  • +
+

+

+ This paragraph applies to you if you are located in Canada. + We may process your information if you have given us specific permission (i.e., express consent) + to use your personal information for a specific purpose, or in situations where your permission + can be inferred (i.e., implied consent). You can withdraw your consent at any time, and may do so by + contacting us at devnull@voremicrocomputers.com. In some exceptional cases, we may be legally + permitted under applicable law to process your information without your consent, including, for example: +

    +
  • If collection is clearly in the interests of an individual and consent cannot be obtained in a timely way.
  • +
  • For investigations and fraud detection and prevention.
  • +
  • For business transactions provided certain conditions are met.
  • +
  • If it is contained in a witness statement and the collection is necessary to assess, process, + or settle an insurance claim.
  • +
  • For identifying injured, ill, or deceased persons and communicating with next of kin.
  • +
  • If we have reasonable grounds to believe an individual has been, is, or may be victim of financial abuse.
  • +
  • If it is reasonable to expect collection and use with consent would compromise the availability or + accuracy of the information and the collection is reasonable for purposes related to investigating a breach + of an agreement or a contravention of the laws of Canada or a province.
  • +
  • If disclosure is required to comply with a subpoena, warrant, court order, or rules of the court + relating to the production of records.
  • +
  • If it was produced by an individual in the course of their employment, business, or profession + and the collection is consistent with the purposes for which the information was produced.
  • +
+

+ +

4. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?

+

+ As one or more Third-Party search engine "backends" may be used for queries, these third-party + services will receive only the necessary information to provide you with their results. This + information should not consist of more than your search query. +

+

+ Otherwise, we will only share your personal information with third parties in the event that we must do so to + comply with law. In the event of a business transfer, merger, or acquisition, your data may be + deleted from our databases unless consent for the transfer is given. +

+ +

5. IS YOUR INFORMATION TRANSFERRED INTERNATIONALLY?

+

+ Our servers are located in the United States. If you are accessing our Service from outside the United States, + please be aware that your information may be transferred to, stored by, and processed by us in our facilities. +

+

+ If you are a resident in the European Economic Area (EEA), United Kingdom (UK), or Switzerland, then + the countries in which your data is stored may not necessarily have data protection laws or other + similar laws as comprehensive as those in your country. However, we will take all necessary measures + to protect your personal information in accordance with this Privacy Policy and applicable law. +

+ +

6. HOW LONG DO WE KEEP YOUR INFORMATION?

+

+ We will only keep your personal information for as long as it is necessary for the purposes set out in + this Privacy Policy, unless a longer retention period is required or permitted by law (such as tax, + accounting, or other legal requirements). No purpose in this policy will require us keeping your + personal information for longer than the period of time in which users have an account with us. +

+

+ When we have no ongoing legitimate business need to process your personal information, we will either + delete or anonymize such information, or, if this is not possible (for example, because your personal + information has been stored in backup archives), then we will securely store your personal information + and isolate it from any further processing until deletion is possible. +

+ +

7. HOW DO WE KEEP YOUR INFORMATION SAFE?

+

+ We take information security seriously, and to the best of our efforts follow industry-standard practices + and procedures to protect your information from both malicious third parties and malicious actors + within Real Microsoft. However, no electronic transmission or information storage technology can be + guaranteed to be 100% secure, and as such we cannot promise or guarantee that unauthorized parties + will not be able to defeat our security and improperly collect, access, steal, or modify your information. +

+

+ Although we will do our best to protect your personal information, transmission of personal information + to and from our Service is at your own risk. You should only access the Service within a secure environment. +

+ +

8. WHAT ARE YOUR PRIVACY RIGHTS?

+

+ In some regions (like the EEA, UK, Switzerland, and Canada), you have certain rights under applicable + data protection laws. These may include the right (i) to request, access, and obtain a copy of personal + information; (ii) to request rectification or erasure; (iii) to restrict the processing of your + personal information; (iv) if applicable, to data portability; and (v) not to be subject to automated + decision-making. In certain circumstances, you may also have the right to object to the processing + of your personal information. You can make such a request by contacting us at devnull@voremicrocomputers.com +

+

+ We will consider and act upon any request in accordance with applicable data protection laws. +

+

+ If you are located in the EEA or UK and you believe we are unlawfully processing your personal information, + you also have the right to complain to your + Member State data protection authority + or UK data protection authority. +

+

+ If you are located in Switzerland, you may contact the + Federal Data Protection and Information Commissioner. +

+

+ Withdrawing your consent: + If we are relying on your consent to process your personal information, which may be express and/or implied + consent depending on the applicable law, you have the right to withdraw your consent at any time. + You can withdraw your consent at any time by contacting us via email at devnull@voremicrocomputers.com. +

+

+ However, please note that this will not affect the lawfulness of processing before its withdrawal nor, + when applicable law allows, will it affect the processing of your personal information conducted in + reliance on lawful processing grounds other than consent. +

+

+ If you would at any time like to review or change the information in your account or terminate your + account, please contact us at devnull@voremicrocomputers.com. +

+

+ Upon your request to terminate your account, we will deactivate or delete your account and information + from our active databases. However, we may retain some information in our files to prevent fraud, + troubleshoot problems, assist with any investigations, enforce our legal terms and/or comply with + applicable legal requirements. +

+ +

9. CONTROLS FOR DO-NOT-TRACK FEATURES

+

+ Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track ("DNT") + feature or setting you can activate to signal your privacy preference not to have data about your online + browsing activities monitored and collected. +

+

+ We currently do not respond to DNT signals, as we feel that there is nothing extra that we could do + to facilitate this request. We do not automatically monitor or collect any information from your + usage of the Service except that which is required or deemed necessary to provide you with the Service, + and any information that is required to be collected for normal functionality is not shared with + any third-parties except in the rare cases specified in Section 4. +

+ +

10. DO WE MAKE UPDATES TO THIS POLICY?

+

+ We may update this Privacy Policy from time to time, such as but not limited to the introduction of new features + to our Service. +

+

+ The updated version will be indicated by an updated "Last updated" date at the top of this Privacy Policy. + If we make material changes to this Privacy Policy, we may notify you either by prominently posting a notice + of such changes or by directly sending you a notification. We encourage you to review this Privacy Policy + frequently to be informed of how we are protecting your information. +

+ +

11. HOW CAN YOU CONTACT US ABOUT THIS NOTICE?

+

+ If you have any questions or comments about this policy, you may email us at devnull@voremicrocomputers.com +

+ +

12. HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?

+

+ You have the right to request access to the personal information we collect from you, details about + how we have processed it, correct inaccuracies, or delete your personal information. You may also + have the right to withdraw your consent to our processing of your personal information. These rights + may be limited in some circumstances by applicable law. To request to review, update, or delete your + personal information, please contact us at devnull@voremicrocomputers.com +

+
+
+
+
+ + \ No newline at end of file diff --git a/static/snow.gif b/static/snow.gif new file mode 100644 index 0000000..2ad24b8 Binary files /dev/null and b/static/snow.gif differ diff --git a/static/terms_of_use.html b/static/terms_of_use.html new file mode 100644 index 0000000..ff8c51b --- /dev/null +++ b/static/terms_of_use.html @@ -0,0 +1,648 @@ + + + + + AskLyphe - Terms Of Use + + + + + +
+ +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +
+
+
+ +
+
+
+

TERMS OF USE

+

Last updated 2024-09-01

+ +

AGREEMENT TO OUR LEGAL TERMS

+

+ We are Real Microsoft, LLC ("Real Microsoft", "we", "us", "our"). +

+

+ We operate the service askLyphe (the "Service"), where it and its related services are governed by + these legal terms (the "Legal Terms"). +

+

+ You can contact us by email at devnull@voremicrocomputers.com +

+

+ These Legal Terms constitute a legally binding agreement made between you, whether personally or on + behalf of an entity ("you"), and Real Microsoft, LLC, concerning your access to and use of + the Service. You agree that by accessing the Service, you have read, understood, and agreed to be + bound by all of these Legal Terms. +

+

+ + IF YOU DO NOT AGREE WITH ALL OF THESE LEGAL TERMS, THEN YOU ARE EXPRESSLY PROHIBITED FROM USING THE + SERVICES AND YOU MUST DISCONTINUE USE IMMEDIATELY. + +

+

+ Supplemental terms and conditions or documents that may be posted on the Service or have been posted + on the Service are hereby expressly incorporated herein by reference. We reserve the right, in our + sole discretion, to make changes or modifications to these Legal Terms. +

+

+ We will alert you about any + changes by updating the "Last updated" date of these Legal Terms, and while we may alert you (such + as but not limited to via email or a notification within the Service) to changes in the Legal Terms, + you waive the right to receive specific notice of each such change. It is your responsibility to + periodically review these Legal Terms to stay informed of updates. +

+

+ You will be subject to, and will be deemed to have been made aware of and to have accepted, the + changes in any revised Legal Terms by your continued use of the Service on and after the date such + revised Legal Terms are posted. +

+ +

TABLE OF CONTENTS

+ + +

1. OUR SERVICE

+

+ The information provided when using the Service is not intended for distribution to or use by any + person or entity in any jurisdiction or country where such distribution or use would be contrary + to law or regulation or which would subject us to any registration requirement within such + jurisdiction or country. +

+

+ Accordingly, those persons who choose to access the Service from other locations do so on their + own initiative and are solely responsible for compliance with local laws, if and to the extent + local laws are applicable. +

+ +

2. INTELLECTUAL PROPERTY RIGHTS

+

Our intellectual property

+

+ We are the owner or the licensee of all intellectual property rights in our Service, including all + source code, databases, functionality, software, website designs, audio, video, text, photographs, + and graphics in the Service (collectively, the "Content"), as well as the trademarks, service marks, + and logos contained therein (the "Marks"). +

+

+ Our Content and Marks are protected by copyright and trademark laws (and various other intellectual + property rights and unfair competition laws) and treaties in the United States and around the world. +

+

+ The Content and Marks are provided in or through the Service "AS IS" for your personal, + non-commercial use or internal business purpose only, except where specified otherwise. +

+

Your use of our Service

+

+ Subject to your compliance with these Legal Terms, including the "PROHIBITED ACTIVITIES" section + below, we grant you a non-exclusive, non-transferable, revocable license to: +

    +
  • access the Service; and
  • +
  • download or print a copy of any portion of the Content to which you have properly gained access.
  • +
+ solely for your personal, non-commercial use or internal business purpose, except where specified otherwise. +

+

+ Except as set out in this section or elsewhere in our Legal Terms, no part of the Service and no + Content or Marks may be copied, reproduced, aggregated, republished, uploaded, posted, + publicly displayed, encoded, translated, transmitted, distributed, sold, licensed, or otherwise + exploited for any commercial purpose whatsoever, without our express prior written permission. +

+

+ If you wish to make any use of the Services, Content, or Marks other than as set out in this section + or elsewhere in our Legal Terms, please email your request to devnull@voremicrocomputers.com +

+

+ If we ever grant you the permission to post, reproduce, or publicly display any part of our Service, + Content, or Marks, you must identify us as the owners or licensors of the Services, Content, + or Marks and ensure that any copyright or proprietary notice appears or is visible on posting, + reproducing, or displaying our Service, Content, or Marks, unless otherwise specified. +

+

+ We reserve all rights not expressly granted to you in and to the Service, Content, and Marks. +

+

+ Any breach of these Intellectual Property Rights will constitute a material breach of our + Legal Terms and your right to use our Service will terminate immediately. +

+

Your submissions

+

+ Please review this section and the "PROHIBITED ACTIVITIES" section carefully prior to using our + Service to understand the (a) rights you give us and (b) obligations you have when you post or + upload any content through the Service. +

+

+ By directly sending us any question, comment, suggestion, idea, feedback, or other information about + the Service ("Submissions"), you agree to assign us all intellectual property rights in such + Submission. You agree that we shall own this Submission and be entitled to its unrestricted use + and dissemination for any lawful purpose, commercial or otherwise, without acknowledgment or + compensation to you. +

+

+ You are responsible for what you post or upload. By sending us Submissions through + any part of the Service, you: +

    +
  • confirm that you have read and agree with our "PROHIBITED ACTIVITIES" and will not post, + send, publish, upload, or transmit through the Service any Submission that is illegal, + harassing, hateful, harmful, defamatory, obscene, bullying, abusive, discriminatory, + threatening to any person or group, false, inaccurate, deceitful, or misleading;
  • +
  • to the extent permissible by applicable law, waive any and all moral rights to any such + Submission;
  • +
  • warrant that any such Submissions are original to you or that you have the necessary rights + and licenses to submit Submissions and that you have full authority to grant us the + above-mentioned rights in relation to your Submissions; and
  • +
  • warrant and represent that your Submissions do not constitute confidential information.
  • +
+

+

+ You are solely responsible for your Submissions, and you expressly agree to reimburse us for any and + all losses that we may suffer because of your breach of (a) this section, (b) any third party's + intellectual property rights, or (c) applicable law. +

+ +

3. USER REPRESENTATIONS

+

+ By using the Service, you represent and warrant that: +

    +
  • all registration information you submit will be true, accurate, current, and complete;
  • +
  • you will maintain the accuracy of such information and promptly update such registration + information as necessary;
  • +
  • you have the legal capacity and you agree to comply with these Legal Terms
  • +
  • you are not a minor in the jurisdiction in which you reside, or are being represented by + someone with the legal capacity to agree to these Legal Terms in your place;
  • +
  • you will not access the Service thorugh automated or non-human means, whether through a bot, + script, or otherwise, except where expressly permitted;
  • +
  • you will not use the Service for any illegal or unauthorized purpose; and
  • +
  • your use of the Service will not violate any applicable law or regulation.
  • +
+

+

+ If you provide any information that is untrue, inaccurate, not current, or incomplete, we have the + right to suspend or terminate your account and refuse any and all current or future use of the + Service (or any portion thereof). +

+ +

4. USER REGISTRATION

+

+ You may be required to register to use the Service. You agree to keep your password confidential + and will be responsible for all use of your account and password. +

+

+ We reserve the right to remove, reclaim, or change a username you select if we determine, in our + sole discretion, that such username is inappropriate, obscene, or otherwise objectionable. +

+ +

5. PROHIBITED ACTIVITIES

+

+ You may not access or use the Service for any purpose other than that for which we make the Service + available. The Service may not be used in connection with any commercial endeavors except those that + are specifically endorsed or approved by us. +

+

+ As a user of the Service, you agree not to: +

    +
  • Systematically retrieve data or other content from the Service to create or compile, + directly or indirectly, a collection, compilation, database, or directory without written + permission from us.
  • +
  • Trick, defraud, or mislead us and other users, especially in any attempt to learn sensitive + account information such as user passwords.
  • +
  • Circumvent, disable, or otherwise interfere with security-related features of the Service, + including features that prevent or restrict the use or copying of any Content or enforce + limitations on the use of the Services and/or the Content contained therein.
  • +
  • Disparage, tarnish, or otherwise harm, in our opinion, us and/or the Service.
  • +
  • Use any information obtained from the Service in order to harass, abuse, or harm another + person.
  • +
  • Make improper use of our support services or submit false reports of abuse or misconduct.
  • +
  • Use the Service in a manner inconsistent with any applicable laws or regulations.
  • +
  • Engage in unauthorized framing of or linking to the Service.
  • +
  • Upload or transmit (or attempt to upload or to transmit) viruses, Trojan horses, or other + material, including spamming (continuous posting of repetitive text), that interferes with any + party's uninterrupted use and enjoyment of the Service or modifies, impairs, disrupts, alters, + or interferes with the use, features, functions, operation, or maintenance of the Service.
  • +
  • Engage in any automated use of the system, such as using scripts to interact with the + Service, or using any data mining, robots, or similar data gathering and extraction tools.
  • +
  • Delete the copyright or other proprietary rights notice from any Content.
  • +
  • Attempt to impersonate another user or person or use the username of another user.
  • +
  • Upload or transmit (or attempt to upload or to transmit) and material that acts as a passive + or active information collection or transmission mechanism, including without limitation, clear + graphics interchange formats ("gifs"), 1x1 pixels, web bugs, cookies, or other similar devices + (sometimes referred to as "spyware" or "passive collection mechanisms" or "pcms").
  • +
  • Interfere with, disrupt, or create an undue burden on the Service or the networks or + services connected to the Service.
  • +
  • Harass, annoy, intimidate, or threaten any of our employees or agents engaged in providing + any portion of the Service to you.
  • +
  • Attempt to bypass any measures of the Service designed to prevent or restrict access to the + Service, or any portion of the Service.
  • +
  • Copy or adapt the Service's software, including but not limited to HTML, JavaScript, or + other code, unless expressly granted permission.
  • +
  • Except as permitted by applicable law, decipher, decompile, disassemble, or reverse engineer + any of the software comprising or in any way making up a part of the Service, unless expressly + granted permission.
  • +
  • Use a buying agent or purchasing agent to make purchases on the Service.
  • +
  • Make any unauthorized use of the Service, including collecting usernames and/or email addresses + of users by electronic or other means for the purpose of sending unsolicited email, or creating + user accounts by automated means or under false pretenses.
  • +
  • Use the Service as part of any effort to compete with use or otherwise use the Service and/or + the Content for any revenue-generating endeavor or commercial enterprise.
  • +
+

+ +

6. USER GENERATED CONTRIBUTIONS

+

+ The Service does not currently offer users to submit or post content. We may provide you with the + opportunity to create, submit, post, display, transmit, perform, publish, distribute, or broadcast + content and materials to us or on the Service, including but not limited to text, writings, video, + audio, photographs, graphics, comments, suggestions, or personal information or other material + (collectively, "Contributions"). +

+

+ Contributions may be viewable by other users of the Service and through third-party websites. + As such, any Contributions you transmit may be treated in accordance with the + Service's Privacy Policy. +

+

+ When you create or make available any contributions, you thereby represent and warrant that: +

    +
  • The creation, distribution, transmission, public display, or performance, and the accessing, + downloading, or copying of your Contributions do not and will not infringe the proprietary rights, + including but not limited to the copyright, patent, trademark, trade secret, or moral rights of + any third party.
  • +
  • You are the creator and owner of or have the necessary licenses, rights, consents, releases, + and permissions to use and to authorize us, the Service, and other users of the Service to use + your Contributions in any manner contemplated by the Service and these Legal Terms.
  • +
  • You have the written consent, release, and/or permission of each and every identifiable + individual person in your Contributions to use the name or likeness of each and every such + identifiable individual person to enable inclusion and use of your Contributions in any manner + contemplated by the Service and these Legal Terms.
  • +
  • Your Contributions are not false, inaccurate, or misleading.
  • +
  • Your Contributions are not obscene, violent, harassing, libelous, slanderous, or otherwise + objectionable (as determined by us).
  • +
  • Your Contributions do not ridicule, mock, disparage, intimidate, or abuse anyone.
  • +
  • Your Contributions are not used to harass or threaten (in the legal sense of those terms) + any other person and to promote violence against a specific person or class of people.
  • +
  • Your Contributions do not violate any applicable law, regulation, or rule.
  • +
  • Your Contributions do not violate the privacy or publicity rights of any third party.
  • +
  • Your Contributions do not violate any applicable law concerning child pornography, or + otherwise intended to protect the health or well-being of minors.
  • +
  • Your Contributions do not include any offensive (as determined by us) comments, such as but + not limited to those which are connected to race, national origin, gender, sexual preference, + or physical handicap.
  • +
  • Your Contributions are not unsolicited or unauthorized advertising, promotional materials, + pyramid schemes, chain letters, spam, mass mailings, or other forms of solicitation.
  • +
  • Your Contributions do not otherwise violate, or link to material that violates, any provision + of these Legal Terms, or any applicable law or regulation.
  • +
+ Any use of the Service in violation of the foregoing violates these Legal Terms and may result in, + among other things, termination or suspension of your rights to use the Service. +

+ +

7. CONTRIBUTION LICENSE

+

+ You agree that we may access, store, process, and use any information and personal data that you + provide following the terms of the Privacy Policy and your choices (including settings). +

+

+ By submitting suggestions or other feedback regarding the Service, you agree that we can use and + share such feedback for any purpose without compensation to you. +

+

+ We do not assert any ownership over your Contributions. You retain full ownership of all of your + Contributions and any intellectual property rights or other proprietary rights associated with + your Contributions. We are not liable for any statements or representations in your Contributions + provided by you in any area on the Service. You are solely responsible for your Contributions to the + Service and you expressly agree to exonerate us from any and all responsibility and to refrain from + any legal action against us regarding your Contributions. +

+ +

8. THIRD-PARTY WEBSITES AND CONTENT

+

+ The Service may contain (or you may be sent via the Service) links to other websites ("Third-Party Websites") + as well as articles, photographs, text, graphics, pictures, designs, music, sound, video, information, + applications, software, and other content or items belonging to or originating from third parties + ("Third-Party Content"). +

+

+ Such Third-Party Websites and Third-Party Content are not investigated, monitored, or checked for + accuracy, appropriateness, or completeness by us, and we are not responsible for any Third-Party Websites + accessed through the Service or any Third-Party Content posted on, available through, or installed from + the Service, including the content, accuracy, offensiveness, opinions, reliability, privacy practices, + or other policies of or contained in the Third-Party Websites or the Third-Party Content. +

+

+ Inclusion of, linking to, or permitting the use or installation of any Third-Party Websites or any + Third-Party Content does not imply approval or endorsement thereof by us. If you decide to leave + the Service and access the Third-Party Websites or to use or install any Third-Party Content, you + do so at your own risk, and you should be aware these Legal Terms no longer govern. +

+

+ You should review the applicable terms and policies, including privacy and data gathering practices, + of any website to which you navigate from the Service or relating to any applications you use or + install from the Service. +

+

+ In general, it is recommended to always read and review the applicable terms and policies of any + website to which you navigate. +

+

+ Any purchases you make through Third-Party Websites will be through other websites and from other + companies, and we take no responsibility whatsoever in relation to such purchases which are + exclusively between you and the applicable third party. You agree and acknowledge that we do not + endorse the products or services offer on Third-Party Websites and you shall hold us blameless from + any harm caused by your purchase of such products or services. +

+

+ Additionally, you shall hold us blameless from any losses sustained by you or harm caused to you + relating to or resulting in any way from any Third-Party Content or any contact with Third-Party Websites. +

+ +

9. SERVICE MANAGEMENT

+

+ We reserve the right, but not the obligation, to: +

    +
  • monitor the Service for violations of these Legal Terms;
  • +
  • take appropriate legal action against anyone who, in our sole discretion, violates the law + or these Legal Terms, including without limitation, reporting such user to law enforcement + authorities;
  • +
  • in our sole discretion and without limitation, refuse, restrict access to, limit the + availability of, or disable (to the extent technologically feasible) any of your Contributions + or any portion thereof;
  • +
  • in our sole discretion and without limitation, notice, or liability, to remove from the + Service or otherwise disable all files and content that are excessive in size or are in any way + burdensome to our systems; and
  • +
  • otherwise manage the Service in a manner designed to protect our rights and property and to + facilitate the proper functioning of the Service.
  • +
+

+ +

10. PRIVACY POLICY

+

+ We care about data privacy and security. Please review our Privacy Policy. +

+

+ By using the Service, you agree to be bound by our Privacy Policy, which is incorporated into these + Legal Terms. Please be advised the Service is hosted in the United States. If you access the Service + from any other region of the world with laws or other requirements governing personal data collection, + use, or disclosure that differ from applicable laws in the United States, then through your continued + use of the Service, you are transferring your data to the United States, and you expressly consent to + have your data transferred to and processed in the United States. +

+ +

11. TERM AND TERMINATION

+

+ These Legal Terms shall remain in full force and effect while you use the Service. +

+

+ + WITHOUT LIMITING ANY OTHER PROVISION OF THESE LEGAL TERMS, WE RESERVE THE RIGHT TO, IN OUR + SOLE DISCRETION AND WITHOUT NOTICE OR LIABILITY, DENY ACCESS TO AND USE OF THE SERVICES + (INCLUDING BLOCKING CERTAIN IP ADDRESSES), TO ANY PERSON FOR ANY REASON OR FOR NO REASON, + INCLUDING WITHOUT LIMITATION FOR BREACH OF ANY REPRESENTATION, WARRANTY, OR COVENANT CONTAINED + IN THESE LEGAL TERMS OR OF ANY APPLICABLE LAW OR REGULATION. WE MAY TERMINATE YOUR USE OR + PARTICIPATION IN THE SERVICES OR DELETE YOUR ACCOUNT AND ANY CONTENT OR INFORMATION THAT YOU POSTED + AT ANY TIME, WITHOUT WARNING, IN OUR SOLE DISCRETION. + +

+

+ If we terminate or suspend your account for any reason, you are prohibited from registering and + creating a new account under your name, a fake or borrowed name, or the name of any third party, even + if you may be acting on behalf of the third party. In addition to terminating or suspending your + account, we reserve the right to take appropriate legal action, including without limitation + pursuing civil, criminal, and injunctive redress. +

+ +

12. MODIFICATIONS AND INTERRUPTIONS

+

+ We reserve the right to change, modify, or remove the contents of the Service at any time for any reason + at our sole discretion without notice. However, we have no obligation to update any information on + our Service. We will not be liable to you or any third party for any modification, price change, + suspension, or discontinuance of the Service. +

+

+ We cannot guarantee the Service will be available at all times. We may experience hardware, software, + or other problems or need to perform maintenance related to the Service, resulting in interruptions, + delays, or errors. We reserve the right to change, revise, update, suspend, discontinue, or otherwise + modify the Service at any time or for any reason without notice to you. You agree that we have no + liability whatsoever for any loss, damage, or inconvenience caused by your inability to access or use + the Service during any downtime or discontinuance of the Service. Nothing in these Legal Terms will + be construed to obligate us to maintain and support the Service or to supply any corrections, updates, + or releases in connection therewith. +

+ +

13. GOVERNING LAW

+

+ These Legal Terms and your use of the Service are governed by and construed in accordance with the + laws of the State of California applicable to agreements made and to be entirely performed within + the State of California, without regard to its conflict of law principles. +

+ +

14. DISPUTE RESOLUTION

+

+ Any legal action of whatever nature brought by either you or us (collectively, the "Parties" and individually, a "Party) + shall be commenced or prosecuted in the state and federal courts located in California, and the Parties + hereby consent to, and waive all defenses of lack of personal jurisdiction and forum non conveniens with + respect to venue and jurisdiction in such state and federal courts. +

+

+ Application of the United Nations Convention on Contracts for the International Sale of Goods and + the Uniform Computer Information Transaction Act (UCITA) are excluded from these Legal Terms. +

+

+ In no event shall any claim, action, or proceeding brought by either Party related in any way to the + Service be commenced more than four (4) years after the cause of action arose. +

+ +

15. CORRECTIONS

+

+ There may be information on the Service that contains typographical errors, inaccuracies, or omissions, + including descriptions, pricing, availability, and various other information. +

+

+ We reserve the right to correct any errors, inaccuracies, or omissions and to change or update the + information on the Service at any time, without prior notice. +

+ +

16. DISCLAIMER

+

+ + THE SERVICE IS PROVIDED ON AN AS-IS AND AS-AVAILABLE BASIS. YOU AGREE THAT YOUR USE OF THE SERVICES + WILL BE AT YOUR SOLE RISK. TO THE FULLEST EXTENT PERMITTED BY LAW, WE DISCLAIM ALL WARRANTIES, + EXPRESS OR IMPLIED, IN CONNECTION WITH THE SERVICE AND YOUR USE THEREOF, INCLUDING, WITHOUT LIMITATION, + THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + WE MAKE NO WARRANTIES OR REPRESENTATIONS ABOUT THE ACCURACY OR COMPLETENESS OF THE SERVICE'S CONTENT + OR THE CONTENT OF ANY WEBSITES OR MOBILE APPLICATIONS LINKED TO THE SERVICE AND WE WILL ASSUME NO + LIABILITY OR RESPONSIBILITY FOR ANY (1) ERRORS, MISTAKES, OR INACCURACIES OF CONTENT AND MATERIALS, + (2) PERSONAL INJURY OR PROPERTY DAMAGE, OF ANY NATURE WHATSOEVER, RESULTING FROM YOUR ACCESS TO AND + USE OF THE SERVICES, (3) ANY UNAUTHORIZED ACCESS TO OR USE OF OUR SECURE SERVERS AND/OR ANY AND ALL + PERSONAL INFORMATION AND/OR FINANCIAL INFORMATION STORED THEREIN, (4) ANY INTERRUPTION OR CESSATION OF + TRANSMISSION TO OR FROM THE SERVICES, (5) ANY BUGS, VIRUSES, TROJAN HORSES, OR THE LIKE WHICH MAY + BE TRANSMITTED TO OR THROUGH THE SERVICES BY ANY THIRD PARTY, AND/OR (6) ANY ERRORS OR OMISSIONS + IN ANY CONTENT AND MATERIALS OR FOR ANY LOSS OR DAMAGE OF ANY KIND INCURRED AS A RESULT OF THE + USE OF ANY CONTENT POSTED, TRANSMITTED, OR OTHERWISE MADE AVAILABLE VIA THE SERVICE. WE DO NOT + WARRANT, ENDORSE, GUARANTEE, OR ASSUME RESPONSIBILITY FOR ANY PRODUCT OR SERVICE ADVERTISED OR + OFFERED BY A THIRD PARTY THROUGH THE SERVICE, ANY HYPERLINKED WEBSITE, OR ANY WEBSITE OR MOBILE + APPLICATION FEATURED IN ANY BANNER OR OTHER ADVERTISING, AND WE WILL NOT BE A PARTY TO OR IN ANY + WAY BE RESPONSIBLE FOR MONITORING ANY TRANSACTION BETWEEN YOU AND ANY THIRD PARTY PROVIDERS OF + PRODUCTS OR SERVICES. AS WITH THE PURCHASE OF A PRODUCT OR SERVICE THROUGH ANY MEDIUM OR IN ANY + ENVIRONMENT, YOU SHOULD USE YOUR BEST JUDGEMENT AND EXERCISE CAUTION WHERE APPROPRIATE. + +

+ +

17. LIMITATIONS OF LIABILITY

+

+ + IN NO EVENT WILL WE OR OUR DIRECTORS, EMPLOYEES, OR AGENTS BE LIABLE TO YOU OR ANY THIRD PARTY + FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, EXEMPLARY, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, + INCLUDING LOST PROFIT, LOST REVENUE, LOSS OF DATA, OR OTHER DAMAGES ARISING FROM YOUR USE OF THE + SERVICE, EVEN IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. NOTWITHSTANDING ANYTHING + TO THE CONTRARY CONTAINED HEREIN, OUR LIABILITY TO YOU FOR ANY CAUSE WHATSOEVER AND REGARDLESS OF + THE FORM OF THE ACTION WILL AT ALL TIMES BE LIMITED TO THE AMOUNT PAID, IF ANY, BY YOU TO US DURING + THE SIX (6) MONTH PERIOD PRIOR TO ANY CAUSE OF ACTION ARISING. CERTAIN US STATE LAWS AND INTERNATIONAL + LAWS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES OR THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES. + IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS OR LIMITATIONS MAY NOT APPLY TO YOU, + AND YOU MAY HAVE ADDITIONAL RIGHTS. + +

+ +

18. INDEMNIFICATION

+

+ You agree to defend, indemnify, and hold us harmless, including our subsidiaries, affiliates, and all of + our respective officers, partners, and employees, from and against any loss, damage, liability, claim, + or demand, including reasonable attorneys' fees and expenses, made by any third party due to or arising out of: +

    +
  • use of the Service;
  • +
  • breach of these Legal Terms;
  • +
  • any breach of your representations and warranties set forth in these Legal Terms;
  • +
  • your violation of the rights of a third party, including but not limited to intellectual property rights; or
  • +
  • any overt harmful act toward any other user of the Service with whom you connected via the Service.
  • +
+

+

+ Notwithstanding the foregoing, we reserve the right, at your expense, to assume the exclusive defense + and control of any matter for which you are required to indemnify us, and you agree to cooperate, at your + expense, with our defense of such claims. We will use reasonable efforts to notify you of any such claim, + action, or proceeding which is subject to this indemnification upon becoming aware of it. +

+ +

19. USER DATA

+

+ We will maintain certain data that you transmit to the Service for the purpose of managing the + performance of the Service, as well as data relating to your use of the Service. +

+

+ Although we perform regular routine backups of data, you are solely responsible for all data that + you transmit or that relates to any activity you have undertaken using the Service. +

+

+ You agree that we shall have no liability to you for any loss or corruption of any such data, and you + hereby waive any right of action against us arising from any such loss or corruption of such data. +

+ +

20. ELECTRONIC COMMUNICATIONS, TRANSACTIONS, AND SIGNATURES

+

+ Visiting the Service, sending us emails, and completing online forms constitute electronic communications. +

+

+ You consent to receive electronic communications, and you agree that all agreements, notices, disclosures, + and other communications we provide to you electronically, via email and on the Service, satisfy + any legal requirement that such communication be in writing. +

+

+ + YOU HEREBY AGREE TO THE USE OF ELECTRONIC SIGNATURES, CONTRACTS, ORDERS, AND OTHER RECORDS, AND + TO ELECTRONIC DELIVERY OF NOTICES, POLICIES, AND RECORDS OF TRANSACTIONS INITIATED OR COMPLETED + BY US OR VIA THE SERVICE. + +

+

+ You hereby waive any rights or requirements under any statutes, regulations, rules, ordinances, or + other laws in any jurisdiction which require an original signature or delivery or retention of + non-electronic records, or to payments or the granting of credits by any means other than electronic + means. +

+ +

21. CALIFORNIA USERS AND RESIDENTS

+

+ If any complaint with us is not satisfactorily resolved, you can contact the Complaint Assistance Unit + of the Division of Consumer Services of the California Department of Consumer Affairs in writing at + 1625 North Market Blvd., Suite N 112, Sacramento, California 95834 or by telephone at (800) 952-5210 or + (916) 445-1254. +

+ +

22. MISCELLANEOUS

+

+ These Legal Terms and any policies or operating rules posted by us on the Service or in respect to + the Service constitute the entire agreement and understanding between you and us. +

+

+ Our failure to exercise or enforce any right or provision of these Legal Terms shall not operate as + a waiver of such right or provision. +

+

+ These Legal Terms operate to the fullest extent permissible by law. +

+

+ We may assign any or all of our rights and obligations to others at any time. +

+

+ We shall not be responsible or liable for any loss, damage, delay, or failure to act caused by any + cause beyond our reasonable control. +

+

+ If any provision or part of a provision of these Legal Terms is determined to be unlawful, void, or + unenforceable, that provision or part of the provision is deemed severable from these Legal Terms and + does not affect the validity and enforceability of any remaining provisions. +

+

+ There is no joint venture, partnership, employment or agency relationship created between you and us + as a result of these Legal Terms or use of the Service. +

+

+ You agree that these Legal Terms will not be construed against us by virtue of having drafted them. +

+

+ You hereby waive any and all defenses you may have based on the electronic form of these Legal Terms + and the lack of signing by the parties hereto to execute these Legal Terms. +

+ +

23. CONTACT

+

+ In order to resolve a complaint regarding the Service or to receive further information regarding + use of the Service, please contact us at: devnull@voremicrocomputers.com +

+
+
+
+
+ + \ No newline at end of file diff --git a/static/themes/classic/home.css b/static/themes/classic/home.css new file mode 100644 index 0000000..262e5b0 --- /dev/null +++ b/static/themes/classic/home.css @@ -0,0 +1,11 @@ +.front-links > ul > li > a, .front-links > ul > li > a:visited { + color: white; +} + +.bent-surrounding { + background: transparent; +} + +#lyphetitle > h2 { + color: white; +} \ No newline at end of file diff --git a/static/themes/classic/inline-announcement.css b/static/themes/classic/inline-announcement.css new file mode 100644 index 0000000..f3c286b --- /dev/null +++ b/static/themes/classic/inline-announcement.css @@ -0,0 +1,73 @@ +.announcement { + background: url("/static/snow.gif"); + border: 3px inset black; + color: black; + min-width: 532px; + max-width: 640px; + min-height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + min-width: 354px; + min-height: 128px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.2em; + line-height: 1.2em; + margin: 18px 22px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.2em; + margin: 18px 22px -16px; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 1em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; +} + +.announcement > p > a:visited { +} + +.announcement-date { + float: right; + margin: 18px 12px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px 0; + color: ghostwhite; + display: block; + font-size: 0.7em; + line-height: 0; + } +} diff --git a/static/themes/classic/logo.png b/static/themes/classic/logo.png new file mode 100644 index 0000000..64e8529 Binary files /dev/null and b/static/themes/classic/logo.png differ diff --git a/static/themes/classic/search.css b/static/themes/classic/search.css new file mode 100644 index 0000000..b0ef6d2 --- /dev/null +++ b/static/themes/classic/search.css @@ -0,0 +1,80 @@ +.pagecontent { + background: url("/static/snow.gif"); + border: 3px inset black; + color: black; +} + +@media screen and (max-width: 800px) { + .pagecontent { + width: calc(100% - 4px); + } +} + +.search-result { + color: black; + text-shadow: cadetblue 0 0 3px; + padding: 10px; + border: 1px solid white; + margin: 3px; +} + +.search-result:visited { + color: darkslateblue; +} +.search-url { + color: black; +} + +.search-description { + color: black; + text-shadow: cadetblue 0 0 3px; +} + +.search-relevance { + color: darkslateblue; +} + +.wikipedia-complication { + background: rgba(0.77, 0.77, 0.77, 0.43); + border: 3px inset white; +} + +.wikipedia-image > img { + background: gray; +} + +.wikipedia-title { + color: white; +} + +.wikipedia-fromwikipedia { + color: white; + text-shadow: cadetblue 0 0 3px; +} + +.wikipedia-class { + color: white; + text-shadow: cadetblue 0 0 3px; +} + +.wikipedia-description { + color: white; +} + +.complications-note { + background: rgba(0.77, 0.77, 0.77, 0.43); + border: 3px inset white; +} + +.unit_converter-complication { + background: rgba(0.77, 0.77, 0.77, 0.43); + border: 3px inset white; +} + +.unit_converter-title { + color: white; +} + +.unit_converter-result { + color: white; +} diff --git a/static/themes/classic/settings.css b/static/themes/classic/settings.css new file mode 100644 index 0000000..3aa2239 --- /dev/null +++ b/static/themes/classic/settings.css @@ -0,0 +1,20 @@ +.settings-area { + background: url("/static/snow.gif"); + border: 1px solid white; +} + +@media screen and (max-width: 800px) { + .settings-area { + width: calc(100% - 1px); + } +} + +.settings-section { + background: rgba(0.77, 0.77, 0.77, 0.43); + border: 3px inset black; + color: white; +} + +p { + color: white; +} \ No newline at end of file diff --git a/static/themes/classic/shell.css b/static/themes/classic/shell.css new file mode 100644 index 0000000..0de6941 --- /dev/null +++ b/static/themes/classic/shell.css @@ -0,0 +1,95 @@ +body { + background: url("/static/bluestars.gif"); +} + +.main { + background: rgba(77,77,77,0.3); + border: 1px solid cadetblue; + color: white; + font-family: sans-serif; + font-weight: normal; + display: flex; + flex-direction: column; + align-items: center; + flex-grow: 1; +} + +input[type=text] { + background: white; + height: 24px; + border: 3px inset black; + font-family: sans-serif; + font-weight: normal; +} + +input[type=text]:focus { + border: 3px inset black; +} + +button, .button { + background: lightgray; + height: 24px; + border: 1px solid dimgray; + font-family: sans-serif; + font-size: 12px; + font-weight: normal; + color: black; + line-height: 0; + padding: 0; + border-radius: 6px; + vertical-align: unset; +} + +.bent-surrounding { + background: transparent; +} + +.user-bar > form > button { + background: lightgray; + border: 1px solid dimgray; + height: 24px; + vertical-align: unset; + font-family: sans-serif; + font-weight: normal; + line-height: 0; + color: black; +} + +.user-bar > a.button { + background: lightgray; + border: 1px solid dimgray; + height: 24px; + vertical-align: unset; + font-family: sans-serif; + font-weight: normal; + line-height: 26px; + color: black; +} + +#lyphetitle > img { + content: url("/static/themes/classic/logo.png"); +} + +#lyphetitlenav > img { + content: url("/static/themes/classic/logo.png"); +} + +.index-bar { + background-color: rgba(0,0,0,0.1) !important; +} + +#websearch-img { + content: url("/static/themes/dark/websearch.png"); +} + +#websearch-img-selected { + content: url("/static/themes/dark/websearch_selected.png"); +} + +#imagesearch-img { + content: url("/static/themes/dark/imagesearch.png"); +} + +#imagesearch-img-selected { + content: url("/static/themes/dark/imagesearch_selected.png"); +} diff --git a/static/themes/dark/announcement.png b/static/themes/dark/announcement.png new file mode 100644 index 0000000..d77774c Binary files /dev/null and b/static/themes/dark/announcement.png differ diff --git a/static/themes/dark/borderbent.png b/static/themes/dark/borderbent.png new file mode 100644 index 0000000..09578d1 Binary files /dev/null and b/static/themes/dark/borderbent.png differ diff --git a/static/themes/dark/button.png b/static/themes/dark/button.png new file mode 100644 index 0000000..f160b14 Binary files /dev/null and b/static/themes/dark/button.png differ diff --git a/static/themes/dark/darkeneder_paper.jpg b/static/themes/dark/darkeneder_paper.jpg new file mode 100644 index 0000000..5fad603 Binary files /dev/null and b/static/themes/dark/darkeneder_paper.jpg differ diff --git a/static/themes/dark/home.css b/static/themes/dark/home.css new file mode 100644 index 0000000..6d60bf0 --- /dev/null +++ b/static/themes/dark/home.css @@ -0,0 +1,17 @@ +.front-links > ul > li > a, .front-links > ul > li > a:visited { + text-decoration: none; + color: white; +} + +.bent-surrounding { + background: url("/static/themes/dark/borderbent.png") no-repeat center; + background-size: 90%; + display: grid; + height: auto; +} + +#lyphetitle > h2 { + font-family: NanumGothicCoding, monospace; + font-size: 175%; + color: white; +} \ No newline at end of file diff --git a/static/themes/dark/imagesearch.css b/static/themes/dark/imagesearch.css new file mode 100644 index 0000000..cf4d49e --- /dev/null +++ b/static/themes/dark/imagesearch.css @@ -0,0 +1,57 @@ +.pagecontent { + background-image: url("/static/themes/dark/darkeneder_paper.jpg"); +} +.search-result { + color: white; +} + +.search-result:visited { + color: steelblue; +} +.search-url { + color: lightgray; +} + +.search-description { + color: gray; +} + +.search-relevance { + color: lightgray; +} + +.wikipedia-complication { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.wikipedia-title { + color: white; +} + +.wikipedia-fromwikipedia { + color: lightslategray; +} + +.wikipedia-class { + color: lightslategray; +} + +.wikipedia-description { + color: white; +} + +.complications-note { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.unit_converter-complication { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.unit_converter-title { + color: white; +} + +.unit_converter-result { + color: white; +} \ No newline at end of file diff --git a/static/themes/dark/imagesearch.png b/static/themes/dark/imagesearch.png new file mode 100644 index 0000000..82304ef Binary files /dev/null and b/static/themes/dark/imagesearch.png differ diff --git a/static/themes/dark/imagesearch_selected.png b/static/themes/dark/imagesearch_selected.png new file mode 100644 index 0000000..4077a11 Binary files /dev/null and b/static/themes/dark/imagesearch_selected.png differ diff --git a/static/themes/dark/inline-announcement.css b/static/themes/dark/inline-announcement.css new file mode 100644 index 0000000..25258f9 --- /dev/null +++ b/static/themes/dark/inline-announcement.css @@ -0,0 +1,101 @@ +#preview { + color: white; + display: flex; + flex-direction: column; + align-items: center; + font-family: monospace; + font-weight: bold; +} + +#preview a { + text-decoration: unset; + color: unset; + background-image: unset; + text-shadow: unset; + box-shadow: unset; + color: unset; + min-height: unset; + border: unset; + border-radius: unset; + padding: unset; + margin: unset; + font-size: unset; + transition: unset; + font-family: unset; + font-weight: unset; +} + +.announcement { + background: url("/static/themes/dark/announcement.png"); + width: 532px; + height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.3em; + line-height: 1.2em; + margin: 28px 32px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + font-size: 1.1em; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.1em; + margin: 24px 32px -16px; + line-height: 1em; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 0.9em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; + color: #00c1ff; +} + +.announcement > p > a:visited { + color: #00c1ff; +} + +.announcement-date { + float: right; + margin: 32px 32px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px -5px; + color: ghostwhite; + display: block; + font-size: 0.6em; + line-height: 0; + } +} diff --git a/static/themes/dark/logo.png b/static/themes/dark/logo.png new file mode 100644 index 0000000..b04b3af Binary files /dev/null and b/static/themes/dark/logo.png differ diff --git a/static/themes/dark/search.css b/static/themes/dark/search.css new file mode 100644 index 0000000..cf4d49e --- /dev/null +++ b/static/themes/dark/search.css @@ -0,0 +1,57 @@ +.pagecontent { + background-image: url("/static/themes/dark/darkeneder_paper.jpg"); +} +.search-result { + color: white; +} + +.search-result:visited { + color: steelblue; +} +.search-url { + color: lightgray; +} + +.search-description { + color: gray; +} + +.search-relevance { + color: lightgray; +} + +.wikipedia-complication { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.wikipedia-title { + color: white; +} + +.wikipedia-fromwikipedia { + color: lightslategray; +} + +.wikipedia-class { + color: lightslategray; +} + +.wikipedia-description { + color: white; +} + +.complications-note { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.unit_converter-complication { + background-image: url("/static/img/darkened_paper.jpg"); +} + +.unit_converter-title { + color: white; +} + +.unit_converter-result { + color: white; +} \ No newline at end of file diff --git a/static/themes/dark/settings.css b/static/themes/dark/settings.css new file mode 100644 index 0000000..e3627ea --- /dev/null +++ b/static/themes/dark/settings.css @@ -0,0 +1,12 @@ +.settings-area { + background-image: url("/static/themes/dark/darkeneder_paper.jpg"); +} + +.settings-section { + background-image: url("/static/img/darkened_paper.jpg"); + color: white; +} + +p { + color: white; +} \ No newline at end of file diff --git a/static/themes/dark/shell.css b/static/themes/dark/shell.css new file mode 100644 index 0000000..66bafaa --- /dev/null +++ b/static/themes/dark/shell.css @@ -0,0 +1,89 @@ +body { + background-color: #18181a; +} + +.main { + background-image: url("/static/img/darkened_paper.jpg"); + color: white; +} + +.footer-inner { + /*margin: 2vw;*/ + margin: 2vw 0; + background-color: rgba(77,77,77,0.3); + border: 1px solid cadetblue; + color: white; + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} + +input[type=text] { + background: url("/static/themes/dark/textbox.png") no-repeat center; + background-size: 256px 64px; + width: 232px; + height: 64px; + border: none; + padding-inline: 10px 10px; + font-family: NanumGothicCoding, monospace; + font-weight: bold; + color: white; +} + +input[type=text]:focus { + border: none; +} + +button, .button { + display: inline-block; + background: url("/static/themes/dark/button.png") no-repeat center; + background-size: 138px 64px; + width: 138px; + height: 64px; + vertical-align: bottom; + padding-top: 6px; + border: none; + font-family: NanumGothicCoding, monospace; + font-weight: bold; + font-size: 1.2em; + text-decoration: none; + line-height: 58px; + color: white; +} + +.user-bar > form > button { + background: url("/static/themes/dark/button.png") no-repeat center; + background-size: 69px 32px; + color: white; +} + +.user-bar > a.button { + background: url("/static/themes/dark/button.png") no-repeat center; + background-size: 69px 32px; + color: white; +} + +#lyphetitle > img { + content: url("/static/themes/dark/logo.png"); +} + +#lyphetitlenav > img { + content: url("/static/themes/dark/logo.png"); +} + +#websearch-img { + content: url("/static/themes/dark/websearch.png"); +} + +#websearch-img-selected { + content: url("/static/themes/dark/websearch_selected.png"); +} + +#imagesearch-img { + content: url("/static/themes/dark/imagesearch.png"); +} + +#imagesearch-img-selected { + content: url("/static/themes/dark/imagesearch_selected.png"); +} \ No newline at end of file diff --git a/static/themes/dark/textbox.png b/static/themes/dark/textbox.png new file mode 100644 index 0000000..c3a627e Binary files /dev/null and b/static/themes/dark/textbox.png differ diff --git a/static/themes/dark/websearch.png b/static/themes/dark/websearch.png new file mode 100644 index 0000000..b8bf015 Binary files /dev/null and b/static/themes/dark/websearch.png differ diff --git a/static/themes/dark/websearch_selected.png b/static/themes/dark/websearch_selected.png new file mode 100644 index 0000000..e445b13 Binary files /dev/null and b/static/themes/dark/websearch_selected.png differ diff --git a/static/themes/default/404.css b/static/themes/default/404.css new file mode 100644 index 0000000..daea1c2 --- /dev/null +++ b/static/themes/default/404.css @@ -0,0 +1,16 @@ +body { + background: white; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +a { + color: black; +} + +img { + width: 640px; + height: 480px; +} \ No newline at end of file diff --git a/static/themes/default/announcement.css b/static/themes/default/announcement.css new file mode 100644 index 0000000..3498961 --- /dev/null +++ b/static/themes/default/announcement.css @@ -0,0 +1,115 @@ +.lyphe-says { + text-align: left; + min-width: 20%; + max-height: 128px; + border: 3px inset black; + padding: 10px; + background-image: url("/static/snow.gif"); +} + +.lyphe-says > img { + height: 100px; + float: left; + margin-right: 10px; +} + +.lyphe-says > h5, p { + color: black; + word-break: break-word; +} + +.lyphe-says > h5 { + padding: 0; + margin: 0; + line-height: 2em; +} + +.ask { + text-align: left; + width: 85%; +} + +.lyphe { + display: flex; + flex-direction: row; + width: 85%; + color: white; + text-decoration: none; +} + +.lyphe > * { + margin-top: auto; + margin-bottom: 1rem; +} + +.lyphe-text { + vertical-align: bottom; + display: inline; +} + +.lyphe-text > h2 { + display: inline; +} + +.lyphe-icon { + height: 120px; + margin-right: 20px; +} +.announcement-area { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; +} + +.announcement-content { + width: 70%; + min-height: 120px; + background-image: url("/static/img/paper.jpg"); + margin: 50px 90px; + padding: 20px; + text-align: left; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; + color: black; +} + +@media screen and (max-width: 800px) { + .announcement-content { + width: 100%; + margin: 20px 0; + padding: 20px 0; + text-align: center; + } +} + +.pagecontent { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +.announcement-date { + color: #454545; + font-weight: lighter; +} + +.announcement-author { + color: #454545; + font-weight: lighter; +} + +.announcement-body { + margin-top: 30px; + font-weight: normal; +} \ No newline at end of file diff --git a/static/themes/default/docs.css b/static/themes/default/docs.css new file mode 100644 index 0000000..aeeb729 --- /dev/null +++ b/static/themes/default/docs.css @@ -0,0 +1,98 @@ +#content { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +#lyphebig { + display: flex; + margin: 3px auto; + width: 30%; +} + +@media screen and (max-width: 800px) { + #lyphebig { + grid-auto-flow: row; + } +} + +#lyphetitle { + margin-left: 5px; + padding-top: 8%; +} + +@media screen and (max-width: 800px) { + #lyphetitle { + padding-top: 0; + } +} + +.bent-surrounding { + background: url("/static/img/borderbent.png") no-repeat center; + background-size: 90%; + display: grid; + height: auto; +} + +#lypheimg { + width: 90%; + margin: auto; +} + +#lyphetitle > img { + width: 100%; + margin: 0; +} + +#lyphetitle > p { + font-family: NanumGothicCoding, monospace; + font-size: 24px; + color: #9baba4; +} + +@media screen and (max-width: 800px) { + #lyphetitle > h2 { + font-size: 100%; + } +} + +form { + margin-top: 10%; +} + +.pagecontent { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +#docsarea { + margin-top: 64px; + color: white; + width: 85% +} + +ul { + width: 30%; + margin: auto; +} + +a, a:visited { + color: #ffe7e7; +} + +strong { + font-weight: bold; +} \ No newline at end of file diff --git a/static/themes/default/frontpage.css b/static/themes/default/frontpage.css new file mode 100644 index 0000000..b6eae26 --- /dev/null +++ b/static/themes/default/frontpage.css @@ -0,0 +1,161 @@ +.feature > p > a { + color: #2a4678; +} + +.feature > p { + font-weight: lighter; +} + +.front-links > ul { + margin: auto; + padding: 0; + display: flex; + justify-content: center; +} + +@media screen and (max-width: 800px) { + .front-links > ul { + flex-direction: column; + } +} + +.front-links > ul > li > a, .front-links > ul > li > a:visited { + text-decoration: none; + color: #586761; +} + +.front-links > ul > li { + list-style: none; + text-align: center; + margin: 10px; + padding: 0; +} + +#features { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.feature { + width: 40%; + background-image: url("/static/img/paper.jpg"); + margin: 20px 30px 20px 30px; + padding: 20px; + text-align: left; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; + color: black; +} + +.feature > img { + float: right; + width: 35%; + margin-left: 20px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +@media screen and (max-width: 800px) { + .feature { + width: 99%; + } +} + +#useful-fun { + flex-grow: 1; +} + +#fourth-box { + width: 30%; +} + +@media screen and (max-width: 800px) { + #fourth-box { + width: 99%; + } +} + +.front-links { + color: black; +} + +.response { + display: flex; + flex-direction: column; + align-items: center; +} + +#lyphebig { + display: grid; + margin: 7% 10% 0 10%; + grid-auto-flow: column; + width: 55%; +} + +@media screen and (max-width: 800px) { + #lyphebig { + grid-auto-flow: row; + } +} + +#lyphetitle { + display: grid; + margin-left: 5px; + padding-top: 20%; +} + +@media screen and (max-width: 800px) { + #lyphetitle { + padding-top: 0; + } +} + +.bent-surrounding { + background: url("/static/img/borderbent.png") no-repeat center; + background-size: 90%; + display: grid; + height: auto; +} + +#lypheimg { + width: 90%; + margin: auto; +} + +#lyphetitle > img { + width: 100%; + margin: 0; +} + +#lyphetitle > p { + font-family: NanumGothicCoding, monospace; + font-size: 175%; + color: #9baba4; +} + +@media screen and (max-width: 800px) { + #lyphetitle > h2 { + font-size: 100%; + } +} + +form { + margin-top: 10%; +} + +.pagecontent { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} \ No newline at end of file diff --git a/static/themes/default/home.css b/static/themes/default/home.css new file mode 100644 index 0000000..79db06c --- /dev/null +++ b/static/themes/default/home.css @@ -0,0 +1,98 @@ +.front-links > ul { + margin: auto; + padding: 0; + display: flex; + justify-content: center; +} + +.front-links > ul > li > a, .front-links > ul > li > a:visited { + text-decoration: none; + color: #586761; +} + +.front-links > ul > li { + list-style: none; + text-align: center; + margin: 10px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .front-links > ul { + flex-direction: column; + } +} + +.response { + display: flex; + flex-direction: column; + align-items: center; +} + +#lyphebig { + display: grid; + margin: 7% 10% 0 10%; + grid-auto-flow: column; + width: 55%; +} + +@media screen and (max-width: 800px) { + #lyphebig { + grid-auto-flow: row; + } +} + +#lyphetitle { + display: grid; + margin-left: 5px; + padding-top: 20%; +} + +@media screen and (max-width: 800px) { + #lyphetitle { + padding-top: 0; + } +} + +.bent-surrounding { + background: url("/static/img/borderbent.png") no-repeat center; + background-size: 90%; + display: grid; + height: auto; +} + +#lypheimg { + width: 90%; + margin: auto; +} + +#lyphetitle > img { + width: 100%; + margin: 0; +} + +#lyphetitle > h2 { + font-family: NanumGothicCoding, monospace; + font-size: 175%; + color: #9baba4; +} + +@media screen and (max-width: 800px) { + #lyphetitle > h2 { + font-size: 100%; + } +} + +form { + margin-top: 10%; +} + +.pagecontent { + margin: 0; + min-height: 100vh; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + flex-grow: 1; +} \ No newline at end of file diff --git a/static/themes/default/imagesearch.css b/static/themes/default/imagesearch.css new file mode 100644 index 0000000..2dcc933 --- /dev/null +++ b/static/themes/default/imagesearch.css @@ -0,0 +1,339 @@ +.lyphe-says { + text-align: left; + min-width: 20%; + max-height: 128px; + border: 3px inset black; + padding: 10px; + background-image: url("/static/snow.gif"); +} + +.lyphe-says > img { + height: 100px; + float: left; + margin-right: 10px; +} + +.lyphe-says > h5, p { + color: black; + word-break: break-word; +} + +.lyphe-says > h5 { + padding: 0; + margin: 0; + line-height: 2em; +} + +.ask { + text-align: left; + width: 85%; +} + +.lyphe { + display: flex; + flex-direction: row; + width: 85%; + color: white; + text-decoration: none; +} + +.lyphe > * { + margin-top: auto; + margin-bottom: 1rem; +} + +.lyphe-text { + vertical-align: bottom; + display: inline; +} + +.lyphe-text > h2 { + display: inline; +} + +.lyphe-icon { + height: 120px; + margin-right: 20px; +} + +.pagecontent { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +.response { + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; + padding: 20px 20px 0 20px; +} + +.resultstat { +} + +.enginelist { + display: flex; + height: 20px; +} + +.search-result-list { + width: 100%; + padding-left: 0; + list-style: none; + flex-grow: 1; +} + +.search-result-list > li { + list-style-type: none; + padding: 10px; + width: 63%; + border-top: 1px black solid; + margin-top: 5px; + display: flex; + flex-direction: column; + word-break: auto-phrase; + overflow-wrap: anywhere; +} + +@media screen and (max-width: 800px) { + .search-result-list > li { + flex-direction: column; + word-break: auto-phrase; + width: 90%; + } +} + +.search-result { + color: lightblue; + display: flex; + flex-direction: column; + text-decoration: none; +} + +.search-result:visited { + color: lightblue; +} + +.search-title { + margin: 2px 0 2px; + line-height: 1em; + font-size: 1.3em; + width: 45%; + font-weight: bold; +} + +@media screen and (max-width: 800px) { + .search-title { + width: unset; + } +} + +.search-url { + font-size: 0.8em; + color: lightgray; +} + +.search-description { + color: white; + width: 35%; + font-size: 14px; + font-weight: lighter; +} + +@media screen and (max-width: 800px) { + .search-description { + width: unset; + } +} + +.search-relevance { + font-size: 0.8em; + color: lightgray; +} + +.results-area { + width: 100%; +} + +@media screen and (max-width: 800px) { + .results-area { + display: flex; + flex-direction: column; + align-items: center; + } +} + +.complications { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + float: right; + width: 30%; + padding: 0 10px 10px 10px; + margin: 0 10px 10px 10px; +} + +@media screen and (max-width: 800px) { + .complications { + float: none; + width: unset; + } +} + +.wikipedia-complication { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.wikipedia-complication > * { + margin: auto; + text-decoration: none; + width: 100%; +} + +.wikipedia-complication > a:visited { + text-decoration: none; +} + +.wikipedia-image > img { + max-width: 100%; + max-height: 256px; + margin-top: 8px; + margin-bottom: 8px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.wikipedia-header { + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; +} + +.wikipedia-title { + text-decoration: none; + color: black; + font-size: 2em; + font-weight: bold; + display: inline-block; +} + +.wikipedia-fromwikipedia { + color: #586761; + font-size: 0.8em; + display: inline-block; +} + +.wikipedia-class { + font-size: 0.9em; + color: #333333; + margin-bottom: 8px; + display: inline-block; +} + +.wikipedia-description { + text-align: left; + display: inline-block; + color: black; + font-weight: lighter; +} + +.complications-note { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.unit_converter-complication { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.unit_converter-title { + font-size: 1.2em; + color: #586761; + font-weight: lighter; + width: 100%; + display: inline-block; +} + +.unit_converter-result { + font-size: 2em; + font-weight: bold; + display: inline-block; + word-break: break-word; + color: black; +} + +.index-bar { + display: flex; + width: 97.5%; + flex-direction: row; + align-items: start; + height: 32px; + padding-left: 2.5%; + box-shadow: inset rgba(0,0,0,0.3) 0 0 10px; + background-color: rgba(0,0,0,0.4); +} + +.index-bar > a > img { + height: 32px; +} + +.image-result-list { + width: 100%; + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: flex-start; + gap: 10px; +} + +.image-result > a > img { + height: 256px; + background-color: white; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; + max-width: 85vw; +} + +@media screen and (max-width: 800px) { + .image-result > a > img { + height: auto; + } +} + +.image-result { + flex-grow: 1; + height: 256px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + text-decoration: none; +} + +@media screen and (max-width: 800px) { + .image-result { + height: auto; + } + +} \ No newline at end of file diff --git a/static/themes/default/inline-announcement.css b/static/themes/default/inline-announcement.css new file mode 100644 index 0000000..956f892 --- /dev/null +++ b/static/themes/default/inline-announcement.css @@ -0,0 +1,96 @@ +#preview { + color: #9baba4; + display: flex; + flex-direction: column; + align-items: center; + font-family: monospace; + font-weight: bold; +} + +#preview a { + text-decoration: unset; + color: unset; + background-image: unset; + text-shadow: unset; + box-shadow: unset; + color: unset; + min-height: unset; + border: unset; + border-radius: unset; + padding: unset; + margin: unset; + font-size: unset; + transition: unset; + font-family: unset; + font-weight: unset; +} + +.announcement { + background: url("/static/img/announcement.png"); + width: 532px; + height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.3em; + line-height: 1.2em; + margin: 28px 32px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + font-size: 1.1em; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.1em; + margin: 24px 32px -16px; + line-height: 1em; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 0.9em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; +} + +.announcement-date { + float: right; + margin: 32px 32px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px -5px; + color: black; + display: block; + font-size: 0.6em; + line-height: 0; + } +} diff --git a/static/themes/default/legal.css b/static/themes/default/legal.css new file mode 100644 index 0000000..fea5500 --- /dev/null +++ b/static/themes/default/legal.css @@ -0,0 +1,38 @@ +@font-face { + font-family: AtkinsonHyperlegible; + src: url("/static/font/AtkinsonHyperlegible-Regular.ttf"); + font-weight: normal; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: AtkinsonHyperlegible; + src: url("/static/font/AtkinsonHyperlegible-Bold.ttf"); + font-weight: bold; + font-style: normal; + font-display: swap; +} + +* { + font-family: "AtkinsonHyperlegible", sans-serif; + text-align: left; + font-weight: normal; + line-height: 2; +} + +ul { + margin-left: 10px; +} + +strong { + color: #c6ebf4; +} + +h1, h2, h3 { + font-weight: bold; + color: #c8ffd4; +} + +li { + margin-bottom: 30px; +} \ No newline at end of file diff --git a/static/themes/default/register.css b/static/themes/default/register.css new file mode 100644 index 0000000..5733a17 --- /dev/null +++ b/static/themes/default/register.css @@ -0,0 +1,34 @@ +.lyphe > * { + margin-top: auto; + margin-bottom: 1rem; +} + +.lyphe-text { + vertical-align: bottom; + display: inline; +} + +.lyphe-text > h2 { + display: inline; +} + +.lyphe-icon { + height: 120px; + margin-right: 20px; +} +.lyphe { + display: flex; + flex-direction: row; + width: 85%; + color: white; + text-decoration: none; +} + +.register-form { + text-align: center; + margin: auto; +} + +.register-form table { + margin: auto; +} \ No newline at end of file diff --git a/static/themes/default/search.css b/static/themes/default/search.css new file mode 100644 index 0000000..4e8d652 --- /dev/null +++ b/static/themes/default/search.css @@ -0,0 +1,300 @@ +.lyphe-says { + text-align: left; + min-width: 20%; + max-height: 128px; + border: 3px inset black; + padding: 10px; + background-image: url("/static/snow.gif"); +} + +.lyphe-says > img { + height: 100px; + float: left; + margin-right: 10px; +} + +.lyphe-says > h5, p { + color: black; + word-break: break-word; +} + +.lyphe-says > h5 { + padding: 0; + margin: 0; + line-height: 2em; +} + +.ask { + text-align: left; + width: 85%; +} + +.lyphe { + display: flex; + flex-direction: row; + width: 85%; + color: white; + text-decoration: none; +} + +.lyphe > * { + margin-top: auto; + margin-bottom: 1rem; +} + +.lyphe-text { + vertical-align: bottom; + display: inline; +} + +.lyphe-text > h2 { + display: inline; +} + +.lyphe-icon { + height: 120px; + margin-right: 20px; +} + +.pagecontent { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +.response { + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; + padding: 20px 20px 0 20px; +} + +.resultstat { +} + +.enginelist { + display: flex; + height: 20px; +} + +.search-result-list { + width: 100%; + padding-left: 0; + list-style: none; + flex-grow: 1; +} + +.search-result-list > li { + list-style-type: none; + padding: 10px; + width: 63%; + border-top: 1px black solid; + margin-top: 5px; + display: flex; + flex-direction: column; + word-break: auto-phrase; + overflow-wrap: anywhere; +} + +@media screen and (max-width: 800px) { + .search-result-list > li { + flex-direction: column; + word-break: auto-phrase; + width: 90%; + } +} + +.search-result { + color: lightblue; + display: flex; + flex-direction: column; + text-decoration: none; +} + +.search-result:visited { + color: lightblue; +} + +.search-title { + margin: 2px 0 2px; + line-height: 1em; + font-size: 1.3em; + width: 45%; + font-weight: bold; +} + +@media screen and (max-width: 800px) { + .search-title { + width: unset; + } +} + +.search-url { + font-size: 0.8em; + color: lightgray; +} + +.search-description { + color: white; + width: 35%; + font-size: 14px; + font-weight: lighter; +} + +@media screen and (max-width: 800px) { + .search-description { + width: unset; + } +} + +.search-relevance { + font-size: 0.8em; + color: lightgray; +} + +.results-area { + width: 100%; +} + +@media screen and (max-width: 800px) { + .results-area { + display: flex; + flex-direction: column; + align-items: center; + } +} + +.complications { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + float: right; + width: 30%; + padding: 0 10px 10px 10px; + margin: 0 10px 10px 10px; +} + +@media screen and (max-width: 800px) { + .complications { + float: none; + width: unset; + } +} + +.wikipedia-complication { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.wikipedia-complication > * { + margin: auto; + text-decoration: none; + width: 100%; +} + +.wikipedia-complication > a:visited { + text-decoration: none; +} + +.wikipedia-image > img { + max-width: 100%; + max-height: 256px; + margin-top: 8px; + margin-bottom: 8px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.wikipedia-header { + display: flex; + flex-direction: column; + align-items: flex-start; + text-align: left; +} + +.wikipedia-title { + text-decoration: none; + color: black; + font-size: 2em; + font-weight: bold; + display: inline-block; +} + +.wikipedia-fromwikipedia { + color: #586761; + font-size: 0.8em; + display: inline-block; +} + +.wikipedia-class { + font-size: 0.9em; + color: #333333; + margin-bottom: 8px; + display: inline-block; +} + +.wikipedia-description { + text-align: left; + display: inline-block; + color: black; + font-weight: lighter; +} + +.complications-note { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.unit_converter-complication { + width: 100%; + background-image: url("/static/img/paper.jpg"); + padding: 10px; + margin: 10px; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; +} + +.unit_converter-title { + font-size: 1.2em; + color: #586761; + font-weight: lighter; + width: 100%; + display: inline-block; +} + +.unit_converter-result { + font-size: 2em; + font-weight: bold; + display: inline-block; + word-break: break-word; + color: black; +} + +.index-bar { + display: flex; + width: 97.5%; + flex-direction: row; + align-items: start; + height: 32px; + padding-left: 2.5%; + box-shadow: inset rgba(0,0,0,0.3) 0 0 10px; + background-color: rgba(0,0,0,0.4); +} + +.index-bar > a > img { + height: 32px; +} \ No newline at end of file diff --git a/static/themes/default/settings.css b/static/themes/default/settings.css new file mode 100644 index 0000000..c398275 --- /dev/null +++ b/static/themes/default/settings.css @@ -0,0 +1,125 @@ +.lyphe-says { + text-align: left; + min-width: 20%; + max-height: 128px; + border: 3px inset black; + padding: 10px; + background-image: url("/static/snow.gif"); +} + +.lyphe-says > img { + height: 100px; + float: left; + margin-right: 10px; +} + +.lyphe-says > h5, p { + color: black; + word-break: break-word; +} + +.lyphe-says > h5 { + padding: 0; + margin: 0; + line-height: 2em; +} + +.ask { + text-align: left; + width: 85%; +} + +.lyphe { + display: flex; + flex-direction: row; + width: 85%; + color: white; + text-decoration: none; +} + +.lyphe > * { + margin-top: auto; + margin-bottom: 1rem; +} + +.lyphe-text { + vertical-align: bottom; + display: inline; +} + +.lyphe-text > h2 { + display: inline; +} + +.lyphe-icon { + height: 120px; + margin-right: 20px; +} +.settings-area { + background-image: url("/static/img/darkened_paper.jpg"); + width: 100%; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px), + linear-gradient(to right, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px), + linear-gradient(to left, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 30px); + margin: 0; + min-height: 100vh; + width: 100%; + display: flex; + flex-direction: column; +} + +.settings-row { + display: flex; + flex-direction: row; +} + +@media screen and (max-width: 800px) { + .settings-row { + flex-direction: column; + } +} + +.settings-section { + width: 10%; + min-height: 120px; + background-image: url("/static/img/paper.jpg"); + margin: 50px 90px 30px 90px; + padding: 20px; + text-align: left; + box-shadow: rgba(0,0,0,0.3) 0 0 10px; + color: black; +} + +@media screen and (max-width: 800px) { + .settings-section { + width: 79%; + margin: 20px auto; + } +} + +.pagecontent { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +#email { + flex-grow: 1; +} + +#theme { + flex-basis: 45%; +} + +form { + display: flex; + flex-direction: column; +} + +#theme-submit { + font-size: 1em; +} \ No newline at end of file diff --git a/static/themes/default/shell.css b/static/themes/default/shell.css new file mode 100644 index 0000000..81f829e --- /dev/null +++ b/static/themes/default/shell.css @@ -0,0 +1,227 @@ +@font-face { + font-family: NanumGothicCoding; + src: url("/static/font/NanumGothicCoding.woff2") format("woff2"), + url("/static/font/NanumGothicCoding.woff") format("woff"); + font-weight: normal; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: NanumGothicCoding; + src: url("/static/font/NanumGothicCoding-Bold.woff2") format("woff2"), + url("/static/font/NanumGothicCoding-Bold.woff") format("woff"); + font-weight: bold; + font-style: normal; + font-display: swap; +} + +body { + text-align: center; + background-color: #4e6e7e; + min-height: 100vh; + margin: 0; + padding: 0; +} + +@media screen and (max-width: 800px) { + body { + padding: 0; + margin: 0; + } +} + +.main { + background-image: url("/static/img/paper.jpg"); + min-height: 100vh; + margin: 0 7% 0 7%; + color: #9baba4; + font-family: monospace; + font-weight: bold; + display: flex; + flex-direction: column; + align-items: center; + flex-grow: 1; +} + +@media screen and (max-width: 800px) { + .main { + margin: 0; + padding: 0; + width: auto; + } + + #alpha-warning, h2, h3 { + margin: 5px; + } +} + +.main > img { + max-width: 35vw; +} + +.footer { + bottom: 0; + left: 0; + width: 100%; + margin-top: 6%; +} + +.footer-inner { + /*margin: 2vw;*/ + margin: 2vw 0; + background-color: rgba(77,77,77,0.3); + border: 1px solid cadetblue; + color: white; + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} + +.footer-inner > ul { + padding: 0; + margin: 0; + list-style: none; + display: flex; + flex-wrap: wrap; +} + +.footer-list { + display: flex; + line-height: 1.5em; + align-items: center; +} + +.footer-item { + padding: 10px 12px; + text-align: center; +} + +.footer-item a { + color: white; + text-decoration: none; +} + +.lyphe-label { + display: block; +} + +input[type=text] { + background: url("/static/img/textbox.png") no-repeat center; + background-size: 256px 64px; + width: 232px; + height: 64px; + border: none; + padding-inline: 10px 10px; + font-family: NanumGothicCoding, monospace; + font-weight: bold; +} + +input[type=text]:focus { + border: none; +} + +button, .button { + display: inline-block; + background: url("/static/img/button.png") no-repeat center; + background-size: 138px 64px; + width: 138px; + height: 64px; + vertical-align: bottom; + padding-top: 6px; + border: none; + font-family: NanumGothicCoding, monospace; + font-weight: bold; + font-size: 1.2em; + text-decoration: none; + line-height: 58px; + color: black; +} + +button:hover, .button:hover { + filter: brightness(78%); + cursor: pointer; +} + +#lyphesmall { + margin-top: 1%; + display: flex; + flex-direction: row; + height: 10%; + text-align: left; +} + +.bent-surrounding { + background: url("/static/img/borderbent.png") no-repeat center; + background-size: 85px; + display: grid; + height: 85px; + margin: auto; +} + +#lypheimg { + width: 85px; + margin: auto; +} + +#lyphetitlenav > img { + height: 72px; + padding-top: 20px; + margin: auto; +} + +.navbar { + width: 95%; + margin-bottom: 1%; +} + +.user-bar { + display: flex; + width: 100%; + flex-direction: row; + align-items: center; + justify-content: right; +} + +.user-bar > form { + margin: 0; +} + +.user-bar > span { + margin-top: auto; + margin-bottom: auto; +} + +.user-bar > form > button { + display: inline-block; + background: url("/static/img/button.png") no-repeat center; + background-size: 69px 32px; + width: 69px; + height: 32px; + margin-top: -6px; + vertical-align: bottom; + border: none; + font-family: NanumGothicCoding, monospace; + font-weight: bold; + font-size: 0.9em; + text-decoration: none; + line-height: 10px; + color: #586761; +} + +.user-bar > a.button { + display: inline-block; + background: url("/static/img/button.png") no-repeat center; + background-size: 69px 32px; + width: 69px; + height: 32px; + margin-top: -6px; + vertical-align: bottom; + border: none; + font-family: NanumGothicCoding, monospace; + font-weight: bold; + font-size: 0.9em; + text-decoration: none; + line-height: 2.1; + color: #586761; +} \ No newline at end of file diff --git a/static/themes/freaky/inline-announcement.css b/static/themes/freaky/inline-announcement.css new file mode 100644 index 0000000..c8810ca --- /dev/null +++ b/static/themes/freaky/inline-announcement.css @@ -0,0 +1,94 @@ +#preview { + color: #9baba4; + display: flex; + flex-direction: column; + align-items: center; + font-family: monospace; + font-weight: bold; +} + +#preview a { + text-decoration: unset; + color: unset; + background-image: unset; + text-shadow: unset; + box-shadow: unset; + color: unset; + min-height: unset; + border: unset; + border-radius: unset; + padding: unset; + margin: unset; + font-size: unset; + transition: unset; + font-family: unset; + font-weight: unset; +} + +.announcement { + background: url("/static/img/announcement.png"); + width: 532px; + height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.0em; + line-height: 1.2em; + margin: 28px 32px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 0.8em; + margin: 24px 32px -16px; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 0.6em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; +} + +.announcement-date { + float: right; + margin: 32px 32px 0 3px; + font-size: 0.6em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px 0; + color: black; + display: block; + font-size: 0.6em; + line-height: 0; + } +} diff --git a/static/themes/freaky/logo.png b/static/themes/freaky/logo.png new file mode 100644 index 0000000..eaab1a6 Binary files /dev/null and b/static/themes/freaky/logo.png differ diff --git a/static/themes/freaky/papyrus.ttf b/static/themes/freaky/papyrus.ttf new file mode 100644 index 0000000..b530afb Binary files /dev/null and b/static/themes/freaky/papyrus.ttf differ diff --git a/static/themes/freaky/shell.css b/static/themes/freaky/shell.css new file mode 100644 index 0000000..8679e8a --- /dev/null +++ b/static/themes/freaky/shell.css @@ -0,0 +1,19 @@ +@font-face { + font-family: Papyrus; + src: url("/static/themes/freaky/papyrus.ttf"); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +* { + font-family: Papyrus !important; +} + +#lyphetitle > img { + content: url("/static/themes/freaky/logo.png"); +} + +#lyphetitlenav > img { + content: url("/static/themes/freaky/logo.png"); +} diff --git a/static/themes/gloss/home.css b/static/themes/gloss/home.css new file mode 100644 index 0000000..329a94a --- /dev/null +++ b/static/themes/gloss/home.css @@ -0,0 +1,20 @@ +.front-links > ul > li > a, .front-links > ul > li > a:visited { + font-family: "Segoe UI", sans-serif; + color: black; + text-shadow: 0 0 8px white; +} + +.front-links > ul > li > a:hover { + color: #ffffff; + text-shadow: 0 0 12px #00c1ff; +} + +#lyphetitle > h2 { + font-family: "Segoe UI", sans-serif; + color: dimgray; + text-shadow: 0 0 8px white; +} + +.main { + background: rgba(240, 240, 240, 0.6) !important; +} \ No newline at end of file diff --git a/static/themes/gloss/imagesearch.css b/static/themes/gloss/imagesearch.css new file mode 100644 index 0000000..aa9bb2c --- /dev/null +++ b/static/themes/gloss/imagesearch.css @@ -0,0 +1,58 @@ +.main { + background: radial-gradient(circle at 75% 0, rgba(206, 255, 212, 0.6), rgba(134, 255, 128, 0.6)); +} + +.pagecontent { + background: rgba(240, 240, 240, 1.0); +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0) 10px); +} + +.search-result-list > li { + border-top: 1px solid #484d50; +} + +.search-result { + color: #1b1b1b; +} + +.search-result:visited { + color: #404e50; +} + +.search-title { + margin: 2px 0 2px; + line-height: 1em; + font-size: 1.3em; + width: 45%; + font-weight: bold; +} + +.search-url { + color: dimgray; +} + +.search-description { + color: black; + font-size: 12px; + font-weight: normal; +} + +.search-relevance { + font-size: 0.8em; + color: dimgray; +} + +.wikipedia-complication, .unit_converter-complication { + border: 1px solid rgba(0,0,0,.7); + box-shadow: 2px 2px 10px 1px rgba(0,0,0,.7), inset 0 0 0 1px #fffa; + background: rgba(240, 240, 240, 0.6); + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + color: #1b1b1b; + width: 100%; + padding: 20px; +} diff --git a/static/themes/gloss/imagesearch.png b/static/themes/gloss/imagesearch.png new file mode 100644 index 0000000..c2efc78 Binary files /dev/null and b/static/themes/gloss/imagesearch.png differ diff --git a/static/themes/gloss/imagesearch_selected.png b/static/themes/gloss/imagesearch_selected.png new file mode 100644 index 0000000..b937405 Binary files /dev/null and b/static/themes/gloss/imagesearch_selected.png differ diff --git a/static/themes/gloss/inline-announcement.css b/static/themes/gloss/inline-announcement.css new file mode 100644 index 0000000..fc47e5c --- /dev/null +++ b/static/themes/gloss/inline-announcement.css @@ -0,0 +1,97 @@ +#preview { + color: #9baba4; + display: flex; + flex-direction: column; + align-items: center; + font-family: monospace; + font-weight: bold; +} + +#preview a { + text-decoration: unset; + color: unset; + background-image: unset; + text-shadow: unset; + box-shadow: unset; + color: unset; + min-height: unset; + border: unset; + border-radius: unset; + padding: unset; + margin: unset; + font-size: unset; + transition: unset; + font-family: unset; + font-weight: unset; +} + +.announcement { + border: 1px solid rgba(0, 0, 0, .7); + box-shadow: 2px 2px 10px 1px rgba(0, 0, 0, .7), inset 0 0 0 1px #fffa; + background: rgba(240, 240, 240, 0.6); + font-family: "Segoe UI", sans-serif; + width: 532px; + height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.4em; + line-height: 1.2em; + margin: 28px 32px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.2em; + margin: 24px 32px -16px; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 1em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; +} + +.announcement-date { + float: right; + margin: 32px 32px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px 0; + color: black; + display: block; + font-size: 0.7em; + line-height: 0; + } +} diff --git a/static/themes/gloss/search.css b/static/themes/gloss/search.css new file mode 100644 index 0000000..aa9bb2c --- /dev/null +++ b/static/themes/gloss/search.css @@ -0,0 +1,58 @@ +.main { + background: radial-gradient(circle at 75% 0, rgba(206, 255, 212, 0.6), rgba(134, 255, 128, 0.6)); +} + +.pagecontent { + background: rgba(240, 240, 240, 1.0); +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0) 10px); +} + +.search-result-list > li { + border-top: 1px solid #484d50; +} + +.search-result { + color: #1b1b1b; +} + +.search-result:visited { + color: #404e50; +} + +.search-title { + margin: 2px 0 2px; + line-height: 1em; + font-size: 1.3em; + width: 45%; + font-weight: bold; +} + +.search-url { + color: dimgray; +} + +.search-description { + color: black; + font-size: 12px; + font-weight: normal; +} + +.search-relevance { + font-size: 0.8em; + color: dimgray; +} + +.wikipedia-complication, .unit_converter-complication { + border: 1px solid rgba(0,0,0,.7); + box-shadow: 2px 2px 10px 1px rgba(0,0,0,.7), inset 0 0 0 1px #fffa; + background: rgba(240, 240, 240, 0.6); + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + color: #1b1b1b; + width: 100%; + padding: 20px; +} diff --git a/static/themes/gloss/segoeui.ttf b/static/themes/gloss/segoeui.ttf new file mode 100644 index 0000000..fc18ebd Binary files /dev/null and b/static/themes/gloss/segoeui.ttf differ diff --git a/static/themes/gloss/settings.css b/static/themes/gloss/settings.css new file mode 100644 index 0000000..5c1c420 --- /dev/null +++ b/static/themes/gloss/settings.css @@ -0,0 +1,22 @@ +.pagecontent { + background: rgba(240, 240, 240, 1.0); +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0, rgba(0, 0, 0, 0) 10px); +} + +.settings-area { + background: rgba(240, 240, 240, 1.0); +} + +.settings-section { + border: 1px solid rgba(0, 0, 0, .7); + box-shadow: 2px 2px 10px 1px rgba(0, 0, 0, .7), inset 0 0 0 1px #fffa; + background: rgba(240, 240, 240, 0.6); + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + color: #1b1b1b; + padding: 20px; +} diff --git a/static/themes/gloss/shell.css b/static/themes/gloss/shell.css new file mode 100644 index 0000000..99b1dca --- /dev/null +++ b/static/themes/gloss/shell.css @@ -0,0 +1,136 @@ +@font-face { + font-family: "Segoe UI"; + src: url("/static/themes/gloss/segoeui.ttf"); + font-weight: normal; + font-style: normal; + font-display: swap; +} +body { + background: radial-gradient(circle at 55% 45%, #74b2d1, #131c1f); +} + +.main { + border: 1px solid rgba(0,0,0,.7); + box-shadow: 2px 2px 10px 1px rgba(0,0,0,.7), inset 0 0 0 1px #fffa; + background: radial-gradient(circle at 75% 0, rgba(101, 137, 106, 0.6), rgba(145, 255, 145, 0.6)); + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + color: #1b1b1b; +} + +#lyphebig { + border: 1px solid rgba(0,0,0,.7); + border-radius: 6px; + box-shadow: 2px 2px 10px 1px rgba(0,0,0,.4), inset 0 0 0 1px #fffa; + background: rgba(240, 240, 240, 0.6); + padding: 30px; +} + +input[type=text] { + background: white; + width: unset; + height: 23px; + border: 1px solid #ccc; + border-top: 1px solid #8e8f8f; + box-sizing: border-box; + padding: 3px 4px 5px; + padding-inline: unset; + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; +} + +input[type=text]:focus { + border: 1px solid #ccc; + border-top: 1px solid #8e8f8f; +} + +button, .button { + background: linear-gradient(to bottom, #f2f2f2 45%, #ebebeb 45%, #cfcfcf); + border: 1px solid #8e8f8f; + border-radius: 3px; + width: unset; + height: 23px; + vertical-align: center; + padding: 0 12px; + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: normal; + color: black; +} + +button:hover, .button:hover { + filter: unset; + cursor: pointer; + border-color: #3c7fb1; +} + +.user-bar > form > button { + background: linear-gradient(to bottom, #f2f2f2 45%, #ebebeb 45%, #cfcfcf); + width: 69px; + height: 23px; + margin-top: unset; + vertical-align: bottom; + border: 1px solid #8e8f8f; + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: normal; + color: black; +} + +.user-bar > a.button { + background: linear-gradient(to bottom, #f2f2f2 45%, #ebebeb 45%, #cfcfcf); + width: 69px; + height: 21px; + margin: 3px; + vertical-align: bottom; + border: 1px solid #8e8f8f; + font-family: "Segoe UI", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: normal; + color: black; + padding: unset; +} + +.user-bar > form > button:hover, .user-bar > a.button:hover { + cursor: pointer; + border-color: #3c7fb1; +} + +.index-bar { + align-items: center !important; + justify-content: start; + height: 26px !important; +} + +.index-bar > a > img { + width: 57px; + height: 23px !important; +} + +.index-bar > a { + height: 23px !important; +} + +#websearch-img { + content: url("/static/themes/gloss/websearch.png"); +} + +#websearch-img-selected { + content: url("/static/themes/gloss/websearch_selected.png"); +} + +#imagesearch-img { + content: url("/static/themes/gloss/imagesearch.png"); +} + +#imagesearch-img-selected { + content: url("/static/themes/gloss/imagesearch_selected.png"); +} diff --git a/static/themes/gloss/websearch.png b/static/themes/gloss/websearch.png new file mode 100644 index 0000000..49ca542 Binary files /dev/null and b/static/themes/gloss/websearch.png differ diff --git a/static/themes/gloss/websearch_selected.png b/static/themes/gloss/websearch_selected.png new file mode 100644 index 0000000..c336359 Binary files /dev/null and b/static/themes/gloss/websearch_selected.png differ diff --git a/static/themes/oled/home.css b/static/themes/oled/home.css new file mode 100644 index 0000000..90d2028 --- /dev/null +++ b/static/themes/oled/home.css @@ -0,0 +1,11 @@ +.front-links > ul > li > a, .front-links > ul > li > a:visited { + color: white; +} + +.bent-surrounding { + background: black; +} + +#lyphetitle > h2 { + color: white; +} \ No newline at end of file diff --git a/static/themes/oled/imagesearch.css b/static/themes/oled/imagesearch.css new file mode 100644 index 0000000..5871574 --- /dev/null +++ b/static/themes/oled/imagesearch.css @@ -0,0 +1,68 @@ +.pagecontent { + background: black; + border: 1px solid white; +} +.search-result { + color: white; + padding: 10px; + border: 1px solid white; + margin: 3px; +} + +.search-result:visited { + color: steelblue; +} +.search-url { + color: lightgray; +} + +.search-description { + color: gray; +} + +.search-relevance { + color: lightgray; +} + +.wikipedia-complication { + background: black; + border: 1px solid white; +} + +.wikipedia-image > img { + background: gray; +} + +.wikipedia-title { + color: white; +} + +.wikipedia-fromwikipedia { + color: lightslategray; +} + +.wikipedia-class { + color: lightslategray; +} + +.wikipedia-description { + color: white; +} + +.complications-note { + background: black; + border: 1px solid white; +} + +.unit_converter-complication { + background: black; + border: 1px solid white; +} + +.unit_converter-title { + color: white; +} + +.unit_converter-result { + color: white; +} \ No newline at end of file diff --git a/static/themes/oled/imagesearch.png b/static/themes/oled/imagesearch.png new file mode 100644 index 0000000..0dd3ca1 Binary files /dev/null and b/static/themes/oled/imagesearch.png differ diff --git a/static/themes/oled/imagesearch_selected.png b/static/themes/oled/imagesearch_selected.png new file mode 100644 index 0000000..d7343c2 Binary files /dev/null and b/static/themes/oled/imagesearch_selected.png differ diff --git a/static/themes/oled/inline-announcement.css b/static/themes/oled/inline-announcement.css new file mode 100644 index 0000000..dccc3d9 --- /dev/null +++ b/static/themes/oled/inline-announcement.css @@ -0,0 +1,72 @@ +.announcement { + border: 1px solid white; + width: 532px; + height: 148px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.4em; + line-height: 1.2em; + margin: 18px 24px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.2em; + margin: 18px 24px -16px; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 1em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; + color: #00c1ff; +} + +.announcement > p > a:visited { + color: #00c1ff; +} + +.announcement-date { + float: right; + margin: 24px 24px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px 0; + color: ghostwhite; + display: block; + font-size: 0.7em; + line-height: 0; + } +} diff --git a/static/themes/oled/logo.png b/static/themes/oled/logo.png new file mode 100644 index 0000000..5d28bdb Binary files /dev/null and b/static/themes/oled/logo.png differ diff --git a/static/themes/oled/search.css b/static/themes/oled/search.css new file mode 100644 index 0000000..5871574 --- /dev/null +++ b/static/themes/oled/search.css @@ -0,0 +1,68 @@ +.pagecontent { + background: black; + border: 1px solid white; +} +.search-result { + color: white; + padding: 10px; + border: 1px solid white; + margin: 3px; +} + +.search-result:visited { + color: steelblue; +} +.search-url { + color: lightgray; +} + +.search-description { + color: gray; +} + +.search-relevance { + color: lightgray; +} + +.wikipedia-complication { + background: black; + border: 1px solid white; +} + +.wikipedia-image > img { + background: gray; +} + +.wikipedia-title { + color: white; +} + +.wikipedia-fromwikipedia { + color: lightslategray; +} + +.wikipedia-class { + color: lightslategray; +} + +.wikipedia-description { + color: white; +} + +.complications-note { + background: black; + border: 1px solid white; +} + +.unit_converter-complication { + background: black; + border: 1px solid white; +} + +.unit_converter-title { + color: white; +} + +.unit_converter-result { + color: white; +} \ No newline at end of file diff --git a/static/themes/oled/settings.css b/static/themes/oled/settings.css new file mode 100644 index 0000000..8528c74 --- /dev/null +++ b/static/themes/oled/settings.css @@ -0,0 +1,20 @@ +.settings-area { + background: black; + border: 1px solid white; +} + +@media screen and (max-width: 800px) { + .settings-area { + width: calc(100% - 1px); + } +} + +.settings-section { + background: black; + border: 1px solid white; + color: white; +} + +p { + color: white; +} \ No newline at end of file diff --git a/static/themes/oled/shell.css b/static/themes/oled/shell.css new file mode 100644 index 0000000..9f52489 --- /dev/null +++ b/static/themes/oled/shell.css @@ -0,0 +1,74 @@ +body { + background-color: black; +} + +.main { + background: black; + color: white; + border: 1px solid white; + border-top-color: black; + border-bottom-color: black; +} + +input[type=text] { + background: black; + background-size: 256px 64px; + height: 40px; + color: white; + border: 1px solid white; + padding: 0; +} + +button, .button { + background: black; + background-size: 138px 64px; + height: 42px; + color: white; + border: 1px solid white; + line-height: 0; + padding: 0; +} + +.bent-surrounding { + background: url("/static/img/borderbent.png") no-repeat center; +} + +.user-bar > form > button { + background: black; + border: 1px solid white; + width: 69px; + height: 32px; + color: white; +} + +.user-bar > a.button { + background: black; + border: 1px solid white; + width: 69px; + height: 30px; + color: white; +} + +#lyphetitle > img { + content: url("/static/themes/oled/logo.png"); +} + +#lyphetitlenav > img { + content: url("/static/themes/oled/logo.png"); +} + +#websearch-img { + content: url("/static/themes/oled/websearch.png"); +} + +#websearch-img-selected { + content: url("/static/themes/oled/websearch_selected.png"); +} + +#imagesearch-img { + content: url("/static/themes/oled/imagesearch.png"); +} + +#imagesearch-img-selected { + content: url("/static/themes/oled/imagesearch_selected.png"); +} diff --git a/static/themes/oled/websearch.png b/static/themes/oled/websearch.png new file mode 100644 index 0000000..7a20c0b Binary files /dev/null and b/static/themes/oled/websearch.png differ diff --git a/static/themes/oled/websearch_selected.png b/static/themes/oled/websearch_selected.png new file mode 100644 index 0000000..b17a6ed Binary files /dev/null and b/static/themes/oled/websearch_selected.png differ diff --git a/static/themes/water/bg.png b/static/themes/water/bg.png new file mode 100644 index 0000000..1e1a9af Binary files /dev/null and b/static/themes/water/bg.png differ diff --git a/static/themes/water/border.png b/static/themes/water/border.png new file mode 100644 index 0000000..990f30f Binary files /dev/null and b/static/themes/water/border.png differ diff --git a/static/themes/water/button_mid.png b/static/themes/water/button_mid.png new file mode 100644 index 0000000..d2110df Binary files /dev/null and b/static/themes/water/button_mid.png differ diff --git a/static/themes/water/button_small.png b/static/themes/water/button_small.png new file mode 100644 index 0000000..802bf6f Binary files /dev/null and b/static/themes/water/button_small.png differ diff --git a/static/themes/water/home.css b/static/themes/water/home.css new file mode 100644 index 0000000..99bfcc4 --- /dev/null +++ b/static/themes/water/home.css @@ -0,0 +1,9 @@ +.front-links > ul > li > a, .front-links > ul > li > a:visited { + font-family: "Lucida Grande", sans-serif; + color: gray; +} + +#lyphetitle > h2 { + font-family: "Lucida Grande", sans-serif; + color: gray; +} \ No newline at end of file diff --git a/static/themes/water/imagesearch.css b/static/themes/water/imagesearch.css new file mode 100644 index 0000000..bac7976 --- /dev/null +++ b/static/themes/water/imagesearch.css @@ -0,0 +1,54 @@ +.pagecontent { + background: white; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +.search-result-list > li { + list-style-type: none; + padding: 10px; + border-top: 1px dimgray solid; + margin-top: 5px; + display: flex; + flex-direction: column; + word-break: break-all; +} + +.search-result { + color: black; +} + +.search-title { + font-size: 14px; +} + +.search-result:visited { + color: dimgray; +} + +.search-url { + font-size: 0.8em; + color: dimgray; +} + +.search-relevance { + color: dimgray; +} + +.search-description { + color: black; + font-size: 12px; +} + +.wikipedia-complication, .unit_converter-complication { + background-image: url("/static/themes/water/bg.png"); + border-radius: 6px; + width: 100%; + padding: 20px; + box-shadow: dimgray 0 0 10px; +} diff --git a/static/themes/water/imagesearch.png b/static/themes/water/imagesearch.png new file mode 100644 index 0000000..c6634af Binary files /dev/null and b/static/themes/water/imagesearch.png differ diff --git a/static/themes/water/imagesearch_selected.png b/static/themes/water/imagesearch_selected.png new file mode 100644 index 0000000..ead483a Binary files /dev/null and b/static/themes/water/imagesearch_selected.png differ diff --git a/static/themes/water/inline-announcement.css b/static/themes/water/inline-announcement.css new file mode 100644 index 0000000..4f084bb --- /dev/null +++ b/static/themes/water/inline-announcement.css @@ -0,0 +1,96 @@ +#preview { + color: #9baba4; + display: flex; + flex-direction: column; + align-items: center; + font-family: monospace; + font-weight: bold; +} + +#preview a { + text-decoration: unset; + color: unset; + background-image: unset; + text-shadow: unset; + box-shadow: unset; + color: unset; + min-height: unset; + border: unset; + border-radius: unset; + padding: unset; + margin: unset; + font-size: unset; + transition: unset; + font-family: unset; + font-weight: unset; +} + +.announcement { + background-image: url("/static/themes/water/bg.png"); + border-radius: 6px; + width: 532px; + height: 148px; + box-shadow: dimgray 0 0 10px; +} + +@media screen and (max-width: 800px) { + .announcement { + margin-top: 10px; + background-size: cover; + width: 354px; + height: 98px; + } +} + +.announcement > h4 { + text-align: left; + font-weight: bold; + font-size: 1.4em; + line-height: 1.2em; + margin: 28px 32px -16px; + padding: 0; +} + +@media screen and (max-width: 800px) { + .announcement > h4 { + margin: 8px 12px -16px; + } +} + +.announcement > p { + text-align: left; + font-weight: normal; + font-size: 1.2em; + margin: 24px 32px -16px; +} + +@media screen and (max-width: 800px) { + .announcement > p { + margin: 14px 12px -12px; + font-size: 1em; + } +} + +.announcement > p > a { + font-size: 0.6em !important; + font-family: monospace !important; + font-weight: bold !important; +} + +.announcement-date { + float: right; + margin: 32px 32px 0 3px; + font-size: 0.8em; +} + +@media screen and (max-width: 800px) { + .announcement-date { + float: none; + text-align: left; + margin: 14px 12px 0; + color: black; + display: block; + font-size: 0.7em; + line-height: 0; + } +} diff --git a/static/themes/water/logo.png b/static/themes/water/logo.png new file mode 100644 index 0000000..6baaf2f Binary files /dev/null and b/static/themes/water/logo.png differ diff --git a/static/themes/water/lucidagrande.ttf b/static/themes/water/lucidagrande.ttf new file mode 100755 index 0000000..63c3d97 Binary files /dev/null and b/static/themes/water/lucidagrande.ttf differ diff --git a/static/themes/water/search.css b/static/themes/water/search.css new file mode 100644 index 0000000..bac7976 --- /dev/null +++ b/static/themes/water/search.css @@ -0,0 +1,54 @@ +.pagecontent { + background: white; +} + +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0) 50px); + margin: 0; + min-height: 100vh; + width: 100%; +} + +.search-result-list > li { + list-style-type: none; + padding: 10px; + border-top: 1px dimgray solid; + margin-top: 5px; + display: flex; + flex-direction: column; + word-break: break-all; +} + +.search-result { + color: black; +} + +.search-title { + font-size: 14px; +} + +.search-result:visited { + color: dimgray; +} + +.search-url { + font-size: 0.8em; + color: dimgray; +} + +.search-relevance { + color: dimgray; +} + +.search-description { + color: black; + font-size: 12px; +} + +.wikipedia-complication, .unit_converter-complication { + background-image: url("/static/themes/water/bg.png"); + border-radius: 6px; + width: 100%; + padding: 20px; + box-shadow: dimgray 0 0 10px; +} diff --git a/static/themes/water/settings.css b/static/themes/water/settings.css new file mode 100644 index 0000000..85cdce0 --- /dev/null +++ b/static/themes/water/settings.css @@ -0,0 +1,20 @@ +.pagegradient { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0) 50px); +} + +.settings-area { + background: white; + width: 100%; +} + +.settings-section { + background-image: url("/static/themes/water/bg.png"); + border-radius: 6px; + padding: 20px; + box-shadow: dimgray 0 0 10px; +} + +#theme-submit { + margin-top: 10px; + background-image: url("/static/themes/water/button_mid.png"); +} \ No newline at end of file diff --git a/static/themes/water/shell.css b/static/themes/water/shell.css new file mode 100644 index 0000000..c29d0e4 --- /dev/null +++ b/static/themes/water/shell.css @@ -0,0 +1,138 @@ +@font-face { + font-family: "Lucida Grande"; + src: url("/static/themes/water/lucidagrande.ttf"); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +#lyphetitle > img { + content: url("/static/themes/water/logo.png"); +} + +#lyphetitlenav > img { + content: url("/static/themes/water/logo.png"); +} + +body { + background: url("/static/themes/water/bg.png"); +} + +.main { + background: white; + color: black; + font-family: "Lucida Grande", sans-serif; + font-weight: bold; + font-size: 12px; + box-shadow: 0 0 40px 0 dimgray; +} + +label { + margin-bottom: 10px; +} + +button, .button { + display: inline-block; + background: url("/static/themes/water/button_small.png") no-repeat center; + width: 100px; + height: 21px; + vertical-align: unset; + padding: 3px; + border: none; + font-family: "Lucida Grande", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: 0; + color: black; +} + +button:hover, .button:hover { + filter: brightness(95%); + cursor: pointer; +} + +input[type=text] { + background: linear-gradient(to bottom, #ebebeb 0%, white 20%); + border-radius: 7px; + width: 300px; + height: 19px; + padding: 3px; + border: 1px solid dimgray; + padding-inline: 3px 0; + font-family: "Lucida Grande", sans-serif; + font-weight: normal; + font-size: 12px; +} + +.user-bar { + color: dimgray; + font-family: "Lucida Grande", sans-serif; + font-weight: normal; + font-size: 12px; +} + +.user-bar > form > button { + background: url("/static/themes/water/button_small.png") no-repeat center; + width: 64px; + height: 21px; + margin: unset; + vertical-align: bottom; + border: none; + font-family: "Lucida Grande", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: 10px; + color: black; +} + +.user-bar > a.button { + background: url("/static/themes/water/button_small.png") no-repeat center; + width: 64px; + height: 21px; + margin: 0; + vertical-align: unset; + border: none; + font-family: "Lucida Grande", sans-serif; + font-weight: normal; + font-size: 12px; + text-decoration: none; + line-height: 21px; + color: black; +} + +.footer-inner { + color: black; +} + +.footer-item a { + color: black; +} + +.index-bar { + background: url("/static/themes/water/bg.png"); + align-items: center !important; + justify-content: start; +} + +.index-bar > a > img { + width: 54px; + height: 21px !important; +} + +#websearch-img { + content: url("/static/themes/water/websearch.png"); +} + +#websearch-img-selected { + content: url("/static/themes/water/websearch_selected.png"); +} + +#imagesearch-img { + content: url("/static/themes/water/imagesearch.png"); +} + +#imagesearch-img-selected { + content: url("/static/themes/water/imagesearch_selected.png"); +} diff --git a/static/themes/water/websearch.png b/static/themes/water/websearch.png new file mode 100644 index 0000000..b2af012 Binary files /dev/null and b/static/themes/water/websearch.png differ diff --git a/static/themes/water/websearch_selected.png b/static/themes/water/websearch_selected.png new file mode 100644 index 0000000..5d5667a Binary files /dev/null and b/static/themes/water/websearch_selected.png differ diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..66f0d82 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,23 @@ + + + + + + + AskLyphe - Not Found + + + + + + + +

404 - Not Found

+

lyphe couldn't find the requested page :(

+back to frontpage! + + + diff --git a/templates/admin/allusers.html b/templates/admin/allusers.html new file mode 100644 index 0000000..861767e --- /dev/null +++ b/templates/admin/allusers.html @@ -0,0 +1,23 @@ +{% extends "admin/shell.html" %} + +{% block title %}User Listing{% endblock %} + +{% block head %} +{% endblock %} + +{% block page %} +

lyphe users

+

important note

+

+ one user in this list has their username truncated to 32 characters, their full username is shown below. + i promised this person that they could keep their super long username, and i will fulfil this promise. +
+ liyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliyliy +

+ + + {% for user in users %} + + {% endfor %} +
usernameemailverifiedadministrator
{{ user.username }}{{ user.email }}{{ user.verified }}{{ user.admin }}
+{% endblock %} diff --git a/templates/admin/announcement.html b/templates/admin/announcement.html new file mode 100644 index 0000000..44085f2 --- /dev/null +++ b/templates/admin/announcement.html @@ -0,0 +1,39 @@ +{% extends "admin/shell.html" %} + +{% block title %}Announcement Writer{% endblock %} + +{% block head %} + +{% endblock %} + +{% block page %} +{% match error %} +{% when Some with (error) %} +

{{ error }}

+{% when None %} +{% endmatch %} +
+

announcement writer!

+

you will be writing announcements as {{ username }}

+ + + + + + + + + + + +
+
+

this is what your announcement will look like on the frontpage!

+
+ Mon, 18 Nov 2024 21:00:00 +0000 +

filled in by javascript

+

+

Read More...

+
+
+{% endblock %} diff --git a/templates/admin/error.html b/templates/admin/error.html new file mode 100644 index 0000000..ba86ac3 --- /dev/null +++ b/templates/admin/error.html @@ -0,0 +1,13 @@ +{% extends "admin/shell.html" %} + +{% block title %}Error!{% endblock %} + +{% block head %} +{% endblock %} + +{% block page %} +

uh oh!

+

an internal server error occurred:

+

{{ error }}

+

report to supervisor!

+{% endblock %} diff --git a/templates/admin/home.html b/templates/admin/home.html new file mode 100644 index 0000000..cf9e1e7 --- /dev/null +++ b/templates/admin/home.html @@ -0,0 +1,25 @@ +{% extends "admin/shell.html" %} + +{% block title %}Home{% endblock %} + +{% block head %} +{% endblock %} + +{% block page %} +

hello administrator!

+
+
+

user count: {{ user_count }}

+

of those users, {{ admin_count }} are administrators

+

currently, there are {{ active_verification_requests }} unverified accounts

+
+
+

last ten users registered:

+
    + {% for user in last_ten_users %} +
  1. {{user}}
  2. + {% endfor %} +
+
+
+{% endblock %} diff --git a/templates/admin/invitecode.html b/templates/admin/invitecode.html new file mode 100644 index 0000000..f7c7039 --- /dev/null +++ b/templates/admin/invitecode.html @@ -0,0 +1,33 @@ +{% extends "admin/shell.html" %} + +{% block title %}Home{% endblock %} + +{% block head %} +{% endblock %} + +{% block page %} +

invite code page

+
+

invite code generator!

+

you will be inserting codes as {{ username }}

+ + + + + +
+

active invite codes

+ + + {% for code in active_codes %} + + {% endfor %} +
codeissuerroot issuerissued oncomment
{{ code.code }}{{ code.creator }}{{ code.root_creator }}{{ code.created_at }}{{ code.comment }}
+

used invite codes (fixme: separate into pages to prevent long load times in the future)

+ + + {% for code in used_codes %} + + {% endfor %} +
codeissuerroot issuerissued onused onused bycomment
{{ code.code }}{{ code.creator }}{{ code.root_creator }}{{ code.created_at }}{{ code.used_at.as_ref().unwrap() }}{{ code.used_by.as_ref().unwrap() }}{{ code.comment }}
+{% endblock %} diff --git a/templates/admin/shell.html b/templates/admin/shell.html new file mode 100644 index 0000000..c81ffa5 --- /dev/null +++ b/templates/admin/shell.html @@ -0,0 +1,32 @@ + + + + + + + AskLyphe Administrator Panel - {% block title %}{% endblock %} + + + + {% block head %}{% endblock %} + + + +
+ +
+ {% block page %}{% endblock %} +
+
+ + \ No newline at end of file diff --git a/templates/announcement.html b/templates/announcement.html new file mode 100644 index 0000000..2b0e566 --- /dev/null +++ b/templates/announcement.html @@ -0,0 +1,44 @@ +{% extends "shell.html" %} + +{% block title %}{{ announcement.title }}{% endblock %} + +{% block head %} + +{% endblock %} + +{% block page %} +
+ + +
+
+
+
+
+

{{ announcement.title }}

+
{{ announcement.date }}
+
posted by {{ announcement.creator }}
+
+

{{ announcement.full|safe }}

+
+
+
+
+
+
+ + {% include "ui/footer.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/frontpage.html b/templates/frontpage.html new file mode 100644 index 0000000..7b84662 --- /dev/null +++ b/templates/frontpage.html @@ -0,0 +1,158 @@ +{% extends "shell.html" %} + +{% block title %}the best search engine{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block page %} +
+ {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% endif %} + {% match error %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} + {% endmatch %} +
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +

a user-first, customizable, useful, and fun search engine!

+
+
+

currently in invite-only alpha, you must have an invite code to register (:

+

invites are currently given out at our discretion. please don't email us begging us for an invite code (:

+ +

{{ count }} sites indexed!

+ + + {% match announcement %} + {% when Some with (a) %} +
+ {{ a.date }} +

{{ a.title }}

+

{{ a.content }}

+

Read More...

+
+ {% when None %} + {% endmatch %} + +
+
+
+
+

user-first

+ lorem ipsum dolor sit amet +

+ we will never serve a single ad. +
+
+ since we will earn money off of subscriptions and do not accept investments or vc funding, + our platform is not a two-sided market, + and thus we do not have anyone we need to please other than our users! +
+
+ furthermore, we will attempt to be as transparent about our methods as possible; + all public-facing search engine software will be open-sourced under AGPL, and we will maintain a publicly + viewable + list of the websites that we derank or block, including a reason with each one. +
+
+ finally, we do not claim to be in any way "apolitical". + we recognize the responsibility we are taking upon ourselves by running a search engine, + and will always respect ethics. +

+
+
+

customizable

+ lorem ipsum dolor sit amet +

+ we aim to design askLyphe in a way that makes personalizing your search results easy and fun! +
+
+ currently we provide a short list of unique themes to let you properly express yourself through your + searching experience, however in the future we also plan to let you customize many more aspects of + the experience, such as through manual ranking personalisation and complications! +

+
+
+

useful, but fun!

+ lorem ipsum dolor sit amet +

+ our search engine does not rely on (however may still include, for completeness) results from + Google, Bing, or any other search engine out there. +
+
+ because of this, we're able to find websites that other search engines would have trouble finding, + and bring personality and humanity back to the web! +
+ however, we also recognize that there are many queries that we simply do not have enough information + to handle + in order to fix this issue, we have a system called +
+ complications! +
+
+ askLyphe complications act in a similar way to watch complications, they show relevant answers to + your + queries with information from trusted sources! +
+ want to find information on the microsoft corporation? + just search "microsoft" to get results from our wikipedia complication! + need to convert 500 feet to kilometers? + just search "500 ft to km" to get results from our unit conversion complication! +
+
+ plus, we're constantly working on developing new complications, and will allow full customization of the + complications + that you see in your results! +

+
+
+

fourth box!

+ lorem ipsum dolor sit amet +

+ i haven't decided what to put here yet! we're still in alpha so i'm sure i'll come up with something + eventually, but i wanted this fourth box because i feel like the design flows nicer with it (: +
+
+ ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. + duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. +
+ excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id + est laborum. +

+
+
+
+
+ +{% include "ui/footer.html" %} +{% endblock %} diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..0d6296d --- /dev/null +++ b/templates/home.html @@ -0,0 +1,74 @@ +{% extends "shell.html" %} + +{% block title %}Home{% endblock %} + +{% block head %} + + + +{% endblock %} + +{% block page %} +
+ {% include "ui/userbar.html" %} + {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% endif %} +
+
+
+ image of lyphe, our mascot! +
+
+ ask Lyphe! +

the best search engine!

+
+
+
+ + + +
+ +
+

{{ count }} sites indexed!

+ + + + {% match announcement %} + {% when Some with (a) %} +
+ {{ a.date }} +

{{ a.title }}

+

{{ a.content }}

+

Read More...

+
+ {% when None %} + {% endmatch %} +
+ {% include "ui/footer.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/image_search.html b/templates/image_search.html new file mode 100644 index 0000000..0adb67c --- /dev/null +++ b/templates/image_search.html @@ -0,0 +1,64 @@ +{% extends "shell.html" %} + +{% block title %}Images - {{ search_query }}{% endblock %} + +{% block head %} + + +{% if search_query == "notnite" %}{% endif %} +{% endblock %} + +{% block page %} +
+ {% include "ui/userbar.html" %} + {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% endif %} + {% include "ui/navbar_image.html" %} + + + +
+
+
+ {% match error %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} + {% match note %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} + {% endmatch %} +
+
+ {% for result in search_results %} +
+ + image result + +
+ {% endfor %} +
+ {% if blocked.len() > 0 %} + {{ blocked.len() }} results were pruned from search results for the following reasons: +
    + {% for (url, reason) in blocked %} +
  1. "{{ url }}" because "{{ reason }}"
  2. + {% endfor %} +
+ {% endif %} +
+ {% endmatch %} +
+
+
+ + {% include "ui/footer.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/loremipsum.html b/templates/loremipsum.html new file mode 100644 index 0000000..dab8b7b --- /dev/null +++ b/templates/loremipsum.html @@ -0,0 +1,20 @@ +onsectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +
+
+ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. +duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla +pariatur. +
+excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id +est laborum. +
+
+sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, +totam +rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt +explicabo. +
+nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur +magni +dolores eos qui ratione voluptatem sequi nesciunt. diff --git a/templates/search.html b/templates/search.html new file mode 100644 index 0000000..db6868b --- /dev/null +++ b/templates/search.html @@ -0,0 +1,100 @@ +{% extends "shell.html" %} + +{% block title %}{{ search_query }}{% endblock %} + +{% block head %} + + +{% if search_query == "notnite" %}{% endif %} +{% endblock %} + +{% block page %} +
+ {% include "ui/userbar.html" %} + {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% endif %} + {% include "ui/navbar.html" %} + + + +
+
+
+ {% match error %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} + {% match note %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} + {% endmatch %} +
found {{ search_results.len() }} results in {{ query_time }} seconds ({{ + page_rank_time + }} was pageranking) +
+
+
+ {% if complications.disabled %} +
+ complications disabled for this query +
+ {% endif %} + {% match complications.unit_converter %} + {% when Some with (conversion) %} +
+ lyphe unit converter + {{ conversion.value }} {{ conversion.unit_a }} = {{ conversion.equals }} {{ conversion.unit_b }} +
+ {% when None %} + {% endmatch %} + {% match complications.wikipedia %} + {% when Some with (wikipedia) %} + + {% when None %} + {% endmatch %} +
+
    + {% for result in search_results %} + {% include "ui/search_result.html" %} + {% endfor %} +
+ {% if blocked.len() > 0 %} + {{ blocked.len() }} results were pruned from search results for the following reasons: +
    + {% for (url, reason) in blocked %} +
  1. "{{ url }}" because "{{ reason }}"
  2. + {% endfor %} +
+ {% endif %} +
+ {% endmatch %} +
+
+
+ + {% include "ui/footer.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/search_js.html b/templates/search_js.html new file mode 100644 index 0000000..aa55755 --- /dev/null +++ b/templates/search_js.html @@ -0,0 +1,79 @@ +{% extends "shell.html" %} + +{% block title %}{{ search_query }}{% endblock %} + +{% block head %} + + +{% if search_query == "notnite" %}{% endif %} + +{% endblock %} + +{% block page %} +
+ {% include "ui/userbar.html" %} + {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% endif %} + {% include "ui/navbar.html" %} + + + +
+
+
+ {% match error %} + {% when Some with (val) %} +
{{ val }}
+ {% when None %} +
+
+ {% if complications.disabled %} +
+ complications disabled for this query +
+ {% endif %} + {% match complications.unit_converter %} + {% when Some with (conversion) %} +
+ lyphe unit converter + {{ conversion.value }} {{ conversion.unit_a }} = {{ conversion.equals }} {{ conversion.unit_b }} +
+ {% when None %} + {% endmatch %} + {% match complications.wikipedia %} + {% when Some with (wikipedia) %} + + {% when None %} + {% endmatch %} +
+
+ {% endmatch %} +
+
+
+ + {% include "ui/footer.html" %} +
+{% endblock %} \ No newline at end of file diff --git a/templates/shell.html b/templates/shell.html new file mode 100644 index 0000000..aa1802e --- /dev/null +++ b/templates/shell.html @@ -0,0 +1,22 @@ + + + + + + + AskLyphe - {% block title %}{% endblock %} + + + + + + + {% block head %}{% endblock %} + + + {% block page %}{% endblock %} + + \ No newline at end of file diff --git a/templates/ui/footer.html b/templates/ui/footer.html new file mode 100644 index 0000000..4764e6c --- /dev/null +++ b/templates/ui/footer.html @@ -0,0 +1,31 @@ + \ No newline at end of file diff --git a/templates/ui/navbar.html b/templates/ui/navbar.html new file mode 100644 index 0000000..b9c6424 --- /dev/null +++ b/templates/ui/navbar.html @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/templates/ui/navbar_image.html b/templates/ui/navbar_image.html new file mode 100644 index 0000000..9d2bfee --- /dev/null +++ b/templates/ui/navbar_image.html @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/templates/ui/search_result.html b/templates/ui/search_result.html new file mode 100644 index 0000000..772e511 --- /dev/null +++ b/templates/ui/search_result.html @@ -0,0 +1,25 @@ +
  • + +

    {% match result.title %}{% when Some with (title) %}{{ title }}{% when None %}{{ result.url }}{% endmatch %}

    + + {% match result.title %} + {% when Some with (_) %}{{ result.url }}{% when None %} + {% endmatch %} + ({{ result.percentage }}%, {{ result.value }} / {{ max_relevance }}) + + {% if result.asklyphe %} + + {% endif %} + {% if result.bing %} + + {% endif %} + {% if result.google %} + + {% endif %} + + + {% match result.description %}{% when Some with (description) %} + {{ description }} + {% when None %}{% endmatch %} +
    +
  • \ No newline at end of file diff --git a/templates/ui/userbar.html b/templates/ui/userbar.html new file mode 100644 index 0000000..a14dc4f --- /dev/null +++ b/templates/ui/userbar.html @@ -0,0 +1,10 @@ +
    + welcome {{ info.username }}! + {%if info.administrator %} + admin + {% endif %} + settings +
    + +
    +
    diff --git a/templates/user_settings.html b/templates/user_settings.html new file mode 100644 index 0000000..c09a8f8 --- /dev/null +++ b/templates/user_settings.html @@ -0,0 +1,68 @@ +{% extends "shell.html" %} + +{% block title %}{{ search_query }}{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block page %} +
    + {% include "ui/userbar.html" %} + {% if alpha %}WARNING! askLyphe is in alpha! user experience is in no way representative of the final product!{% + endif %} + {% include "ui/navbar.html" %} + +
    +
    + {% match error %} + {% when Some with (val) %} +
    {{ val }}
    + {% when None %} + {% endmatch %} +
    +
    +
    +

    username

    + {{ info.username }} (cannot currently be changed) +
    +
    +

    email

    + {{ info.email }} +
    + to change your email, you must email an administrator at devnull@voremicrocomputers.com +
    + (this will be changed in the future) +
    +
    +

    change password

    + this cannot currently be performed (which we are also working on fixing) +
    +
    +
    +
    +

    theme

    + {% for t in themes %} + {%if theme==t.value%} +

    your current theme is: "{{t.name}}"

    + {%endif%} + {% endfor %} +
    + + + +
    +
    +
    +
    +
    +
    + + {% include "ui/footer.html" %} +
    +{% endblock %} \ No newline at end of file