requarks / wiki-v1

Legacy version (1.x) of Wiki.js
https://wiki.js.org
GNU Affero General Public License v3.0
100 stars 75 forks source link

Unable to sync with Bitbucket repo #94

Open jeremyj opened 6 years ago

jeremyj commented 6 years ago

Actual behavior

Unable to connect to Bitbucket repo

Expected behavior

Connect to Bitbucket repo

Steps to reproduce the behavior

Install and configure as referenced in docs Add the following to config.yml

git:
  url: git@bitbucket.org:teamaccount/wiki.git
  branch: master
  auth:
    type: ssh
    privateKey: /etc/wiki/keys/git.pem
    sslVerify: true
  signature:
    name: My Name
    email: me@example.com

launch node wiki start

error log shows:

{ code: 1,
  message: '`git --git-dir=repo/.git --work-tree=repo pull origin master` failed with code 1',
  stderr: 'Permission denied (publickey).\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n',
  stdout: '' }

Manual git workflow (clone|add|commit|push) with git.pem key works correctly

user@server:~/wiki# ssh-agent bash -c 'ssh-add /etc/wiki/keys/git.pem; git push'
Identity added: /etc/wiki/keys/git.pem (/etc/wiki/keys/git.pem)

Counting objects: 3, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 384 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@bitbucket.org:teamaccount/wiki.git
   fae27dc..ba21c75  master -> master
NGPixel commented 6 years ago

Make sure the key is not passphrase protected and that it can be read by the node process.

jeremyj commented 6 years ago

@NGPixel the key does not have a passphrase, it's owned by root and it's permissions are 0640. Node is running as root. Any more suggestions?

julbrs commented 5 years ago

Do you have put the corresponding public key in your Bitbucket account ?

I have the exact same setup and it works well. Bad thing is that Bitbucket is not allowing some kind of per repo key system but it work with my SSH key account ;D

image