Wiki: Wiki is ignoring git ssh auth

Created on 20 Feb 2017  路  12Comments  路  Source: Requarks/wiki

Logs:

0|wiki | { code: 128, 0|wiki | message: 'git --git-dir=repo/.git --work-tree=repo push origin masterfailed with code 128', 0|wiki | stderr: 'fatal: could not read Username for \'https://github.com\': No such device or address\n', 0|wiki | stdout: '' }

Config:

git:
  url: [email protected]:WumpusPrime/wiki.git
  branch: master
  auth:

    # Type: basic or ssh
    type: ssh

    # Only for Basic authentication:
    username: // DiscordWiki
    password: // yayayaa

    # Only for SSH authentication:
    privateKey: /home/wiki/.ssh/id_rsa
bug

Most helpful comment

Here's the root cause. Once the repo folder is created, any changes to the git URL / authentication settings will not be reflected into the actual repo git config. I'll add some code in the future to make sure both matches when starting Wiki.js. In the meantime, you have 2 solutions:

  • Edit that ./git/config file and change the url parameter below the [remote "origin"] block to use the new value [email protected]:WumpusPrime/wiki.git. Save and restart Wiki.js.
  • Delete the repo folder and restart Wiki.js. The repo will be created again with the correct settings.

All 12 comments

Remove the parameters username and password from your config file. They are not used in SSH authentication at all.

The // in the username field is most likely causing an issue when building the git remote.

I didn't leave them in, I just did it to signal those fields were in fact empty. Removing them still ignores ssh auth

Can you paste the contents of /path-to-your-wiki/repo/.git/config file? It might be a config mismatch issue.

Sure

wiki@webconsole:~$ cat wiki/repo/.git/config [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true sshCommand = ssh -i \"/home/wiki/.ssh/id_rsa\" -o StrictHostKeyChecking=no [user] name = Discord Wiki email = [email protected] [http] sslVerify = true [remote "origin"] url = https://github.com/WumpusPrime/wiki fetch = +refs/heads/*:refs/remotes/origin/* wiki@webconsole:~$

Here's the root cause. Once the repo folder is created, any changes to the git URL / authentication settings will not be reflected into the actual repo git config. I'll add some code in the future to make sure both matches when starting Wiki.js. In the meantime, you have 2 solutions:

  • Edit that ./git/config file and change the url parameter below the [remote "origin"] block to use the new value [email protected]:WumpusPrime/wiki.git. Save and restart Wiki.js.
  • Delete the repo folder and restart Wiki.js. The repo will be created again with the correct settings.

Okay, that made it worse. I went with option 2, and obviously it deleted all uncommitted pages. Then, to top things off, now the deleted pages are still there in the sense the database thinks they're there: but you can't view them

Pages are always committed as soon as they are created / modified.

What do you mean by deleted pages are still there? What behavior shows delete entries? Indexes and cache is rebuilt completely when restarting Wiki.js.

You can't create the page, it says it exists: but when you go to edit it, it doesn't exist

It would be great if you could sync the git remote setting when starting the app. I had some problem today with git because I set the url to https at first. And then I realize I actually need the [email protected] url (since I'm using ssh auth). I had to manually change the url in the git repo.

Fixed in Beta 11 (642bcac472fb7e743fe8f3eda8c16fc93680107b)

This still got me with version 1.0.102.
I set it up to use SSH authentication from the beginning, but the config file then included a username, password, and the wrong GitHub URL (https...) and took a while to find why the commits were not being made.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

touhoku-japan picture touhoku-japan  路  3Comments

bennycode picture bennycode  路  4Comments

D3mon86 picture D3mon86  路  4Comments

ghost picture ghost  路  3Comments

den1622 picture den1622  路  3Comments