Skip to Content
SetupStandard

Standard

Install Prerequisites

Install NodeJS 

Install Rust 

Install curl for your system if it’s not already present.

See Environment for a full variable reference and defaults.

Install

Clone this repo:

git clone https://github.com/TurtIeSocks/Koji.git

Install OR-Tools:

⚠️

Check the OR-Tools Prerequisites 

For example, on Ubuntu 20.04:

sudo apt update sudo apt install -y build-essential cmake lsb-release
sudo chmod +x or-tools/install.sh && ./or-tools/install.sh

Create a new schema in your database for Kōji.

Copy the env file:

cd server && cp .env.example .env

Edit the env file: nano .env:

# To escape special characters you must surround the values with single quotes ('') # Commented out variables are optional # Your Golbat or RDM database SCANNER_DB_URL='mysql://golbat_user:golbat_password@host:3306/golbat_database' # Your Dragonite or RDM database (if you're using a hybrid Golbat/RDM setup) CONTROLLER_DB_URL: 'mysql://dragonite_user:dragonite_password@host:3306/dragonite_database' # Your Koji database KOJI_DB_URL='mysql://koji_user:koji_password@127.0.0.1:3306/koji_database' # Max Database connections # MAX_CONNECTIONS=100 # Your Koji API bearer token and client password KOJI_SECRET='your_super_secret' # Host address # HOST='0.0.0.0' # Host port # PORT='8080' # Start latitude on initial client load # START_LAT=0 # Start longitude on initial client load # START_LON=0 # Nominatim URL used for searching and importing geofences from OSM # NOMINATIM_URL='https://nominatim.openstreetmap.org' # highly recommended using your own # Logging level | error | warn | info | debug | trace # LOG_LEVEL=info

Compile the client:

cd ../client && yarn install && yarn build

Compile the server:

# you might have to also install pkg-config (`apt install pkg-config`) cd ../server && cargo install --path . --force

Optionally install PM2  to run the server in the background:

npm install pm2 -g pm2 start koji # from the /server folder

Updating

# pull latest git pull # recompile OR-Tools ./or-tools/install.sh # recompile client cd client && yarn install && yarn build # recompile server cd ../server && cargo install --path . --force # if using PM2 pm2 restart koji
Last updated on