this post was submitted on 10 Sep 2024
36 points (90.9% liked)

Selfhosted

39239 readers
477 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hi, how do you run forgejo under a reverse proxy while using an ssh channel to pull/push commits?

From what I understand caddy is only able to proxy http traffic.

you are viewing a single comment's thread
view the rest of the comments
[–] irotsoma@lemmy.world 2 points 6 days ago (1 children)

There's really no need to reverse proxy ssh. What are you attempting to accomplish with the reverse proxy exactly? Http proxying allows you to add things like TLS encryption and modify headers. But ssh is a secure protocol already and you can't really modify much in transit.

There are plenty of valid reasons to want to use a reverse proxy for SSH:

  • Maybe there is a Forgejo instance and Gitea instance running on the same server.
  • Maybe there is a Prod Forgejo instance and Dev Forgejo instance running on the same server.
  • Maybe both Forgejo and an SFTP are running on the same server.
  • Maybe Forgejo is running in a cluster like Docker Swarm or Kubernetes
  • Maybe there is a desire to have Caddy act as a bastion host due to an inability to run a true bastion host for SSH or reduce maintenance of managing yet another service/server in addition to Caddy

Regardless of the reason, your last point is valid and the real issue here. I do not think it is possible for Caddy to reverse proxy SSH traffic - at least not without additional software (either on the client, server, or both) or some overly complicated (and likely less secure) setup. This may be possible if TCP traffic included SNI information, but unfortunately it does not.