emacs-circe / circe

Circe, a Client for IRC in Emacs
GNU General Public License v3.0
395 stars 51 forks source link

circe & gitter #321

Closed seblemaguer closed 6 years ago

seblemaguer commented 6 years ago

Hello,

I try to make circe working with gitter. I used this configuration:

 (setq circe-network-options
          '(
            ("gitter"
             :tls t
             :nick "seblemaguer"
             :sasl-password my-irc-password
             :server-buffer-name "⇄ gitter"
             :host"irc.gitter.im"
             :service "6667")
            ))

but so far no success.

wasamasa commented 6 years ago

This configuration will pass the symbol my-irc-password literally to Circe which is probably not what you want. If you want a variable by that name with the password as value to be used, you must use backquote instead:

(setq circe-network-options
      `(("gitter"
         :tls t
         :nick "seblemaguer"
         :sasl-password ,my-irc-password
         :server-buffer-name "⇄ gitter"
         :host"irc.gitter.im"
         :service "6667")))
seblemaguer commented 6 years ago

thanks a lot. my-irc-password is function. I used it to access to the authinfo which is storing my password and for the other networks. I tried to connect using the password directly indicated as a string it is not working. This is my log:

E: "conn.connected" 
C: CAP LS
C: NICK seblemaguer
C: USER slemaguer 8 * slemaguer
S: ERROR :You must authenticate, check: https://irc.gitter.im
E: "ERROR" nil "You must authenticate, check: https://irc.gitter.im"
S: - Peer has closed the GnuTLS connection
E: "-" nil "Peer" "has" "closed" "the" "GnuTLS" "connection"
E: "conn.disconnected" 
wasamasa commented 6 years ago

Hm, perhaps :sasl-password is the wrong key then. Did you try :pass instead?

seblemaguer commented 6 years ago

perfect, that was it. Thanks a lot

mcraveiro commented 4 years ago

Hi

Many thanks for a great software package for emacs. I also have a problem setting up Circe for gitter. I tried following the code from @seblemaguer but sadly I'm not the best at emacs lisp :-) I tried to combine the wiki instructions with his tips and came up with:

(setq auth-sources '("~/.authinfo.gpg"))

(defun my-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))
      (error "Password not found for %S" params))))

(defun my-nickserv-password (server)
  (my-fetch-password :login "mcraveiro" :machine "irc.gitter.im"))

(setq circe-network-options
      `(("Gitter"
         :tls t
         :nick "mcraveiro"
         :pass my-nickserv-password
         :server-buffer-name "⇄ gitter"
         :host "irc.gitter.im"
         :service "6667")))

When I start circe and choose Gitter I don't seem to be connected:

*** Connecting...
*** No target for current buffer
>

I also replaced my-nickserv-password with the actual password to test it and it still does not connect. Also, I couldn't locate the logs that @seblemaguer posted above.

Any tips or ideas would be greatly appreciated.

Many thanks for your time

Marco

wasamasa commented 4 years ago

To obtain the above log, evaluate (setq irc-debug-log t) and look for a "IRC Protocol" buffer. For testing I'd recommend omitting the auth-source parts and just using the literal password.

mcraveiro commented 4 years ago

Hi @wasamasa,

Thanks very much for that. So using a literal password and with debug log I get:

E: "conn.failed" 
C: QUIT :Using Circe, the loveliest of all IRC clients
E: "conn.failed" 

I think we are not setting the hostname correctly, maybe?

wasamasa commented 4 years ago

Hm, this means it's an issue happening before the client has even a chance to establish a connection. Do you have gnutls-cli on PATH?

mcraveiro commented 4 years ago

ah interesting! well I installed the package as per docs, e.g.:

apt install gnutls-bin

and then, from an emacs shell, if I do:

$ which gnutls-cli
/usr/bin/gnutls-cli

That looks healthy...

wasamasa commented 4 years ago

Yeah, at this point you'd need to do manual testing by opening a connection to the server with gnutls-cli and looking for anything suspicious. Alternatively, try applying this hack before I do: https://github.com/jorgenschaefer/circe/issues/306#issuecomment-493236603