From 9bbc43a4557adcfafe75c3970c16c5102bfdf195 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 1 Sep 2021 17:14:44 -0500 Subject: Add acdw/fetch-password and circe network configuration --- init.el | 19 +++++++++++++++++-- lisp/acdw.el | 13 ++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 3e631fc..d56c33d 100644 --- a/init.el +++ b/init.el @@ -1119,9 +1119,24 @@ like a dumbass." (setq acdw-irc/post-my-nick "-> ") - (setq circe-default-part-message "See You, Space Cowpokes . . ." + (setq circe-default-nick "acdw" + circe-default-part-message "See You, Space Cowpokes . . ." circe-highlight-nick-type 'all - ;; circe-network-options in private.el + circe-network-options + (("Libera Chat" + :channels ("#emacs" "#systemcrafters" "##webpals") + :sasl-username "acdw" + :sasl-password ,(acdw/fetch-password :host "libera.chat")) + ("Tilde Chat" + :channels ("#meta" "#bread" "#dadjokes" "#team") + :host "irc.tilde.chat" :port 6697 :use-tls t + :sasl-username "acdw" + :sasl-password ,(acdw/fetch-password :host "tilde.chat")) + ("Casa" + :channels ("#basement") + :host "m455.casa" :port 6697 :use-tls t + :sasl-username "acdw" + :sasl-password ,(acdw/fetch-password :host "m455.casa"))) circe-reduce-lurker-spam t circe-server-auto-join-default-type :after-auth) diff --git a/lisp/acdw.el b/lisp/acdw.el index f23ca0e..796c2f1 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -579,7 +579,18 @@ It's called 'require-private' for historical reasons." (switch-to-buffer nil) (other-window (or arg 1)))) - + +;;; Auth-sources +;; https://github.com/emacs-circe/circe/wiki/Configuration +(defun acdw/fetch-password (&rest params) + (require 'auth-source) + (let ((match (car (apply #'auth-source-search params)))) + (if match + (let ((secret (plist-get match :secret))) + (if (functionp secret) + (funcall secret) + secret)) + (warn "Password not found for %S" params)))) (provide 'acdw) ;;; acdw.el ends here -- cgit 1.4.1-21-gabe81