Giter VIP home page Giter VIP logo

asvz-enroller's Introduction

ASVZ Enroller

The asvz enroller is a Telegram-based ASVZ bot that signs you up for your ASVZ sports lessons as soon as registration opens. You send it links to lessons via Telegram and it will communicate with you as soon as you are enrolled. If a class is already full, it will periodically check and try to get you a spot.

The application automatically schedules enrolment jobs (done with selenium) and can be deployed easily using Docker on any host.

The application consists of two main parts. First, each user goes to a web interface that allows them to save their ASVZ credentials and link their Telegram account. Once this is done, interaction is only via Telegram. The web interface guides the user through all the details.

Note: The enroller (primarily the selenium code) is based on https://github.com/fbuetler/asvz-bot

Installation

To run this application you need to have Docker installed. Further you need to have a telegram bot API key.

Clone this repository and create a config.yaml file in the root and fill it with the required information. See config_example.yaml for details on how the file should be structured. See below for details on how to add users.

To start the containers simply run:

docker-compose up --build -d

By default this will expose the web interface on port 5090 on localhost. Modify the docker-compose.yaml file to change the port binding.

Creating users

Only the host can add new users. Use the admin.py script to create/reset/delete any users.

To create a user run:

python admin.py -u USERNAME

The script will automatically create a password for this user. The user can't change it. These login credentials are for the web interface that will allow him to store his ASVZ login credentials and connect to his telegram account.

If you want to reset a user run:

python admin.py -u USERNAME -r

This will delete any associated data and create a new password.

To delete a user run:

python admin.py -u USERNAME -d

Broadcasting

It might be of interest to broadcast messages to all users. This is mainly intended to announce downtime or similar things.

python broadcast.py -m "A test message"

This will send a message from the bot to all users that have connected a telegram account.

Data privacy

You should be aware that the application must store the ASVZ credentials of all users locally. So that the passwords are not completely unencrypted in the database, they are encrypted with a symmetric encryption. But the key is defined in the config and lies on the host machine as well. Primarily intended such that the host does not accidently reads passwords when analysing the database in case of bugs.

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.