diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-01-07 13:17:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-07 13:17:44 +0800 |
commit | 34dfc25b8311117ae83f1c070ce4a6114ffe2843 (patch) | |
tree | 4448035e2e5628234f2de2ff48c834824b9345cf /routers/api | |
parent | 98637fe76e70d8b963827354b2eed2e8f151ebd6 (diff) | |
download | gitea-34dfc25b8311117ae83f1c070ce4a6114ffe2843.tar.gz gitea-34dfc25b8311117ae83f1c070ce4a6114ffe2843.zip |
Make git clone URL could use current signed-in user (#33091)
close #33086
* Add a special value for "SSH_USER" setting: `(DOER_USERNAME)`
* Improve parseRepositoryURL and add tests (now it doesn't have hard
dependency on some setting values)
Many changes are just adding "ctx" and "doer" argument to functions.
By the way, improve app.example.ini, remove all `%(key)s` syntax, it
only makes messy and no user really cares about it.
Document: https://gitea.com/gitea/docs/pulls/138
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/packages/npm/npm.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/packages/npm/npm.go b/routers/api/packages/npm/npm.go index 1372303049..6ec46bcb36 100644 --- a/routers/api/packages/npm/npm.go +++ b/routers/api/packages/npm/npm.go @@ -163,7 +163,7 @@ func UploadPackage(ctx *context.Context) { return } - repo, err := repo_model.GetRepositoryByURL(ctx, npmPackage.Metadata.Repository.URL) + repo, err := repo_model.GetRepositoryByURLRelax(ctx, npmPackage.Metadata.Repository.URL) if err == nil { canWrite := repo.OwnerID == ctx.Doer.ID |