Coder Social home page Coder Social logo

Comments (3)

matthiasbe avatar matthiasbe commented on June 28, 2024

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)

from gogs_ynh.

matthiasbe avatar matthiasbe commented on June 28, 2024

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 ?

from gogs_ynh.

matthiasbe avatar matthiasbe commented on June 28, 2024

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:

  • Did I enable any unnecessary security hole by doing this ?
  • Is it the correct shell to use ?

from gogs_ynh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.