Package: opendrift-leeway-webgui
AboutThis is a little Django web application that does anOpenDriftLeewaysimulation with a set of provided parameters via a web form. The result is sent to a user via e-mail.This is an experimental tool to help Search and Rescue operations. An experimental service is available atleeway.tuerantuer.org.Sample output from the leeway tool (100 points, 1km radius, south of Lampedusa):UsageDjango users have to be created in the CRUD backend, available athttps://leeway.example.com/admin. E-mail addresses should be added for users as they receive the result via e-mail.The program regularly fetches incoming mails via IMAP and starts simulations from key-value-pairs in the mail subject or text body. The sender of the mail needs to have an associated account. Allowed keys via e-mail are:longitude,latitude,object_type,radius,duration,start_time. The separator between key and value is=. Key-value-pairs are separated by;in the subject and by new lines in the text body. The date format for start date isYYYY-MM-DD HH:MM:SS.API usageAPI documentation can be found at:https://leeway.tuerantuer.org/api/docs/Authentication can be provided in two ways:Via your session cookie, obtained from the normal loginVia an authentication token, can be obtained via/api/auth/login/InstallationPrerequisite:Python 3.8 or later is required.Clone this repository and change into the new directory:gitclonegit@github.com:digitalfabrik/opendrift-leeway-webgui.gitleewaycdleewayCreate a virtual environment outside of the project directory and activate it:python3-mvenv~/.venvsource~/.venv/bin/activateInstall the dependencies:pipinstall-e.[dev]Create minimal config file/etc/opendrift-leeway-webgui.inito enableDEBUGmode:[base]DEBUG=TrueInitialize the database:cdopendrift_leeway_webgui
python3manage.pymigrate
python3manage.pycreatesuperuserBuild the enhanced Docker container:cdopendrift
dockerbuild-topendrift-leeway-custom.Development ServerSwitch into the cloned project and then into theopendrift_leeway_webguisubdirectory.Open two terminals:In the first terminal run:source../.venv/bin/activate
python3manage.pyrunserverIn the second terminal run:source../.venv/bin/activate
celery-Aleewayworker-lINFOReleasingRunbumpver updateto perform the following tasks with one command:Bump the version inpyproject.tomlCreate a version bump commitCreate a new version tagPush the commit and tagCreate a new release on PyPI via GitHub ActionsProduction ServerThis details the installation on Debian with Apache2 and mod_wsgi.Create target directory on the production system:sudomkdir/opt/iopendrift-leeway-webgui
sudochownwww-data:www-data/opt/opendrift-leeway-webguiCreate the virtual environment:sudo-uwww-databash
python3-mvenv.venvsource.venv/bin/activateInstall the application into the virtual environment:pipinstallopendrift-leeway-webguiCopy the example config file to/etc/opendrift-leeway-webgui.iniand fill in the templateInstall Docker and add thedockergroup to thewww-datauser.Create symlink to facilitate the Apache configuration:ln-s$(python-c"from opendrift_leeway_webgui.core import wsgi; print(wsgi.__file__)").Configure Apache2 according to the example.Set up Celery worker withleeway-celery.serviceand start the service.