greenpau / caddy-git

Git Plugin for Caddy v2
Apache License 2.0
70 stars 13 forks source link

question: debugging git error "invalid auth method" #21

Open polds opened 1 year ago

polds commented 1 year ago

I'm looking for ways to better debug the git error invalid auth method, I'm not entirely sure what the error is meaning and I'm pretty sure I have everything set up correctly.

I'm using caddy-git 1.0.7 with Caddy 2.5.0 (this version because I hit the error mentioned in #19 on a newer Caddy).

This is my Caddyfile verbatim:

{
    order git before reverse_proxy

    auto_https off

    git {
        repo website {
            base_dir /mnt
            url {env.REPO}
            auth key /.ssh/id_rsa passphrase {env.SSH_KEY_PASSPHRASE}
            webhook Gitlab X-Gitlab-Token {env.WEBHOOK_SECRET}
            branch master
            post pull exec {
                name Pager
                command /usr/bin/echo
                args "pulled repo"
            }
        }
    }
}

:80 {
    route /webhook {
        git update repo website
    }

    reverse_proxy {
        to localhost:1313
    }
}

I have verified the environment variables are injected and available. I have verified that the id_rsa key is available - I get a different error if it's not found.

I am trying to clone a Gitlab private repo in the form of git@gitlab.com:/.git

These are the Caddy errors I see when starting:

{"level":"info","ts":1677257928.3675237,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1677257928.3699372,"logger":"git","msg":"provisioning app instance","app":"git"}
{"level":"error","ts":1677257928.552225,"logger":"git","msg":"failed managing repo","repo_name":"website","error":"invalid auth method"}
{"level":"error","ts":1677257928.552259,"logger":"git","msg":"failed configuring app instance","app":"git","error":"invalid auth method"}
run: loading initial config: loading new config: loading git app module: provision git: invalid auth method

Hopefully I'm missing something silly - any help is appreciated.