How to start lipi server
MazeMap provides lipi in a docker container that you can download and start. Follow the instructions below to get it working
...
Lipi is now available via docker. if you already have docker installed, you could run LIPI with only a few commands. To install docker on various platforms see https://docs.docker.com/get-docker/
Running LIPI
Create an environment variable file lipi-docker-env-file
Code Block | ||
---|---|---|
| ||
LIPI_API_KEY |
...
POSITION_PROVIDER_USERNAME - Username of the position provider (CMX, Aruba ALE...)
...
POSITION_PROVIDER_PASSWORD - Password of the position provider (CMX, Aruba ALE...)
...
POSITION_PROVIDER_HTTP_SCHEME - The http protocol of the position provider (CMX, Aruba ALE...)
Required variables
LIPI_API_KEY
POSITION_PROVIDER_USERNAME
POSITION_PROVIDER_PASSWORD
Optional variables and defaults
POSITION_PROVIDER_HTTP_SCHEME='https'
Running LIPI
1 . Download the lipi
Download from https://www.jottacloud.com/s/113fa527a64ca7b4c2fb5f22ba0f217b8b5 .
Take note of the version of the tar file.
Eg. for a file named
lipi_server_4.1.0_0.tar
, the version will be4.1.0_0
2 . Load the image
Code Block | ||
---|---|---|
| ||
VERSION=<the-tar-version>
docker load --input lipi_server_$VERSION.tar |
3 . Start Server
Code Block | ||
---|---|---|
| ||
VERSION=<the-tar-version>
LIPI_API_KEY=<lipi-api-key>
docker run -e LIPI_API_KEY=$LIPI_API_KEY \
-e POSITION_PROVIDER_USERNAME=user \
-e POSITION_PROVIDER_PASSWORD=pass \
-p 4431:443 \
--name lipi-server \
lipi-server:$VERSION |
4 . Start Server with a local config.json
file
Code Block | ||
---|---|---|
| ||
VERSION=<the-tar-version> LIPI_API_KEY=<lipi-api-key> docker run -e LIPI_API_KEY=$LIPI_API_KEY \ -e POSITION_PROVIDER_USERNAME=<put-username-here>=<lipi-api-key> # Where DNA Spaces is the position provider, the following should be left as is POSITION_PROVIDER_USERNAME=<username-here> POSITION_PROVIDER_PASSWORD=<password-here> |
Use the environment variable file to start the lipi
For production: Start the service in the background, by adding the --detach
option:
Code Block | ||
---|---|---|
| ||
sudo docker run --detach --rm --name lipi \
--env-file=lipi-docker-env-file \
-p 443:8080 \
gcr.io/mazemap-public-docker/lipi:latest |
Special case: For debugging/testing: you can run without the --detach option to remain inside the docker context and see what is going in after starting it.
Code Block | ||
---|---|---|
| ||
sudo docker run --rm --name lipi \
--env-file=lipi-docker-env-file \
-p 443:8080 \
gcr.io/mazemap-public-docker/lipi:latest |
Inspecting logs
Docker has a command to view the logs of containers running in the background: docker logs <container_name>
.
By default this command prints everything logged since the container was started and then returns you to the command prompt. You may add the option --follow
to see the log messages as they arrive. If the service has been running for a long time and you’re only interested in, say, messages from the last 5 minutes, use --since 5m
. Putting it all together:
Code Block |
---|
sudo docker logs --since 5m --follow lipi |
Start Server with local config.json
file
This is a special case, the normal case for production use is to start the service in the background, as described further up in this document.
Code Block | ||
---|---|---|
| ||
sudo docker run --rm --name lipi \ --env-file=lipi-docker-env-file \ -e POSITION_PROVIDER_PASSWORD=<put-password-here>v <your-config-path>:/app/resources/local_config.json \ -p 443:4438080 \ -v <your-config-path>:/srv/config.jsongcr.io/mazemap-public-docker/lipi:latest |
Applying LIPI Config Changes
Changes to the LIPI configuration can be applied by deleting the container:
Code Block | ||
---|---|---|
| ||
sudo docker rm -f lipi |
And then starting again it in the same way as normal.
Available LIPI versions
You can choose to run a specific LIPI version by replacing latest
with a specific version string. To list available versions:
Code Block | ||
---|---|---|
| ||
wget -q https://gcr.io/v2/mazemap-public-docker/lipi/tags/list -O - | \ --name lipi-server \ lipi-server:$VERSIONpython -c "import json, sys; tags=json.loads(sys.stdin.read())['tags']; print(*[tag for tag in tags if len(tag) < 40], sep='\n')" |
Recognized variables
LIPI_API_KEY - Api key from lipi config in Map Editor
LIPI_HTTP_SCHEME - The http protocol LIPI will run with (
http
orhttps
)POSITION_PROVIDER_USERNAME - Username of the position provider (CMX, Aruba ALE...)
POSITION_PROVIDER_PASSWORD - Password of the position provider (CMX, Aruba ALE...)
HTTP_PROXY_SCHEME - Proxy server protocol (http or https)
HTTP_PROXY_HOST - Host name of proxy server
HTTP_PROXY_PORT - Port number for proxy server
REQUIRE_API_KEY_IN_NOTIFICATIONS - If set to “yes”, rejects CMX notifications if they don’t have X-LIPI-API-Key header set to the value of LIPI_API_KEY. Added in 4.2.12.
Required
LIPI_API_KEY
POSITION_PROVIDER_USERNAME
POSITION_PROVIDER_PASSWORD
Optional and defaults
LIPI_HTTP_SCHEME='https'
Possible Values:
http
,https
REQUIRE_API_KEY_IN_NOTIFICATIONS='no'
Security and privacy considerations
The LIPI_HTTP_SCHEME should only be set to http for testing purposes, as this means that users' positions will be sent unencrypted between LIPI and the user devices.
The REQUIRE_API_KEY_IN_NOTIFICATIONS variable should be set to “yes” in production, otherwise it is theoretically possible for malicious users to pose as a CMX server and inject position and user data into the LIPI, which could cause service disruptions.