infrabot-io.github.io

Documentation

Documentation for infrabot


Configuration file Overview


Configuration file config.json is located, by default in the infrabot installation directory C:\Program Files\infrabot.io

Default configuration file structure is shown below:

			        		
{
    "telegram_bot_token": "YOUR_API_TOKEN",
    "telegram_enable_logging": false,
    "telegram_enable_reminder": true,
    "telegram_enable_reloadconfig": true,
    "telegram_enable_emergency": true,
    "telegram_enable_showmyid": false,
    "telegram_powershell_path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "telegram_powershell_executionpolicy": "-ExecutionPolicy Unrestricted",
    "telegram_result_max_length": 12000,
    "telegram_allowed_users_id": [],
    "telegram_allowed_users_id_emergency": [],
    "telegram_allowed_users_id_reloadconfig": [],
    "telegram_allowed_users_id_getcommands": [],
    "telegram_allowed_users_id_remindme": []
}
							
			        	

Main Parameters

In the table below shown parameters` descriptions and how to properly to configure them. You can use Config Editor to configure your config.json file, 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_reminder Boolean Enable /remindme command.
telegram_enable_reloadconfig Boolean Enable /reloadconfig command.
telegram_enable_emergency Boolean Enable /emergency command.
telegram_enable_showmyid Boolean Enable /showmyid command.
telegram_powershell_path String Full path to PowerShell.exe on your system
telegram_powershell_executionpolicy String Execution Policy for PowerShell. By default Windows prevents PowerShell scripts execution. By default Unrestricted execution policy have been set in configuration file. 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 have been set. You can read more about this here: Read More
telegram_result_max_length Integer Limit result length in characters which Bot can send back to you. Imagine that you have created your own command with a script which gets logs from some directory and logs` size may be gigabytes. If you did a logic mistake in your script, Bot would have sent to you all that gigabytes of logs, if this parameter not existed....
telegram_allowed_users_id Array of Integers List of Telegram Users` ids from whom Bot can accept commands.
telegram_allowed_users_id_emergency Array of Integers List of Telegram Users` ids from whom Bot can accept /emergency command.
telegram_allowed_users_id_reloadconfig Array of Integers List of Telegram Users` ids from whom Bot can accept /reloadconfig command.
telegram_allowed_users_id_getcommands Array of Integers List of Telegram Users` ids from whom Bot can accept /getcommands command.
telegram_allowed_users_id_remindme Array of Integers List of Telegram Users` ids from whom Bot can accept /getcommands command. This parameter is checked before telegram_allowed_chats_id_remindme. If User is in the list, then User will have a permission to execute this command