When using git clone git@... always password of git is asked
AlexBrightwater opened this issue · 1 comments
Gogs version
0.14.0+dev
Git version
- Server: 2.38.5
- Client: 2.34.1
Operating system
debian 12 with docker
Database
postgres:latest
Describe the bug
When trying to use git clone git@... I am always asked for the password of git@
➜ git clone git@<domain>:<user>/<user>s_repo.git
Cloning into '<user>s_repo'...
git@<domain>'s password:
To reproduce
Install gogs via docker, create non-admin user, add ssh key, create repo, try cloning repo using ssh
Expected behavior
Being asked for my pin of my key and cloning the repo
Additional context
I installed gogs via docker-compose aka portainer stack. I modified the app.ini a little but all in all my setup is pretty basic. I can't really find any documentaion that seems to apply to what I am looking for, but I have checked.
I use nginx-proxy-manager.
Here is my app.ini:
BRAND_NAME = Gogs
RUN_USER = git
RUN_MODE = prod
[database]
TYPE = postgres
HOST = gogs-db-1:5432
NAME = gogs
SCHEMA = public
USER = gogs
PASSWORD = <redacted>
SSL_MODE = disable
PATH = /app/gogs/data/gogs.db
[repository]
ROOT = /data/git/gogs-repositories
DEFAULT_BRANCH = master
[server]
DOMAIN = <domain>
HTTP_PORT = 3000
EXTERNAL_URL = http://<domain>/
DISABLE_SSH = false
SSH_PORT = 22
START_SSH_SERVER = false
OFFLINE_MODE = false
[mailer]
ENABLED = false
[auth]
REQUIRE_EMAIL_CONFIRMATION = false
DISABLE_REGISTRATION = true
ENABLE_REGISTRATION_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = true
[user]
ENABLE_EMAIL_NOTIFICATION = false
[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = false
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = Info
ROOT_PATH = /app/gogs/log
[security]
INSTALL_LOCK = true
SECRET_KEY = <redacted>
Here is my docker-compose.yml:
version: '3.1'
services:
db:
image: postgres:latest
environment:
POSTGRES_USER: gogs
POSTGRES_PASSWORD: <redacted>
POSTGRES_DB: gogs
volumes:
- /mnt/sda1/volumes/gogs_postgres_data:/var/lib/postgresql/data
restart: always
networks:
- gogs_net
app:
image: gogs/gogs
depends_on:
- db
volumes:
- /mnt/fuse/volumes/gogs_data:/data
restart: always
environment:
DB_TYPE: postgres
DB_HOST: db:5432
DB_NAME: gogs
DB_USER: gogs
DB_PASSWD: <redacted>
links:
- db:db
networks:
- reverse-proxy-net
- gogs_net
networks:
reverse-proxy-net:
external: true
gogs_net:
driver: bridge
Code of Conduct
- I agree to follow this project's Code of Conduct
I figured out that the problem is that the containers port 22 is not available on the host.
So I created a port mapping that mapps port 2222 on the host to port 22 on the container. But since I expose this service to the internet, I don't really like to expose ports. Is there a more sleak way of doing this?