infrabot-io.github.io

Documentation

Documentation for infrabot


Configuration file overview


Configuration file is a file with the set of parameters which determine infrabot core functionality.

File config.json is a JSON type file located in the infrabot installation directory C:\Program Files\infrabot.io.

Default configuration file structure is shown below:

			        		{
    "telegram_bot_token": "Your_Bot_Token",
    "telegram_enable_logging": false,
    "telegram_enable_reloadconfig": true,
    "telegram_enable_emergency": true,
    "telegram_enable_showmyid": true,
    "telegram_powershell_default_path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "telegram_powershell_arguments": "-ExecutionPolicy Unrestricted -NoProfile",
    "telegram_result_max_length": 12000,
    "telegram_allowed_users_id": [],
    "telegram_allowed_users_id_emergency": [],
    "telegram_allowed_users_id_reloadconfig": [],
    "telegram_allowed_users_id_getcommands": []
}
							
			        	

Parameters

In the table below shown descriptions of the parameters and how to properly configure them. It is possible to use Config Editor to edit config.json file as well, however knowing each command will help you to troubleshoot in future.

Parameter Type Description
telegram_bot_token String Your Telegram API token key which you got from @BotFather
telegram_enable_logging Boolean Defines if Bot should log all activity
telegram_enable_reloadconfig Boolean Defines if /reloadconfig command is active. This command will reload config.json file and all plugins.
telegram_enable_emergency Boolean Defines if /emergency command is active. This command will immediately shutdown infrabot service to prevent further commands execution. After execution of this command service must be started manually.
telegram_enable_showmyid Boolean Defines if /showmyid command is active. This command will show Telegram ID of the user. Useful if there is a necessity to give access for user.
telegram_powershell_default_path String Defines full path to PowerShell.exe executable on your system
telegram_powershell_arguments String Determines arguments sent to PowerShell. Execution Policy and NoProfile arguments for PowerShell are specified by default. More about arguments here.
By default Windows prevents PowerShell scripts execution. Unrestricted execution policy is set in this parameter file to bypass this restriction. It is not safe to use Unrestricted execution policy. The best secure option is to use AllSigned type execution policy. Do not forget to sign your scripts when AllSigned type execution policy is set. You can read more about an execution policy here.
telegram_result_max_length Integer Defines a limit of maximum characters length which bot can send back to chat after script or application execution.
telegram_allowed_users_id Array of Integers Defines a list of Telegram Users` ids from which Bot can accept commands.
telegram_allowed_users_id_emergency Array of Integers Defines a list of Telegram Users` ids from which Bot can accept /emergency command.
telegram_allowed_users_id_reloadconfig Array of Integers Defines a list of Telegram Users` ids from which Bot can accept /reloadconfig command.
telegram_allowed_users_id_getcommands Array of Integers Defines a list of Telegram Users` ids from which Bot can accept /getcommands command.