-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 使用 PostgreSQL 存储日志,使用 Gotify 发送工作流运行失败通知
- Loading branch information
Showing
6 changed files
with
57 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
# MongoDB 数据库 | ||
[mongodb] | ||
# 地址 | ||
host = "localhost" | ||
# 端口 | ||
port = 27017 | ||
# 数据库名 | ||
database = "jfetcher" | ||
|
||
# 日志 | ||
[postgres] | ||
host = "localhost" | ||
port = 5432 | ||
user = "postgres" | ||
password = "postgres" | ||
database = "jfetcher" | ||
|
||
[logging] | ||
# 是否保存日志 | ||
enable_save = true | ||
# 日志展示等级 | ||
display_level = "DEBUG" | ||
# 日志保存等级 | ||
save_level = "DEBUG" | ||
|
||
# 飞书消息推送 | ||
[feishu_notification] | ||
# 是否启用消息推送 | ||
enabled = true | ||
# 消息推送 Webhook URL | ||
webhook_url = "" | ||
# 任务运行失败消息卡片 ID | ||
failure_card_id = "" | ||
[notify] | ||
enabled: true | ||
host = "localhost" | ||
port = 8701 | ||
token = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
from sshared.config import ConfigBase | ||
from sshared.config.blocks import ConfigBlock, LoggingBlock, MongoBlock | ||
from sshared.strict_struct import NonEmptyStr | ||
|
||
|
||
class FeishuNotificationBlock(ConfigBlock, frozen=True): | ||
enabled: bool | ||
webhook_url: NonEmptyStr | ||
failure_card_id: NonEmptyStr | ||
from sshared.config.blocks import GotifyBlock, LoggingBlock, MongoBlock, PostgresBlock | ||
|
||
|
||
class _Config(ConfigBase, frozen=True): | ||
mongodb: MongoBlock | ||
mongo: MongoBlock | ||
postgres: PostgresBlock | ||
logging: LoggingBlock | ||
feishu_notification: FeishuNotificationBlock | ||
notify: GotifyBlock | ||
|
||
|
||
CONFIG = _Config.load_from_file("config.toml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.