I’m trying to set up SSH for Gitea. It works when I don’t try to make traefik redirect the ssh traffic. I followed the documentation but I also got confused about the middle part of SSH passthrough where I need to create an executable file in /app/gitea/gitea
. That path doesn’t exist and there is already a folder named gitea. It’s getting confusing I named that file ssh_poass in the mean time as I wasn’t sure where it was going and I didn’t want to forget about it.
Docker Compose configuration:
gitea:
container_name: gitea
image: kunde21/gitea-arm:latest
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /storage/containers/gitea:/data
networks:
- public
ports:
- 127.0.0.1:10022:10022
- 3100:3000
environment:
- GITEA_CUSTOM=/data/gitea
- GITEA_WORK_DIR=/data/gitea
- USER=git
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- USER_UID=1001
- USER_GID=1001
- SSH_DOMAIN=gitea.somethin
- SSH_PORT=10022
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.gitea.tls=true
- traefik.http.routers.gitea.rule=Host(`gitea.somethin`)
- traefik.http.routers.gitea.tls.certResolver=letstls
- traefik.http.services.gitea-main.loadbalancer.server.port=3000
# Doesn't work:
- traefik.http.routers.gitea-ssh.rule=Host(`gitea.somethin`)
- traefik.http.routers.gitea-ssh.service=gitea-ssh
- traefik.http.services.gitea-ssh.loadbalancer.server.port=10022
Structure:
$ tree /storage/containers/gitea
├── git
│ ├── lfs
│ └── repositories
│ ├── somethin …
├── gitea
│ ├── attachments
│ │ └── a
│ │ └── f
│ ├── avatars
│ │ ├── 3
│ │ ├── 5
│ │ ├── 64e1b8d34f425d19e1ee2ea7236d3028
│ │ └── e5aa6b7a2ffc945900941318ed167fc9
│ ├── conf
│ │ └── app.ini
│ ├── indexers [error opening dir]
│ ├── log
│ └── sessions [error opening dir]
├── gitea.db
├── log
│ ├── gitea.log
├── ssh
│ ├── ssh_host_dsa_key
│ ├── ssh_host_dsa_key.pub
│ ├── ssh_host_ecdsa_key
│ ├── ssh_host_ecdsa_key.pub
│ ├── ssh_host_ed25519_key
│ ├── ssh_host_ed25519_key.pub
│ ├── ssh_host_rsa_key
│ └── ssh_host_rsa_key.pub
└── ssh_pass
- How can I redirect a port for ssh in gitea container using traefik
- Where do I put my
ssh_pass
file
Thanks!