-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate configuration handling to the confuse lib, take 2 #364
Changes from all commits
d121e0a
8050def
0c9f7a0
2d20311
39d395b
edb7506
42676a8
198e293
527eefe
d811a0e
6208892
2ea6b24
96ebce9
8d51de6
83db911
95204a3
a73aaea
5daca4f
a9e8baf
c88cdb8
4717d3d
ea1e0e3
d6be587
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,15 @@ verify the sender email. | |
Test with: | ||
|
||
``` | ||
SENDER="[email protected]" SENDER_NAME="ChiaDog" RECIPIENT="[email protected]" HOST=smtp.example.com PORT=587 USERNAME_SMTP=username PASSWORD_SMTP=password python3 -m unittest tests.notifier.test_smtp_notifier | ||
SMTP_SENDER="[email protected]" \ | ||
SMTP_SENDER_NAME="ChiaDog" \ | ||
SMTP_RECIPIENT="[email protected]" \ | ||
SMTP_HOST=smtp.example.com \ | ||
SMTP_PORT=587 \ | ||
SMTP_ENABLE_AUTH=true \ | ||
SMTP_USERNAME=username \ | ||
SMTP_PASSWORD=password \ | ||
python3 -m unittest tests.notifier.test_smtp_notifier | ||
``` | ||
|
||
## Slack | ||
|
@@ -113,7 +121,7 @@ Messages sent to the MQTT topic look like this: | |
Test with: | ||
|
||
``` | ||
HOST=<hostname> PORT=<port> TOPIC=<mqtt_topic> python3 -m unittest tests.notifier.test_mqtt_notifier | ||
MQTT_HOST=<hostname> MQTT_PORT=<port> MQTT_TOPIC=<mqtt_topic> python3 -m unittest tests.notifier.test_mqtt_notifier | ||
``` | ||
|
||
Or with full parameters: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ cd chiadog | |
cp config-example.yaml config.yaml | ||
``` | ||
|
||
4. Open up `config.yaml` in your editor and configure it to your preferences. | ||
4. Open up `config.yaml` in your editor and configure it to your preferences. The example is large, feel free to omit any portions where you're fine with the defaults! | ||
|
||
### Updating to the latest release | ||
|
||
|
@@ -141,8 +141,6 @@ git pull | |
./install.sh | ||
``` | ||
|
||
> Important: Automated migration of config is not supported. Please check that your `config.yaml` has all new fields introduced in `config-example.yaml` and add anything missing. If correctly migrated, you shouldn't get any ERROR logs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙌 |
||
|
||
## Monitoring a local harvester / farmer | ||
|
||
1. Open `config.yaml` and configure `file_log_consumer`: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Please copy this example config to config.yaml | ||
# and adjust it to your needs. | ||
# Most config values have sane defaults! This example is more verbose than it needs to be, | ||
# your config only needs to override what you want to change. | ||
|
||
# This is useful to differentiate multiple chiadog | ||
# instances monitoring multiple harvesters | ||
|
@@ -29,7 +31,7 @@ keep_alive_monitor: | |
# Enable this and you'll receive a daily summary notification | ||
# on your farm performance at the specified time of the day. | ||
daily_stats: | ||
enable: true | ||
enable: true # default: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is excellent comment! In a future iteration (e.g. when we bump the major version to 1.0) we can switch to more optimistic defaults but as discussed in the previous PR, now we’re keeping the conservative defaults from the code. |
||
time_of_day: "21:00" | ||
frequency_hours: 24 | ||
|
||
|
@@ -40,7 +42,7 @@ handlers: | |
enable: true | ||
# Transactions with lower amount mojos will be ignored | ||
# Use this to avoid notification spam during dust storms | ||
min_mojos_amount: 5 | ||
min_mojos_amount: 5 # default: 0 | ||
# Checks for skipped signage points (full node) | ||
finished_signage_point_handler: | ||
enable: true | ||
|
@@ -61,6 +63,9 @@ handlers: | |
# notifications to each of them. E.g. enable daily_stats only to E-mail. | ||
# If you enable wallet_events you'll get notifications anytime your | ||
# wallet receives some XCH (e.g. farming reward). | ||
# | ||
# NOTE: No notifier is enabled by default, and all notification topics are disabled by default. | ||
# You'll need to enable the notifiers and topics that you want to see! | ||
notifier: | ||
pushover: | ||
enable: false | ||
|
@@ -134,7 +139,7 @@ notifier: | |
decreasing_plot_events: true | ||
increasing_plot_events: false | ||
topic: chia/chiadog/alert | ||
qos: 1 | ||
qos: 1 # default: 0 | ||
retain: false | ||
credentials: | ||
host: '192.168.0.10' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
[tool.black] | ||
line-length = 120 | ||
line-length = 120 | ||
|
||
# No type hints: https://github.com/beetbox/confuse/issues/121 | ||
[[tool.mypy.overrides]] | ||
module = ["confuse", "confuse.exceptions"] | ||
ignore_missing_imports = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ python-dateutil~=2.8.1 | |
PyYAML==5.4 | ||
retry==0.9.2 | ||
pygtail==0.11.1 | ||
confuse==2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing these!