Skip to content

Latest commit

 

History

History
 
 

V2RayGen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

V2IpLimit

Limiting the number of active users with IP
V2RayGen version

if you have problem just run this python app with sudo

When you use V2RayGen, the important thing is to use this tag at the end when creating the configuration --loglevel warning
like this:

curl https://raw.githubusercontent.com/SonyaCore/V2RayGen/main/V2RayGen.py | sudo python3 - --vmess --loglevel warning

You must install this library:

pip install docker

To run this program

git clone https://github.com/houshmand-2005/V2IpLimit.git
cd V2IpLimit
cd V2RayGen
python3 v2_ip_limit.py

You can change this file according to your needs:

{
  "WRITE_LOGS_TF": "True", // ----> write the logs like who disable and how many users are active now and ...
  "SEND_LOGS_TO_TEL": "False", // ----> send logs to a telegram bot
  "LIMIT_NUMBER": 2, // ----> number of active IPs for users
  "EN_DIS_USERS": "en_dis_users.json",
  "LOG_FILE_NAME": "ip_email.log",
  "CONFIG_FILE": "config.json", // you must have this file
  "TELEGRAM_BOT_URL": "https://api.telegram.org/bot[add_your_bot_token_here]/sendMessage", // ----> get your token from @BotFather
  "CHAT_ID": 111111111, // get from here ----> @RawDataBot
  "EXCEPT_EMAIL": ["[email protected]"], // ----> Accounts in this list will not be deactivated
  "CONTAINER_ID": "auto" // Enter the ID of the container in which V2RayGen is running or leave it to auto. Be sure to enter the full ID**
}

** You can do this by running the following command:

sudo docker inspect --format="{{.Id}}" containername

This program is activated every 6 minutes, it sends information, and users who have used more than the specified number of IPs are deactivated, and these users are written in a json file (EN_DIS_USERS) and after 6 minutes, all users are activated. And it is checked again if there is a need to deactivate the user in these 6 minutes, and if so, it will do so. And again after 6 minutes all users are activated and...

As a result, users who use more than the specified IP cannot use their account unless they are equal to or less than the IP limit.

Important note

As you know, this program must always be running, so there are many ways to do this, but I recommend using the screen command (be sure to read about it so you don't get into trouble.)
First, hit the screen command

screen

On the screen that opens, press the space bar Then run the program.
Now you can keep the program running in the background with the combined control A and D. Now if your connection to the server is interrupted, the program will remain running.


To see active screens
Run this command
screen -ls


And to go to that screen, this command

screen -r {id}

Donation

If you found V2IpLimit useful and would like to support its development, you can donate on the following crypto network:
  • TRON network (TRX): TLARb1Ns5vA7pH6wqSyZGreDbGooS85Mi5

Thank you for your support!


If this program was useful for you, please give it a star ⭐