mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-03 20:51:07 -05:00
fix: add required headers to pagure migration (#9973)
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
See https://pagure.io/fedora-infrastructure/issue/12886 for details. Resolves https://codeberg.org/forgejo/forgejo/issues/9974 ## Test 1. Go to https://dev.gusted.xyz/repo/migrate?service_type=10 2. Fill in https://pagure.io/slapi-nis 3. Migrate. 4. Verify the migration succeeded. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9973 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Alexander Bokovoy <ab@samba.org> Co-committed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
parent
f9a6460cec
commit
e7ef2eb370
3 changed files with 7 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ import (
|
|||
"forgejo.org/modules/log"
|
||||
base "forgejo.org/modules/migration"
|
||||
"forgejo.org/modules/proxy"
|
||||
"forgejo.org/modules/setting"
|
||||
"forgejo.org/modules/structs"
|
||||
"forgejo.org/modules/util"
|
||||
)
|
||||
|
|
@ -279,6 +280,11 @@ func (d *PagureDownloader) callAPI(endpoint string, parameter map[string]string,
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// pagure.io is protected by Anubis and requires proper headers
|
||||
req.Header.Add("Accept", "*/*")
|
||||
req.Header.Add("User-Agent", "Forgejo/"+setting.AppVer)
|
||||
|
||||
if d.privateIssuesOnlyRepo {
|
||||
req.Header.Set("Authorization", "token "+d.token)
|
||||
}
|
||||
|
|
@ -344,7 +350,7 @@ func (d *PagureDownloader) GetMilestones() ([]*base.Milestone, error) {
|
|||
func (d *PagureDownloader) GetLabels() ([]*base.Label, error) {
|
||||
rawLabels := PagureLabelsList{}
|
||||
|
||||
err := d.callAPI("/api/0/"+d.repoName+"/tags", nil, &rawLabels)
|
||||
err := d.callAPI("/api/0/"+d.repoName+"/tags/", nil, &rawLabels)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue