Skip to content

Proxy settings from configuration file is not passed to push mirror operations #33506

Closed
@melonedo

Description

@melonedo

Description

In mirror_pull.go, the proxy settings are retrieved and passed to git operations

envs := proxy.EnvWithProxy(remoteURL.URL)
stdoutBuilder := strings.Builder{}
stderrBuilder := strings.Builder{}
if err := cmd.Run(&git.RunOpts{
Timeout: timeout,
Dir: repoPath,
Env: envs,
Stdout: &stdoutBuilder,
Stderr: &stderrBuilder,
}); err != nil {

However, in mirror_push.go, the environment is not passed to the underlying interface although it is supported

if err := git.Push(ctx, path, git.PushOptions{
Remote: m.RemoteName,
Force: true,
Mirror: true,
Timeout: timeout,
}); err != nil {

This prevents push mirrors from using proxies.

Gitea Version

Gitea version 1.22.4 built with GNU Make 4.3, go1.22.9 : bindata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Configure proxy.PROXY_ENABLED/PROXY_URL/PROXY_HOSTS and use push mirrors

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions