This is a Telegram bot that allows you to access a terminal SSH mini app directly from your Telegram chat. The app is divided into two parts:
-
Web (Located in the
client
folder)- The UI is not using any frameworks, and it's written in plain JavaScript.
-
Server (Located in the
server
folder)- WebSocket server that the web part connects to for SSH communication
- SSH client that connects to the WebSocket server and executes commands on the server
- Express server that serves the web part
- Telegram bot (written by GrammyJS) to control the bot interface
Follow these steps to configure and run the Telegram SSH Mini App Bot:
-
Clone the Repository: Clone this repository to your local machine.
git clone https://github.com/meh7an/Teleminal.git cd Teleminal
-
Set Up Telegram Bot:
-
Create a bot on Telegram and obtain the API token from BotFather.
-
Create an
.env
file in the root directory and update the following variables:TOKEN=YOUR_TELEGRAM_BOT_TOKEN BOT_ID=YOUR_BOT_ID APP_ID=YOUR_APP_ID URL=YOUR_APP_URL PORT=YOUR_SERVER_PORT
-
-
Install Dependencies:
-
Install the required dependencies.
# In the root directory npm install
-
-
Start the App:
-
Run the following command to start both the web interface and the Telegram bot.
# In the root directory npm run start
-
Your Telegram SSH Mini App Bot should now be up and running. You can interact with the bot in your Telegram bot to open and use the SSH mini app.
To add a new server to the Telegram SSH Mini App Bot, follow these steps:
-
Start a chat with the bot on Telegram.
-
Send the
/addserver
command to the bot and tap on "Add Server". You can also open the interface directly by bot's menu button, but you need to configure it in the BotFather. -
Share the necessary server information with the bot. This typically includes the server's hostname or IP address, SSH port, username, and password or SSH key, depending on your authentication method.
-
After sharing the server information, the bot will process it and establish a connection to the server.
-
Once the connection is established, you will receive a connection message indicating that the server has been added successfully. Also, you will get the connection information from the bot's chat.
-
You can also send the
/shortcut
command to create a shareable shortcut directly using the bot interface.
Enjoy using your Telegram SSH Mini App Bot! If you encounter any issues or have questions, please refer to the GitHub Issues.