Kumi
c13b8bd507
Introduce support for configuring the CryptPad Prometheus exporter via environment variables and command line arguments. This enhancement moves away from the previous method that required direct modifications to the source code, offering a more flexible and user-friendly approach for setting the pins directory and server port. By enabling dynamic configuration, users can more easily adapt the exporter to various environments without altering the codebase. The update includes parsing arguments at runtime and prioritizing command line inputs over environment variables for greater control. This change also encompasses improvements to code readability and structure, including better error handling and documentation within the exporter script.
29 lines
746 B
Markdown
29 lines
746 B
Markdown
# CryptPad Prometheus Exporter
|
|
|
|
This is a simple Prometheus exporter for CryptPad. Currently it only exports the number of registered users, but it is still a work in progress.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
python3 -m venv venv
|
|
source venv/bin/activate
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
source venv/bin/activate
|
|
python exporter.py
|
|
```
|
|
|
|
## Configuration
|
|
|
|
The exporter can be configured using environment variables or command line arguments.
|
|
|
|
- `PINS_DIR`/`--pins-dir`: The directory where the CryptPad pins are stored. Default: `/srv/cryptpad/data/pins`
|
|
- `PORT`/`--port`: The port the exporter listens on. Default: `8000`
|
|
|
|
## License
|
|
|
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|