mirror of
https://github.com/status-im/status-bot.git
synced 2026-08-27 10:41:08 +00:00
1c67a08b41feb82f78895ae9ac2b2f364626eb3f
Related to https://github.com/status-im/status-bot/issues/7 - Add custom logger to `Account` class - Add `display_name` validation based on Status App - Update new `display_name` for other accounts when account has been recovered with mnemonics - Update documentation
Status App Monitoring
Monitoring tool for Status App communities
Setup
Environment Variables
POSTGRES_USERNAME- Postgres username.POSTGRES_DATABASE- The database name in the Postgres connection.POSTGRES_HOST- The Postgres host name that will be remotely connected to.POSTGRES_PORT- The Postgres port that will be remotely connected to.STATUS_BACKEND_BASE_URL(OPTIONAL) - The Status Backend URL. If you are running locally you do not need this variable (localhostwill be automatically set). If you are running it in a Docker container, please set it tostatus-backend(as thecontainer_nameof thedocker-compose.yaml).STATUS_USERNAME- The Status username that will be used to create an account. This is required if you are running Dockerfile forcreate_account.py.STATUS_PASSWORD- The Status password that will be used to create an account. This is required if you are running Dockerfile forcreate_account.py.
Account Creation
To create an account, please make sure you have set the following environment variables:
STATUS_BACKEND_BASE_URLSTATUS_USERNAMESTATUS_PASSWORD
docker compose --profile account-creation up
Monitoring
To download and upload messages, please make sure you have set the following environment variables:
POSTGRES_USERNAMEPOSTGRES_DATABASEPOSTGRES_HOSTPOSTGRES_PORTSTATUS_BACKEND_BASE_URLSTATUS_USERNAME- required ifbot_nameis not provided in the config.
docker compose --profile monitoring up
Status Backend
Run Backend independently so you can develop and test locally.
docker compose --profile backend up
Python
- Setup environment. Conda example:
conda create -n status-monitoring python=3.12
Note: Code has been tested with Python 3.12.
- Install requirements
pip install -r requirements.txt
Note: If you are on Windows, you will have to install psycopg2 instead of psycopg2-binary.
Files
Short explanation of what each runnable file does:
create_account.py- create a Status App account for the givenusernameandpassword. Example runs:python create_account.py -u snt-maxxer -p StatusApp#123python create_account.py --username snt-maxxer --password StatusApp#123python create_account.pyworks if you have addedSTATUS_USERNAMEandSTATUS_PASSWORDin your.envfile.
download.py- download all messages and overall community info from the specified Status App channels inconfig.yaml.upload.py- upload data fromdownload.pyto Postgres.
Languages
Python
99.5%
Dockerfile
0.5%