XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
23.2k stars 3.71k forks source link

API: Stats of the user remains when the user got deleted through API #3390

Open somebodywashere opened 2 months ago

somebodywashere commented 2 months ago

Integrity requirements

Version

latest

Description

The issue is that stats of the user remains when the user got deleted through API.

So If I want to delete and then add user through API with the same Email, then new user will keep the same stats until core is restarted. So only current solution is to restart Xray core or modify Email :(

I suggest that: Stats of the user needs to be deleted with the user. If not possible than we need to restart statsService on user deletion. Or if even that's not acceptable than at least we need a method to restart statsService / flush stats without restarting whole core.

Reproduction Method

Delete a user through API, then add a new user through API with the same Email. Stats will remain from deleted user.

Client config


not needed

Server config


not needed

Client log


not needed

Server log


not needed
Fangliding commented 2 months ago

Classic ancient feature's shit mountain issue

somebodywashere commented 2 months ago

Classic ancient feature's shit mountain issue

What do you mean by that?

chise0713 commented 2 months ago

Classic ancient feature's shit mountain issue

What do you mean by that?

https://en.wiktionary.org/wiki/屎山

MK0ltra commented 1 month ago

Well, this feature is useful for VPN sellers, so you should fix it yourself. If you really think about it, there are people that connect to internet for business goals, Then if this project can help people connect to internet it should be completely removed from Github, because it's not for making money.

somebodywashere commented 1 month ago

Well, this feature is useful for VPN sellers, so you should fix it yourself. If you really think about it, there are people that connect to internet for business goals, Then if this project can help people connect to internet it should be completely removed from Github, because it's not for making money.

Why being so toxic for actually no reason. I don't mean to add any new features and Yes, I can maybe fix it later on myself and make a PR. But If I post an issue there's some reasons behind that.

From your logic it's better to remove API then

yuhan6665 commented 1 month ago

Correct. API is designed for UI clients, web panels, 机场 backends and we are committed to improve APIs ..of the community, by the community, for the community :)

Fangliding commented 1 month ago

To be honest, I feel that the API of Xray is indeed undermaintenance, so many times, some things about it are put on hold This system inherited from v2fly is indeed quite problematic. If we committed to repairing this, it would be like giving free work to commercial activities as mentioned above. Personally, I do want to remove this system. Mature commercial panels use completely different mechanisms, but it seems that there are people who need it, and there are occasional PR submissions. But overall, this is a series of features that are rarely used by people, and encountering problems on them is very likely, so this is probably the current situation.

Grvzard commented 1 month ago

https://github.com/Grvzard/Xray-core/tree/fix-stats I don't think it's wise to use the built-in user management stuff, but check this out if it helps.

somebodywashere commented 1 month ago

https://github.com/Grvzard/Xray-core/tree/fix-stats I don't think it's wise to use the built-in user management stuff, but check this out if it helps.

Thanks! Didn't have enought time to check tho. But uf you tested and everything is ok, I think it's ok to make a PR

pulsarice commented 1 month ago

Actually, not everyone is using userstats api for commercial purposes. For example, I have a non-profit system in which I use a domestic server to connect a handful of friends and family to foreign servers. The problem is that here in Iran, most of the domestic servers are metered per GB of download and if there were no way to measure the usage, I wouldn't be able to fairly charge users for their actual usage. So please don't remove the API feature. Thanks.

willstore69 commented 3 weeks ago

https://github.com/Grvzard/Xray-core/tree/fix-stats I don't think it's wise to use the built-in user management stuff, but check this out if it helps.

is this only for vless ?