git clone --recurse-submodules [email protected]:PierrePaul/wifipunch.git
- for building: docker, docker-compose
- for the code: see wifipunch/requirements.txt
docker-compose exec wifipunch flask db migrate
docker-compose exec wifipunch flask db update
- testing the API:
./test_api.sh [<IP:port (default: localhost)>]
Copy one of the following file, depending on your shell :
.env.sample
to.env
if you are using bashdev.env.fish
to.env
if you are using fish
This file will be automatically loaded by docker-composer
when you start the services.
There is also a pi.env.fish
if you are deploying to a remote docker host.
Configure the environment variables (see .env, dev.env.fish, pi.env.fish):
INTERFACE
: the network interface the container will bind onIP_ADDR
: force assign an IP Address to the containerSUBNET
: the subnet the container will be connected toGATEWAY
: gateway the container should use to communicate with the networkFLASK_ENV
:production
ordevelopment
VOLUME_PATH
: set to""
if deploying remotely, or./
if using locallySENDGRID_API_KEY
: Sendgrid API KeyFROM_EMAIL
: email to send fromTO_EMAIL
: email to send fromWIFIPUNCH_API_KEY
: api key to accept for sending reports
docker-compose build
: this will build the wifipunch container
docker-compose up
: this runs the db container and wifipunch
- set
DOCKER_HOST
tossh://<user>@<rpi IP>
- run
docker-compose up -d
- create crons:
- to send reports, ie
0 2 * * * http 172.16.238.3:5000/reports api_key=SomethingReallyCustom
- to scan the network, ie
0 2 * * * http post 172.16.238.3:5000/mac/log
- to send reports, ie
- if the container cannot access internet (ie: can't send emails), it could be due to the
$GATEWAY
improperly set. To verify rundocker-compose exec wifipunch ip ro
and check that it matches. If not, you will have todocker-compose down
, source the variable file and callup
again.