File tree 4 files changed +31
-5
lines changed
4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,14 @@ Here is timezone list at [wikipedia](https://en.wikipedia.org/wiki/List_of_tz_da
314
314
315
315
Default: ` UTC `
316
316
317
+ #### DISPLAY_NAME
318
+
319
+ A custom name to identify your vaultwarden instance in notifications and logs.
320
+
321
+ This doesn't affect functionality, it only affects the display in the notification title and partial log output.
322
+
323
+ Default: ` vaultwarden `
324
+
317
325
#### DATA_DIR
318
326
319
327
This folder stores the data of vaultwarden.
Original file line number Diff line number Diff line change @@ -312,6 +312,14 @@ Rclone 全局参数,详见 [flags](https://rclone.org/flags/)。
312
312
313
313
默认值:` UTC `
314
314
315
+ #### DISPLAY_NAME
316
+
317
+ 用于在通知和日志中标识 vaultwarden 实例的自定义名称。
318
+
319
+ 这不会影响功能,仅影响通知标题和部分日志输出中的显示。
320
+
321
+ 默认值:` vaultwarden `
322
+
315
323
#### DATA_DIR
316
324
317
325
指定存放 vaultwarden 数据的目录。
Original file line number Diff line number Diff line change 12
12
# mail test
13
13
if [[ " $1 " == " mail" ]]; then
14
14
export_env_file
15
+ init_env_display
15
16
init_env_mail
16
17
17
18
MAIL_SMTP_ENABLE=" TRUE"
@@ -21,19 +22,20 @@ if [[ "$1" == "mail" ]]; then
21
22
MAIL_TO=" $2 "
22
23
fi
23
24
24
- send_mail " vaultwarden Backup Test" " Your SMTP configuration looks correct."
25
+ send_mail " ${DISPLAY_NAME} Backup Test" " Your SMTP configuration looks correct."
25
26
26
27
exit 0
27
28
fi
28
29
29
30
# ping test
30
31
if [[ " $1 " == " ping" ]]; then
31
32
export_env_file
33
+ init_env_display
32
34
init_env_ping
33
35
34
36
PING_DEBUG=" TRUE"
35
37
36
- send_ping " $2 " " vaultwarden Backup Test" " Your PING configuration looks correct."
38
+ send_ping " $2 " " ${DISPLAY_NAME} Backup Test" " Your PING configuration looks correct."
37
39
38
40
exit 0
39
41
fi
Original file line number Diff line number Diff line change @@ -163,9 +163,9 @@ function send_ping() {
163
163
# notification content
164
164
# #######################################
165
165
function send_notification() {
166
- local SUBJECT_START=" vaultwarden Backup Start"
167
- local SUBJECT_SUCCESS=" vaultwarden Backup Success"
168
- local SUBJECT_FAILURE=" vaultwarden Backup Failed"
166
+ local SUBJECT_START=" ${DISPLAY_NAME} Backup Start"
167
+ local SUBJECT_SUCCESS=" ${DISPLAY_NAME} Backup Success"
168
+ local SUBJECT_FAILURE=" ${DISPLAY_NAME} Backup Failed"
169
169
170
170
case " $1 " in
171
171
start)
@@ -301,6 +301,7 @@ function init_env() {
301
301
302
302
init_env_dir
303
303
init_env_db
304
+ init_env_display
304
305
init_env_ping
305
306
init_env_mail
306
307
@@ -413,6 +414,7 @@ function init_env() {
413
414
color yellow " MAIL_WHEN_FAILURE: ${MAIL_WHEN_FAILURE} "
414
415
fi
415
416
color yellow " TIMEZONE: ${TIMEZONE} "
417
+ color yellow " DISPLAY_NAME: ${DISPLAY_NAME} "
416
418
color yellow " ========================================"
417
419
}
418
420
@@ -512,6 +514,12 @@ function init_env_db() {
512
514
fi
513
515
}
514
516
517
+ function init_env_display() {
518
+ # DISPLAY_NAME
519
+ get_env DISPLAY_NAME
520
+ DISPLAY_NAME=" ${DISPLAY_NAME:- " vaultwarden" } "
521
+ }
522
+
515
523
function init_env_ping() {
516
524
# PING_URL
517
525
get_env PING_URL
You can’t perform that action at this time.
0 commit comments