Giter VIP home page Giter VIP logo

hcloud-tg's Introduction

hcloud-tg

License Docker size Docker build Docker build Docker pulls

Telegram bot for managing Hetzner cloud servers.

dups

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=<BOT_TOKEN> -e ALLOWED_USERS=<ALLOWED_USERS> -e HETZNER_API_KEY=<HETZNER_CLOUD_API> 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=<YOUR_BOT_TOKEN>
ALLOWED_USERS=<ALLOWED_USERS>
HETZNER_API_KEY=<YOUR_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

hcloud-tg's People

Contributors

navid2zp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.