Skip to content

[Docs] Simpler option for docker ssh config (no passthrough) #25479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lonix1 opened this issue Jun 24, 2023 · 8 comments
Open

[Docs] Simpler option for docker ssh config (no passthrough) #25479

lonix1 opened this issue Jun 24, 2023 · 8 comments
Labels
type/docs This PR mainly updates/creates documentation type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lonix1
Copy link
Contributor

lonix1 commented Jun 24, 2023

Feature Description

There are many issues with the ssh passthrough/tunnelling approach and docs. I decided to follow the advice of @wxiaoguang to try something simpler: opening another port for gitea's ssh server so tunnelling is unnecessary.

But that approach is not documented at all. I've spent just as long on this problem as on passthrough. I am fairly good at linux and ssh (and comfortable with gitea settings too), so the problem is not me - there are very complex settings for this, and there seem to be some weird corner cases (maybe bugs too), so the average user will struggle.

PLEASE, document this approach, and promote it as the default instead of ssh tunnelling/passthrough. At the very least, can someone post a link to a working example, to save others (and me!) from wasting time on this.

I suggest a good place for this is another section in the "Installation with Docker" page, before the ssh passthrough section.

Screenshots

No response

@lonix1 lonix1 added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jun 24, 2023
@wxiaoguang wxiaoguang added this to the 1.21.0 milestone Jun 24, 2023
@lonix1 lonix1 changed the title [Docs] Simpler option for ssh config (no passthrough) [Docs] Simpler option for docker ssh config (no passthrough) Jun 24, 2023
@wxiaoguang wxiaoguang added the type/docs This PR mainly updates/creates documentation label Jun 24, 2023
@krokosik
Copy link

Could you share this approach?

@lonix1
Copy link
Contributor Author

lonix1 commented Sep 14, 2023

It was a while ago so I don't remember how I did it. But I suppose you'll need to open another port on your server (allow it through your firewall) and update gitea's config file accordingly. I recall there was more to it that that though - it unfortunately wasn't documented properly.

@lunny lunny modified the milestones: 1.21.0, 1.22.0 Sep 21, 2023
@bst27
Copy link

bst27 commented Nov 19, 2023

@wkrasnicki I created an example over there: https://gist.github.com/bst27/1b5d43317e50183320e0e094d1e4f7fc

@techknowlogick
Copy link
Member

Closing as the docs do have exposing a port for ssh as the first example.

@lonix1
Copy link
Contributor Author

lonix1 commented Nov 20, 2023

@techknowlogick @wxiaoguang With respect, this shouldn't be closed. This was a very complex and painful issue.

The problem is the docs promote passthrough and most users will try it and fail miserably, not just because it's hard, but as I recall, because the docs are wrong and because of this issue.

The docs should state that passthrough is an option, but highly recommend not to use it (and use a normal port). And, that should be done only once someone can confirm that passthrough actually works - because it does not.

@florianbeisel
Copy link

Adding my two cents here:

Passthrough is indeed a viable option which I use in a rootless docker environment. But the documentation is lacking. I will try to document my steps today(ish) and try to document a working setup.

@bst27
Copy link

bst27 commented Jan 5, 2024

Adding my two cents here:

Passthrough is indeed a viable option which I use in a rootless docker environment. But the documentation is lacking. I will try to document my steps today(ish) and try to document a working setup.

Maybe you want to have a look at my example setup I shared above:

https://gist.github.com/bst27/1b5d43317e50183320e0e094d1e4f7fc

@florianbeisel
Copy link

Maybe you want to have a look at my example setup I shared above:

https://gist.github.com/bst27/1b5d43317e50183320e0e094d1e4f7fc

Sorry for the misunderstanding. I wanted really badly to keep port 22. I already have a working setup with rootless docker and SSH passthrough. I just need to retrace my steps what I did exactly and document it.

In short what I did:

  • add the GID that is associated with docker.sock to the system groups so we can reference it
  • add the git user to said group (in my case its called rootless-docker)
  • use a systemd service to fix the permissions on /run/user/UID
  • create the wrapper script for the git users shell
  • create another wrapper for use with AuthorizedKeysCommand so that we can supply the path to the docker.sock

This is just from the top of my head so caveat emptor

@lunny lunny modified the milestones: 1.22.0, 1.23.0 Mar 4, 2024
@lunny lunny removed this from the 1.23.0 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs This PR mainly updates/creates documentation type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

7 participants