Porygon (backend)
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:
| Variable | Value |
|---|---|
| MARIADB_HOST | Host address |
| MARIADB_USER | User name |
| MARIADB_PASSWD | Password |
| OCID_TOKEN | OpenCellID 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.