python3-cyberfusion-rabbitmq-consumer-log-server
Log server for RabbitMQ consumer.
Use the RabbitMQ consumer? The log server gives you an overview of RPC requests/responses - from all your RabbitMQ consumers - in one place.
Install
PyPI
Run the following command to install the package from PyPI:
pip3 install python3-cyberfusion-rabbitmq-consumer-log-server
Debian
Run the following commands to build a Debian package:
mk-build-deps -i -t 'apt -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
dpkg-buildpackage -us -uc
Configure
The log server consists of two parts: a web-based GUI, and an API.
API
The RabbitMQ consumer writes RPC requests/responses to the API. To let the consumer ship logs to the log server, see the consumer's README.
In the consumer, an API token must be set. Set it in /etc/rabbitmq-consumer-log-server/api_token (regular text file).
You can generate a random API token using openssl: openssl rand -hex 32
You don't need to keep the API token confidential: it's only used by the RabbitMQ consumer to write logs. Therefore, abuse would be a nuisance at the worst, not a data breach.
GUI
Use the web-based GUI to view RPC requests/responses.
The web GUI uses basic authentication. Set a password in /etc/rabbitmq-consumer-log-server/gui_password (regular text file).
You can generate a random password using openssl: openssl rand -hex 32
You can use any basic authentication username - it's ignored.
Retention
By default, logs are kept for 45 days. To override this, set the environment variable KEEP_DAYS to the number of days.
Periodic tasks
Using the Debian package? You don't have to do anything - periodic tasks are automatically executed using cron.
Otherwise, run the following commands periodically:
rabbitmq-consumer-log-server-purge-logs(every 24 hours)
Usage
Run
Manually
- Run migrations:
alembic upgrade head - Run the app using an ASGI server such as Uvicorn.
systemd
The server runs on :::4194.
systemctl start rabbitmq-consumer-log-server.service
Web GUI
Once the server is started, access the web GUI on /rpc-requests.
SSL
Use a proxy that terminates SSL. E.g. HAProxy.
When using a reverse proxy, 127.0.0.1 is trusted by default. To override this, set the FORWARDED_ALLOW_IPS environment variable.
For more information, see the Uvicorn documentation (look for --proxy-headers and --forwarded-allow-ips).
⚠️ Development
Developing the RabbitMQ consumer? Access the API documentation on /redoc (Redoc) and /docs (Swagger).
Developing the log server? After installing it, and running migrations, seed your database with example data:
python3 seed_example_data.py
You can run the seeder multiple times to fill up your database with more data.
Release files for python3-cyberfusion-rabbitmq-consumer-log-server 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1.tar.gz
| Download URL | python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
488dd30b94035f92f33ca60e0970e5b1ebbae4480609c4bf199129df80357acb
|
|
BLAKE2b-256 checksum How to use checksums |
5ea5f3df13fc39a80666eca326a9af9e7b106dceb8fabd2eae1f0ba6db7877b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1-py3-none-any.whl
| Download URL | python3_cyberfusion_rabbitmq_consumer_log_server-1.2.1-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1bf5ffa478d4fb80705c8f403a28152987e28ac88c6e1113a34c1945aa2a661
|
|
BLAKE2b-256 checksum How to use checksums |
3fce34b35bfa4467222a19946e8450f0c11e3d95b9b73b205d319f12cd97f990
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|