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

question: How to change ssh port #25

Open
eeRieee1 opened this issue Oct 31, 2023 · 8 comments
Open

question: How to change ssh port #25

eeRieee1 opened this issue Oct 31, 2023 · 8 comments
Assignees

Comments

@eeRieee1
Copy link

I am using a self-hosted git server, the ssh port is not 22. How can I change it in Caddyfile?

@greenpau
Copy link
Owner

I am using a self-hosted git server, the ssh port is not 22. How can I change it in Caddyfile?

@Riddle233 , try changing it via url directive.

@eeRieee1
Copy link
Author

eeRieee1 commented Nov 2, 2023

{
	git {
		repo docs {
			base_dir /var/www
			auth key /var/keys/id_ed25519
			url git@localhost:20002/xxx/doc.git
			branch web
		}
	}
}

and I got an error:

ERROR   git     failed managing repo    {"repo_name": "docs", "error": "invalid auth method"}
ERROR   git     failed configuring app instance {"app": "git", "error": "invalid auth method"}

@greenpau
Copy link
Owner

greenpau commented Nov 2, 2023

@Riddle233 , the "invalid auth method" is from your code repo, not the plugin itself. Check the logs for your git server.

@eeRieee1
Copy link
Author

eeRieee1 commented Nov 3, 2023

Didn't get anything in gitea logs :(

@greenpau
Copy link
Owner

greenpau commented Nov 3, 2023

@Riddle233 , try running gitea with debugging enabled

@eeRieee1
Copy link
Author

eeRieee1 commented Nov 3, 2023

Can i use username and password auth with http instead?

@greenpau
Copy link
Owner

greenpau commented Nov 3, 2023

@Riddle233 , I'd say tinker with it. Trace what is going on, e.g. is caddy-git makes a connection to gitea? What does it send? What does gitea respond with?

@eeRieee1
Copy link
Author

eeRieee1 commented Nov 4, 2023

I tested it on my wsl with same caddyfile, it works locally, but didn't work on my nas (in docker), and I cannot get any log from gitea when I use it via docker
my Dockerfile:

FROM caddy:builder AS builder

RUN xcaddy build \
    --with github.com/caddy-dns/cloudflare \
    --with github.com/greenpau/caddy-git

FROM caddy:latest

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

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

No branches or pull requests

2 participants