mirror of
https://github.com/go-gitea/gitea
synced 2024-11-19 00:39:30 +01:00
Merge branch 'main' into lunny/fix_move_column
This commit is contained in:
commit
b987f00778
25
.github/workflows/disk-clean.yml
vendored
25
.github/workflows/disk-clean.yml
vendored
@ -1,25 +0,0 @@
|
|||||||
name: disk-clean
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
triage:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
uses: jlumbroso/free-disk-space@main
|
|
||||||
with:
|
|
||||||
# this might remove tools that are actually needed,
|
|
||||||
# if set to "true" but frees about 6 GB
|
|
||||||
tool-cache: false
|
|
||||||
|
|
||||||
# all of these default to true, but feel free to set to
|
|
||||||
# "false" if necessary for your workflow
|
|
||||||
android: true
|
|
||||||
dotnet: true
|
|
||||||
haskell: true
|
|
||||||
large-packages: false
|
|
||||||
docker-images: false
|
|
||||||
swap-storage: true
|
|
2
.github/workflows/release-nightly.yml
vendored
2
.github/workflows/release-nightly.yml
vendored
@ -9,8 +9,6 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
disk-clean:
|
|
||||||
uses: ./.github/workflows/disk-clean.yml
|
|
||||||
nightly-binary:
|
nightly-binary:
|
||||||
runs-on: nscloud
|
runs-on: nscloud
|
||||||
steps:
|
steps:
|
||||||
|
4
assets/go-licenses.json
generated
4
assets/go-licenses.json
generated
@ -540,8 +540,8 @@
|
|||||||
"licenseText": "Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
"licenseText": "Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "github.com/google/go-github/v57/github",
|
"name": "github.com/google/go-github/v61/github",
|
||||||
"path": "github.com/google/go-github/v57/github/LICENSE",
|
"path": "github.com/google/go-github/v61/github/LICENSE",
|
||||||
"licenseText": "Copyright (c) 2013 The go-github AUTHORS. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
"licenseText": "Copyright (c) 2013 The go-github AUTHORS. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/google/go-github/v57/github"
|
"github.com/google/go-github/v61/github"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
4
go.mod
4
go.mod
@ -16,6 +16,7 @@ require (
|
|||||||
gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4
|
gitea.com/lunny/levelqueue v0.4.2-0.20230414023320-3c0159fe0fe4
|
||||||
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
|
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121
|
||||||
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
|
||||||
|
github.com/ProtonMail/go-crypto v1.0.0
|
||||||
github.com/PuerkitoBio/goquery v1.9.1
|
github.com/PuerkitoBio/goquery v1.9.1
|
||||||
github.com/alecthomas/chroma/v2 v2.13.0
|
github.com/alecthomas/chroma/v2 v2.13.0
|
||||||
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb
|
||||||
@ -53,7 +54,7 @@ require (
|
|||||||
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
|
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
|
||||||
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
|
||||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||||
github.com/google/go-github/v57 v57.0.0
|
github.com/google/go-github/v61 v61.0.0
|
||||||
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7
|
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/gorilla/feeds v1.1.2
|
github.com/gorilla/feeds v1.1.2
|
||||||
@ -135,7 +136,6 @@ require (
|
|||||||
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
github.com/Masterminds/semver/v3 v3.2.1 // indirect
|
||||||
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||||
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
|
||||||
github.com/RoaringBitmap/roaring v1.9.0 // indirect
|
github.com/RoaringBitmap/roaring v1.9.0 // indirect
|
||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||||
github.com/andybalholm/cascadia v1.3.2 // indirect
|
github.com/andybalholm/cascadia v1.3.2 // indirect
|
||||||
|
4
go.sum
4
go.sum
@ -394,8 +394,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs=
|
github.com/google/go-github/v61 v61.0.0 h1:VwQCBwhyE9JclCI+22/7mLB1PuU9eowCXKY5pNlu1go=
|
||||||
github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw=
|
github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY=
|
||||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||||
github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk=
|
github.com/google/go-tpm v0.9.0 h1:sQF6YqWMi+SCXpsmS3fd21oPy/vSddwZry4JnmltHVk=
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
"code.gitea.io/gitea/models/migrations/v1_20"
|
"code.gitea.io/gitea/models/migrations/v1_20"
|
||||||
"code.gitea.io/gitea/models/migrations/v1_21"
|
"code.gitea.io/gitea/models/migrations/v1_21"
|
||||||
"code.gitea.io/gitea/models/migrations/v1_22"
|
"code.gitea.io/gitea/models/migrations/v1_22"
|
||||||
"code.gitea.io/gitea/models/migrations/v1_23"
|
|
||||||
"code.gitea.io/gitea/models/migrations/v1_6"
|
"code.gitea.io/gitea/models/migrations/v1_6"
|
||||||
"code.gitea.io/gitea/models/migrations/v1_7"
|
"code.gitea.io/gitea/models/migrations/v1_7"
|
||||||
"code.gitea.io/gitea/models/migrations/v1_8"
|
"code.gitea.io/gitea/models/migrations/v1_8"
|
||||||
@ -574,18 +573,20 @@ var migrations = []Migration{
|
|||||||
// v293 -> v294
|
// v293 -> v294
|
||||||
NewMigration("Ensure every project has exactly one default column", v1_22.CheckProjectColumnsConsistency),
|
NewMigration("Ensure every project has exactly one default column", v1_22.CheckProjectColumnsConsistency),
|
||||||
|
|
||||||
// Gitea 1.22.0 ends at 294
|
// Gitea 1.22.0-rc0 ends at 294
|
||||||
|
|
||||||
// v294 -> v295
|
// v294 -> v295
|
||||||
NewMigration("Add unique index for project issue table", v1_23.AddUniqueIndexForProjectIssue),
|
NewMigration("Add unique index for project issue table", v1_22.AddUniqueIndexForProjectIssue),
|
||||||
// v295 -> v296
|
// v295 -> v296
|
||||||
NewMigration("Add commit status summary table", v1_23.AddCommitStatusSummary),
|
NewMigration("Add commit status summary table", v1_22.AddCommitStatusSummary),
|
||||||
// v296 -> v297
|
// v296 -> v297
|
||||||
NewMigration("Add missing field of commit status summary table", v1_23.AddCommitStatusSummary2),
|
NewMigration("Add missing field of commit status summary table", v1_22.AddCommitStatusSummary2),
|
||||||
// v297 -> v298
|
// v297 -> v298
|
||||||
NewMigration("Add everyone_access_mode for repo_unit", v1_23.AddRepoUnitEveryoneAccessMode),
|
NewMigration("Add everyone_access_mode for repo_unit", v1_22.AddRepoUnitEveryoneAccessMode),
|
||||||
// v298 -> v299
|
// v298 -> v299
|
||||||
NewMigration("Drop wrongly created table o_auth2_application", v1_23.DropWronglyCreatedTable),
|
NewMigration("Drop wrongly created table o_auth2_application", v1_22.DropWronglyCreatedTable),
|
||||||
|
|
||||||
|
// Gitea 1.22.0-rc1 ends at 299
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current db version
|
// GetCurrentDBVersion returns the current db version
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"slices"
|
"slices"
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import "xorm.io/xorm"
|
import "xorm.io/xorm"
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import "xorm.io/xorm"
|
import "xorm.io/xorm"
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.gitea.io/gitea/models/perm"
|
"code.gitea.io/gitea/models/perm"
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
package v1_23 //nolint
|
package v1_22 //nolint
|
||||||
|
|
||||||
import "xorm.io/xorm"
|
import "xorm.io/xorm"
|
||||||
|
|
@ -5,8 +5,8 @@ package user_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
package pwn
|
package pwn
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand/v2"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -18,11 +17,6 @@ var client = New(WithHTTP(&http.Client{
|
|||||||
Timeout: time.Second * 2,
|
Timeout: time.Second * 2,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
|
||||||
rand.Seed(time.Now().Unix())
|
|
||||||
os.Exit(m.Run())
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestPassword(t *testing.T) {
|
func TestPassword(t *testing.T) {
|
||||||
// Check input error
|
// Check input error
|
||||||
_, err := client.CheckPassword("", false)
|
_, err := client.CheckPassword("", false)
|
||||||
@ -81,24 +75,24 @@ func testPassword() string {
|
|||||||
|
|
||||||
// Set special character
|
// Set special character
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
random := rand.Intn(len(specialCharSet))
|
random := rand.IntN(len(specialCharSet))
|
||||||
password.WriteString(string(specialCharSet[random]))
|
password.WriteString(string(specialCharSet[random]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set numeric
|
// Set numeric
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
random := rand.Intn(len(numberSet))
|
random := rand.IntN(len(numberSet))
|
||||||
password.WriteString(string(numberSet[random]))
|
password.WriteString(string(numberSet[random]))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set uppercase
|
// Set uppercase
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
random := rand.Intn(len(upperCharSet))
|
random := rand.IntN(len(upperCharSet))
|
||||||
password.WriteString(string(upperCharSet[random]))
|
password.WriteString(string(upperCharSet[random]))
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 5; i++ {
|
for i := 0; i < 5; i++ {
|
||||||
random := rand.Intn(len(allCharSet))
|
random := rand.IntN(len(allCharSet))
|
||||||
password.WriteString(string(allCharSet[random]))
|
password.WriteString(string(allCharSet[random]))
|
||||||
}
|
}
|
||||||
inRune := []rune(password.String())
|
inRune := []rune(password.String())
|
||||||
|
@ -466,14 +466,15 @@ func (ar artifactRoutes) downloadArtifact(ctx *ArtifactContext) {
|
|||||||
log.Error("Error getting artifact: %v", err)
|
log.Error("Error getting artifact: %v", err)
|
||||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
} else if !exist {
|
}
|
||||||
|
if !exist {
|
||||||
log.Error("artifact with ID %d does not exist", artifactID)
|
log.Error("artifact with ID %d does not exist", artifactID)
|
||||||
ctx.Error(http.StatusNotFound, fmt.Sprintf("artifact with ID %d does not exist", artifactID))
|
ctx.Error(http.StatusNotFound, fmt.Sprintf("artifact with ID %d does not exist", artifactID))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if artifact.RunID != runID {
|
if artifact.RunID != runID {
|
||||||
log.Error("Error dismatch runID and artifactID, task: %v, artifact: %v", runID, artifactID)
|
log.Error("Error mismatch runID and artifactID, task: %v, artifact: %v", runID, artifactID)
|
||||||
ctx.Error(http.StatusBadRequest, err.Error())
|
ctx.Error(http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ func getRunJobs(ctx *context_module.Context, runIndex, jobIndex int64) (*actions
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
if len(jobs) == 0 {
|
if len(jobs) == 0 {
|
||||||
ctx.Error(http.StatusNotFound, err.Error())
|
ctx.Error(http.StatusNotFound)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ package migrations
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/google/go-github/v57/github"
|
"github.com/google/go-github/v61/github"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrRepoNotCreated returns the error that repository not created
|
// ErrRepoNotCreated returns the error that repository not created
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/proxy"
|
"code.gitea.io/gitea/modules/proxy"
|
||||||
"code.gitea.io/gitea/modules/structs"
|
"code.gitea.io/gitea/modules/structs"
|
||||||
|
|
||||||
"github.com/google/go-github/v57/github"
|
"github.com/google/go-github/v61/github"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -76,7 +76,8 @@
|
|||||||
{{ctx.Locale.Tr "admin.dashboard.system_status"}}
|
{{ctx.Locale.Tr "admin.dashboard.system_status"}}
|
||||||
</h4>
|
</h4>
|
||||||
{{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}}
|
{{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}}
|
||||||
<div hx-get="{{$.Link}}/system_status" hx-swap="morph:innerHTML" hx-trigger="every 5s" hx-indicator=".divider" class="ui attached table segment">
|
<div class="no-loading-indicator tw-hidden"></div>
|
||||||
|
<div hx-get="{{$.Link}}/system_status" hx-swap="morph:innerHTML" hx-trigger="every 5s" hx-indicator=".no-loading-indicator" class="ui attached table segment">
|
||||||
{{template "admin/system_status" .}}
|
{{template "admin/system_status" .}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -235,7 +235,7 @@
|
|||||||
|
|
||||||
{{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}}
|
{{if and (not $.Repository.IsArchived) (not .DiffNotAvailable)}}
|
||||||
<template id="issue-comment-editor-template">
|
<template id="issue-comment-editor-template">
|
||||||
<div class="ui comment form">
|
<div class="ui form comment">
|
||||||
{{template "shared/combomarkdowneditor" (dict
|
{{template "shared/combomarkdowneditor" (dict
|
||||||
"MarkdownPreviewUrl" (print $.Repository.Link "/markup")
|
"MarkdownPreviewUrl" (print $.Repository.Link "/markup")
|
||||||
"MarkdownPreviewContext" $.RepoLink
|
"MarkdownPreviewContext" $.RepoLink
|
||||||
@ -249,7 +249,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
<div class="text right edit buttons">
|
<div class="text right edit buttons">
|
||||||
<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
|
<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
|
||||||
<button class="ui primary save button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
{{with .Issue}}
|
{{with .Issue}}
|
||||||
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
|
{{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}}
|
||||||
|
{{$attachments := index $.Page.issuesAttachmentMap .ID}}
|
||||||
|
{{if $attachments}}
|
||||||
<div class="card-attachment-images">
|
<div class="card-attachment-images">
|
||||||
{{range (index $.Page.issuesAttachmentMap .ID)}}
|
{{range $attachments}}
|
||||||
<img src="{{.DownloadURL}}" alt="{{.Name}}" />
|
<img src="{{.DownloadURL}}" alt="{{.Name}}" />
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="content tw-p-0 tw-w-full">
|
{{end}}
|
||||||
<div class="tw-flex tw-items-start">
|
<div class="content tw-w-full">
|
||||||
|
<div class="tw-flex tw-items-start tw-gap-[5px]">
|
||||||
<div class="issue-card-icon">
|
<div class="issue-card-icon">
|
||||||
{{template "shared/issueicon" .}}
|
{{template "shared/issueicon" .}}
|
||||||
</div>
|
</div>
|
||||||
@ -18,7 +21,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
<div class="meta tw-my-1">
|
<div class="meta">
|
||||||
<span class="text light grey muted-links">
|
<span class="text light grey muted-links">
|
||||||
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
|
{{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}}
|
||||||
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
|
{{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}}
|
||||||
@ -59,13 +62,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if or .Labels .Assignees}}
|
{{if or .Labels .Assignees}}
|
||||||
<div class="extra content labels-list tw-p-0 tw-pt-1">
|
<div class="tw-flex tw-justify-between">
|
||||||
|
<div class="labels-list tw-flex-1">
|
||||||
{{range .Labels}}
|
{{range .Labels}}
|
||||||
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
|
<a target="_blank" href="{{$.Issue.Repo.Link}}/issues?labels={{.ID}}">{{RenderLabel ctx ctx.Locale .}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="right floated">
|
</div>
|
||||||
|
<div class="tw-flex tw-flex-wrap tw-content-start tw-gap-1">
|
||||||
{{range .Assignees}}
|
{{range .Assignees}}
|
||||||
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini tw-mr-2"}}</a>
|
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{ctx.Locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28}}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<template id="issue-comment-editor-template">
|
<template id="issue-comment-editor-template">
|
||||||
<div class="ui comment form">
|
<div class="ui form comment">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
{{template "shared/combomarkdowneditor" (dict
|
{{template "shared/combomarkdowneditor" (dict
|
||||||
"MarkdownPreviewUrl" (print .Repository.Link "/markup")
|
"MarkdownPreviewUrl" (print .Repository.Link "/markup")
|
||||||
@ -164,8 +164,8 @@
|
|||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="text right edit">
|
<div class="text right edit">
|
||||||
<button class="ui basic cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
|
<button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>
|
||||||
<button class="ui primary save button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.save"}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
package integration
|
package integration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"math/rand/v2"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"testing"
|
"testing"
|
||||||
@ -18,7 +18,7 @@ import (
|
|||||||
func StringWithCharset(length int, charset string) string {
|
func StringWithCharset(length int, charset string) string {
|
||||||
b := make([]byte, length)
|
b := make([]byte, length)
|
||||||
for i := range b {
|
for i := range b {
|
||||||
b[i] = charset[rand.Intn(len(charset))]
|
b[i] = charset[rand.IntN(len(charset))]
|
||||||
}
|
}
|
||||||
return string(b)
|
return string(b)
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ func BenchmarkRepoBranchCommit(b *testing.B) {
|
|||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
b.Run("CreateBranch", func(b *testing.B) {
|
b.Run("CreateBranch", func(b *testing.B) {
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
branchName := StringWithCharset(5+rand.Intn(10), "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
branchName := StringWithCharset(5+rand.IntN(10), "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||||
b.StartTimer()
|
b.StartTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
b.Run("new_"+branchName, func(b *testing.B) {
|
b.Run("new_"+branchName, func(b *testing.B) {
|
||||||
|
@ -5,9 +5,9 @@ package integration
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/test"
|
"code.gitea.io/gitea/modules/test"
|
||||||
"code.gitea.io/gitea/tests"
|
"code.gitea.io/gitea/tests"
|
||||||
|
|
||||||
|
"github.com/ProtonMail/go-crypto/openpgp"
|
||||||
|
"github.com/ProtonMail/go-crypto/openpgp/armor"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"golang.org/x/crypto/openpgp"
|
|
||||||
"golang.org/x/crypto/openpgp/armor"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGPGGit(t *testing.T) {
|
func TestGPGGit(t *testing.T) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
.issue-card {
|
.issue-card {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
@ -17,7 +18,6 @@
|
|||||||
.issue-card-title {
|
.issue-card-title {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.issue-card.sortable-chosen .issue-card-title {
|
.issue-card.sortable-chosen .issue-card-title {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export function handleGlobalEnterQuickSubmit(target) {
|
export function handleGlobalEnterQuickSubmit(target) {
|
||||||
const form = target.closest('form');
|
let form = target.closest('form');
|
||||||
if (form) {
|
if (form) {
|
||||||
if (!form.checkValidity()) {
|
if (!form.checkValidity()) {
|
||||||
form.reportValidity();
|
form.reportValidity();
|
||||||
@ -9,5 +9,10 @@ export function handleGlobalEnterQuickSubmit(target) {
|
|||||||
// here use the event to trigger the submit event (instead of calling `submit()` method directly)
|
// here use the event to trigger the submit event (instead of calling `submit()` method directly)
|
||||||
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
|
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
|
||||||
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true}));
|
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form = target.closest('.ui.form');
|
||||||
|
if (form) {
|
||||||
|
form.querySelector('.ui.primary.button')?.click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,8 +162,8 @@ async function onEditContent(event) {
|
|||||||
editContentZone.innerHTML = document.getElementById('issue-comment-editor-template').innerHTML;
|
editContentZone.innerHTML = document.getElementById('issue-comment-editor-template').innerHTML;
|
||||||
comboMarkdownEditor = await initComboMarkdownEditor(editContentZone.querySelector('.combo-markdown-editor'));
|
comboMarkdownEditor = await initComboMarkdownEditor(editContentZone.querySelector('.combo-markdown-editor'));
|
||||||
comboMarkdownEditor.attachedDropzoneInst = await setupDropzone(editContentZone.querySelector('.dropzone'));
|
comboMarkdownEditor.attachedDropzoneInst = await setupDropzone(editContentZone.querySelector('.dropzone'));
|
||||||
editContentZone.querySelector('.cancel.button').addEventListener('click', cancelAndReset);
|
editContentZone.querySelector('.ui.cancel.button').addEventListener('click', cancelAndReset);
|
||||||
editContentZone.querySelector('.save.button').addEventListener('click', saveAndRefresh);
|
editContentZone.querySelector('.ui.primary.button').addEventListener('click', saveAndRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show write/preview tab and copy raw content as needed
|
// Show write/preview tab and copy raw content as needed
|
||||||
|
Loading…
Reference in New Issue
Block a user