File tree Expand file tree Collapse file tree 4 files changed +3
-46
lines changed
Expand file tree Collapse file tree 4 files changed +3
-46
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,6 @@ S3 支持使用虚拟域名作为 endpoint,即可以将 region 或者 bucket
152152- S3_PREFIX: 选填,要存储的前缀
153153- S3_SIGNATURE_VERSION: 选填,签名版本,使用阿里云 oss 时,需要设置为"s3",minio 无需处理
154154
155- - FEISHU_NOTIFY_TOKEN: 选填,飞书推送 token,为空时不推送
156- - FEISHU_NOTIFY_TITLE: 选填,飞书推送标题,FEISHU_NOTIFY_TOKEN 为空时无效,例如 haiviv cn,此时飞书通知的标题为 ` haivivi cn mongodb 备份出错 `
157-
158155### restore
159156
160157- S3_ENABLE: 选填,是否从 S3 中进行恢复,true 表示启用
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ RUN apt-get update && \
55 apt-get install -y zip psmisc python3 python3-pip
66
77RUN pip3 install --upgrade pip
8- RUN pip3 install boto3 requests
8+ RUN pip3 install boto3
99
1010WORKDIR /app
1111ADD . /app
Original file line number Diff line number Diff line change 3636 "S3_REGION" ,
3737 "S3_BUCKET" ,
3838 "S3_PREFIX" ,
39- "FEISHU_TOKEN" ,
4039]
4140
4241for key in must_inputs :
@@ -95,13 +94,6 @@ def check_bool(key):
9594 os .environ ["S3_SIGNATURE_VERSION" ] if check_var ("S3_SIGNATURE_VERSION" ) else None
9695)
9796
98- feishu_notify_token = (
99- os .environ ["FEISHU_NOTIFY_TOKEN" ] if check_var ("FEISHU_NOTIFY_TOKEN" ) else None
100- )
101- feishu_notify_title = (
102- os .environ ["FEISHU_NOTIFY_TITLE" ] if check_var ("FEISHU_NOTIFY_TITLE" ) else None
103- )
104-
10597# 计算当前日期,按照 年月日时分 格式
10698date = (datetime .now () + timedelta (hours = 8 )).strftime ("%Y%m%d%H%M%S" )
10799
@@ -245,34 +237,6 @@ def upload_s3(prefix):
245237 print (f"Deleted s3 old backup files: { keys_to_remove } " )
246238
247239
248- def send_feishu_notify (msg ):
249- data = {
250- "msg_type" : "post" ,
251- "content" : {
252- "post" : {
253- "zh_cn" : {
254- "title" : f"{ feishu_notify_title } mongodb 备份出错" ,
255- "content" : [
256- [
257- {
258- "tag" : "text" ,
259- "text" : msg ,
260- }
261- ]
262- ],
263- }
264- }
265- },
266- }
267- try :
268- requests .post (
269- f"https://open.feishu.cn/open-apis/bot/v2/hook/{ feishu_notify_token } " ,
270- json = data ,
271- )
272- except Exception as e :
273- print ("Feishu notify error:" , e )
274-
275-
276240try :
277241 if not os .path .exists (backup_path ):
278242 os .makedirs (backup_path )
@@ -300,8 +264,4 @@ def send_feishu_notify(msg):
300264
301265except Exception as e :
302266 print ("backup error:" , e )
303-
304- if feishu_notify_token :
305- send_feishu_notify (f"错误信息: { e } " )
306-
307267 sys .exit ()
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ type: application
1515# This is the chart version. This version number should be incremented each time you make changes
1616# to the chart and its templates, including the app version.
1717# Versions are expected to follow Semantic Versioning (https://semver.org/)
18- version : 1.6.1
18+ version : 1.6.2
1919
2020# This is the version number of the application being deployed. This version number should be
2121# incremented each time you make changes to the application. Versions are not expected to
2222# follow Semantic Versioning. They should reflect the version the application is using.
2323# It is recommended to use it with quotes.
24- appVersion : " 1.6.1 "
24+ appVersion : " 1.6.2 "
You can’t perform that action at this time.
0 commit comments