mirror of
git://git.savannah.gnu.org/guix/guix-cuirass.git
synced 2023-12-14 06:03:04 +01:00
Use default database parameters.
* src/cuirass/parameters.scm (%cuirass-database, %cuirass-host): New parameters. * src/cuirass/database.scm (db-open): Use them.
This commit is contained in:
parent
37de70546b
commit
370ff7d8cd
2 changed files with 16 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
||||||
#:use-module (cuirass logging)
|
#:use-module (cuirass logging)
|
||||||
#:use-module (cuirass config)
|
#:use-module (cuirass config)
|
||||||
#:use-module (cuirass notification)
|
#:use-module (cuirass notification)
|
||||||
|
#:use-module (cuirass parameters)
|
||||||
#:use-module (cuirass remote)
|
#:use-module (cuirass remote)
|
||||||
#:use-module (cuirass specification)
|
#:use-module (cuirass specification)
|
||||||
#:use-module (cuirass utils)
|
#:use-module (cuirass utils)
|
||||||
|
@ -356,8 +357,8 @@ upgrade-n.sql files."
|
||||||
database object."
|
database object."
|
||||||
(let* ((param (or database
|
(let* ((param (or database
|
||||||
(format #f "dbname=~a host=~a"
|
(format #f "dbname=~a host=~a"
|
||||||
(getenv "CUIRASS_DATABASE")
|
(%cuirass-database)
|
||||||
(getenv "CUIRASS_HOST"))))
|
(%cuirass-host))))
|
||||||
(db (connect-to-postgres-paramstring param)))
|
(db (connect-to-postgres-paramstring param)))
|
||||||
(when (%create-database?)
|
(when (%create-database?)
|
||||||
(match (db-schema-version db)
|
(match (db-schema-version db)
|
||||||
|
|
|
@ -17,10 +17,14 @@
|
||||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
(define-module (cuirass parameters)
|
(define-module (cuirass parameters)
|
||||||
#:export (%cuirass-url
|
#:export (%cuirass-database
|
||||||
|
%cuirass-host
|
||||||
|
%cuirass-url
|
||||||
|
|
||||||
%zabbix-url
|
%zabbix-url
|
||||||
%zabbix-user
|
%zabbix-user
|
||||||
%zabbix-password
|
%zabbix-password
|
||||||
|
|
||||||
%mastodon-instance-name
|
%mastodon-instance-name
|
||||||
%mastodon-instance-url
|
%mastodon-instance-url
|
||||||
%mastodon-instance-token))
|
%mastodon-instance-token))
|
||||||
|
@ -28,6 +32,14 @@
|
||||||
;; This variable is looked up by 'mu-message-send'.
|
;; This variable is looked up by 'mu-message-send'.
|
||||||
(define-public mu-debug 0)
|
(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
|
;; The URL of the Cuirass web server. This is useful to send absolute links
|
||||||
;; within notifications.
|
;; within notifications.
|
||||||
(define %cuirass-url
|
(define %cuirass-url
|
||||||
|
|
Loading…
Reference in a new issue