Skip to content
Snippets Groups Projects
Select Git revision
  • 4a275cadbb0deeaca6abf7ff0d14725ad0c10463
  • master default protected
  • config
3 results

stechuhr-server

  • Clone with SSH
  • Clone with HTTPS
  • Run dev-server with poetry

    To make a development server run on localhost:

    export FLASK_APP=stechuhr_server/server.py
    export FLASK_ENV=development
    poetry run flask run --cert=adhoc

    Run with python3-ven in production

    Make sure python3-venv is installed:

    sudo apt install python3-venv

    Then clone the repo and enter it:

    git clone ssh://git@code.hfbk.net:4242/pandemic_response/stechuhr-server.git
    cd stechuhr-server

    Create a new venv environment, activate it, install the reuqirements from requirements.txt and start the server

    python3 -m venv env
    source env/bin/activate
    pip3 install -r requirements.txt
    python3 stechuhr_server/server.py

    Check the output to find the config directory. You might want to run it as a different user tho.

    There is also a systemctl unit file that you probably need to change to your needs

    In production it makes sense to run stechuhr with gunicorn:

    source env/bin/activate
    gunicorn stechuhr_server.server:app

    Configuration

    ID verification

    in config.toml you can add a list of regex patterns that stechuhr (both on server and on client!) uses to verify the Card IDs. These two patterns for example allow upper/lowercase hex strings with lengths either between 6 and 16 characters OR exactly 24 characters:

    id_patterns = [
        "^[A-Fa-f0-9]{24}$",
        "^[A-Fa-f0-9]{6,16}$",
    ]

    If in doubt consider testing your regexes here