services: zabbix-front-end: Improve hint and error messages.
* gnu/services/monitoring.scm (zabbix-front-end-config): Improve hint and error messages.
This commit is contained in:
parent
9a50cedc6b
commit
0485717ee9
1 changed files with 8 additions and 6 deletions
|
@ -29,9 +29,11 @@
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
|
#:use-module ((guix ui) #:select (display-hint))
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:use-module (ice-9 rdelim)
|
#:use-module (ice-9 rdelim)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
|
#:use-module (srfi srfi-35)
|
||||||
#:export (darkstat-configuration
|
#:export (darkstat-configuration
|
||||||
prometheus-node-exporter-configuration
|
prometheus-node-exporter-configuration
|
||||||
darkstat-service-type
|
darkstat-service-type
|
||||||
|
@ -525,16 +527,16 @@ $DB['DATABASE'] = '" db-name "';
|
||||||
$DB['USER'] = '" db-user "';
|
$DB['USER'] = '" db-user "';
|
||||||
$DB['PASSWORD'] = '" (if (string-null? db-password)
|
$DB['PASSWORD'] = '" (if (string-null? db-password)
|
||||||
(if (string-null? db-secret-file)
|
(if (string-null? db-secret-file)
|
||||||
(display "Provide a `db-secret-file' \
|
(raise (condition
|
||||||
or `db-password' field.
|
(&message
|
||||||
"
|
(message "\
|
||||||
(current-error-port))
|
You must provide either 'db-secret-file' or 'db-password'."))))
|
||||||
(string-trim-both
|
(string-trim-both
|
||||||
(with-input-from-file db-secret-file
|
(with-input-from-file db-secret-file
|
||||||
read-string)))
|
read-string)))
|
||||||
(begin
|
(begin
|
||||||
(display "
|
(display-hint "
|
||||||
Hint: Consider use `db-secret-file' instead of `db-password' and unset
|
Consider use `db-secret-file' instead of `db-password' and unset
|
||||||
`db-password' for security in `zabbix-front-end-configuration'.
|
`db-password' for security in `zabbix-front-end-configuration'.
|
||||||
")
|
")
|
||||||
db-password)) "';
|
db-password)) "';
|
||||||
|
|
Reference in a new issue