This application provides a database for tracking pilot-airstrip-aircraft checkout tuples. Once recorded the tuples can be searched to find available flight scheduling assignments based on the known parameters or to identify checkouts which should be prioritized for new training to alleviate scheduling constraints. A reporting feature allows analyzing checkouts per pilot, per airstrip, or per base of operations.
Checkniner stands on the shoulders of many incredible free & libre software giants. Among them are several particularly valuable projects which have made this application possible:
The only firm requirement for developing and testing checkniner
is an
installation of Python 3.7+. The steps below will also assume the presence
of git
, virtualenv
, and pip
.
First let's get the repository and set up the virtual environment.
$ git clone https://github.com/eallrich/checkniner.git
$ cd checkniner
$ virtualenv --python=python3 .
Next we'll provide a few dev settings and install the python dependencies.
$ echo "export DATABASE_URL='sqlite://$(pwd)/cotracker/dev.db'" >> bin/activate
$ echo "export DJANGO_SETTINGS_MODULE=cotracker.settings.development" >> bin/activate
$ echo "export PYTHONPATH='$(pwd)/cotracker/'" >> bin/activate
$ echo "export SECRET_KEY='$(head -c 15 /dev/urandom | base64)'" >> bin/activate
$ echo "export SENTRY_DSN=https://[email protected]/2" >> bin/activate
$ echo "export EXPORT_PREFIX=zyxwvutsr" >> bin/activate
$ source bin/activate
$ pip install -r requirements/development.txt
Then we have a bit of database set up work.
$ python cotracker/manage.py migrate --noinput
Finally we're ready to run our application!
$ honcho start
# Run the tests using the provided script
$ scripts/test
# If desired, generate a visual HTML report of the coverage
$ cd cotracker
$ coverage html --include="./*"
Unlike setting up for development, deploying a production-ready instance is intended to be as automated as practical. You'll only need to provide:
- A fresh Ubuntu 18.04 64-bit server
- A domain name pointing to the server's IP address
- A Sentry DSN
- A secret key to restrict access to exported files
If you have SSH access to the server you can use scripts/remote_init
to take
care of everything. Otherwise you'll need to connect to the server and do a few
things yourself before picking up with scripts/setup
- just follow what's in
scripts/remote_init
and perform those steps manually on your server.
We're going to assume these values for the above requirements:
DOMAIN
:checkouts.example.com
SENTRY_DSN
:https://[email protected]/1
EXPORT_PREFIX
:zyxwvutsr
You can read more about these settings (and the others the app supports) in the settings documentation.
The simplest option is to check out this repository locally and then run the
scripts/remote_init
script. Let's say the server's SSH connection string is
[email protected]
and that you've set up SSH keys.
$ git clone https://github.com/eallrich/checkniner.git
$ checkniner/scripts/remote_init [email protected] checkouts.example.com https://[email protected]/1 zyxwvutsr
After waiting approximately five minutes you should be able to visit your new instance at https://checkouts.example.com/ and be presented with the login screen.
Details for backing up and restoring the checkniner database are available in the scripts/backups readme.
The pilot weights feature supports the ability to send notification emails when a weight value is modified. Sending email is currently accomplished through the Mailgun API. To enable these email notifications set the following:
$ echo "export MAILGUN_SENDER=\"Checkniner <[email protected]>\"" >> bin/activate
$ echo "export MAILGUN_API_URL=https://api.mailgun.net/v3/example.com/messages" >> bin/activate
$ echo "export MAILGUN_API_KEY=key-0123456789abcdef" >> bin/activate
$ echo "export [email protected]" >> bin/activate
# Optional additional recipients
$ echo "export [email protected]" >> bin/activate
$ echo "export [email protected]" >> bin/activate