Take use_ssl as env var flag
This commit is contained in:
parent
3075453a8c
commit
4cddf53837
|
@ -151,13 +151,15 @@
|
||||||
xmpp-username
|
xmpp-username
|
||||||
xmpp-password
|
xmpp-password
|
||||||
db-host
|
db-host
|
||||||
|
db-port
|
||||||
db-name
|
db-name
|
||||||
db-username
|
db-username
|
||||||
db-password)
|
db-password
|
||||||
|
db-use-ssl)
|
||||||
(let ((postmodern:*ignore-unknown-columns* t)
|
(let ((postmodern:*ignore-unknown-columns* t)
|
||||||
(cl-postgres:*query-log* *standard-output*)
|
(cl-postgres:*query-log* *standard-output*)
|
||||||
(*dns-store* (make-instance 'backplane-dns-store:postgres-dns-store)))
|
(*dns-store* (make-instance 'backplane-dns-store:postgres-dns-store)))
|
||||||
(postmodern:with-connection (list db-name db-username db-password db-host)
|
(postmodern:with-connection (list db-name db-username db-password db-host (port db-port) (use-ssl db-use-ssl))
|
||||||
(with-backplane (backplane (backplane-connect xmpp-host xmpp-username xmpp-password))
|
(with-backplane (backplane (backplane-connect xmpp-host xmpp-username xmpp-password))
|
||||||
(start-listening backplane)))))
|
(start-listening backplane)))))
|
||||||
|
|
||||||
|
@ -175,6 +177,10 @@
|
||||||
(uiop:die 1 "unable to find required env var: ~A" env-var))
|
(uiop:die 1 "unable to find required env var: ~A" env-var))
|
||||||
value)))
|
value)))
|
||||||
|
|
||||||
|
(defun getenv-flag (env-var)
|
||||||
|
(let ((value (uiop:getenv env-var)))
|
||||||
|
(if value t nil)))
|
||||||
|
|
||||||
(defun start-listener-with-env ()
|
(defun start-listener-with-env ()
|
||||||
(backplane-dns-listen
|
(backplane-dns-listen
|
||||||
:xmpp-host (getenv-or-fail "FUDO_DNS_BACKPLANE_XMPP_HOSTNAME")
|
:xmpp-host (getenv-or-fail "FUDO_DNS_BACKPLANE_XMPP_HOSTNAME")
|
||||||
|
@ -184,4 +190,6 @@
|
||||||
:db-name (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_NAME")
|
:db-name (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_NAME")
|
||||||
:db-username (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_USERNAME")
|
:db-username (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_USERNAME")
|
||||||
:db-host (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_HOSTNAME")
|
:db-host (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_HOSTNAME")
|
||||||
:db-password (read-file-line (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_PASSWORD_FILE"))))
|
:db-port (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_PORT" 5432)
|
||||||
|
:db-password (read-file-line (getenv-or-fail "FUDO_DNS_BACKPLANE_DATABASE_PASSWORD_FILE"))
|
||||||
|
:db-use-ssl (getenv-flag "FUDO_DNS_BACKPLANE_DATABASE_USE_SSL")))
|
||||||
|
|
Loading…
Reference in New Issue