On this page

Porygon is the name of the main backend server for OpenAGPS. It receives satframes from connected base stations, and will store and process them. It also (right now) handles the OpenCellID database, keeping it up to date, and provides a triangulation API.

Setup

Porygon is distributed as a Docker container, and requires a MariaDB database to be hosted for it.

When setting up Docker, set the following environment variables:

VariableValue
MARIADB_HOSTHost address
MARIADB_USERUser name
MARIADB_PASSWDPassword
OCID_TOKENOpenCellID token

The server is hosted on port 80 in the container.

Database

Porygon uses a MariaDB database; a script to initialize needed tables is shipped in the repository as [init.sql]{.title-ref}. The script is written in such a way that it does not overwrite or delete any data when being executed, therefore it is safe to always unconditionally run it on a database before starting the server. This, however, is not done by the container or by Porygon; it must be done manually.

Tokens

Porygon checks tokens to authenticate base stations before allowing them to submit satframes. The tokens are stored in the [tokens]{.title-ref} table in the [config]{.title-ref} database. They must be added manually. All API calls that do not result in data being changed in the API are not authenticated, and do not require tokens.