Open matthiasbe opened 1 year ago
From the documentation, it seems that the $HOME
is defaulted to /var/www/__APP__
in Yunohost (see here). This is also the default value of __INSTALL_DIR__
(see here).
In https://github.com/YunoHost-Apps/gogs_ynh/blob/master/conf/app.ini#L63 we have
; The path of SSH root directory, default is "$HOME/.ssh".
SSH_ROOT_PATH =
And in the service config:
HOME=__DATA_DIR__
I think it should be HOME=__INSTALL_DIR__
instead, to be consistent with yunohost config.
I'm would enjoy any feedback on this, and any clue on how to test this properly (I have not yet attempted to develop anything on yunohost, so any pointers to try this quickly would help)
I issued the command sudo ln -s /home/yunohost.app/gogs/.ssh /var/www/gogs
.
This fixed the issue for the key authentication. I am now connected to ssh.
But another problem occures:
matthias@matthias-pc:~/inria/redaction$ git push
Debian GNU/Linux 11
fatal : Error: fatal: protocol error: bad line length character: This
This thread is useful for debugging.
It leads me to issue the following:
$ ssh gogs@<server> git-receive-pack /home/yunohost.app/gogs/repositories/matthias/<my_repo>.git/
Debian GNU/Linux 11
This account is currently not available.
$
From this other thread it looks that the gogs user being setup as "nologin" causes this issue.
My question now is the following: should the git user be setup as nologin, for enable ssh correctly ?
This is fixed with changing the shell of user "gogs" from /sbin/login
to /bin/bash
(I first tried with /usr/bin/git-shell
, but this fails due to gogs using specific command along with the key, command that is not available with git-shell
).
You can make this change with
sudo usermod gogs --shell /bin/bash
And now it works well:
$ git push
Debian GNU/Linux 11
Everything up-to-date
Two remarks:
I am trying to setup SSH connection to pull/push and clone. After fixing the issue #77, I stumble over another issue.
The terminal asks for password even if I have given SSH key in gogs' interface. I see the key in
/home/yunohost_app/gogs/.ssh/authorized_keys
.The command
ssh -vT gogs@<server>
issues the following:After checking, it seems it does not find the correct file
authorized_keys
.I added
AuthorizedKeysFile %h/.ssh/authorized_keys
in/etc/ssh/sshd_config
as suggested in the doc of the app.But still, I think the
$HOME
is not correctly put. Indeed I have the following:I think this should point to
/home/yunohost_app/gogs
no ? How to fix this in the app ?Thank you for your help.