- Install Python 3.10+.
- Install dependencies with
pip install -r requirements.txt. - Run
scripts/set_god_password.pyto set up DB and God user.- You can create a
users.csvfile in thescriptsdirectory to automate the creation of the God user and any other users when you run this script. Use theusers.csv.distfile as a template.
- You can create a
- Run
main.pyto start the server.
There are several .bat files provided to automate or simplify working with this software.
install.bat- Performs a full installation in the root folder of the software utilizing a virtual environment.bat/add_fake_comms.bat- Sends 5 fake commissions to the server.bat/setup_users.bat- Runsset_god_password.py. Helpful if you draftusers.csvprior.bat/start_server.bat- Starts the server, simple as that.bat/priv/run.bat- Runs a single line of batch in the virtual environment set up byinstall.bat.bat/priv/run_with_token.bat- Identical torun.bat, with the addition ofKOFI_VERIFICATION_TOKENbeing set in the environment.
Both add_fake_comms.bat and start_server.bat require that you populate bat/priv/kofi_verification_token.txt with your Ko-fi token. This is detailed in the following section.
The following instructions assume you have a domain that can be used to hit the machine you're using to run Commission Tracker, and have configured your network to allow it to be hit from the public internet.
- Edit conf/config.ini
- Change the
hostvalue to the local IP of the machine Commission Tracker is running on. - Set
portto whatever value you want. Set it to port 80 if you want users to hit the Commissions Tracker without having to specify a port in their URL.
- Change the
- Go to the Ko-fi webhooks page and set
{domain}/kofi_webhookas the webhook URL, where{domain}is the domain you have set up for your machine. - Add a
KOFI_VERIFICATION_TOKENenvironment variable using the verification token provided by the Ko-fi webhooks page, under theAdvancedaccordion. - Stop
main.pyif it's running, and start it again.- On Windows, you may need to logout and back in for your environment variable change to take effect.
- Use the "Test a webhook" buttons on the Ko-fi webhook page. You should see a commission appear on the Commission Tracker.
You can also use the scripts/test_kofi_webhook.py script to make randomized calls to your webhook.
Note: This method has been disabled in this version of the Commission Tracker. Use the Ko-fi setup above.
- Install Python 3.10+.
- Install dependencies with
pip install -r requirements.txt. - Add a
SERVICE_ACCOUNT_PASSWORDenvironment variable. Can be any value. - Create a Google Form for people to use to submit commissions, and have it send the responses to a Google Sheet.
- Change the Google Sheet's sharing settings so that anyone with the link can view it.
- Add a
SPREADSHEET_IDenvironment variable with the ID of the Google Sheet to pull data from.- Example: From the link
https://docs.google.com/spreadsheets/d/aaaBBBcccDDD/edit, it would beaaaBBBcccDDD
- Example: From the link
- Create a developer key for Google Sheets and add as a
GOOGLE_SHEETS_DEVELOPER_KEYenvironment variable.- See this page for instructions on how to create a developer key. I recommend limiting the scope of the key to Google Sheets.
- Run
scripts/set_god_password.pyto set up DB and God user. - Run
main.pyto start server. - Run
run_update_loop.pyto set up background process to keep DB updated with new commissions.