Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/navid2zp/hcloud-tg
Telegram bot for managing Hetzner cloud servers.
https://github.com/navid2zp/hcloud-tg
cloud hcloud-tg hetzner hetzner-api hetzner-cloud hetzner-cloud-servers telegram-bot
Last synced: about 1 month ago
JSON representation
Telegram bot for managing Hetzner cloud servers.
- Host: GitHub
- URL: https://github.com/navid2zp/hcloud-tg
- Owner: Navid2zp
- License: mit
- Created: 2020-12-26T13:23:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-30T15:51:09.000Z (over 3 years ago)
- Last Synced: 2024-11-04T07:35:50.210Z (about 2 months ago)
- Topics: cloud, hcloud-tg, hetzner, hetzner-api, hetzner-cloud, hetzner-cloud-servers, telegram-bot
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 39
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hcloud-tg
Telegram bot for managing Hetzner cloud servers.
## Running
hcloud-tg requires some environment variables to work.
`BOT_TOKEN`:
Your bot token which you got from @BotFather.`ALLOWED_USERS`:
A list of users telegram id that are allowed to use the bot. IDs should be separated using '-' (12345678-3215477). You can either get your id by messaging `@get_id_bot` bot or you can run the bot without any allowed users and send `/me` command to get a reply containing your telegram id.`HETZNER_API_KEY`:
An API key generated from Hetzner cloud console. Note that only servers that are in the API project will be available to manage.### Docker:
**Using `docker run`:**
```
docker run -e BOT_TOKEN= -e ALLOWED_USERS= -e HETZNER_API_KEY= navid2zp/hcloud-tg
```**Using `docker-compose`:**
create a `docker-compose.yml` file:
```
version: "3.9"services:
hcloud-tg:
container_name: hcloud-tgbot
image: navid2zp/hcloud-tg
env_file: ./env.list
restart: always
```create a file containing environment variables named `env.list` next to `docker-compose.yml`:
```
BOT_TOKEN=
ALLOWED_USERS=
HETZNER_API_KEY=
```
and then run: `docker-compose up`### Python:
Add the required environment variables and then:
```
git clone https://github.com/Navid2zp/hcloud-tg.git
cd hcloud-tg
pip install -r requirements.txt
python bot.py
```## Supported actions
- reset
- reboot
- shutdown
- power on
- power off
- root password reset## Docker hub
https://hub.docker.com/r/navid2zp/hcloud-tg
License
----
MIT