Open nightscape opened 4 years ago
Hi! There's nothing built into the package that makes this possible. I haven't used .authinfo much myself, since I use the same Emacs configuration on both Windows and Linux. Maybe this site can help: https://www.masteringemacs.org/article/keeping-secrets-in-emacs-gnupg-auth-sources
Ok, figured it out with the help of https://emacs.stackexchange.com/a/8072/11825
This can be done by putting the following line into ~/.authinfo.gpg
machine hypothes.is login your_hypothesis_user secret "your_hypothesis_token"
and the following code in your Emacs config
(with-eval-after-load 'random-mode
(require 'auth-source)
(let ((auth (nth 0 (auth-source-search :host "hypothes.is"
:requires '(user secret)))))
(setq hypothesis-token (funcall (plist-get auth :secret))
hypothesis-username (plist-get auth :user))))
or in Doom Emacs in ~/.doom.d/config.el
(after! hypothesis
(require 'auth-source)
(let ((auth (nth 0 (auth-source-search :host "hypothes.is"
:requires '(user secret)))))
(setq hypothesis-token (funcall (plist-get auth :secret))
hypothesis-username (plist-get auth :user))))
Should this be put in the README?
I personally don't feel like it should be in the README since storing personal information seems like a general concept, rather than something specific to this package. Also it feels a bit strange to recommend something regarding safety when I don't understand it myself.
Hi @Kungsgeten,
is it possible to read the credentials from the
.authinfo.gpg
. I'm an Elisp noob, therefore I can't tell from the code...Thanks for creating this! Looking forward to integrating it into my Building A Second Brain workflow 😄