Skip to content

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

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

Closed
melonedo opened this issue Feb 5, 2025 · 0 comments
Closed
Labels
Milestone

Comments

@melonedo
Copy link

melonedo commented Feb 5, 2025

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

lunny pushed a commit that referenced this issue Feb 12, 2025
…, fuzzy prompt, mirror proxy, adopt git) (#33569)

* Make artifact list output a stable order
* Fix #33506
* Fix #33521
* Fix #33288
* Fix #33196
* Fix #33561
@lunny lunny added this to the 1.23.4 milestone Feb 12, 2025
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Feb 12, 2025
…, fuzzy prompt, mirror proxy, adopt git) (go-gitea#33569)

* Make artifact list output a stable order
* Fix go-gitea#33506
* Fix go-gitea#33521
* Fix go-gitea#33288
* Fix go-gitea#33196
* Fix go-gitea#33561
lunny pushed a commit that referenced this issue Feb 12, 2025
…, fuzzy prompt, mirror proxy, adopt git) (#33569) (#33577)

Backport #33569 by @wxiaoguang

* Make artifact list output has stable order
* Fix #33506
* Fix #33521
* Fix #33288
* Fix #33196
* Fix #33561

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants