首页 文章

如何让phabricator到观察者本地git存储库

提问于
浏览
0

我试图观察phabricator中的本地git存储库时遇到错误 . 回购在运行phabricator的同一台机器上,我相信拥有所有正确的权限,但是phab无法识别路径 . 有没有其他人遇到过类似的问题?你怎么解决的?提前感谢您的任何指导 .

The main error:

phabricator-ssh-exec: Unrecognized repository path "/var/repos/git/test". Expected a path like "/diffusion/X/", "/diffusion/123/", or "/source/thaumaturgy".

Steps I took to set up observed repository:

Created a new repository in phabricator

Set the following (all) default URIs to "read only"
    ssh://git@phabricator.localhost.com:2222/diffusion/1/test Read Only Hidden
    ssh://git@phabricator.localhost.com:2222/source/test  Read Only Visible
    ssh://git@phabricator.localhost.com:2222/diffusion/TEST/test  Read Only Hidden

Created a 4th URI and set it to observe:
    ssh://git@phabricator.localhost.com:2222/var/repos/git/test Observe Hidden 

Set up credentials for that URI successfully

Activated respository

The full phabricator error:

Raw Error
Error updating working copy: Command failed with error #128!
COMMAND
git ls-remote '********'

STDOUT
( empty)

STDERR
Warning: Permanently added '[phabricator.localhost.com]:2222' (ECDSA) to the list of known hosts.
phabricator-ssh-exec: Unrecognized repository path "/var/repos/git/test". Expected a path like "/diffusion/X/", "/diffusion/123/", or "/source/thaumaturgy".
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Short Summary:

我也尝试过使用test.git . 目录/ var / repos / git / test存在并且是wdev组的775(读,写,执行),其中myuser和git是成员

我无法弄清楚phabricator在哪里寻找这些目录 . 我期望从我的服务器的根目录,但/ diffusion / X最无限的不是我的服务器root . 我做错了假设吗?

我尝试了3个其他URI,所有这些URI都失败并出现相同的错误 . 我在下面提供了更多信息 .

tl;dr

导致相同错误的其他步骤:

1.  Changed URI to ssh://git@phabricator.localhost.com:2222/var/repos/git/test.git
2.  Changed URI to ssh://git@phabricator.localhost.com:2222/home/myuser/local-repos/git/test.git
3.  Changed URI to ssh://git@phabricator.localhost.com:2222/home/myuser/local-repos/git/test

My phabricator SSH user:

[myuser@localhost ~]$ cat /etc/passwd |grep git
git:x:1002:1003::/var/repos/git:/bin/bash

[myuser@localhost ~]$ cat /etc/group |grep wdev
wdev:x:1001:myuser,apache,phd,git

[myuser@localhost ~]$ sudo cat /etc/shadow |grep git
git:NP:17669:0:99999:7:::

[myuser@localhost ~]$ sudo cat /etc/sudoers.d/phabricator-sudoers
git All=(phd) SETENV: NOPASSWD: /usr/bin/ls, /usr/bin/git, /usr/bin/git-upload-pack, /usr/bin/git-receive-pack, /usr/bin/ssh
apache All=(phd) SETENV: NOPASSWD: /usr/bin/git, /usr/bin/git-http-backend
myuser All=(phd) SETENV: NOPASSWD: /var/www/phabricator/phabricator/bin/phd

Phabricator SSH user can ssh:

[myuser@localhost ~]$ echo {} | ssh -p 2222  git@phabricator.localhost.com conduit conduit.ping
{"result":"localhost.localdomain","error_code":null,"error_info":null}

Permissions on path to test repository

[myuser@localhost apache2-php7-postgres]$ cd /var

[myuser@localhost var]$ ls -ltrh |grep repos
drwxrwxr-x.  3 myuser wdev   4.0K May  2 16:21 repos

[myuser@localhost var]$ cd repos

[myuser@localhost repos]$ ls -ltrh |grep git
drwxrwxr-x. 4 myuser wdev 4.0K May 18 08:00 git

[myuser@localhost repos]$ cd git

[myuser@localhost git]$ ls -ltrh
total 4.0K
drwxrwxr-x. 7 myuser wdev 4.0K May  2 16:47 test

[myuser@localhost git]$ cd test

[myuser@localhost test]$ ls -alrh
total 40K
drwxrwxr-x. 4 myuser wdev 4.0K May  2 16:47 refs
drwxrwxr-x. 7 myuser wdev 4.0K May  2 16:47 objects
drwxrwxr-x. 2 myuser wdev 4.0K May  2 16:47 info
drwxrwxr-x. 2 myuser wdev 4.0K May  2 16:47 hooks
-rw-rw-r--. 1 myuser wdev   23 May  2 16:47 HEAD
-rw-rw-r--. 1 myuser wdev   73 May  2 16:47 description
-rw-rw-r--. 1 myuser wdev   66 May  2 16:47 config
drwxrwxr-x. 2 myuser wdev 4.0K May  2 16:47 branches
drwxrwxr-x. 4 myuser wdev 4.0K May 18 08:00 ..
drwxrwxr-x. 7 myuser wdev 4.0K May  2 16:47 .

[myuser@localhost test]$ pwd
/var/repos/git/test

I then cloned test repository by running

cd /home/myuser/local-repos/git/
git clone /var/repos/git/test

I changed URI to use /home/myuser/local-repos/git/test

Directory permissions and contents of clone

[myuser@localhost home]$ ls -ltrh |grep myuser
drwx------. 25 myuser myuser 4.0K May 18 08:10 myuser

[myuser@localhost home]$ cd myuser/

[myuser@localhost ~]$ ls -ltrh |grep local-repos
drwxrwxr-x. 3 myuser wdev     4.0K May  2 16:13 local-repos

[myuser@localhost ~]$ cd local-repos/

[myuser@localhost local-repos]$ ls -altrh
total 12K
drwxrwxr-x.  3 myuser wdev     4.0K May  2 16:13 .
drwxrwxr-x.  3 myuser wdev     4.0K May 18 08:00 git
drwx------. 25 myuser myuser 4.0K May 18 08:10 ..

[myuser@localhost local-repos]$ cd git

[myuser@localhost git]$ ls -altrh
total 12K
drwxrwxr-x. 3 myuser wdev 4.0K May  2 16:13 ..
drwxrwxr-x. 3 myuser wdev 4.0K May  2 16:47 test
drwxrwxr-x. 3 myuser wdev 4.0K May 18 08:00 .

[myuser@localhost git]$ cd test

[myuser@localhost test]$ ls -altrh
total 16K
-rw-rw-r--. 1 myuser wdev    3 May  2 16:47 init.txt
drwxrwxr-x. 3 myuser wdev 4.0K May  2 16:47 .
drwxrwxr-x. 8 myuser wdev 4.0K May  2 16:47 .git
drwxrwxr-x. 3 myuser wdev 4.0K May 18 08:00 ..

2 回答

  • 0

    尝试删除第4个URL(您的),并将 ssh://git@phabricator.localhost.com:2222/source/test 更改为“观察”模式 . 该错误是由于URL不应指向目录(在文件系统中)本身,而是指向Phabricator创建的指向它的URL .

  • 0

    得到它为我的设置工作 .

    我使用我的phabricator ssh用户(git)来获取这个新的ssh URI,结果发现用户无法观察到本地文件系统上已经存在的repo . 我更改了URI以在端口22上使用常规ssh(不是在端口2222上运行的phabricator的ssh)并以我的用户ssh输入:

    ssh://myuser@phabricator.localhost.com/var/repos/git/test Observe Hidden
    

    所以现在我为这个预先存在的本地仓库配置了以下URI:

    ssh://myuser@phabricator.localhost.com/var/repos/git/test Observe Hidden 
    ssh://git@phabricator.localhost.com:2222/diffusion/1/test Read Only Hidden
    ssh://git@phabricator.localhost.com:2222/source/test  Read Only Visible
    ssh://git@phabricator.localhost.com:2222/diffusion/TEST/test  Read Only Hidden
    

    Phab正在观察我的存储库!

    我不知道这是否标准,但对我而言,就目前而言,这是有效的 . 如果有人有其他建议或想法,我很乐意听到他们 .

相关问题