aliwoto / psychopass Goto Github PK
View Code? Open in Web Editor NEWSibyl System's API, written in the go programming language.
Home Page: https://psychopass.kaizoku.cyou
Sibyl System's API, written in the go programming language.
Home Page: https://psychopass.kaizoku.cyou
This should be changed, even if data for each one is different, but their user-id is exactly same, only the last data should be considered as the valid data.
see also: https://t.me/c/1774295256/22994
when debug
variable in config file is set to true
, gin prints these lines:
[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.
Please check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.
[GIN-debug] Listening and serving HTTP on :5101
the link is pointing to https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies, this issue needs more investigation.
Types EndpointResponse and EndpointError should be used as a generic types, and they should be defined in ssg package with this form:
type EndpointResponse[T any] struct {
Success bool `json:"success"`
Result *T `json:"result"`
Error *EndpointError `json:"error"`
}
type EndpointError struct {
ErrorCode int `json:"code"`
Message string `json:"message"`
Origin string `json:"origin"`
Date string `json:"date"`
}
EndpointError
needs to have a ErrorType
field (integer) as well
Scan has been approved by エイリ・ヲト at 0001-01-01 00:00:00
most probably the date should be set in one of the Approve
, Reject
or Close
methods; since its only usage is for being printed by ParseAsMd
method (in here, and this is the line date is being used)
logic behind date variables of scans/user-infos/etc needs to be re-written.
See also: https://t.me/AnimeKaizoku/6679250 and https://t.me/c/1498878414/40788
1- close a multi-scan request
2- go to another chat and hit on "reject" button for the same multi-scan request.
bot should show the message "this scan has already been closed....", then edits the text of the message correctly.
(as you can see in screenshot), bot will edit the message in a plain-text format.
this function needs a mutex.
Since multiple inspectors might send census command to fetch the stats, if there is no mutex in this function, database will be spammed with a large amount of sql queries... and this is what we don't want.
See also: https://t.me/c/1774295256/23964 which was originated from https://t.me/Division01/7327
For example: owners are never assigned, their assign date has to be set manually, otherwise they will have their default, zero value.
See also: https://t.me/c/1774295256/24698
Pretty much sure it's a logic issue inside of the reject handlers, which isn't related to database, still needs more investigation.
https://t.me/c/1498878414/42454
Enforcers have +100 crime coefficient, but they are not banned, hence there is a possibility that someone might try full-revert method on them; resulting in clearing their crime coefficient. (they will still be treated as enforcer, but this time with less than 100 crime coefficients).
we have two choices:
vscode is showing me this warning:
strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019)go-staticcheck
putting this issue here to find an alternative for strings.Title
function (used in this line)
this file, this function and GetGitStats need to be moved to ssg.
in this screenshot, I tried to send only 100 users, but the error message says Too many users, only 50000 users are permitted
, we need to use a dynamical value for that amount of users instead of a constant. (the constant is defined here)
when someone sends association-ban request to api, we expect all of the scan values to have a valid AssociationBanId
field set, but logs are saying otherwise:
2022/04/14 21:28:58 /home/ubuntu/aliwoto/projects/go/PsychoPass/sibyl/database/scans.go:49
INSERT INTO `reports` (`unique_id`,`reporter_id`,`target_user`,`target_type`,`report_date`,`report_reason`,`report_message`,`scan_source_link`,`agent_id`,`agent_reason`,`agent_date`,`reporter_permission`,`scan_status`,`association_ban_id`) VALUES ("6258921a-4fef6dbc-1f40",1341091260,8000,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f41",1341091260,8001,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f42",1341091260,8002,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f43",1341091260,8003,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f44",1341091260,8004,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f45",1341091260,8005,"0","14/04/2022 21:28:58","spamming NSFW stickers in groups","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f46",1341091260,8006,"0","14/04/2022 21:28:58","psychohazard","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f47",1341091260,8007,"0","14/04/2022 21:28:58","psychohazard","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f48",1341091260,8008,"0","14/04/2022 21:28:58","psychohazard","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0",""),("6258921a-4fef6dbc-1f49",1341091260,8009,"0","14/04/2022 21:28:58","psychohazard","message","https://t.me/c/1774295256/22990",0,"","0000-00-00 00:00:00","3","0","")
this will result in #6 (after restarting the api), since they are being cached in memory, but after restarting api, that cache will be lost.
Discussion link: https://t.me/c/1774295256/23268
This needs to be implemented asap.
getToken_test and revokeToken_test files in tests directory are not implemented yet. they should be implemented in future.
Normally API doesn't let inspector to scan/ban other inspectors, but I've recently found a hole which makes that possible.
That flaw needs to be fixed asap.
This feature needs long polling (something like telegram bot api), so when a pending scan gets approved/rejected/closed, api can send the details to the person who has sent the scan.
Add a method to list all the methods and their description.
Close
, Approve
and Reject
buttons in Association scan's message (also known as MultiScan
) in sibyl's helper bot won't edit the message text.
The do remove the buttons, but there is no change in text itself.
Permanent ban means there is no way back for the user (unless they become unbanned directly by an inspector)
but currently, it's possible for those users to get banned by another reason and use auto-appeal system to unban themselves, api should be smart enough to prevent
FullRevert
method doesn't allow users who are banned to be full-reverted, which is a bug. both users with cc in Restored
range and banned range should be able to become full-reverted.
Reference links:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.