[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Use default database parameters.
From: |
Mathieu Othacehe |
Subject: |
branch master updated: Use default database parameters. |
Date: |
Tue, 09 Mar 2021 01:38:11 -0500 |
This is an automated email from the git hooks/post-receive script.
mothacehe pushed a commit to branch master
in repository guix-cuirass.
The following commit(s) were added to refs/heads/master by this push:
new 370ff7d Use default database parameters.
370ff7d is described below
commit 370ff7d8cdfdfab66000350e409521918079346d
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Mar 9 07:37:29 2021 +0100
Use default database parameters.
* src/cuirass/parameters.scm (%cuirass-database, %cuirass-host): New
parameters.
* src/cuirass/database.scm (db-open): Use them.
---
src/cuirass/database.scm | 5 +++--
src/cuirass/parameters.scm | 14 +++++++++++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/cuirass/database.scm b/src/cuirass/database.scm
index 2b86a23..c692e87 100644
--- a/src/cuirass/database.scm
+++ b/src/cuirass/database.scm
@@ -25,6 +25,7 @@
#:use-module (cuirass logging)
#:use-module (cuirass config)
#:use-module (cuirass notification)
+ #:use-module (cuirass parameters)
#:use-module (cuirass remote)
#:use-module (cuirass specification)
#:use-module (cuirass utils)
@@ -356,8 +357,8 @@ upgrade-n.sql files."
database object."
(let* ((param (or database
(format #f "dbname=~a host=~a"
- (getenv "CUIRASS_DATABASE")
- (getenv "CUIRASS_HOST"))))
+ (%cuirass-database)
+ (%cuirass-host))))
(db (connect-to-postgres-paramstring param)))
(when (%create-database?)
(match (db-schema-version db)
diff --git a/src/cuirass/parameters.scm b/src/cuirass/parameters.scm
index 9aec051..f37618d 100644
--- a/src/cuirass/parameters.scm
+++ b/src/cuirass/parameters.scm
@@ -17,10 +17,14 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (cuirass parameters)
- #:export (%cuirass-url
+ #:export (%cuirass-database
+ %cuirass-host
+ %cuirass-url
+
%zabbix-url
%zabbix-user
%zabbix-password
+
%mastodon-instance-name
%mastodon-instance-url
%mastodon-instance-token))
@@ -28,6 +32,14 @@
;; This variable is looked up by 'mu-message-send'.
(define-public mu-debug 0)
+;; The Cuirass PostgreSQL database name.
+(define %cuirass-database
+ (make-parameter "cuirass"))
+
+;; The Cuirass PostgreSQL database host.
+(define %cuirass-host
+ (make-parameter "/var/run/postgresql"))
+
;; The URL of the Cuirass web server. This is useful to send absolute links
;; within notifications.
(define %cuirass-url
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Use default database parameters.,
Mathieu Othacehe <=