SSH With Forgejo (Gitea fork)

Hi,
iam having problem to route ssh to my git container. I tried lot of combinations and am not able to get it working. Traefik is running on different machine than git. Http redirects works all good but ssh is not. Currently iam on this config

docker-compose - traefik

  traefik:
    depends_on:
      - authelia
    image: traefik:latest
    container_name: traefik
    restart: unless-stopped
    environment:
      CF_DNS_API_TOKEN: CENSORED
    networks:
      - traefik_proxy
      - default
    ports:
      - 80:80
      - 443:443
      - 2224:2224
    volumes:
      - /etc/localtime:/etc/localtime:ro    
      - ./config/traefik/acme.json:/acme.json
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./config/traefik/config.yml:/config.yml
      - ./config/traefik/traefik.yml:/traefik.yml:ro
    # labels:
    #   - com.centurylinklabs.watchtower.monitor-only=true

docker-compose git

  forgejo:
    image: codeberg.org/forgejo/forgejo:8
    container_name: git
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
    restart: always
    volumes:
      - ./config/git:/data
      - /home/thehorde/backup/repositories:/data/git
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '3000:3000'
      - '2224:22'

traefik.yml

entryPoints:
  traefik:
    address: ":8080"
  http:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
  https:
    address: ":443"
  git_ssh:
    address: ":2224"

and config.yml

tcp:
  routers:
    git-ssh:
      entryPoints:
        - git_ssh
      rule: "HostSNI(`*`)"
      service: git-ssh
      tls:
        passthrough: true
  services:
    git-ssh:
      loadBalancer:
        servers:
          - address: "10.10.42.3:2224"

Try to remove this:

It’s a TCP connection, if you don’t enable TLS in Traefik, the stream will just be passed through.

Thanks a lot:) Thats now working. Still some things to do but it seems that traefik part is ok and now my router is the problem...

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.