magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.32k stars 117 forks source link

New common mistake: gitlab host for unix password-store #529

Closed gabor-braun closed 1 year ago

gabor-braun commented 1 year ago

I had troubles setting up forge to use Unix password store for a private GitLab instance. What was unclear to me is to where to put the path (e.g., /api/v4) of the gitlab host in the password store. What works for me: omitting it altogether.

Please add this to the page on common mistakes. Perhaps also to the documentation of ghub.

Just to clarify, a working example (with private information replaced):

Init file:

(require 'auth-source-pass)
(require 'forge

(setq auth-sources '(password-store))

(push
   '("git.example.com" "git.example.com/api/v4" "git.example.com" forge-gitlab-repository)
   forge-alist)

~/.password-store/git.example.com/ziggy^forge.gpg decrypted:

012345abcdef...

This is the analogue an example form ghub's documetation, except that /api/v4 is omitted. It only appears in forge-alist.

Init file:

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

~/.authinfo:

 machine gitlab.com/api/v4 login ziggy^forge password 012345abcdef...
tarsius commented 1 year ago

I've added a brief note. Note that anyone can edit the wiki, so feel free to improve the entry.