forked from spacebar/SplatNet-Backend
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ceb17282ec | |||
| 54041297e6 | |||
| 03c11b4462 | |||
| 2933b3bba0 | |||
| 9625b1be62 | |||
| d4d6fd3d07 | |||
| 432931aab2 | |||
| c696d306aa | |||
|
b299191514 |
|||
| 2b4e9ae7c0 | |||
| a3571f971d | |||
| 0cecc52a55 | |||
| d81f451963 | |||
| 014e59b234 | |||
| 4e5d08b7fc | |||
| ddfacaf4a5 | |||
| 702abc832d | |||
| a90061f692 | |||
| ad0cf39647 | |||
| 86792bc48e | |||
| 8097e6f278 | |||
| e37aa0dc37 | |||
| d42f74c81c | |||
| 0b7b272117 | |||
| 6f3bb98524 | |||
| 17682b74d1 | |||
| 2293547d97 | |||
| ac59d976da | |||
| 8d9909a9ed | |||
|
8b532e831e |
|||
|
3065a4d51e |
|||
|
cf9a05855f |
|||
|
aa5e9e5be0 |
|||
| 09a2f6f69d | |||
| 7f187bdad9 | |||
| 35a6c0db78 | |||
| c4fe4f1bf1 | |||
| ca8090d20d | |||
| 0b5e56b69b | |||
| c89806fe87 | |||
| 13afb709c5 | |||
| 2d703c78b3 | |||
| 75dca3509e | |||
| 2f59f2f315 | |||
| e12611b812 | |||
| e013c5930f | |||
| 269f9f4058 | |||
| 40fce749ba | |||
| c4b503c208 | |||
| d650edd883 | |||
| 313dfa3cec | |||
| 3954801823 | |||
| 2ac86b3fc6 | |||
| fdfde0fb3d | |||
| ceeed0dade | |||
| aaef1e7ecd | |||
| d776c11555 | |||
| 53c9ce2653 | |||
| 39f0ff2bf9 | |||
| 9d778f39a7 | |||
| 1dfa7bccf2 | |||
| 54ceec85fb | |||
| d6c4ddac44 | |||
| ffe66d1377 | |||
| cbaa1fa941 | |||
| 0d91d6a566 | |||
| c410aa4074 | |||
|
|
f42880bec2 | ||
|
|
95a022d479 | ||
|
|
a4ebf2f106 | ||
|
|
bfe7f02099 | ||
|
|
78c1c709fb | ||
| 41b0c3297e | |||
| d5819ceec6 | |||
| 889db3abab | |||
| 65d2c9dc20 | |||
| d916aaece5 | |||
| d885899baf | |||
| ab469e203f | |||
| 458eddc65f | |||
| 1e8ebd0f44 | |||
|
|
3fe3913aa2 | ||
|
|
37f7399edb | ||
| 88e7a89f25 | |||
| 027430953b | |||
| 5c23336fcf | |||
| 8e528bc0d9 | |||
| ff8f5e29aa | |||
| ab391b8997 | |||
|
049d33ea47 |
|||
| 6e4fb00675 | |||
| 4d7b3f9bae | |||
| 1f146fb558 | |||
| 54c01fdc54 | |||
| b5eab7ac9e | |||
| 953754b537 | |||
| 37af414473 | |||
| 0f027550e6 | |||
| ed9dedeef9 | |||
| 69cbe960d7 | |||
| d557e8c370 | |||
| 6890e59809 | |||
| a43a555a34 | |||
| 0b435e97be | |||
| d554353008 | |||
| 8a41f1ae93 | |||
| 6579f8add6 | |||
| 658c2ea006 | |||
| e80add0c06 | |||
| 903318754a | |||
| 6c30bf69c3 | |||
| 9b00783f38 | |||
| 33a8f8c315 | |||
| 8caf832ba9 | |||
| cbb3b4fdad | |||
| 17a70cac80 | |||
| 1aa6fc0371 | |||
| 0fda25d76c | |||
| 38cd3603b9 | |||
| c6efe237ed | |||
| 650741f7e6 | |||
| 731e95feb5 | |||
| ab10f2e4e5 | |||
| 2adf1f58a0 | |||
| bd9502cf29 | |||
| 57df5ce4cc | |||
| bb9b35e58c | |||
| c287dc0d84 | |||
| 7c65fb4d31 | |||
| 2da6d21979 | |||
| 6e084400db | |||
| 7e626a1503 | |||
|
|
e105f4e0fa | ||
|
|
a30f3eca46 | ||
| 5b1bafea17 | |||
| 15ed13086f | |||
| 02a14ce457 | |||
| d80bf323ac | |||
| 66d4bc0771 | |||
| 683057221c | |||
| 0e082c65d2 | |||
|
|
cc30baa5f0 | ||
|
|
5712238297 | ||
| 581c950261 | |||
| ccd63e713b | |||
| e265b4e5cd | |||
| 995f85a6fa | |||
| dfdca8fc2a | |||
| 4b3e128221 | |||
| de640f00d6 | |||
| b0c4af716a | |||
| 27c93f6f5b | |||
| cc27b1166f | |||
| 91b77c034e | |||
|
01063d489a |
|||
|
8a846c0880 |
|||
|
|
57ebc98406 | ||
|
15fcd601fc |
|||
|
03975c1f5f |
|||
| 49a795733b | |||
|
|
f39291b8fc | ||
|
|
755be835c0 | ||
|
|
d423d62642 | ||
|
|
80f012d41f | ||
|
|
e44377ed7a | ||
|
|
258c1e18f6 | ||
|
0989c091be |
|||
|
|
2949429354 | ||
|
cd21bf5617 |
|||
|
fcdac7ffe5 |
|||
|
234ea0dcdb |
|||
|
|
2c0e8f7704 | ||
|
7953f406a9 |
|||
|
bf7dabf817 |
|||
|
|
d60daa1672 | ||
|
|
f85d5daa2d | ||
|
|
87cbe99ab4 | ||
|
d9af7b3305 |
|||
|
|
d57d0a1ed8 | ||
|
|
b1f4e39850 | ||
|
|
fbe1297a5e | ||
|
|
6d027aa601 | ||
|
|
bd9b09d082 | ||
|
572ab6c047 |
|||
|
dd1a6227dc |
|||
|
d4b4928443 |
|||
|
|
e73bf9769e | ||
|
|
ac67a8dcb9 | ||
|
0947d1d1a6 |
|||
|
|
17c4eace0c | ||
|
|
b84a3c53ed | ||
|
|
2e4773991a | ||
|
f2760a172f |
|||
|
8d94df35d3 |
|||
|
|
428197972b | ||
|
|
858dcd46b2 | ||
|
|
b45d2c99f4 | ||
|
|
118e36caf0 | ||
|
|
755cddda39 | ||
|
30089971a1 |
|||
|
af97e95e10 |
|||
|
491a6f0578 |
|||
|
|
cbbe1a9e7c | ||
|
|
71116685d2 | ||
|
f7efea8729 |
|||
|
d81d7d7293 |
|||
|
a630bd34a4 |
|||
|
f64e61dd08 |
|||
|
e616167ecd |
|||
|
|
2814425728 | ||
|
|
47f37425da | ||
|
|
2205905677 | ||
|
|
8199cdc256 | ||
|
|
dbe09f2829 | ||
|
|
c61c8dac0c | ||
|
|
a7e117db9a | ||
|
|
4b90f753a5 | ||
|
|
26825a5a82 | ||
|
|
3965646e39 | ||
|
3b40d565a4 |
|||
|
|
bcbdc92f53 | ||
|
|
a985a72567 |
32 changed files with 1608 additions and 2038 deletions
|
|
@ -7,16 +7,19 @@ on:
|
|||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: debian-bookworm
|
||||
runs-on: ${{ vars.RUNNER_LABEL }}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: install docker???
|
||||
run: apt update && apt install wget -y && wget "https://download.docker.com/linux/debian/dists/bookworm/pool/stable/amd64/docker-ce-cli_29.2.1-1~debian.12~bookworm_amd64.deb" && dpkg --force-confold -i "docker-ce-cli_29.2.1-1~debian.12~bookworm_amd64.deb"
|
||||
run: |
|
||||
apt update && apt install wget cmake -y && \
|
||||
wget "https://download.docker.com/linux/debian/dists/bookworm/pool/stable/amd64/docker-ce-cli_29.2.1-1~debian.12~bookworm_amd64.deb" && \
|
||||
dpkg --force-confold -i "docker-ce-cli_29.2.1-1~debian.12~bookworm_amd64.deb"
|
||||
|
||||
- name: set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: login
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
|
|
|
|||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,6 +1,9 @@
|
|||
__pycache__
|
||||
.env
|
||||
boss.yaml
|
||||
fes_boss.yaml
|
||||
node_modules
|
||||
build
|
||||
splatnet_backend.egg-info
|
||||
venv/*
|
||||
.venv/*
|
||||
|
|
@ -1 +1 @@
|
|||
3.11
|
||||
3.14
|
||||
|
|
|
|||
235
LICENSE
235
LICENSE
|
|
@ -1,235 +0,0 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
splatnet-backend
|
||||
Copyright (C) 2026 kittentm
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.
|
||||
104
LICENSE.md
Normal file
104
LICENSE.md
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
# PolyForm Strict License 1.0.0
|
||||
|
||||
<https://polyformproject.org/licenses/strict/1.0.0>
|
||||
|
||||
## Acceptance
|
||||
|
||||
In order to get any license under these terms, you must agree
|
||||
to them as both strict obligations and conditions to all
|
||||
your licenses.
|
||||
|
||||
## Copyright License
|
||||
|
||||
The licensor grants you a copyright license for the software
|
||||
to do everything you might do with the software that would
|
||||
otherwise infringe the licensor's copyright in it for any
|
||||
permitted purpose, other than distributing the software or
|
||||
making changes or new works based on the software.
|
||||
|
||||
## Patent License
|
||||
|
||||
The licensor grants you a patent license for the software that
|
||||
covers patent claims the licensor can license, or becomes able
|
||||
to license, that you would infringe by using the software.
|
||||
|
||||
## Noncommercial Purposes
|
||||
|
||||
Any noncommercial purpose is a permitted purpose.
|
||||
|
||||
## Personal Uses
|
||||
|
||||
Personal use for research, experiment, and testing for
|
||||
the benefit of public knowledge, personal study, private
|
||||
entertainment, hobby projects, amateur pursuits, or religious
|
||||
observance, without any anticipated commercial application,
|
||||
is use for a permitted purpose.
|
||||
|
||||
## Noncommercial Organizations
|
||||
|
||||
Use by any charitable organization, educational institution,
|
||||
public research organization, public safety or health
|
||||
organization, environmental protection organization,
|
||||
or government institution is use for a permitted purpose
|
||||
regardless of the source of funding or obligations resulting
|
||||
from the funding.
|
||||
|
||||
## Fair Use
|
||||
|
||||
You may have "fair use" rights for the software under the
|
||||
law. These terms do not limit them.
|
||||
|
||||
## No Other Rights
|
||||
|
||||
These terms do not allow you to sublicense or transfer any of
|
||||
your licenses to anyone else, or prevent the licensor from
|
||||
granting licenses to anyone else. These terms do not imply
|
||||
any other licenses.
|
||||
|
||||
## Patent Defense
|
||||
|
||||
If you make any written claim that the software infringes or
|
||||
contributes to infringement of any patent, your patent license
|
||||
for the software granted under these terms ends immediately. If
|
||||
your company makes such a claim, your patent license ends
|
||||
immediately for work on behalf of your company.
|
||||
|
||||
## Violations
|
||||
|
||||
The first time you are notified in writing that you have
|
||||
violated any of these terms, or done anything with the software
|
||||
not covered by your licenses, your licenses can nonetheless
|
||||
continue if you come into full compliance with these terms,
|
||||
and take practical steps to correct past violations, within
|
||||
32 days of receiving notice. Otherwise, all your licenses
|
||||
end immediately.
|
||||
|
||||
## No Liability
|
||||
|
||||
***As far as the law allows, the software comes as is, without
|
||||
any warranty or condition, and the licensor will not be liable
|
||||
to you for any damages arising out of these terms or the use
|
||||
or nature of the software, under any kind of legal claim.***
|
||||
|
||||
## Definitions
|
||||
|
||||
The **licensor** is the individual or entity offering these
|
||||
terms, and the **software** is the software the licensor makes
|
||||
available under these terms.
|
||||
|
||||
**You** refers to the individual or entity agreeing to these
|
||||
terms.
|
||||
|
||||
**Your company** is any legal entity, sole proprietorship,
|
||||
or other kind of organization that you work for, plus all
|
||||
organizations that have control over, are under the control of,
|
||||
or are under common control with that organization. **Control**
|
||||
means ownership of substantially all the assets of an entity,
|
||||
or the power to direct its management and policies by vote,
|
||||
contract, or otherwise. Control can be direct or indirect.
|
||||
|
||||
**Your licenses** are all the licenses granted to you for the
|
||||
software under these terms.
|
||||
|
||||
**Use** means anything you do with the software requiring one
|
||||
of your licenses.
|
||||
38
README.md
38
README.md
|
|
@ -3,9 +3,8 @@
|
|||
<br>
|
||||
|
||||
<img src="https://git.crafterpika.cc/kittentm/splatnet-backend/raw/branch/main/currentprogress.png" height=50px>
|
||||
<img src="https://progress-bar.xyz/40?title=&height=20&show_text=false" width="100%" height=20px>
|
||||
<img src="https://progress-bar.xyz/65?title=&height=20&show_text=false" width="100%" height=20px>
|
||||
<br>
|
||||
<strong>Basically 0% lol</strong>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
|
@ -13,33 +12,43 @@
|
|||
|
||||
# SplatNet
|
||||
|
||||
[](https://git.crafterpika.cc/kittentm/splatnet-backend/commits/branch/main)
|
||||

|
||||
[](https://git.crafterpika.cc/kittentm/splatnet-backend/actions)
|
||||
[](https://git.crafterpika.cc/kittentm/splatnet-backend)
|
||||
[](https://git.crafterpika.cc/kittentm/splatnet-backend)
|
||||
[](https://git.crafterpika.cc/kittentm/splatnet-backend/src/branch/main/LICENSE)
|
||||

|
||||

|
||||
|
||||
This is the backend for the [SplatNet](https://git.crafterpika.cc/kittentm/splatnet) Revival frontend.
|
||||
|
||||
</div>
|
||||
|
||||
This is the backend for the [SplatNet](https://git.crafterpika.cc/kittentm/splatnet) Revival frontend. It is a combination of Python & JS.
|
||||
|
||||
## Self-hosting
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This project is not easy to self host!! Please please please read the console logs before asking for help.
|
||||
|
||||
### Running from source
|
||||
|
||||
To start, install Python `3.11+`. While newer versions aren't tested they should work fine. Dependencies are installed using
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
### Installing from source
|
||||
|
||||
Telemetry is technically not required for the server to run, however it is required for most functions on the website. Judd is run via Node `/judd`. First change directories to Judd, and install the node modules.
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
To start, install either Python `3.11` or `3.12`. While newer versions aren't tested they should work fine. Note that anything **ABOVE** 3.12 will require building oead from source, as it is a required dependency. View their documentation [here](https://oead.readthedocs.io/en/stable/about.html#building-from-source). Then install using:
|
||||
```
|
||||
pip install . -v
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> It is not required to run in verbose, however is reccomended as otherwise it looks like it has hung. The installation progress will take awhile as it copies all Node modules.
|
||||
|
||||
Now you must configure your `.env` A example `.env` is included for you. For a full explanation, jump to [.env configuration](https://git.crafterpika.cc/kittentm/splatnet-backend#env-configuration).
|
||||
Once done, run `/main.py`. This will launch both the frontend api & telemetry.
|
||||
Once done, run:
|
||||
```
|
||||
splatnet
|
||||
```
|
||||
This uses the `.env` found in your current directory.
|
||||
|
||||
### Docker
|
||||
Alternatively, this is available as a Docker image.
|
||||
|
|
@ -78,6 +87,9 @@ The .env file is used for server setup. A example one with the fields already th
|
|||
| `cookie_secure` | `bool` | `True` | Primarily for debugging, controls the flag in cookies |
|
||||
| `judd_port` | `int` | `4000` | The port the Judd (telemetry) server will listen on |
|
||||
| `webhook_url` | str | *Required* | Where logging of blacklist.json will be sent to |
|
||||
| `twitter_client_id` | `str` | *Required* | Twitter API client id |
|
||||
| `twitter_client_secret` | `str` | *Required* | Twitter API Client secret |
|
||||
| `twitter_redirect_uri` | `str` | *Required* | Where twitter redirects after logging in. Must match whats set in the API key. |
|
||||
|
||||
> [!TIP]
|
||||
> For dumping your boss keys, see [this](https://github.com/PretendoNetwork/BetterKeyDumper/releases/tag/v1.0.0) HBL app. Note that the keys shown on the screen are garbage, I reccomend using a hex editor on the files it dumps.
|
||||
65
code_of_conduct.md
Normal file
65
code_of_conduct.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Spacebar Network Code of Conduct
|
||||
|
||||
This repository adheres to the official Spacebar Network Code of Conduct ("COC.") These regulations extend to the entire Spacebar network, our official Discord community, and all Git repositories. By choosing to interact with our community, you are entering into a social contract designed to protect the integrity of the project and the well-being of its members.
|
||||
|
||||
> **Note:** If you wish to propose changes or simply view the COC, the primary residence and master copy of this Code of Conduct can be found [here](https://git.spbr.net/spacebar/policy).
|
||||
|
||||
If you intend to contribute code, participate in community discussions, or experience any element of the Spacebar ecosystem, you must strictly abide by the standards and expectations set forth in this Covenant. We believe that a healthy community is built on mutual respect and shared responsibility. Our goal is to foster a space that is welcoming, inclusive, and free from harassment for everyone, regardless of their background or level of experience. Failure to adhere to these principles may result in removal from the network, as we prioritize maintaining a safe and productive environment for all participants.
|
||||
|
||||
---
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We pledge to make the Spacebar community welcoming, safe, and equitable for all.
|
||||
|
||||
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
|
||||
|
||||
## Encouraged Behaviors
|
||||
|
||||
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
|
||||
|
||||
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
|
||||
|
||||
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
|
||||
2. Engaging **kindly and honestly** with others.
|
||||
3. Respecting **different viewpoints** and experiences.
|
||||
4. **Taking responsibility** for our actions and contributions.
|
||||
5. Gracefully giving and accepting **constructive feedback**.
|
||||
6. Committing to **repairing harm** when it occurs.
|
||||
7. Behaving in other ways that promote and sustain the **well-being of our community**.
|
||||
|
||||
## Restricted Behaviors
|
||||
|
||||
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
|
||||
|
||||
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
|
||||
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
|
||||
3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
|
||||
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
|
||||
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
|
||||
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
|
||||
7. Behaving in other ways that **threaten the well-being** of our community.
|
||||
|
||||
### Other Restrictions
|
||||
|
||||
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
|
||||
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute. If you are found to be using SDK material, all of your content commited towards Spacebar will be removed. No exceptions.
|
||||
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
|
||||
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
|
||||
5. **Discussion of Piracy, or anything relating.**
|
||||
|
||||
## Reporting an Issue
|
||||
|
||||
When an incident occurs, it is important to report it promptly. To report a possible violation, please contact the Spacebar Maintainers via contacting a SPFN or SPBR developer on the discord server found [here](https://discord.gg/grMSxZf).
|
||||
|
||||
Spacebar moderators take reports seriously and will respond in a timely manner. They will investigate all reports by reviewing logs, messages, or interviewing participants. We aim to keep enforcement actions transparent while prioritizing the safety and confidentiality of those involved.
|
||||
|
||||
---
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
|
||||
|
||||
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
|
||||
|
||||
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources).
|
||||
|
|
@ -18,6 +18,7 @@ class Settings(BaseSettings):
|
|||
twitter_client_id: str
|
||||
twitter_client_secret: str
|
||||
twitter_redirect_uri: str
|
||||
account_client_secret: str
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=[
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
FROM python:3.11-slim
|
||||
FROM python:3.14-slim
|
||||
|
||||
RUN apt-get update && apt-get install -y curl build-essential \
|
||||
RUN apt-get update && apt-get install -y curl build-essential cmake \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm@latest \
|
||||
|
|
|
|||
|
|
@ -1,14 +1,31 @@
|
|||
const crypto = require('crypto');
|
||||
|
||||
function validateBOSSDigestMiddleware(request, response, next) {
|
||||
// prevents viewing it in a browser to fucking up the process lmfao
|
||||
if (request.method === 'GET') {
|
||||
return response.status(404).send('Not Found');
|
||||
}
|
||||
|
||||
try {
|
||||
// try to catch undefined, previously was making everything die
|
||||
if (!request.rawBody) {
|
||||
throw new Error('rawBody is undefined');
|
||||
}
|
||||
|
||||
const calculatedHash = crypto.createHash('sha1').update(request.rawBody).digest('hex');
|
||||
const expectedHash = request.headers['x-boss-digest'];
|
||||
|
||||
//catch all other errors
|
||||
if (calculatedHash !== expectedHash) {
|
||||
return next('Provided BOSS digest does not match the calculated hash');
|
||||
console.warn(`[Digest Mismatch] Expected: ${expectedHash}, Calculated: ${calculatedHash}`);
|
||||
return response.status(403).send('Provided BOSS digest does not match the calculated hash');
|
||||
}
|
||||
|
||||
next();
|
||||
} catch (error) {
|
||||
console.error('[Digest Middleware Error]:', error.message);
|
||||
return response.status(500).send('Internal Server Error');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = validateBOSSDigestMiddleware;
|
||||
|
|
@ -64,6 +64,8 @@ const SplatfestResult = connection.define('SplatfestResult', {
|
|||
MemoryHash: { type: DataTypes.BIGINT },
|
||||
Paint_Alpha: { type: DataTypes.INTEGER },
|
||||
Paint_Bravo: { type: DataTypes.INTEGER },
|
||||
RemainCount_Alpha: { type: DataTypes.INTEGER },
|
||||
RemainCount_Bravo: { type: DataTypes.INTEGER },
|
||||
FaceImg: { type: DataTypes.BLOB }
|
||||
}, {
|
||||
tableName: 'results',
|
||||
|
|
|
|||
1247
judd/package-lock.json
generated
1247
judd/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -11,15 +11,16 @@
|
|||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"discord.js": "^14.25.1",
|
||||
"express": "^4.18.2",
|
||||
"express-rate-limit": "^8.3.1",
|
||||
"express-subdomain": "^1.0.5",
|
||||
"joi": "^17.7.0",
|
||||
"morgan": "^1.10.0",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"pg": "^8.18.0",
|
||||
"axios": "^1.15.2",
|
||||
"discord.js": "^14.26.3",
|
||||
"express": "^5.2.1",
|
||||
"express-rate-limit": "^8.3.2",
|
||||
"express-subdomain": "^1.0.6",
|
||||
"joi": "^18.1.2",
|
||||
"morgan": "^1.10.1",
|
||||
"multer": "^2.1.1",
|
||||
"pg": "^8.20.0",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"sequelize": "^6.37.7"
|
||||
"sequelize": "^6.37.8"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"weapons": [1000, 1001, 1002, 1003, 1100, 1200, 1800, 1801, 2000, 2001, 2002, 2003, 5000],
|
||||
"weapons": [],
|
||||
"clothes": [26061, 26062, 26063, 26064, 26065, 26066, 26067, 26068, 26069, 26070, 26071, 26072, 26073, 26074, 26075, 26076, 26077, 26078, 26079, 26080, 26081, 26082, 26083, 26084, 26085, 26086, 26087, 26088, 26089, 26090, 26091, 26092, 26093, 26094, 26095, 26096, 26097, 26098, 26099, 26100, 26101, 26102, 26103, 26104, 26105, 26106, 26107, 26108, 26109, 26110, 26111, 26112, 26113, 26114, 26115, 26116, 26117, 26118, 26119, 26120, 26121, 26122, 26123, 26124, 26125, 26126, 26127, 26128, 26129, 26130, 26131, 26132, 26133, 26134, 26135, 26136],
|
||||
"rules": [-1]
|
||||
}
|
||||
|
|
@ -32,110 +32,97 @@
|
|||
"15": "Mahi-Mahi Resort (ID=15)"
|
||||
},
|
||||
"weapons_main": {
|
||||
"100": "Sploosh-o-matic (ID=100)",
|
||||
"101": "Neo Sploosh-o-matic (ID=101)",
|
||||
"102": "Splattershot Jr. (ID=102)",
|
||||
"103": "Custom Splattershot Jr. (ID=103)",
|
||||
"104": "Splash-o-matic (ID=104)",
|
||||
"105": "Neo Splash-o-matic (ID=105)",
|
||||
"106": "Aerospray MG (ID=106)",
|
||||
"107": "Aerospray RG (ID=107)",
|
||||
"108": "Splattershot (ID=108)",
|
||||
"109": "Tentatek Splattershot (ID=109)",
|
||||
"110": "Hero Shot Replica (ID=110)",
|
||||
"111": "Octoshot Replica (ID=111)",
|
||||
"112": ".52 Gal (ID=112)",
|
||||
"113": ".52 Gal Deco (ID=113)",
|
||||
"114": "N-ZAP '85 (ID=114)",
|
||||
"115": "N-ZAP '89 (ID=115)",
|
||||
"116": "Splattershot Pro (ID=116)",
|
||||
"117": "Forge Splattershot Pro (ID=117)",
|
||||
"118": ".96 Gal (ID=118)",
|
||||
"119": ".96 Gal Deco (ID=119)",
|
||||
"120": "Dual Squelcher (ID=120)",
|
||||
"121": "Custom Dual Squelcher (ID=121)",
|
||||
"122": "Jet Squelcher (ID=122)",
|
||||
"123": "Custom Jet Squelcher (ID=123)",
|
||||
"124": "Luna Blaster (ID=124)",
|
||||
"125": "Luna Blaster Neo (ID=125)",
|
||||
"126": "Blaster (ID=126)",
|
||||
"127": "Custom Blaster (ID=127)",
|
||||
"128": "Range Blaster (ID=128)",
|
||||
"129": "Custom Range Blaster (ID=129)",
|
||||
"130": "Rapid Blaster (ID=130)",
|
||||
"131": "Rapid Blaster Deco (ID=131)",
|
||||
"132": "Rapid Blaster Pro (ID=132)",
|
||||
"133": "Rapid Blaster Pro Deco (ID=133)",
|
||||
"134": "L-3 Nozzlenose (ID=134)",
|
||||
"135": "L-3 Nozzlenose D (ID=135)",
|
||||
"136": "H-3 Nozzlenose (ID=136)",
|
||||
"137": "H-3 Nozzlenose D (ID=137)",
|
||||
"138": "Wasabi Splattershot (ID=138)",
|
||||
"139": "Berry Splattershot Pro (ID=139)",
|
||||
"140": "Sploosh-o-matic 7 (ID=140)",
|
||||
"141": "Aerospray PG (ID=141)",
|
||||
"142": "N-ZAP '83 (ID=142)",
|
||||
"143": "Grim Range Blaster (ID=143)",
|
||||
"144": "Cherry H-3 Nozzlenose (ID=144)",
|
||||
"200": "Carbon Roller (ID=200)",
|
||||
"201": "Carbon Roller Deco (ID=201)",
|
||||
"202": "Splat Roller (ID=202)",
|
||||
"203": "Krak-On Splat Roller (ID=203)",
|
||||
"204": "Hero Roller Replica (ID=204)",
|
||||
"205": "Dynamo Roller (ID=205)",
|
||||
"206": "Gold Dynamo Roller (ID=206)",
|
||||
"207": "Inkbrush (ID=207)",
|
||||
"208": "Inkbrush Nouveau (ID=208)",
|
||||
"209": "Octobrush (ID=209)",
|
||||
"210": "Octobrush Nouveau (ID=210)",
|
||||
"211": "Tempered Dynamo Roller (ID=211)",
|
||||
"212": "Permanent Inkbrush (ID=212)",
|
||||
"213": "CoroCoro Splat Roller (ID=213)",
|
||||
"300": "Classic Squiffer (ID=300)",
|
||||
"301": "New Squiffer (ID=301)",
|
||||
"302": "Splat Charger (ID=302)",
|
||||
"303": "Kelp Splat Charger (ID=303)",
|
||||
"304": "Hero Charger Replica (ID=304)",
|
||||
"305": "Splatterscope (ID=305)",
|
||||
"306": "Kelp Splatterscope (ID=306)",
|
||||
"307": "E-liter 3K (ID=307)",
|
||||
"308": "Custom E-liter 3K (ID=308)",
|
||||
"309": "E-liter 3K Scope (ID=309)",
|
||||
"310": "Custom E-liter 3K Scope (ID=310)",
|
||||
"311": "Bamboozler 14 Mk I (ID=311)",
|
||||
"312": "Bamboozler 14 Mk II (ID=312)",
|
||||
"313": "Fresh Squiffer (ID=313)",
|
||||
"314": "Bamboozler 14 Mk III (ID=314)",
|
||||
"315": "Bento Splat Charger (ID=315)",
|
||||
"316": "Bento Splatterscope (ID=316)",
|
||||
"400": "Slosher (ID=400)",
|
||||
"401": "Slosher Deco (ID=401)",
|
||||
"402": "Tri-Slosher (ID=402)",
|
||||
"403": "Tri-Slosher Nouveau (ID=403)",
|
||||
"404": "Sloshing Machine (ID=404)",
|
||||
"405": "Sloshing Machine Neo (ID=405)",
|
||||
"406": "Soda Slosher (ID=406)",
|
||||
"500": "Mini Splatling (ID=500)",
|
||||
"501": "Zink Mini Splatling (ID=501)",
|
||||
"502": "Heavy Splatling (ID=502)",
|
||||
"503": "Heavy Splatling Deco (ID=503)",
|
||||
"504": "Hydra Splatling (ID=504)",
|
||||
"505": "Custom Hydra Splatling (ID=505)",
|
||||
"506": "Refurbished Mini Splatling (ID=506)",
|
||||
"507": "Heavy Splatling Remix (ID=507)",
|
||||
"1000": "?Shot_Msn0Lv0 (ID=1000)",
|
||||
"1001": "?Shot_Msn0Lv1 (ID=1001)",
|
||||
"1002": "?Shot_Msn0Lv2 (ID=1002)",
|
||||
"1003": "?Shot_Msn0Lv3 (ID=1003)",
|
||||
"1100": "?Roller_Mission (ID=1100)",
|
||||
"1200": "?Charge_Mission (ID=1200)",
|
||||
"1800": "?BigBall_SpecAdjust01 (ID=1800)",
|
||||
"1801": "?BigBall_SpecAdjust02 (ID=1801)",
|
||||
"2000": "?Shot_Rvl0Lv0 (ID=2000)",
|
||||
"2001": "?Shot_Rvl0Lv1 (ID=2001)",
|
||||
"2002": "?Shot_Rvl0Lv2 (ID=2002)",
|
||||
"2003": "?Shot_Rvl0Lv3 (ID=2003)",
|
||||
"5000": "?Roller_KingSquid (ID=5000)"
|
||||
"1000": "Sploosh-o-matic (ID=1000)",
|
||||
"1001": "Neo Sploosh-o-matic (ID=1001)",
|
||||
"1002": "Sploosh-o-matic 7 (ID=1002)",
|
||||
"1010": "Splattershot Jr. (ID=1010)",
|
||||
"1011": "Custom Splattershot Jr. (ID=1011)",
|
||||
"1020": "Splash-o-matic (ID=1020)",
|
||||
"1021": "Neo Splash-o-matic (ID=1021)",
|
||||
"1030": "Aerospray MG (ID=1030)",
|
||||
"1031": "Aerospray RG (ID=1031)",
|
||||
"1032": "Aerospray PG (ID=1032)",
|
||||
"1040": "Splattershot (ID=1040)",
|
||||
"1041": "Tentatek Splattershot (ID=1041)",
|
||||
"1042": "Wasabi Splattershot (ID=1042)",
|
||||
"1045": "Hero Shot Replica (ID=1045)",
|
||||
"1046": "Octoshot Replica (ID=1046)",
|
||||
"1050": ".52 Gal (ID=1050)",
|
||||
"1051": ".52 Gal Deco (ID=1051)",
|
||||
"1060": "N-ZAP '85 (ID=1060)",
|
||||
"1061": "N-ZAP '89 (ID=1061)",
|
||||
"1062": "N-ZAP '83 (ID=1062)",
|
||||
"1070": "Splattershot Pro (ID=1070)",
|
||||
"1071": "Forge Splattershot Pro (ID=1071)",
|
||||
"1072": "Berry Splattershot Pro (ID=1072)",
|
||||
"1080": ".96 Gal (ID=1080)",
|
||||
"1081": ".96 Gal Deco (ID=1081)",
|
||||
"1090": "Dual Squelcher (ID=1090)",
|
||||
"1091": "Custom Dual Squelcher (ID=1091)",
|
||||
"1100": "Jet Squelcher (ID=1100)",
|
||||
"1101": "Custom Jet Squelcher (ID=1101)",
|
||||
"1110": "Luna Blaster (ID=1110)",
|
||||
"1111": "Luna Blaster Neo (ID=1111)",
|
||||
"1120": "Blaster (ID=1120)",
|
||||
"1121": "Custom Blaster (ID=1121)",
|
||||
"1130": "Range Blaster (ID=1130)",
|
||||
"1131": "Custom Range Blaster (ID=1131)",
|
||||
"1132": "Grim Range Blaster (ID=1132)",
|
||||
"1140": "Rapid Blaster (ID=1140)",
|
||||
"1141": "Rapid Blaster Deco (ID=1141)",
|
||||
"1150": "Rapid Blaster Pro (ID=1150)",
|
||||
"1151": "Rapid Blaster Pro Deco (ID=1151)",
|
||||
"1160": "L-3 Nozzlenose (ID=1160)",
|
||||
"1161": "L-3 Nozzlenose D (ID=1161)",
|
||||
"1170": "H-3 Nozzlenose (ID=1170)",
|
||||
"1171": "H-3 Nozzlenose D (ID=1171)",
|
||||
"1172": "Cherry H-3 Nozzlenose (ID=1172)",
|
||||
"2000": "Carbon Roller (ID=2000)",
|
||||
"2001": "Carbon Roller Deco (ID=2001)",
|
||||
"2010": "Splat Roller (ID=2010)",
|
||||
"2011": "Krak-On Splat Roller (ID=2011)",
|
||||
"2012": "CoroCoro Splat Roller (ID=2012)",
|
||||
"2015": "Hero Roller Replica (ID=2015)",
|
||||
"2020": "Dynamo Roller (ID=2020)",
|
||||
"2021": "Gold Dynamo Roller (ID=2021)",
|
||||
"2022": "Tempered Dynamo Roller (ID=2022)",
|
||||
"2030": "Inkbrush (ID=2030)",
|
||||
"2031": "Inkbrush Nouveau (ID=2031)",
|
||||
"2032": "Permanent Inkbrush (ID=2032)",
|
||||
"2040": "Octobrush (ID=2040)",
|
||||
"2041": "Octobrush Nouveau (ID=2041)",
|
||||
"4000": "Classic Squiffer (ID=4000)",
|
||||
"4001": "New Squiffer (ID=4001)",
|
||||
"4002": "Fresh Squiffer (ID=4002)",
|
||||
"4010": "Splat Charger (ID=4010)",
|
||||
"4011": "Kelp Splat Charger (ID=4011)",
|
||||
"4012": "Bento Splat Charger (ID=4012)",
|
||||
"4015": "Hero Charger Replica (ID=4015)",
|
||||
"4020": "Splatterscope (ID=4020)",
|
||||
"4021": "Kelp Splatterscope (ID=4021)",
|
||||
"4022": "Bento Splatterscope (ID=4022)",
|
||||
"4030": "E-liter 3K (ID=4030)",
|
||||
"4031": "Custom E-liter 3K (ID=4031)",
|
||||
"4040": "E-liter 3K Scope (ID=4040)",
|
||||
"4041": "Custom E-liter 3K Scope (ID=4041)",
|
||||
"4050": "Bamboozler 14 Mk I (ID=4050)",
|
||||
"4051": "Bamboozler 14 Mk II (ID=4051)",
|
||||
"4052": "Bamboozler 14 Mk III (ID=4052)",
|
||||
"3000": "Slosher (ID=3000)",
|
||||
"3001": "Slosher Deco (ID=3001)",
|
||||
"3002": "Soda Slosher (ID=3002)",
|
||||
"3010": "Tri-Slosher (ID=3010)",
|
||||
"3011": "Tri-Slosher Nouveau (ID=3011)",
|
||||
"3020": "Sloshing Machine (ID=3020)",
|
||||
"3021": "Sloshing Machine Neo (ID=3021)",
|
||||
"5000": "Mini Splatling (ID=5000)",
|
||||
"5001": "Zink Mini Splatling (ID=5001)",
|
||||
"5002": "Refurbished Mini Splatling (ID=5002)",
|
||||
"5010": "Heavy Splatling (ID=5010)",
|
||||
"5011": "Heavy Splatling Deco (ID=5011)",
|
||||
"5012": "Heavy Splatling Remix (ID=5012)",
|
||||
"5020": "Hydra Splatling (ID=5020)",
|
||||
"5021": "Custom Hydra Splatling (ID=5021)"
|
||||
},
|
||||
"sub_weapons": {
|
||||
"0": "Splat Bomb (ID=0)",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ const router = require('express').Router();
|
|||
const rateLimit = require('express-rate-limit');
|
||||
const titles = require('../titles');
|
||||
const { WebhookClient, EmbedBuilder } = require('discord.js');
|
||||
const axios = require('axios');
|
||||
const lookup = require('./ids.json');
|
||||
const blacklist = require('./blacklist.json');
|
||||
|
||||
|
|
@ -27,8 +28,35 @@ router.post('/post', postLimiter, async (request, response, next) => {
|
|||
|
||||
const ResultTypeModel = title.result_model;
|
||||
const data = request.resultData || {};
|
||||
const pid = data.PId || 'N/A';
|
||||
const miiName = data.MiiName || 'N/A';
|
||||
|
||||
try {
|
||||
let isPidValid = true;
|
||||
try {
|
||||
const spfnCheck = await axios.get(`https://account.spbr.net/api/v2/users/${pid}/mii`);
|
||||
if (typeof spfnCheck.data === 'string' && spfnCheck.data.includes('<code>0008</code>')) {
|
||||
isPidValid = false;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`Caught error when validating ${pid}:`, err.message || err);
|
||||
isPidValid = false;
|
||||
}
|
||||
|
||||
if (!isPidValid) {
|
||||
const invalidPidEmbed = new EmbedBuilder()
|
||||
.setTitle(":warning: | Invalid Telemetry received")
|
||||
.setDescription("## PID is not a valid SPFN ID\nThis submission has been BLOCKED!")
|
||||
.setColor(15158332)
|
||||
.addFields(
|
||||
{ name: "PID", value: `${pid}`, inline: true },
|
||||
{ name: "Mii Name", value: `${miiName}`, inline: true }
|
||||
);
|
||||
|
||||
await webhookClient.send({ embeds: [invalidPidEmbed] });
|
||||
return response.status(500).send('Invalid PID... fuck off mate stop sending it');
|
||||
}
|
||||
|
||||
const result = await ResultTypeModel.create({
|
||||
type: title.type,
|
||||
bossUniqueId: request.headers['x-boss-uniqueid'],
|
||||
|
|
@ -36,17 +64,20 @@ router.post('/post', postLimiter, async (request, response, next) => {
|
|||
...request.resultData
|
||||
});
|
||||
const offenses = [];
|
||||
const weaponExists = Object.prototype.hasOwnProperty.call(lookup.weapons_main, String(data.Weapon));
|
||||
if (!weaponExists && data.Weapon !== undefined) offenses.push("Invalid Weapon ID");
|
||||
if ((blacklist.weapons || []).includes(Number(data.Weapon))) offenses.push("weapon");
|
||||
if ((blacklist.clothes || []).includes(Number(data.Gear_Clothes))) offenses.push("clothes");
|
||||
if ((blacklist.rules || []).includes(Number(data.Rule))) offenses.push("rule");
|
||||
if (offenses.length > 0) {
|
||||
const sWep = offenses.includes("weapon") ? "⭐ " : "";
|
||||
const sWep = (offenses.includes("weapon") || offenses.includes("Invalid Weapon ID")) ? "⭐ " : "";
|
||||
const sClt = offenses.includes("clothes") ? "⭐ " : "";
|
||||
const sRul = offenses.includes("rule") ? "⭐ " : "";
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle(":warning: | Invalid Telemetry received")
|
||||
.setDescription(`## Offending information detected in: ${offenses.join(', ')}`)
|
||||
.setColor(offenses.includes("Invalid Weapon ID") ? 0xFF9900 : 15158332)
|
||||
.setFields(
|
||||
{
|
||||
name: "User Information:",
|
||||
|
|
@ -55,7 +86,11 @@ router.post('/post', postLimiter, async (request, response, next) => {
|
|||
},
|
||||
{ name: "PID", value: `${data.PId || 'N/A'}`, inline: true },
|
||||
{ name: "Mii Name", value: `${data.MiiName || 'N/A'}`, inline: true },
|
||||
{ name: "Weapon", value: `${sWep}${lookup.weapons_main[data.Weapon] || data.Weapon || 'N/A'}`, inline: true },
|
||||
{
|
||||
name: "Weapon",
|
||||
value: `${sWep}${lookup.weapons_main[data.Weapon] || `UNKNOWN ID: ${data.Weapon}`}`,
|
||||
inline: true
|
||||
},
|
||||
{ name: "Headgear", value: `${lookup.headgear[data.Gear_Head] || data.Gear_Head || 'N/A'}`, inline: true },
|
||||
{ name: "Clothes", value: `${sClt}${lookup.clothes[data.Gear_Clothes] || data.Gear_Clothes || 'N/A'}`, inline: true },
|
||||
{ name: "Shoes", value: `${lookup.shoes[data.Gear_Shoes] || data.Gear_Shoes || 'N/A'}`, inline: true },
|
||||
|
|
|
|||
|
|
@ -4,50 +4,61 @@ const { SplatfestResult } = require('../models/splatfest_result');
|
|||
const { Equipment } = require('../models/equipment');
|
||||
const { EquipmentLast } = require('../models/equipmentLast');
|
||||
const { PlayerRank } = require('../models/playerRank');
|
||||
const MAX_INT32 = 2147483647;
|
||||
|
||||
module.exports = {
|
||||
type: 'telemetry',
|
||||
result_model: {
|
||||
create: async (data) => {
|
||||
const result = await SplatfestResult.create(data);
|
||||
const sanitizedData = { ...data };
|
||||
|
||||
const rankValue = parseInt(data.Rank);
|
||||
if (isNaN(rankValue) || rankValue > MAX_INT32 || rankValue < 0) {
|
||||
sanitizedData.Rank = 0;
|
||||
}
|
||||
|
||||
if (parseInt(data.SessionID) > MAX_INT32) sanitizedData.SessionID = 0;
|
||||
|
||||
const result = await SplatfestResult.create(sanitizedData, { ordering: false, ignoreDuplicates: false });
|
||||
|
||||
await Equipment.upsert({
|
||||
PId: data.PId,
|
||||
weapon: data.Weapon,
|
||||
sumpaint: data.SumPaint
|
||||
PId: sanitizedData.PId,
|
||||
weapon: sanitizedData.Weapon,
|
||||
sumpaint: sanitizedData.SumPaint
|
||||
});
|
||||
|
||||
await EquipmentLast.upsert({
|
||||
PId: data.PId,
|
||||
weapon: data.Weapon,
|
||||
Gear_Shoes: data.Gear_Shoes,
|
||||
Gear_Shoes_Skill0: data.Gear_Shoes_Skill0,
|
||||
Gear_Shoes_Skill1: data.Gear_Shoes_Skill1,
|
||||
Gear_Shoes_Skill2: data.Gear_Shoes_Skill2,
|
||||
Gear_Clothes: data.Gear_Clothes,
|
||||
Gear_Clothes_Skill0: data.Gear_Clothes_Skill0,
|
||||
Gear_Clothes_Skill1: data.Gear_Clothes_Skill1,
|
||||
Gear_Clothes_Skill2: data.Gear_Clothes_Skill2,
|
||||
Gear_Head: data.Gear_Head,
|
||||
Gear_Head_Skill0: data.Gear_Head_Skill0,
|
||||
Gear_Head_Skill1: data.Gear_Head_Skill1,
|
||||
Gear_Head_Skill2: data.Gear_Head_Skill2,
|
||||
Rank: data.Rank,
|
||||
Udemae: data.Udemae
|
||||
PId: sanitizedData.PId,
|
||||
weapon: sanitizedData.Weapon,
|
||||
Gear_Shoes: sanitizedData.Gear_Shoes,
|
||||
Gear_Shoes_Skill0: sanitizedData.Gear_Shoes_Skill0,
|
||||
Gear_Shoes_Skill1: sanitizedData.Gear_Shoes_Skill1,
|
||||
Gear_Shoes_Skill2: sanitizedData.Gear_Shoes_Skill2,
|
||||
Gear_Clothes: sanitizedData.Gear_Clothes,
|
||||
Gear_Clothes_Skill0: sanitizedData.Gear_Clothes_Skill0,
|
||||
Gear_Clothes_Skill1: sanitizedData.Gear_Clothes_Skill1,
|
||||
Gear_Clothes_Skill2: sanitizedData.Gear_Clothes_Skill2,
|
||||
Gear_Head: sanitizedData.Gear_Head,
|
||||
Gear_Head_Skill0: sanitizedData.Gear_Head_Skill0,
|
||||
Gear_Head_Skill1: sanitizedData.Gear_Head_Skill1,
|
||||
Gear_Head_Skill2: sanitizedData.Gear_Head_Skill2,
|
||||
Rank: sanitizedData.Rank,
|
||||
Udemae: sanitizedData.Udemae
|
||||
});
|
||||
const gameMode = parseInt(data.GameMode);
|
||||
|
||||
const gameMode = parseInt(sanitizedData.GameMode);
|
||||
|
||||
if (gameMode !== 3 && gameMode !== 4) {
|
||||
const isWin = Number(data.IsWinGame) === 1;
|
||||
const isWin = Number(sanitizedData.IsWinGame) === 1;
|
||||
const [stats, created] = await PlayerRank.findOrCreate({
|
||||
where: {
|
||||
PId: data.PId,
|
||||
GameMode: data.GameMode
|
||||
PId: sanitizedData.PId,
|
||||
GameMode: sanitizedData.GameMode
|
||||
},
|
||||
defaults: {
|
||||
MiiName: data.MiiName,
|
||||
Rank: data.Rank,
|
||||
FesPower: parseFloat(data.FesPower) || 0,
|
||||
MiiName: sanitizedData.MiiName,
|
||||
Rank: sanitizedData.Rank,
|
||||
FesPower: parseFloat(sanitizedData.FesPower) || 0,
|
||||
WinSum: 0,
|
||||
LoseSum: 0,
|
||||
RankingScore: 0
|
||||
|
|
@ -68,9 +79,9 @@ module.exports = {
|
|||
const newRankingScore = currentWins * winRate * 10;
|
||||
|
||||
await stats.update({
|
||||
MiiName: data.MiiName,
|
||||
Rank: data.Rank,
|
||||
FesPower: parseFloat(data.FesPower) || 0,
|
||||
MiiName: sanitizedData.MiiName,
|
||||
Rank: sanitizedData.Rank,
|
||||
FesPower: parseFloat(sanitizedData.FesPower) || 0,
|
||||
WinSum: currentWins,
|
||||
LoseSum: currentLosses,
|
||||
RankingScore: newRankingScore
|
||||
|
|
@ -138,8 +149,12 @@ module.exports = {
|
|||
BottleneckPlayerNum: joi.numberstring(),
|
||||
MaxSilenceFrame: joi.numberstring(),
|
||||
MemoryHash: joi.numberstring(),
|
||||
//swaps Paint_TEAM for RemainCount_TEAM.
|
||||
//Paint_TEAM is used in turf, RemainCount is used in Ranked
|
||||
Paint_Alpha: joi.numberstring(),
|
||||
Paint_Bravo: joi.numberstring(),
|
||||
RemainCount_Alpha: joi.numberstring(),
|
||||
RemainCount_Bravo: joi.numberstring(),
|
||||
FaceImg: joi.binary()
|
||||
}).unknown(true).options({ presence: 'optional' }).required(),
|
||||
multipart_validator: multer().any()
|
||||
|
|
|
|||
99
main.py
99
main.py
|
|
@ -14,11 +14,13 @@ from routes.equipment import equipment_history
|
|||
from routes.equipment import equipment
|
||||
from services.boss_retrieval import process_boss_file
|
||||
from routes import Ranking
|
||||
from routes import ranking_grabstats
|
||||
from routes import twitter_link
|
||||
from contextlib import asynccontextmanager
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from sqlalchemy import delete
|
||||
from config import BASE_DIR
|
||||
import yaml
|
||||
import asyncio
|
||||
import subprocess
|
||||
import signal
|
||||
|
|
@ -31,6 +33,7 @@ JUDD_SERVER_JS = os.path.join(JUDD_CWD, "server.js")
|
|||
JUDD_CMD = ["node", JUDD_SERVER_JS]
|
||||
|
||||
judd_process = None
|
||||
skip_upcoming_reset = False
|
||||
|
||||
async def boss_worker_loop():
|
||||
print("background worker started")
|
||||
|
|
@ -43,22 +46,71 @@ async def boss_worker_loop():
|
|||
await asyncio.sleep(3600)
|
||||
|
||||
async def weekly_rank_reset_loop():
|
||||
global skip_upcoming_reset
|
||||
print("weekly_rank_reset worker started")
|
||||
while True:
|
||||
now = datetime.now()
|
||||
days_ahead = 6 - now.weekday()
|
||||
|
||||
FES_BOSS_PATH = os.path.join(BASE_DIR, "fes_boss.yaml")
|
||||
|
||||
def get_next_sunday_reset_time_utc():
|
||||
now_utc = datetime.now(timezone.utc)
|
||||
days_ahead = 6 - now_utc.weekday()
|
||||
if days_ahead <= 0:
|
||||
days_ahead += 7
|
||||
next_sunday_utc = now_utc + timedelta(days=days_ahead)
|
||||
return next_sunday_utc.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
next_sunday = now + timedelta(days=days_ahead)
|
||||
next_run = next_sunday.replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
async def check_splatfest_schedule_loop():
|
||||
global skip_upcoming_reset
|
||||
while True:
|
||||
try:
|
||||
target_reset_utc = get_next_sunday_reset_time_utc()
|
||||
print(f"checking if a splatfest will be active at: {target_reset_utc.isoformat()}")
|
||||
|
||||
wait_seconds = (next_run - now).total_seconds()
|
||||
print(f"Next ranking reset scheduled for: {next_run} (in {wait_seconds:.0f} seconds)")
|
||||
if os.path.exists(FES_BOSS_PATH):
|
||||
with open(FES_BOSS_PATH, "r", encoding="utf-8") as f:
|
||||
fes_data = yaml.safe_load(f)
|
||||
|
||||
if fes_data and "Time" in fes_data:
|
||||
start_time = datetime.fromisoformat(fes_data["Time"]["Start"])
|
||||
end_time = datetime.fromisoformat(fes_data["Time"]["End"])
|
||||
|
||||
start_time_utc = start_time.astimezone(timezone.utc)
|
||||
end_time_utc = end_time.astimezone(timezone.utc)
|
||||
|
||||
print(f"detected splatfest schedule: {start_time_utc.isoformat()} to {end_time_utc.isoformat()}")
|
||||
|
||||
if start_time_utc <= target_reset_utc <= end_time_utc:
|
||||
skip_upcoming_reset = True
|
||||
print("Splatfest detected in reset window")
|
||||
else:
|
||||
skip_upcoming_reset = False
|
||||
print("No splatfest active in reset window, yay!!!")
|
||||
else:
|
||||
print("could not find yaml, defaulted to no fest")
|
||||
skip_upcoming_reset = False
|
||||
|
||||
except Exception as e:
|
||||
print(f"failed to check fest schedule: {e}")
|
||||
|
||||
await asyncio.sleep(7200)
|
||||
|
||||
asyncio.create_task(check_splatfest_schedule_loop())
|
||||
|
||||
while True:
|
||||
now_utc = datetime.now(timezone.utc)
|
||||
next_run_utc = get_next_sunday_reset_time_utc()
|
||||
wait_seconds = (next_run_utc - now_utc).total_seconds()
|
||||
|
||||
print(f"Next ranking reset scheduled for: {next_run_utc.isoformat()} (in {wait_seconds:.0f} seconds)")
|
||||
|
||||
try:
|
||||
await asyncio.sleep(wait_seconds)
|
||||
|
||||
print("ranking reset triggerred!")
|
||||
|
||||
if skip_upcoming_reset:
|
||||
print("Reset skipped due to active splatfest")
|
||||
else:
|
||||
print("Executing weekly ranking reset...")
|
||||
with SessionLocal() as db:
|
||||
db.execute(delete(PlayerRank))
|
||||
|
|
@ -121,34 +173,6 @@ app.add_middleware(
|
|||
async def proxy_fallback(request: Request, call_next):
|
||||
response = await call_next(request)
|
||||
|
||||
if response.status_code != 404:
|
||||
return response
|
||||
|
||||
url = f"http://127.0.0.1:{settings.judd_port}{request.url.path}"
|
||||
body = await request.body()
|
||||
|
||||
async with httpx.AsyncClient() as client:
|
||||
try:
|
||||
judd_resp = await client.request(
|
||||
request.method,
|
||||
url,
|
||||
headers={k: v for k, v in request.headers.items() if k.lower() != "host"},
|
||||
params=request.query_params,
|
||||
content=body,
|
||||
)
|
||||
except httpx.RequestError:
|
||||
return response
|
||||
|
||||
return Response(
|
||||
content=judd_resp.content,
|
||||
status_code=judd_resp.status_code,
|
||||
headers=dict(judd_resp.headers),
|
||||
)
|
||||
|
||||
|
||||
@app.middleware("http")
|
||||
async def force_cors_on_errors(request: Request, call_next):
|
||||
response = await call_next(request)
|
||||
origin = request.headers.get("origin")
|
||||
if origin == settings.frontend_url:
|
||||
response.headers["Access-Control-Allow-Origin"] = origin
|
||||
|
|
@ -164,9 +188,10 @@ app.include_router(equipment_history.router, prefix="/api/v1")
|
|||
app.include_router(equipment.router, prefix="/api/v1")
|
||||
app.include_router(Ranking.router, prefix="/api/v1")
|
||||
app.include_router(twitter_link.router, prefix="/api/v1")
|
||||
app.include_router(ranking_grabstats.router, prefix="/api/v1")
|
||||
|
||||
def start():
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=settings.port, reload=True)
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=settings.port, reload=False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
start()
|
||||
|
|
@ -5,47 +5,48 @@ description = "Backend for SplatNet"
|
|||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"annotated-doc==0.0.4",
|
||||
"annotated-doc==0.0.5",
|
||||
"annotated-types==0.7.0",
|
||||
"anyio==4.12.1",
|
||||
"anyio==4.14.1",
|
||||
"argon2-cffi==25.1.0",
|
||||
"argon2-cffi-bindings==25.1.0",
|
||||
"certifi==2026.2.25",
|
||||
"cffi==2.0.0",
|
||||
"charset-normalizer==3.4.4",
|
||||
"click==8.3.1",
|
||||
"certifi==2026.7.22",
|
||||
"cffi==2.1.1",
|
||||
"charset-normalizer==3.4.9",
|
||||
"click==8.4.2",
|
||||
"colorama==0.4.6",
|
||||
"cryptography==46.0.5",
|
||||
"fastapi==0.134.0",
|
||||
"cryptography==50.0.0",
|
||||
"fastapi==0.141.1",
|
||||
"fastapi-cache2==0.2.2",
|
||||
"greenlet==3.3.2",
|
||||
"greenlet==3.5.5",
|
||||
"h11==0.16.0",
|
||||
"httpcore==1.0.9",
|
||||
"httpx==0.28.1",
|
||||
"idna==3.11",
|
||||
"idna==3.18",
|
||||
"oauthlib==3.3.1",
|
||||
"oead==1.2.9.post4",
|
||||
"pendulum==3.2.0",
|
||||
"psycopg2-binary==2.9.11",
|
||||
"psycopg2-binary==2.9.12",
|
||||
"pycparser==3.0",
|
||||
"pydantic==2.12.5",
|
||||
"pydantic-core==2.41.5",
|
||||
"pydantic-settings==2.13.1",
|
||||
"pydantic==2.13.4",
|
||||
"pydantic-core==2.46.4",
|
||||
"pydantic-settings==2.15.0",
|
||||
"python-dateutil==2.9.0.post0",
|
||||
"python-dotenv==1.2.1",
|
||||
"python-multipart==0.0.22",
|
||||
"python-dotenv==1.2.2",
|
||||
"python-multipart==0.0.32",
|
||||
"pyyaml==6.0.3",
|
||||
"requests==2.32.5",
|
||||
"requests==2.34.2",
|
||||
"requests-oauthlib==2.0.0",
|
||||
"six==1.17.0",
|
||||
"sqlalchemy==2.0.48",
|
||||
"starlette==0.52.1",
|
||||
"tweepy==4.16.0",
|
||||
"typing-extensions==4.15.0",
|
||||
"typing-inspection==0.4.2",
|
||||
"tzdata==2025.3",
|
||||
"urllib3==2.6.3",
|
||||
"uvicorn==0.41.0",
|
||||
"sqlalchemy==2.0.51",
|
||||
"starlette==1.6.0",
|
||||
"tweepy==4.17.0",
|
||||
"typing-extensions==4.16.0",
|
||||
"typing-inspection==0.4.3",
|
||||
"tzdata==2026.3",
|
||||
"urllib3==2.7.0",
|
||||
"uvicorn==0.52.1",
|
||||
"jinja2==3.1.6",
|
||||
]
|
||||
|
||||
[tool.setuptools]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["config:recommended"],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"automerge": false
|
||||
},
|
||||
{
|
||||
"matchUpdateTypes": ["major"],
|
||||
"automerge": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -37,7 +37,31 @@ RULE_NAMES = {
|
|||
@cache(expire=3660)
|
||||
async def boss_rotation(request: Request):
|
||||
try:
|
||||
with open("boss.yaml", "r") as f:
|
||||
def format_stages(stage_list):
|
||||
formatted = []
|
||||
for s in stage_list:
|
||||
mid = s.get("MapID")
|
||||
formatted.append({
|
||||
"mapID": mid,
|
||||
"translatedNames": MAP_DATA.get(mid, {"en-US": "Unknown Stage"})
|
||||
})
|
||||
return formatted
|
||||
|
||||
def nintydevsuranidiotforusingrgb(color_val):
|
||||
if not color_val:
|
||||
return "#000000"
|
||||
if isinstance(color_val, str):
|
||||
parts = [float(p.strip()) for p in color_val.split(",") if p.strip()]
|
||||
elif isinstance(color_val, (list, tuple)):
|
||||
parts = [float(p) for p in color_val]
|
||||
else:
|
||||
return "#000000"
|
||||
|
||||
# trash 4th val
|
||||
rgb = [round(c * 255) for c in parts[:3]]
|
||||
return f"#{rgb[0]:02X}{rgb[1]:02X}{rgb[2]:02X}"
|
||||
|
||||
with open("boss.yaml", "r", encoding='utf-8') as f:
|
||||
yaml_data = yaml.safe_load(f)
|
||||
|
||||
start_time = yaml_data.get("DateTime")
|
||||
|
|
@ -50,16 +74,6 @@ async def boss_rotation(request: Request):
|
|||
for phase in yaml_data.get("Phases", []):
|
||||
ts_ms = str(int(current_rotation_start.timestamp() * 1000))
|
||||
|
||||
def format_stages(stage_list):
|
||||
formatted = []
|
||||
for s in stage_list:
|
||||
mid = s.get("MapID")
|
||||
formatted.append({
|
||||
"mapID": mid,
|
||||
"translatedNames": MAP_DATA.get(mid, {"en-US": "Unknown Stage"})
|
||||
})
|
||||
return formatted
|
||||
|
||||
duration = phase.get("Time", 4)
|
||||
rotations[ts_ms] = {
|
||||
"startTime": current_rotation_start.isoformat(),
|
||||
|
|
@ -80,6 +94,47 @@ async def boss_rotation(request: Request):
|
|||
}
|
||||
}
|
||||
|
||||
try:
|
||||
with open("fes_boss.yaml", "r", encoding='utf-8') as f:
|
||||
fes_yaml = yaml.safe_load(f)
|
||||
|
||||
if fes_yaml:
|
||||
time_cfg = fes_yaml.get("Time", {})
|
||||
|
||||
def parse_iso(iso_str):
|
||||
if not iso_str: return None
|
||||
return int(datetime.fromisoformat(iso_str.replace('Z', '+00:00')).timestamp())
|
||||
|
||||
fest_start = parse_iso(time_cfg.get("Start"))
|
||||
fest_end = parse_iso(time_cfg.get("End"))
|
||||
fest_announce = parse_iso(time_cfg.get("Announce"))
|
||||
fest_result = parse_iso(time_cfg.get("Result"))
|
||||
|
||||
teams = fes_yaml.get("Teams", [])
|
||||
formatted_teams = []
|
||||
for team in teams:
|
||||
raw_color = team.get("Color")
|
||||
formatted_teams.append({
|
||||
"shortName": team.get("ShortName", {}),
|
||||
"color": nintydevsuranidiotforusingrgb(raw_color)
|
||||
})
|
||||
|
||||
response_data["splatfestivalSplatfest"] = {
|
||||
"stages": format_stages(fes_yaml.get("Stages", [])),
|
||||
"mode": RULE_NAMES.get(fes_yaml.get("Rule"), "TurfWar"),
|
||||
"teams": formatted_teams,
|
||||
"battleResultRate": fes_yaml.get("BattleResultRate", {}),
|
||||
"time": {
|
||||
"start": fest_start,
|
||||
"end": fest_end,
|
||||
"annoucement": fest_announce,
|
||||
"results": fest_result
|
||||
},
|
||||
"festivalID": fes_yaml.get("FestivalId", 0)
|
||||
}
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
return response_data
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ async def get_equipment_composite(request: Request, db: DBSession = Depends(get_
|
|||
try:
|
||||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
token_data = auth.get_token(user.username, decrypted_pass)
|
||||
profile = json.loads(auth.get_profile(token_data["token"]))
|
||||
profile = auth.get_profile(token_data["access_token"])
|
||||
pid_val = int(profile.get("pid"))
|
||||
mii_name = profile.get("name", user.username)
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ async def get_history(request: Request, db: DBSession = Depends(get_db)):
|
|||
try:
|
||||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
token_data = auth.get_token(user.username, decrypted_pass)
|
||||
profile = json.loads(auth.get_profile(token_data["token"]))
|
||||
profile = auth.get_profile(token_data["access_token"])
|
||||
pid_val = int(profile.get("pid"))
|
||||
print(f"Fetching History for PID: {pid_val}")
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ async def get_my_profile(request: Request, db: DBSession = Depends(get_db)):
|
|||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
|
||||
token_data = auth.get_token(user.username, decrypted_pass)
|
||||
if not token_data or "token" not in token_data:
|
||||
if not token_data or "access_token" not in token_data:
|
||||
return RedirectResponse(url="/sign_in/")
|
||||
|
||||
profile_data = auth.get_profile(token_data["token"])
|
||||
profile_data = auth.get_profile(token_data["access_token"])
|
||||
if not profile_data:
|
||||
raise HTTPException(status_code=404, detail="Profile not found")
|
||||
|
||||
|
|
|
|||
72
routes/ranking_grabstats.py
Normal file
72
routes/ranking_grabstats.py
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy.orm import Session as DBSession
|
||||
from sqlalchemy import desc
|
||||
from database import SessionLocal, PlayerRank, EquipmentLast
|
||||
from fastapi_cache.decorator import cache
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
def get_db():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
@router.get("/leaderboard/getplayerstats/{pid}")
|
||||
@cache(expire=60)
|
||||
async def get_player_stats(pid: int, mode: int | None = None, db: DBSession = Depends(get_db)):
|
||||
try:
|
||||
query = (
|
||||
db.query(PlayerRank, EquipmentLast)
|
||||
.outerjoin(EquipmentLast, PlayerRank.PId == EquipmentLast.PId)
|
||||
.filter(PlayerRank.PId == pid)
|
||||
)
|
||||
|
||||
if mode is not None:
|
||||
query = query.filter(PlayerRank.GameMode == mode)
|
||||
|
||||
result = query.first()
|
||||
|
||||
if not result:
|
||||
raise HTTPException(status_code=404, detail="Player not found")
|
||||
|
||||
player, gear = result
|
||||
|
||||
player_data = {
|
||||
"PId": player.PId,
|
||||
"MiiName": player.MiiName,
|
||||
"Rank": player.Rank,
|
||||
"GameMode": player.GameMode,
|
||||
"WinSum": player.WinSum,
|
||||
"LoseSum": player.LoseSum,
|
||||
"RankingScore": round(player.RankingScore, 2),
|
||||
"weapon": gear.weapon if gear else None,
|
||||
"headgear": gear.Gear_Head if gear else None,
|
||||
"clothes": gear.Gear_Clothes if gear else None,
|
||||
"shoes": gear.Gear_Shoes if gear else None,
|
||||
}
|
||||
|
||||
if player.GameMode == 2:
|
||||
top_100_query = (
|
||||
db.query(PlayerRank.PId)
|
||||
.order_by(desc(PlayerRank.FesPower))
|
||||
.limit(100)
|
||||
.all()
|
||||
)
|
||||
top_100_tuples = set(top_100_query)
|
||||
|
||||
is_top_100 = (player.PId,) in top_100_tuples
|
||||
player_data["FesPower"] = player.FesPower
|
||||
player_data["is_top_100_fes"] = is_top_100
|
||||
else:
|
||||
player_data["FesPower"] = None
|
||||
player_data["is_top_100_fes"] = False
|
||||
|
||||
return player_data
|
||||
|
||||
except HTTPException as http_ex:
|
||||
raise http_ex
|
||||
except Exception as e:
|
||||
print(f"Error fetching stats for player {pid}: {e}")
|
||||
return {"error": str(e)}
|
||||
|
|
@ -37,27 +37,26 @@ async def login(
|
|||
try:
|
||||
print("fetching spfn token")
|
||||
data = auth.get_token(username, password)
|
||||
if not data or "token" not in data:
|
||||
if not data or "access_token" not in data:
|
||||
print("auth failed")
|
||||
return RedirectResponse(f"{auth_path}{sep}error=auth&username={username}", 303)
|
||||
|
||||
print(f"checking user {username}")
|
||||
user = db.query(User).filter(User.username == username).first()
|
||||
|
||||
enc_pass = cipher.encrypt(password.encode()).decode()
|
||||
|
||||
if not user:
|
||||
print("creating new user with argon2id")
|
||||
enc_pass = cipher.encrypt(password.encode()).decode() if rememberMe else ""
|
||||
user = User(
|
||||
username=username,
|
||||
local_hash=auth.hash_password(password),
|
||||
spfn_pass_enc=enc_pass
|
||||
)
|
||||
db.add(user)
|
||||
elif rememberMe:
|
||||
print("updating encrypted pass for client")
|
||||
user.spfn_pass_enc = cipher.encrypt(password.encode()).decode()
|
||||
else:
|
||||
print("client requested no password storage, skipping update")
|
||||
print("updating encrypted pass for client")
|
||||
user.spfn_pass_enc = enc_pass
|
||||
|
||||
db.flush()
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ async def confirm_twitter(state: str, code: str, db: DBSession = Depends(get_db)
|
|||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
profile_auth = auth.get_token(user.username, decrypted_pass)
|
||||
|
||||
profile_response = auth.get_profile(profile_auth["token"])
|
||||
profile_response = auth.get_profile(profile_auth["access_token"])
|
||||
|
||||
if isinstance(profile_response, str):
|
||||
try:
|
||||
|
|
@ -149,7 +149,7 @@ async def get_twitter_status(request: Request, db: DBSession = Depends(get_db)):
|
|||
try:
|
||||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
profile_auth = auth.get_token(user.username, decrypted_pass)
|
||||
profile_res = auth.get_profile(profile_auth["token"])
|
||||
profile_res = auth.get_profile(profile_auth["access_token"])
|
||||
|
||||
if isinstance(profile_res, str):
|
||||
profile_data = json.loads(profile_res)
|
||||
|
|
@ -183,7 +183,7 @@ async def unlink_twitter(request: Request, db: DBSession = Depends(get_db)):
|
|||
user = db.query(User).filter(User.username == db_session.username).first()
|
||||
decrypted_pass = cipher.decrypt(user.spfn_pass_enc.encode()).decode()
|
||||
profile_auth = auth.get_token(user.username, decrypted_pass)
|
||||
profile_data = auth.get_profile(profile_auth["token"])
|
||||
profile_data = auth.get_profile(profile_auth["access_token"])
|
||||
|
||||
if isinstance(profile_data, str):
|
||||
profile_data = json.loads(profile_data)
|
||||
|
|
|
|||
3
security.md
Normal file
3
security.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Security Policy
|
||||
|
||||
Report security vulnerabilities through the security tab on this repo. Only vulnerabilities on the latest commit of any branch will be considered.
|
||||
|
|
@ -1,35 +1,41 @@
|
|||
import requests
|
||||
import base64
|
||||
from config import settings
|
||||
from argon2 import PasswordHasher
|
||||
|
||||
API_URL = "https://account.spfn.net/api/v2"
|
||||
API_URL = "https://account.spbr.net/api/v2"
|
||||
CLIENT_ID = "splatnet"
|
||||
CLIENT_SECRET = settings.account_client_secret
|
||||
ph = PasswordHasher()
|
||||
|
||||
def hash_password(password: str):
|
||||
return ph.hash(password)
|
||||
|
||||
def verify_password(hashed: str, password: str):
|
||||
try:
|
||||
return ph.verify(hashed, password)
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_token(username, password):
|
||||
creds = f"{username} {password}"
|
||||
encoded = base64.b64encode(creds.encode()).decode()
|
||||
url = f"{API_URL}/oauth2/generate_token"
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Basic {encoded}",
|
||||
"User-Agent": "saturday & allison should lwk kiss..."
|
||||
payload = {
|
||||
"grant_type": "password",
|
||||
"username": username,
|
||||
"password": password,
|
||||
"client_id": CLIENT_ID,
|
||||
"client_secret": CLIENT_SECRET
|
||||
}
|
||||
|
||||
response = requests.get(f"{API_URL}/oauth2/generate_token", headers=headers, timeout=10)
|
||||
headers = {
|
||||
"User-Agent": "chiyo & eri should lwk kiss..."
|
||||
}
|
||||
|
||||
response = requests.post(url, data=payload, headers=headers, timeout=10)
|
||||
return response.json() if response.ok else None
|
||||
|
||||
def get_profile(token):
|
||||
url = f"{API_URL}/users/@me/profile"
|
||||
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"User-Agent": "every update im going to change this user agent because im bored!!"
|
||||
"User-Agent": "lets make the most of the night like were gonna die young!!"
|
||||
}
|
||||
response = requests.get(f"{API_URL}/users/@me/profile", headers=headers, timeout=10)
|
||||
return response.text if response.ok else None
|
||||
|
||||
response = requests.get(url, headers=headers, timeout=10)
|
||||
|
||||
return response.json() if response.ok else None
|
||||
|
|
|
|||
|
|
@ -7,25 +7,54 @@ from config import settings, BASE_DIR
|
|||
|
||||
def process_boss_file():
|
||||
temp_boss = "bosstemp.bin"
|
||||
output_yaml = "boss.yaml"
|
||||
decrypt_script = os.path.join(BASE_DIR, "services", "decrypt.js")
|
||||
|
||||
if not os.path.exists(decrypt_script):
|
||||
print(f"{decrypt_script} is missing!")
|
||||
return False
|
||||
|
||||
base_url = settings.boss_url.rstrip('/')
|
||||
tasks = [
|
||||
{
|
||||
"url": f"{base_url}/zvGSM4kOrXpkKnpT/schdat2?c=JP&l=en",
|
||||
"filename": "VSSetting.byaml",
|
||||
"output": "boss.yaml"
|
||||
},
|
||||
{
|
||||
"url": f"{base_url}/zvGSM4kOrXpkKnpT/optdat2?c=US&l=en",
|
||||
"filename": "Festival.byaml",
|
||||
"output": "fes_boss.yaml"
|
||||
}
|
||||
]
|
||||
|
||||
try:
|
||||
master_url = settings.boss_url
|
||||
success_all = True
|
||||
for task in tasks:
|
||||
master_url = task["url"]
|
||||
target_filename = task["filename"]
|
||||
output_yaml = task["output"]
|
||||
|
||||
print(f"data get: {master_url}")
|
||||
meta_res = requests.get(master_url, timeout=10)
|
||||
meta_res.raise_for_status()
|
||||
root = ET.fromstring(meta_res.content)
|
||||
data_url_element = root.find(".//Url")
|
||||
if data_url_element is None or not data_url_element.text:
|
||||
print("woops! no <Url> tag found in the XML response")
|
||||
return False
|
||||
real_data_url = data_url_element.text.strip()
|
||||
print(f"parsed data url: {real_data_url}")
|
||||
|
||||
# LMFAO HOW DID THIS FLY UNDER THE RADAR FOR SO LONG
|
||||
real_data_url = None
|
||||
for file_element in root.findall(".//File"):
|
||||
filename_elem = file_element.find("Filename")
|
||||
if filename_elem is not None and filename_elem.text == target_filename:
|
||||
url_elem = file_element.find("Url")
|
||||
if url_elem is not None and url_elem.text:
|
||||
real_data_url = url_elem.text.strip()
|
||||
break
|
||||
|
||||
if not real_data_url:
|
||||
print(f"woops! could not find URL for file '{target_filename}' in the XML response")
|
||||
success_all = False
|
||||
continue
|
||||
|
||||
print(f"parsed data url for {target_filename}: {real_data_url}")
|
||||
res = requests.get(real_data_url, timeout=10)
|
||||
res.raise_for_status()
|
||||
|
||||
|
|
@ -45,7 +74,8 @@ def process_boss_file():
|
|||
|
||||
if result.returncode != 0:
|
||||
print(f"decrypt fail! {result.stderr.decode()}")
|
||||
return False
|
||||
success_all = False
|
||||
continue
|
||||
|
||||
byml_obj = oead.byml.from_binary(result.stdout)
|
||||
yaml_content = oead.byml.to_text(byml_obj)
|
||||
|
|
@ -54,7 +84,8 @@ def process_boss_file():
|
|||
f.write(yaml_content)
|
||||
|
||||
print(f"yay! success: {output_yaml}")
|
||||
return True
|
||||
|
||||
return success_all
|
||||
|
||||
except ET.ParseError:
|
||||
print("woops! the url returned non xml... we're hanging here")
|
||||
|
|
|
|||
3
support.md
Normal file
3
support.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Support
|
||||
|
||||
For support, join [our discord](https://discord.gg/splatfestival).
|
||||
Loading…
Reference in a new issue