-
Notifications
You must be signed in to change notification settings - Fork 23
Configuration File
The configuration file is a Python file that contains the settings for the MasterCryptoFarmBot. This file is located in the MasterCryptoFarmBot
directory and is named config.py
.
To create a configuration file, copy the config.py.sample
file and rename it to config.py
. This file will contain the configuration settings for the MasterCryptoFarmBot.
π΄ Important: Keep the original config.py.sample
file intact. Do not rename, delete, or edit config.py.sample
, as it is required for updates. Make your changes in config.py
after creating a copy of config.py.sample
.
config.py
contains the following settings:
-
web_server
: The settings for the web server, which is a dictionary containing the following keys:-
host
: The IP address of the web server.- Default value:
127.0.0.1
, meaning the web server will be accessible only from the same machine (localhost) and not from the network or the internet. - To access the web server from the network or the internet, change it to
0.0.0.0
or the specific IP address of the machine within the private network or the internet. - Example values:
192.168.1.1
(private network) or200.200.100.100
(public internet). - Setting it to a private IP address restricts access to the web server from within the private network only.
- Setting it to a public IP address allows access to the web server from the internet.
- For a Linux VPS without a GUI, set it to
0.0.0.0
to access the web server from the internet.
- Default value:
-
port
: The port number of the web server.- Default value:
3232
. This means you can access the control panel at:http://YOUR-IP:3232
. - You can use integer values between 1 and 65535.
- Ensure the port is not being used by other programs.
- For internet-facing projects, use a random port between 10000 and 64000.
- If you want to access it from a private network or the internet, ensure the selected port is open and allowed by the firewall.
- For example, if you change the port to
54321
, you can access the control panel at:http://YourIP:54321
.
- Default value:
-
-
telegram_api
: This setting configures your Pyrogram settings. If you are not planning to use Pyrogram, this part is not required. For more information about this part, please visit HowTo: Get Telegram API_ID & API_HASH. -
auto_update
: This setting enables or disables the automatic update feature. If set toTrue
, the bot will automatically check for and download updates. If set toFalse
, the bot will not check for updates for the MasterCryptoFarmBot (modules will still be updated). If you enable this feature, make sure to run the project withstart_windows.cmd
orstart_linux.sh
, as they will restart the project if it closes due to updates. -
auto_update_modules
: This setting enables or disables the automatic update feature for the modules. If set toTrue
, the bot will automatically check for and download updates for the modules. If set toFalse
, the bot will not check for updates for the modules. -
update_check_interval
: The interval in seconds at which the bot checks for updates. The default value is3600
seconds (1 hour). You can change this value to check for updates more or less frequently. -
run_delay
: The delay in seconds before the bot starts running modules. The default value is60
seconds. You can change this value to start the modules sooner or later after launching MasterCryptoFarm. -
display_module_logs_in_console
: This setting enables or disables displaying the module logs in the console. If set toTrue
, the logs will be displayed in the console. If set toFalse
, the logs will not be displayed in the console, but you can still view logs on the modules section of WebPanel. -
auto_setup_accounts
: This setting automates the setup of your Telegram accounts by adding a last name and profile picture. Note that adding a username is mandatory and enabled by default, and it cannot be disabled.
Here is an example of a configuration file:
config = {
"web_server": {
"host": "0.0.0.0",
"port": 54321,
},
"telegram_api": {
"api_id": 123456789, # Must be integer/number, no " at start and end
"api_hash": "00000ceeaeeeeeeeeeeeaaaaaaaaa", # Must be string, don't forget " at start and end
},
"auto_update": True,
"auto_update_modules": True,
"update_check_interval": 3600,
"run_delay": 30,
"display_module_logs_in_console": False,
}
You can check the config.py.sample file for more information.
To edit the configuration file, open the config.py
file in a text editor. You can change the settings according to your requirements. After making the changes, save the file.
- Windows users can use Notepad or Notepad++ to edit the file.
- Linux users can use Nano or Vim to edit the file.
After editing the configuration file, you need to restart the bot for the changes to take effect. If the bot is running, stop it and start it again.
If you want to reset the configuration file to its default settings, you can delete the config.py
file and copy the config.py.sample
file again. After copying the config.py.sample
file, rename it to config.py
.
If you are using a firewall, you need to open the port you set in the configuration file. For example, if you set the port to 54321
, you need to open port 54321
in your firewall settings.
- Open the Windows Defender Firewall settings.
- Click on "Advanced settings" on the left side.
- Click on "Inbound Rules" on the left side.
- Click on "New Rule" on the right side.
- Select "Port" and click "Next".
- Select "TCP" and enter the port number you set in the configuration file (e.g.,
54321
). - Click "Next" and select "Allow the connection".
- Click "Next" and select the network types you want to allow the connection on.
- Click "Next" and enter a name for the rule (e.g.,
MasterCryptoFarmBot
). - Click "Finish" to create the rule.
For more detailed steps, refer to this guide on how to open a port in Windows Firewall.
First, determine which firewall you are using. The most common firewalls are UFW, Firewalld, and nftables. Check the firewall status to identify which one you are using.
Add firewall rules if your firewall is enabled. If your firewall is disabled, you can skip this step.
-
Check the status of UFW:
sudo ufw status
-
Allow the port:
sudo ufw allow 54321
-
Check the status again:
sudo ufw status
-
Check the status of Firewalld:
sudo firewall-cmd --state
-
Allow the port:
sudo firewall-cmd --zone=public --add-port=54321/tcp --permanent
-
Reload the firewall:
sudo firewall-cmd --reload
-
Check the status again:
sudo firewall-cmd --list-all
-
Check the status of nftables:
sudo nft list ruleset
-
Allow the port:
sudo nft add rule inet filter input tcp dport 54321 accept
-
Save the rules:
sudo nft list ruleset > /etc/nftables.conf
-
Reload nftables:
sudo systemctl reload nftables
For more detailed steps, refer to these guides on opening a port in UFW, Firewalld, and nftables.
β If you have a question, idea, or suggestion, You can create new discussion in the Discussions
π If you encounter a bug or issue, please create a new issue in the Issues section.
For more information and updates, join our π’ Telegram Channel or join our π¬ Telegram Group for discussion and support.