AmigoProxy
A proxy for transportation devices.
Running with Docker
This is the easiest way to get AmigoProxy running, specially on a development environment.
- Install docker and docker-compose
- Clone this repository:
git clone git@github.com:amigocloud/amigoproxy.git
- Create a secrets file:
cd amigoproxy/src/amigoproxy
cp secrets.py.dist secrets.py
- Edit the
secrets.py
with your favorite editor and Set an appropriateSECRET_KEY
. You can leaveHIPCHAT_TOKEN
variable empty. - If you wish to change the broker's username and/or password, do so in
docker-compose.yml
(lines 68-69). Then reflect the changes in lines 55-56 and in thesecrets.py
file. - Run
docker-compose up -d
to bring up all the services. - Create database tables and superuser:
docker exec -ti amigoproxy_django_1 manage.py syncdb
- That's it. You can now open the dashboard at
http://localhost
Running on production
Additionally to the steps presented above, you might want to disable DEBUG
mode.
To do so, either edit src/amigoproxy/settings.py
or create a new file src/amigoproxy/local_settings.py
and set the DEBUG = False
there.
You can use this file to tweak any other setting you want.
Usage
Let's first define the purpose of each term presented in the dashboard:
- Targets: The services that will receive the requests (described by a name and an URL).
- Sources: The devices that send data (for example, buses).
- Groups: Groups of targets.
Devices can send data to the proxy through a POST
request to the main URL, for instance:
https://proxy.amigocloud.com
Once devices start sending data to the proxy, you will be able to search them by their ID. Then you can then assign them Groups (of Targets) that will recive data from that particular device.
Optionally, you can set a Group to be default, meaning that all its Targets will receive data coming from all the devices.