Search code examples
gogs

Should the gogs suggested ssh url be the real on disk location of the repository?


I'm having trouble with the gogs ssh url,but am not sure if the web ui config needs corrected, or whether server config needs changed.

The recommended ssh url in the web ui always has the same user and looks like this:

[email protected]:org/application.git

The problem: That url is not the user's name, nor the complete location on disk of the repository. Is that normal? Replacing the user gets authenticated, but the location is denied.

//no go,  does not appear to be a git repository
git clone ssh://[email protected]:org/application.git

My current workaround: The repositories are kept on disk at /gogs-repositories, and I can clone them by going directly to them:

git clone ssh://[email protected]:/gogs-repositories/org/application.git

But this modification has drawbacks. There are write permission/collaboration issues that have to be managed through CLI instead of through gogs.

Update:

Fiddling with it, I did get the suggested link to pass initial authenticaton, but debugging shows a gogs specific error

Gogs: "Invalid key ID".

Solution

  • That's actually pretty common, notice that GitHub, GitLab etc actually use git@server regardless of username, the user is identified through the public key instead. The path doesn't use the real physical path because the git server (in this case, gogs) handles everything.

    If you haven't been able to clone using the gogs username, you likely haven't set up authentication correctly, browse to yourserver.com/user/settings/ssh and paste your public key there. If you haven't done so already, just run ssh-keygen -t ed25519 in your terminal, leave the directory at its default value unless you have configured a custom location, and paste the content of id_ed25519.pub.