HSE Microsoft Auth Bot

Демонстрация бота для защиты 03.06.2021

Демонстрация

Development

  1. Setup environment

    git clone git@github.com:NanoBjorn/hse_ms_bot.git
    cd hse_ms_bot
    
    # python3 -m pip install virtualenv
    python3 -m virtualenv env
    source env/bin/activate
    pip install -r requirements.txt
  2. Install docker

  3. Run postgres locally:

    docker-compose run -p 5432:5432 postgres 
  4. Install ngrok

  5. Run ngrok locally to publish 8000 port with https

    ngrok http 8000
  6. Fill .env file

    cp .env.sample .env

    and fill it manually

  7. Run main.py in src/server, main_worker.py in src/worker and main_ms.py in src/ms

    Server will run on https://0.0.0.0:8000

Deployment

  1.  git clone git@github.com:NanoBjorn/hse_ms_bot.git
     cd hse_ms_bot/
  2. Fill .env file

    cp .env.sample .env

    and fill it manually

  3. Install nginx

  4. Setup nginx with ./docker/nginx.conf file

  5. Install docker

  6. Run docker-compose

    docker-compose up --build --detach

Adding bot to your chat

  1. Find @hsechatauthbot bot in Telegram
  2. Add @hsechatauthbot to your chat
  3. Make @hsechatauthbot an administrator

Available commands for administrators

  1. /ignore - command to add a user to whitelist. Can be used as reply a to a Telegram "new chat member" message or just with the username:
/ignore @username
/ignore username
  1. /ban - command to ban a user. Banned user is deleted from all chats that are administered by bot. Can be used as a reply to a message of a banning user or just with the username:
/ban @username
/ban username