Gitea: add SSH port 2222, fix Traefik network, update SSH docs

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-13 20:13:57 +02:00
co-authored by Cursor
parent 5014d55d62
commit df98521459
2 changed files with 55 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
# SSH Key Setup for Homelab Git
## 1. Generate key with custom name
```bash
ssh-keygen -t ed25519 -C "miczek.r@gmail.com" -f ~/.ssh/id_ed25519_private -N ""
```
Creates:
- `~/.ssh/id_ed25519_private` (private never share)
- `~/.ssh/id_ed25519_private.pub` (public add to Gitea & GitHub)
## 2. Add to SSH config
Append to `~/.ssh/config`:
```
Host git.zea.lt
HostName 127.0.0.1
Port 2222
IdentityFile ~/.ssh/id_ed25519_private
IdentitiesOnly yes
Host github.com
IdentityFile ~/.ssh/id_ed25519_private
IdentitiesOnly yes
```
## 3. Add public key to remotes
```bash
cat ~/.ssh/id_ed25519_private.pub
```
- **Gitea:** Settings → SSH / GPG Keys → Add Key
- **GitHub:** Settings → SSH and GPG keys → New SSH key
## 4. Trust host keys & push
```bash
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-keyscan git.zea.lt >> ~/.ssh/known_hosts
cd /home/miczek/homelab
git push -u origin main
```
+9 -1
View File
@@ -7,13 +7,21 @@ services:
- USER_UID=1000
- USER_GID=1000
- GITEA__server__ROOT_URL=https://git.zea.lt
- GITEA__server__SSH_PORT=2222
ports:
- "2222:22"
volumes:
- .:/data
networks:
- homelab
- homelab_homelab
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelab_homelab"
- "traefik.http.routers.gitea.rule=Host(`git.zea.lt`)"
- "traefik.http.routers.gitea.entrypoints=websecure"
- "traefik.http.routers.gitea.tls.certresolver=leresolver"
- "traefik.http.services.gitea.loadbalancer.server.port=3000"
networks:
homelab_homelab:
external: true