Skip to content

Globe999/csb_door_opener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSB Door Opener

This is a Flask application that uses Selenium to automate the process of opening a door at Chalmers studentbostäder. It exposes a single API endpoint /open that triggers the door opening process when a GET request is made. It creates a headless browser which executes the same steps as a user would have to do to open a door.

Environment Variables

The application uses the following environment variables:

  • BASE_URL: The base URL of the website.
  • LINK_URL: The URL of the link to be clicked.
  • APTUS_URL: The URL of the Aptus page.
  • USERNAME: The username for login.
  • PASSWORD: The password for login.
  • SECRET_KEY: The secret key for the Flask application.
  • ENTRANCE_DOOR_ID: The ID of the entrance door element.
  • PORT: The port on which the Flask application runs.
  • API_KEY: The API key for accessing the /open endpoint.

Refer to .env.example to see default environment variables

Running the Application

To run the application, first install the required Python packages:

pip install -r requirements.txt

Docker

The application can also be run inside a Docker container. To build and run the Docker container, use the following docker-compose.yml:

version: '3'
services:
  csb_door_opener:
    image: globeeee/csb_door_opener:main
    env_file:
      - .env
    ports:
      - "${PORT}:${PORT}"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published