-
Notifications
You must be signed in to change notification settings - Fork 1
Running
One of the major improvements to WildRank in this release is the new FastAPI/Uvicorn based web server. This server has vastly improved performance over the previous Python http.server based implementation while supporting even more extra features.
The server is run from the repository root and can be started with just one command:
uvicorn --host 0.0.0.0 --app-dir python server:app
This starts the server such that it can be accessed via any IP address that leads to the current machine at port 80 (you may require elivated permissions to use well-known ports port like 80). A custom port can be used with the ---port
argument and the number of workers (think threads) used by the server (to increase performance) can be set with the --workers
argument. Finally, the server will look for an environment variable named WILDRANK_PASSWORD
to set a password for POST requests. For development purposes I often use this command:
WILDRANK_PASSWORD=test uvicorn --host 0.0.0.0 --port 8080 --workers 1 --app-dir python server:app
The app can then be accessed in your web browser at http://localhost:8080
From a fresh clone of the repo most features of the app should work, but some configuration is required for some features to work.
In order to pull event data from The Blue Alliance an API key is required. While the data can be imported via zip transfer one client will need to pull the data from TBA. In order to get an API key follow these steps:
- Navigate to https://www.thebluealliance.com/account
- Scroll to the "Read API Keys" section
- Enter a description of your app in the "Description" field
- Press "Add New Key"
- Copy the new "X-TBA-Auth-Key" from the table below
Then, to add the API key to WildRank open the settings configuration file, config/settings-config.json
. Place the key in the tba
field of the keys
section.
If you opted to set a password for the server the client must also be made aware of the password in order to POST files to the server. Also in the keys
section of the settings configuration file, config/settings-config.json
. Place the password in the server
field.
Neither of the above configurations are a particularly secure method. This is because the config file with the keys will be served to any connected clients. If you care about the security of these keys they should not be placed in the served configuration file, but instead in a client side file. This can be done using one of 3 methods
- Zip Transfer
- Place a settings configuration file in a zip archive
- In the "Transfer Raw Data" field import "Settings" from the local zip archive
- Settings Import
- At the bottom of the "Settings Editor" upload a settings configuration file via the "Upload" button
- Press "Apply"
- Settings Editor Entry
- Both keys can be entered in their appropriate field in the "Keys" column of the "Settings Editor"
- Press "Apply" at the bottom