Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipv6 address parsing issues within ssh server address #17559

Closed
iarba opened this issue Nov 5, 2021 · 0 comments · Fixed by #17561
Closed

Ipv6 address parsing issues within ssh server address #17559

iarba opened this issue Nov 5, 2021 · 0 comments · Fixed by #17561

Comments

@iarba
Copy link

iarba commented Nov 5, 2021

Gitea Version

1.15.6

Git Version

2.25.1

Operating System

Ubuntu 20.04 x64

How are you running Gitea?

Downloaded gitea from dl.gitea.io

Running under supervisor, with gitea.conf

[program:gitea]
directory=/opt/gitea
command=/opt/gitea/gitea web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/opt/gitea/log/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/opt/gitea/log/stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
user = git
environment = HOME="/home/git", USER="git"

server section in app.ini, altered to remove sensitive data

[server]
PROTOCOL         = https
DOMAIN           = git.example.com
HTTP_ADDR        = ::
HTTP_PORT        = 443
SSH_DOMAIN       = git.example.com
START_SSH_SERVER = true
SSH_LISTEN_HOST  = ::
SSH_LISTEN_PORT  = 22
ROOT_URL         = https://git.example.com/
DISABLE_SSH      = false
LFS_START_SERVER = true
LFS_CONTENT_PATH = /opt/gitea/data/lfs
LFS_JWT_SECRET   = 
OFFLINE_MODE     = false
# certificate is valid for *.example.com
CERT_FILE        = /opt/crt/example.com/cert.pem
KEY_FILE         = /opt/crt/example/com/key.pem

Additionallty, there is an openssh server running on 0.0.0.0:1022, thus not conflicting with [::]:22

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/iarba/8eb927803fff4beaf6e12f9600cbb903

Description

Upon trying to bring the server online, ssh server fails to initialise, and the following error is recorded in the log file:

2021/11/05 16:37:43 ...s/graceful/server.go:62:NewServer() [I] Starting new SSH server: tcp::::22 on PID: 47150
2021/11/05 16:37:43 ...s/graceful/server.go:88:ListenAndServe() [E] Unable to GetListener: address :::22: too many colons in address
2021/11/05 16:37:43 .../ssh/ssh_graceful.go:26:listen() [F] Failed to start SSH server: address :::22: too many colons in address

Gitea fails to initialise and appears as down within supervisor.

Changed the line in app.ini regarding ssh server address from SSH_LISTEN_HOST = :: to SSH_LISTEN_HOST = [::]. This seems to fix the error, however is inconsistent with #12321.

2021/11/05 17:14:07 ...s/graceful/server.go:62:NewServer() [I] Starting new SSH server: tcp:[::]:22 on PID: 48304
2021/11/05 17:14:07 ...xer/stats/indexer.go:84:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2021/11/05 17:14:07 cmd/web.go:196:listen() [I] Listen: https://[::]:443
2021/11/05 17:14:07 cmd/web.go:199:listen() [I] LFS server enabled
2021/11/05 17:14:07 ...s/graceful/server.go:62:NewServer() [I] Starting new Web server: tcp:[::]:443 on PID: 48304

Traffic test querying the web-server(ubuntu 18.04 + firefox 94.0) and git fetch(ubuntu18.04 + git 2.17.1) passes.

Screenshots

No response

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant