Update docker docs about ssh server #5095

Closed
opened 2025-11-02 06:14:17 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @weeman1337 on GitHub (Mar 22, 2020).

  • Gitea version (or commit ref): v1.11.3 in docker image from dockerhub same tag
  • Git version: docker image
  • Operating system: docker image
  • Database:
    • MySQL
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)

Description

It may be partially ma fault but I didn't get any error nor info in the docs:

I've set up Gitea using the official docker image. Then I uploaded some ssh keys to the accounts / as deployment key. We struggled with the SSH ports, so I updated the config. This is there the fun began :)

As we wanted to use SSH I thought " hey, cool enable the built in server if Gitea has one". Then SSH worked fine so far. But uploading or removing SSH keys lead to errors like "unauthorized" or "key not found: 1". I spent much time finding out, that the docker image ships openssh as server.

My suggestions:

• Shouldn't an error occur from the internal SSH server, that the port (22) is already in use? It didn't raise one.
• Update docker docs to point out that an SSH server is included and the internal server shouldn't be used (at least on port 22).

Originally created by @weeman1337 on GitHub (Mar 22, 2020). - Gitea version (or commit ref): v1.11.3 in docker image from dockerhub same tag - Git version: docker image - Operating system: docker image - Database: - [X] MySQL - Can you reproduce the bug at https://try.gitea.io: - [X] Yes (provide example URL) ## Description It may be partially ma fault but I didn't get any error nor info in the docs: I've set up Gitea using the official docker image. Then I uploaded some ssh keys to the accounts / as deployment key. We struggled with the SSH ports, so I updated the config. This is there the fun began :) As we wanted to use SSH I thought " hey, cool enable the built in server if Gitea has one". Then SSH worked fine so far. But uploading or removing SSH keys lead to errors like "unauthorized" or "key not found: 1". I spent much time finding out, that the docker image ships openssh as server. ## My suggestions: • Shouldn't an error occur from the internal SSH server, that the port (22) is already in use? It didn't raise one. • Update docker docs to point out that an SSH server is included and the internal server shouldn't be used (at least on port 22).
GiteaMirror added the type/docs label 2025-11-02 06:14:17 -06:00
Author
Owner

@lunny commented on GitHub (Mar 22, 2020):

Yes. Once you decide to use internal SSH server, you should do two things. One is check if the port has been used by other application, another is change the config and restart gitea. And if internal SSH server start failed, the total gitea should exit.

@lunny commented on GitHub (Mar 22, 2020): Yes. Once you decide to use internal SSH server, you should do two things. One is check if the port has been used by other application, another is change the config and restart gitea. And if internal SSH server start failed, the total gitea should exit.
Author
Owner

@weeman1337 commented on GitHub (Mar 22, 2020):

Thanks for the response.

And if internal SSH server start failed, the total gitea should exit.

It currently doesn't look like doing that. That is the issue. All the other things are have been my faults of course ;) That is why this issue is just for improving the docs and Gitea behavior avoiding others spending hours on this.

@weeman1337 commented on GitHub (Mar 22, 2020): Thanks for the response. > And if internal SSH server start failed, the total gitea should exit. It currently doesn't look like doing that. That is the issue. All the other things are have been my faults of course ;) That is why this issue is just for improving the docs and Gitea behavior avoiding others spending hours on this.
Author
Owner

@zeripath commented on GitHub (Mar 22, 2020):

Hmm. This is probably my fault.

c61b902538/modules/ssh/ssh_graceful.go (L19)

Probably should be log.Fatal

@zeripath commented on GitHub (Mar 22, 2020): Hmm. This is probably my fault. https://github.com/go-gitea/gitea/blob/c61b902538e8e4b2bb83136f190e044a6bbcdd9b/modules/ssh/ssh_graceful.go#L19 Probably should be `log.Fatal`
Author
Owner

@zeripath commented on GitHub (Mar 22, 2020):

Ah actually it was originally just a log.Error so I didn't introduce the bug.

@zeripath commented on GitHub (Mar 22, 2020): Ah actually it was originally just a `log.Error` so I didn't introduce the bug.
Author
Owner

@weeman1337 commented on GitHub (Mar 22, 2020):

Wow that was a fast response 👍
Thank you

I would also update the docker docs that the image container an openssh server.

@weeman1337 commented on GitHub (Mar 22, 2020): Wow that was a fast response :+1: Thank you I would also update the docker docs that the image container an openssh server.
Author
Owner

@zeripath commented on GitHub (Mar 22, 2020):

Write what you want as a comment on that PR or here and I'll add it.

@zeripath commented on GitHub (Mar 22, 2020): Write what you want as a comment on that PR or here and I'll add it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5095