Verified working again?
This commit is contained in:
parent
4cd4d8f8d9
commit
c0e4d12fb7
@ -1,9 +1,10 @@
|
|||||||
# dns-backplane
|
# backplane-dns
|
||||||
### _Your Name <your.name@example.com>_
|
### _Niten <niten@fudo.org>_
|
||||||
|
|
||||||
This is a project to do ... something.
|
Common lisp server to listen on an XMPP backplane connection for notifications
|
||||||
|
of DNS changes, and update a postgresql database accordingly. The data can then
|
||||||
|
be served by PowerDNS with the gpgsql backend.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Specify license here
|
Specify license here
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
(make-instance 'result/error :message msg))
|
(make-instance 'result/error :message msg))
|
||||||
|
|
||||||
(defparameter *hostname-rx*
|
(defparameter *hostname-rx*
|
||||||
"([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])")
|
"(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])")
|
||||||
|
|
||||||
(defun get-domain (name)
|
(defun get-domain (name)
|
||||||
(car (select-dao 'dns-domain (:= 'name name))))
|
(car (select-dao 'dns-domain (:= 'name name))))
|
||||||
@ -86,14 +86,14 @@
|
|||||||
(get-domain)
|
(get-domain)
|
||||||
(id))))
|
(id))))
|
||||||
(car (select-dao 'dns-record
|
(car (select-dao 'dns-record
|
||||||
(:= 'name hostname)
|
(:= 'name (format nil "~A.~A" hostname domain))
|
||||||
(:= 'domain-id domain-id)
|
(:= 'domain-id domain-id)
|
||||||
(:= 'type "A")))
|
(:= 'type "A")))
|
||||||
(error 'domain-name-missing :domain domain)))
|
(error 'domain-name-missing :domain domain)))
|
||||||
|
|
||||||
(defun set-host-v4ip (host domain v4ip)
|
(defun set-host-v4ip (host domain v4ip)
|
||||||
(let* ((full-hostname (format nil "~A.~A" host domain))
|
(let* ((full-hostname (format nil "~A.~A" host domain))
|
||||||
(a-record (host-a-record full-hostname domain)))
|
(a-record (host-a-record host domain)))
|
||||||
(if a-record
|
(if a-record
|
||||||
(progn (setf (record-content a-record) v4ip)
|
(progn (setf (record-content a-record) v4ip)
|
||||||
(update-dao a-record))
|
(update-dao a-record))
|
||||||
@ -175,7 +175,7 @@
|
|||||||
(xmpp:auth backplane
|
(xmpp:auth backplane
|
||||||
xmpp-username
|
xmpp-username
|
||||||
xmpp-password
|
xmpp-password
|
||||||
"server"
|
(format nil "backplane-~A" (machine-instance))
|
||||||
:mechanism :sasl-plain)
|
:mechanism :sasl-plain)
|
||||||
(funcall f backplane)))
|
(funcall f backplane)))
|
||||||
|
|
||||||
@ -188,10 +188,11 @@
|
|||||||
db-username
|
db-username
|
||||||
db-password
|
db-password
|
||||||
db-tls)
|
db-tls)
|
||||||
(postmodern:with-connection (list db-name db-username db-password db-host)
|
(let ((postmodern:*ignore-unknown-columns* t))
|
||||||
(with-backplane xmpp-host xmpp-username xmpp-password
|
(postmodern:with-connection (list db-name db-username db-password db-host)
|
||||||
(lambda (backplane)
|
(with-backplane xmpp-host xmpp-username xmpp-password
|
||||||
(xmpp:receive-stanza-loop backplane)))))
|
(lambda (backplane)
|
||||||
|
(xmpp:receive-stanza-loop backplane))))))
|
||||||
|
|
||||||
(defun read-file-line (filename)
|
(defun read-file-line (filename)
|
||||||
(let ((input (open filename :if-does-not-exist nil)))
|
(let ((input (open filename :if-does-not-exist nil)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user