diff --git a/.forgejo/workflows-composite/build-backend/action.yaml b/.forgejo/workflows-composite/build-backend/action.yaml index 68a99ffaf9..ada372b834 100644 --- a/.forgejo/workflows-composite/build-backend/action.yaml +++ b/.forgejo/workflows-composite/build-backend/action.yaml @@ -3,7 +3,7 @@ runs: steps: - run: | su forgejo -c 'make deps-backend' - - uses: https://data.forgejo.org/actions/cache@v4 + - uses: actions/cache@v4 id: cache-backend with: path: ${{github.workspace}}/gitea diff --git a/.forgejo/workflows-composite/setup-cache-go/action.yaml b/.forgejo/workflows-composite/setup-cache-go/action.yaml index 1e0425fd0e..67372d9f36 100644 --- a/.forgejo/workflows-composite/setup-cache-go/action.yaml +++ b/.forgejo/workflows-composite/setup-cache-go/action.yaml @@ -48,7 +48,7 @@ runs: - name: "Restore Go dependencies from cache or mark for later caching" id: cache-deps - uses: https://data.forgejo.org/actions/cache@v4 + uses: actions/cache@v4 with: key: setup-cache-go-deps-${{ runner.os }}-${{ inputs.username }}-${{ steps.go-version.outputs.go_version }}-${{ hashFiles('go.sum', 'go.mod') }} restore-keys: | diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index 1af6d567dd..6410915644 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -25,7 +25,7 @@ jobs: if: vars.ROLE == 'forgejo-coding' runs-on: lxc-bookworm steps: - - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: actions/checkout@v4 - id: forgejo uses: https://data.forgejo.org/actions/setup-forgejo@v2.0.4 diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index 0d7f94c5a6..9d88cb43dd 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -33,7 +33,7 @@ jobs: # root is used for testing, allow it if: vars.ROLE == 'forgejo-integration' || github.repository_owner == 'root' steps: - - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index bcc7821f4f..710cd27ba4 100644 --- a/.forgejo/workflows/cascade-setup-end-to-end.yml +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -37,11 +37,11 @@ jobs: container: image: data.forgejo.org/oci/node:20-bookworm steps: - - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: actions/checkout@v4 with: fetch-depth: '0' show-progress: 'false' - - uses: https://data.forgejo.org/actions/cascading-pr@v2.2.0 + - uses: https://code.forgejo.org/actions/cascading-pr@v2.2.0 with: origin-url: ${{ env.GITHUB_SERVER_URL }} origin-repo: ${{ github.repository }} diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml index 93ad54de1c..a3ff48c718 100644 --- a/.forgejo/workflows/publish-release.yml +++ b/.forgejo/workflows/publish-release.yml @@ -39,7 +39,7 @@ jobs: runs-on: lxc-bookworm if: vars.DOER != '' && vars.FORGEJO != '' && vars.TO_OWNER != '' && vars.FROM_OWNER != '' && secrets.TOKEN != '' steps: - - uses: https://data.forgejo.org/actions/checkout@v4 + - uses: actions/checkout@v4 - name: copy & sign uses: https://data.forgejo.org/forgejo/forgejo-build-publish/publish@v5.3.1 diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index a93ca7879c..c4972c96c9 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -44,7 +44,7 @@ jobs: apt-get update -qq apt-get -q install -qq -y zstd - name: "Cache frontend build for playwright testing" - uses: https://data.forgejo.org/actions/cache/save@v4 + uses: actions/cache/save@v4 with: path: ${{github.workspace}}/public/assets key: frontend-build-${{ github.sha }} @@ -102,7 +102,7 @@ jobs: fetch-depth: 20 - uses: ./.forgejo/workflows-composite/setup-env - name: "Restore frontend build" - uses: https://data.forgejo.org/actions/cache/restore@v4 + uses: actions/cache/restore@v4 id: cache-frontend with: path: ${{github.workspace}}/public/assets diff --git a/.gitignore b/.gitignore index f040fdaf37..744577248d 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,6 @@ cpu.out /tests/e2e/reports /tests/e2e/test-artifacts /tests/e2e/test-snapshots -/tests/e2e/.auth /tests/*.ini /tests/**/*.git/**/*.sample /node_modules diff --git a/Dockerfile b/Dockerfile index 1f33f5d57f..d39de78bf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx +FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/xx AS xx -FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env +FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.23-alpine3.20 as build-env ARG GOPROXY ENV GOPROXY=${GOPROXY:-direct} @@ -51,7 +51,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \ /go/src/code.gitea.io/gitea/environment-to-ini RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete -FROM data.forgejo.org/oci/alpine:3.20 +FROM code.forgejo.org/oci/alpine:3.20 ARG RELEASE_VERSION LABEL maintainer="contact@forgejo.org" \ org.opencontainers.image.authors="Forgejo" \ diff --git a/Dockerfile.rootless b/Dockerfile.rootless index 63fb88a7a7..d636e10168 100644 --- a/Dockerfile.rootless +++ b/Dockerfile.rootless @@ -1,6 +1,6 @@ -FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/xx AS xx +FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/xx AS xx -FROM --platform=$BUILDPLATFORM data.forgejo.org/oci/golang:1.23-alpine3.20 as build-env +FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.23-alpine3.20 as build-env ARG GOPROXY ENV GOPROXY=${GOPROXY:-direct} @@ -49,7 +49,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \ /go/src/code.gitea.io/gitea/environment-to-ini RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete -FROM data.forgejo.org/oci/alpine:3.20 +FROM code.forgejo.org/oci/alpine:3.20 LABEL maintainer="contact@forgejo.org" \ org.opencontainers.image.authors="Forgejo" \ org.opencontainers.image.url="https://forgejo.org" \ diff --git a/build/lint-locale.go b/build/lint-locale.go index 0b5e501701..44d320994c 100644 --- a/build/lint-locale.go +++ b/build/lint-locale.go @@ -59,9 +59,9 @@ func initRemoveTags() { oldnew := []string{} for _, el := range []string{ "email@example.com", "correu@example.com", "epasts@domens.lv", "email@exemplo.com", "eposta@ornek.com", "email@példa.hu", "email@esempio.it", - "user", "utente", "lietotājs", "gebruiker", "usuário", "Benutzer", "Bruker", "bruger", "użytkownik", + "user", "utente", "lietotājs", "gebruiker", "usuário", "Benutzer", "Bruker", "bruger", "server", "servidor", "kiszolgáló", "serveris", - "label", "etichetta", "etiķete", "rótulo", "Label", "utilizador", "etiket", "iezīme", "etykieta", + "label", "etichetta", "etiķete", "rótulo", "Label", "utilizador", "etiket", "iezīme", } { oldnew = append(oldnew, "<"+el+">", "REPLACED-TAG") } diff --git a/go.mod b/go.mod index 19bec3f81f..d5f48716ff 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module code.gitea.io/gitea go 1.23 -toolchain go1.23.5 +toolchain go1.23.4 require ( code.forgejo.org/f3/gof3/v3 v3.10.2 diff --git a/models/actions/runner.go b/models/actions/runner.go index b24950d014..a679d7d989 100644 --- a/models/actions/runner.go +++ b/models/actions/runner.go @@ -282,22 +282,27 @@ func UpdateRunner(ctx context.Context, r *ActionRunner, cols ...string) error { } // DeleteRunner deletes a runner by given ID. -func DeleteRunner(ctx context.Context, r *ActionRunner) error { +func DeleteRunner(ctx context.Context, id int64) error { + runner, err := GetRunnerByID(ctx, id) + if err != nil { + return err + } + // Replace the UUID, which was either based on the secret's first 16 bytes or an UUIDv4, // with a sequence of 8 0xff bytes followed by the little-endian version of the record's // identifier. This will prevent the deleted record's identifier from colliding with any // new record. b := make([]byte, 8) - binary.LittleEndian.PutUint64(b, uint64(r.ID)) - r.UUID = fmt.Sprintf("ffffffff-ffff-ffff-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x", + binary.LittleEndian.PutUint64(b, uint64(id)) + runner.UUID = fmt.Sprintf("ffffffff-ffff-ffff-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x", b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]) - err := UpdateRunner(ctx, r, "UUID") + err = UpdateRunner(ctx, runner, "UUID") if err != nil { return err } - _, err = db.DeleteByID[ActionRunner](ctx, r.ID) + _, err = db.DeleteByID[ActionRunner](ctx, id) return err } diff --git a/models/actions/runner_test.go b/models/actions/runner_test.go index 2c8d430f94..26ef4c44c6 100644 --- a/models/actions/runner_test.go +++ b/models/actions/runner_test.go @@ -34,7 +34,7 @@ func TestDeleteRunner(t *testing.T) { require.NoError(t, unittest.PrepareTestDatabase()) before := unittest.AssertExistsAndLoadBean(t, &ActionRunner{ID: recordID}) - err := DeleteRunner(db.DefaultContext, &ActionRunner{ID: recordID}) + err := DeleteRunner(db.DefaultContext, recordID) require.NoError(t, err) var after ActionRunner diff --git a/models/actions/variable.go b/models/actions/variable.go index 39cea95c4b..d0f917d923 100644 --- a/models/actions/variable.go +++ b/models/actions/variable.go @@ -86,7 +86,7 @@ func FindVariables(ctx context.Context, opts FindVariablesOpts) ([]*ActionVariab } func UpdateVariable(ctx context.Context, variable *ActionVariable) (bool, error) { - count, err := db.GetEngine(ctx).ID(variable.ID).Where("owner_id = ? AND repo_id = ?", variable.OwnerID, variable.RepoID).Cols("name", "data"). + count, err := db.GetEngine(ctx).ID(variable.ID).Cols("name", "data"). Update(&ActionVariable{ Name: variable.Name, Data: variable.Data, @@ -94,9 +94,11 @@ func UpdateVariable(ctx context.Context, variable *ActionVariable) (bool, error) return count != 0, err } -func DeleteVariable(ctx context.Context, variableID, ownerID, repoID int64) (bool, error) { - count, err := db.GetEngine(ctx).Table("action_variable").Where("id = ? AND owner_id = ? AND repo_id = ?", variableID, ownerID, repoID).Delete() - return count != 0, err +func DeleteVariable(ctx context.Context, id int64) error { + if _, err := db.DeleteByID[ActionVariable](ctx, id); err != nil { + return err + } + return nil } func GetVariablesOfRun(ctx context.Context, run *ActionRun) (map[string]string, error) { diff --git a/models/fixtures/PrivateIssueProjects/project.yml b/models/fixtures/PrivateIssueProjects/project.yml deleted file mode 100644 index cf63e4e413..0000000000 --- a/models/fixtures/PrivateIssueProjects/project.yml +++ /dev/null @@ -1,23 +0,0 @@ -- - id: 1001 - title: Org project that contains private issues - owner_id: 3 - repo_id: 0 - is_closed: false - creator_id: 2 - board_type: 1 - type: 3 - created_unix: 1738000000 - updated_unix: 1738000000 - -- - id: 1002 - title: User project that contains private issues - owner_id: 2 - repo_id: 0 - is_closed: false - creator_id: 2 - board_type: 1 - type: 1 - created_unix: 1738000000 - updated_unix: 1738000000 diff --git a/models/fixtures/PrivateIssueProjects/project_board.yml b/models/fixtures/PrivateIssueProjects/project_board.yml deleted file mode 100644 index 3f1fe1e705..0000000000 --- a/models/fixtures/PrivateIssueProjects/project_board.yml +++ /dev/null @@ -1,17 +0,0 @@ -- - id: 1001 - project_id: 1001 - title: Triage - creator_id: 2 - default: true - created_unix: 1738000000 - updated_unix: 1738000000 - -- - id: 1002 - project_id: 1002 - title: Triage - creator_id: 2 - default: true - created_unix: 1738000000 - updated_unix: 1738000000 diff --git a/models/fixtures/PrivateIssueProjects/project_issue.yml b/models/fixtures/PrivateIssueProjects/project_issue.yml deleted file mode 100644 index 222b2e5f71..0000000000 --- a/models/fixtures/PrivateIssueProjects/project_issue.yml +++ /dev/null @@ -1,11 +0,0 @@ -- - id: 1001 - issue_id: 6 - project_id: 1001 - project_board_id: 1001 - -- - id: 1002 - issue_id: 7 - project_id: 1002 - project_board_id: 1002 diff --git a/models/fixtures/team_unit.yml b/models/fixtures/team_unit.yml index e8f8d0e422..de0e8d738b 100644 --- a/models/fixtures/team_unit.yml +++ b/models/fixtures/team_unit.yml @@ -1,49 +1,42 @@ - id: 1 team_id: 1 - org_id: 3 type: 1 access_mode: 4 - id: 2 team_id: 1 - org_id: 3 type: 2 access_mode: 4 - id: 3 team_id: 1 - org_id: 3 type: 3 access_mode: 4 - id: 4 team_id: 1 - org_id: 3 type: 4 access_mode: 4 - id: 5 team_id: 1 - org_id: 3 type: 5 access_mode: 4 - id: 6 team_id: 1 - org_id: 3 type: 6 access_mode: 4 - id: 7 team_id: 1 - org_id: 3 type: 7 access_mode: 4 diff --git a/models/issues/issue_project.go b/models/issues/issue_project.go index f606b713cf..835ea1db52 100644 --- a/models/issues/issue_project.go +++ b/models/issues/issue_project.go @@ -7,10 +7,8 @@ import ( "context" "code.gitea.io/gitea/models/db" - org_model "code.gitea.io/gitea/models/organization" project_model "code.gitea.io/gitea/models/project" user_model "code.gitea.io/gitea/models/user" - "code.gitea.io/gitea/modules/optional" "code.gitea.io/gitea/modules/util" ) @@ -50,29 +48,22 @@ func (issue *Issue) ProjectColumnID(ctx context.Context) int64 { } // LoadIssuesFromColumn load issues assigned to this column -func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column, doer *user_model.User, org *org_model.Organization, isClosed optional.Option[bool]) (IssueList, error) { - issueOpts := &IssuesOptions{ +func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column) (IssueList, error) { + issueList, err := Issues(ctx, &IssuesOptions{ ProjectColumnID: b.ID, ProjectID: b.ProjectID, SortType: "project-column-sorting", - IsClosed: isClosed, - } - if doer != nil { - issueOpts.User = doer - issueOpts.Org = org - } else { - issueOpts.AllPublic = true - } - - issueList, err := Issues(ctx, issueOpts) + }) if err != nil { return nil, err } if b.Default { - issueOpts.ProjectColumnID = db.NoConditionID - - issues, err := Issues(ctx, issueOpts) + issues, err := Issues(ctx, &IssuesOptions{ + ProjectColumnID: db.NoConditionID, + ProjectID: b.ProjectID, + SortType: "project-column-sorting", + }) if err != nil { return nil, err } @@ -87,10 +78,10 @@ func LoadIssuesFromColumn(ctx context.Context, b *project_model.Column, doer *us } // LoadIssuesFromColumnList load issues assigned to the columns -func LoadIssuesFromColumnList(ctx context.Context, bs project_model.ColumnList, doer *user_model.User, org *org_model.Organization, isClosed optional.Option[bool]) (map[int64]IssueList, error) { +func LoadIssuesFromColumnList(ctx context.Context, bs project_model.ColumnList) (map[int64]IssueList, error) { issuesMap := make(map[int64]IssueList, len(bs)) for i := range bs { - il, err := LoadIssuesFromColumn(ctx, bs[i], doer, org, isClosed) + il, err := LoadIssuesFromColumn(ctx, bs[i]) if err != nil { return nil, err } @@ -169,36 +160,3 @@ func IssueAssignOrRemoveProject(ctx context.Context, issue *Issue, doer *user_mo }) }) } - -// NumIssuesInProjects returns the amount of issues assigned to one of the project -// in the list which the doer can access. -func NumIssuesInProjects(ctx context.Context, pl []*project_model.Project, doer *user_model.User, org *org_model.Organization, isClosed optional.Option[bool]) (map[int64]int, error) { - numMap := make(map[int64]int, len(pl)) - for _, p := range pl { - num, err := NumIssuesInProject(ctx, p, doer, org, isClosed) - if err != nil { - return nil, err - } - numMap[p.ID] = num - } - - return numMap, nil -} - -// NumIssuesInProject returns the amount of issues assigned to the project which -// the doer can access. -func NumIssuesInProject(ctx context.Context, p *project_model.Project, doer *user_model.User, org *org_model.Organization, isClosed optional.Option[bool]) (int, error) { - numIssuesInProject := int(0) - bs, err := p.GetColumns(ctx) - if err != nil { - return 0, err - } - im, err := LoadIssuesFromColumnList(ctx, bs, doer, org, isClosed) - if err != nil { - return 0, err - } - for _, il := range im { - numIssuesInProject += len(il) - } - return numIssuesInProject, nil -} diff --git a/models/issues/issue_project_test.go b/models/issues/issue_project_test.go deleted file mode 100644 index 6ebc803722..0000000000 --- a/models/issues/issue_project_test.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2025 The Forgejo Authors. All rights reserved. -// SPDX-License-Identifier: GPL-3.0-or-later - -package issues_test - -import ( - "testing" - - "code.gitea.io/gitea/models/db" - "code.gitea.io/gitea/models/issues" - "code.gitea.io/gitea/models/organization" - "code.gitea.io/gitea/models/project" - "code.gitea.io/gitea/models/unittest" - user_model "code.gitea.io/gitea/models/user" - "code.gitea.io/gitea/modules/optional" - "code.gitea.io/gitea/tests" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestPrivateIssueProjects(t *testing.T) { - defer tests.AddFixtures("models/fixtures/PrivateIssueProjects/")() - require.NoError(t, unittest.PrepareTestDatabase()) - - user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) - t.Run("Organization project", func(t *testing.T) { - org := unittest.AssertExistsAndLoadBean(t, &organization.Organization{ID: 3}) - orgProject := unittest.AssertExistsAndLoadBean(t, &project.Project{ID: 1001, OwnerID: org.ID}) - column := unittest.AssertExistsAndLoadBean(t, &project.Column{ID: 1001, ProjectID: orgProject.ID}) - - t.Run("Authenticated user", func(t *testing.T) { - defer tests.PrintCurrentTest(t)() - issueList, err := issues.LoadIssuesFromColumn(db.DefaultContext, column, user2, org, optional.None[bool]()) - require.NoError(t, err) - assert.Len(t, issueList, 1) - assert.EqualValues(t, 6, issueList[0].ID) - - issuesNum, err := issues.NumIssuesInProject(db.DefaultContext, orgProject, user2, org, optional.None[bool]()) - require.NoError(t, err) - assert.EqualValues(t, 1, issuesNum) - - issuesNum, err = issues.NumIssuesInProject(db.DefaultContext, orgProject, user2, org, optional.Some(true)) - require.NoError(t, err) - assert.EqualValues(t, 0, issuesNum) - - issuesNum, err = issues.NumIssuesInProject(db.DefaultContext, orgProject, user2, org, optional.Some(false)) - require.NoError(t, err) - assert.EqualValues(t, 1, issuesNum) - }) - - t.Run("Anonymous user", func(t *testing.T) { - defer tests.PrintCurrentTest(t)() - issueList, err := issues.LoadIssuesFromColumn(db.DefaultContext, column, nil, org, optional.None[bool]()) - require.NoError(t, err) - assert.Empty(t, issueList) - - issuesNum, err := issues.NumIssuesInProject(db.DefaultContext, orgProject, nil, org, optional.None[bool]()) - require.NoError(t, err) - assert.EqualValues(t, 0, issuesNum) - }) - }) - - t.Run("User project", func(t *testing.T) { - userProject := unittest.AssertExistsAndLoadBean(t, &project.Project{ID: 1002, OwnerID: user2.ID}) - column := unittest.AssertExistsAndLoadBean(t, &project.Column{ID: 1002, ProjectID: userProject.ID}) - - t.Run("Authenticated user", func(t *testing.T) { - defer tests.PrintCurrentTest(t)() - issueList, err := issues.LoadIssuesFromColumn(db.DefaultContext, column, user2, nil, optional.None[bool]()) - require.NoError(t, err) - assert.Len(t, issueList, 1) - assert.EqualValues(t, 7, issueList[0].ID) - - issuesNum, err := issues.NumIssuesInProject(db.DefaultContext, userProject, user2, nil, optional.None[bool]()) - require.NoError(t, err) - assert.EqualValues(t, 1, issuesNum) - - issuesNum, err = issues.NumIssuesInProject(db.DefaultContext, userProject, user2, nil, optional.Some(true)) - require.NoError(t, err) - assert.EqualValues(t, 0, issuesNum) - - issuesNum, err = issues.NumIssuesInProject(db.DefaultContext, userProject, user2, nil, optional.Some(false)) - require.NoError(t, err) - assert.EqualValues(t, 1, issuesNum) - }) - - t.Run("Anonymous user", func(t *testing.T) { - defer tests.PrintCurrentTest(t)() - - issueList, err := issues.LoadIssuesFromColumn(db.DefaultContext, column, nil, nil, optional.None[bool]()) - require.NoError(t, err) - assert.Empty(t, issueList) - - issuesNum, err := issues.NumIssuesInProject(db.DefaultContext, userProject, nil, nil, optional.None[bool]()) - require.NoError(t, err) - assert.EqualValues(t, 0, issuesNum) - }) - }) -} diff --git a/models/migrations/v1_23/v303.go b/models/migrations/v1_23/v303.go index 2fb37ac843..e3ee180539 100644 --- a/models/migrations/v1_23/v303.go +++ b/models/migrations/v1_23/v303.go @@ -1,27 +1,23 @@ -// Copyright 2025 The Forgejo Authors. -// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright 2024 The Forgejo Authors. +// SPDX-License-Identifier: MIT package v1_23 //nolint import ( + "fmt" + "code.gitea.io/gitea/models/migrations/base" "xorm.io/xorm" - "xorm.io/xorm/schemas" ) func GiteaLastDrop(x *xorm.Engine) error { - tables, err := x.DBMetas() - if err != nil { - return err - } - sess := x.NewSession() defer sess.Close() for _, drop := range []struct { - table string - column string + table string + field string }{ {"badge", "slug"}, {"oauth2_application", "skip_secondary_authorization"}, @@ -33,25 +29,10 @@ func GiteaLastDrop(x *xorm.Engine) error { {"protected_branch", "force_push_allowlist_team_i_ds"}, {"protected_branch", "force_push_allowlist_deploy_keys"}, } { - var table *schemas.Table - found := false - - for _, table = range tables { - if table.Name == drop.table { - found = true - break - } - } - - if !found { + if _, err := sess.Exec(fmt.Sprintf("SELECT `%s` FROM `%s` WHERE 0 = 1", drop.field, drop.table)); err != nil { continue } - - if table.GetColumn(drop.column) == nil { - continue - } - - if err := base.DropTableColumns(sess, drop.table, drop.column); err != nil { + if err := base.DropTableColumns(sess, drop.table, drop.field); err != nil { return err } } diff --git a/models/migrations/v1_23/v303_test.go b/models/migrations/v1_23/v303_test.go deleted file mode 100644 index 752eacee0c..0000000000 --- a/models/migrations/v1_23/v303_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2025 The Forgejo Authors. -// SPDX-License-Identifier: GPL-3.0-or-later - -package v1_23 //nolint - -import ( - "testing" - - migration_tests "code.gitea.io/gitea/models/migrations/test" - - "github.com/stretchr/testify/require" - "xorm.io/xorm/schemas" -) - -func Test_GiteaLastDrop(t *testing.T) { - type Badge struct { - ID int64 `xorm:"pk autoincr"` - Slug string - } - - x, deferable := migration_tests.PrepareTestEnv(t, 0, new(Badge)) - defer deferable() - if x == nil || t.Failed() { - return - } - - getColumn := func() *schemas.Column { - tables, err := x.DBMetas() - require.NoError(t, err) - require.Len(t, tables, 1) - table := tables[0] - require.Equal(t, "badge", table.Name) - return table.GetColumn("slug") - } - - require.NotNil(t, getColumn(), "slug column exists") - require.NoError(t, GiteaLastDrop(x)) - require.Nil(t, getColumn(), "slug column was deleted") - // idempotent - require.NoError(t, GiteaLastDrop(x)) -} diff --git a/models/project/column.go b/models/project/column.go index f6d6614004..222f448599 100644 --- a/models/project/column.go +++ b/models/project/column.go @@ -57,6 +57,20 @@ func (Column) TableName() string { return "project_board" // TODO: the legacy table name should be project_column } +// NumIssues return counter of all issues assigned to the column +func (c *Column) NumIssues(ctx context.Context) int { + total, err := db.GetEngine(ctx).Table("project_issue"). + Where("project_id=?", c.ProjectID). + And("project_board_id=?", c.ID). + GroupBy("issue_id"). + Cols("issue_id"). + Count() + if err != nil { + return 0 + } + return int(total) +} + func (c *Column) GetIssues(ctx context.Context) ([]*ProjectIssue, error) { issues := make([]*ProjectIssue, 0, 5) if err := db.GetEngine(ctx).Where("project_id=?", c.ProjectID). diff --git a/models/project/issue.go b/models/project/issue.go index 984f47ee7c..3361b533b9 100644 --- a/models/project/issue.go +++ b/models/project/issue.go @@ -34,6 +34,20 @@ func deleteProjectIssuesByProjectID(ctx context.Context, projectID int64) error return err } +// NumIssues return counter of all issues assigned to a project +func (p *Project) NumIssues(ctx context.Context) int { + c, err := db.GetEngine(ctx).Table("project_issue"). + Where("project_id=?", p.ID). + GroupBy("issue_id"). + Cols("issue_id"). + Count() + if err != nil { + log.Error("NumIssues: %v", err) + return 0 + } + return int(c) +} + // NumClosedIssues return counter of closed issues assigned to a project func (p *Project) NumClosedIssues(ctx context.Context) int { c, err := db.GetEngine(ctx).Table("project_issue"). diff --git a/models/repo/user_repo.go b/models/repo/user_repo.go index 0f95f5ab6b..781a75730a 100644 --- a/models/repo/user_repo.go +++ b/models/repo/user_repo.go @@ -166,9 +166,9 @@ func GetReviewers(ctx context.Context, repo *Repository, doerID, posterID int64) // If isShowFullName is set to true, also include full name prefix search func GetIssuePostersWithSearch(ctx context.Context, repo *Repository, isPull bool, search string, isShowFullName bool) ([]*user_model.User, error) { users := make([]*user_model.User, 0, 30) - prefixCond := db.BuildCaseInsensitiveLike("name", search+"%") + var prefixCond builder.Cond = builder.Like{"name", search + "%"} if isShowFullName { - prefixCond = db.BuildCaseInsensitiveLike("full_name", "%"+search+"%") + prefixCond = prefixCond.Or(builder.Like{"full_name", "%" + search + "%"}) } cond := builder.In("`user`.id", diff --git a/models/user/search.go b/models/user/search.go index 143f9d39c9..cb90ca850e 100644 --- a/models/user/search.go +++ b/models/user/search.go @@ -126,15 +126,17 @@ func (opts *SearchUserOptions) toSearchQueryBase(ctx context.Context) *xorm.Sess return e.Where(cond) } - // Check if the user has two factor enabled, which is TOTP or Webauthn. + // 2fa filter uses LEFT JOIN to check whether a user has a 2fa record + // While using LEFT JOIN, sometimes the performance might not be good, but it won't be a problem now, such SQL is seldom executed. + // There are some possible methods to refactor this SQL in future when we really need to optimize the performance (but not now): + // (1) add a column in user table (2) add a setting value in user_setting table (3) use search engines (bleve/elasticsearch) if opts.IsTwoFactorEnabled.Value() { - cond = cond.And(builder.Expr("two_factor.uid IS NOT NULL OR webauthn_credential.user_id IS NOT NULL")) + cond = cond.And(builder.Expr("two_factor.uid IS NOT NULL")) } else { - cond = cond.And(builder.Expr("two_factor.uid IS NULL AND webauthn_credential.user_id IS NULL")) + cond = cond.And(builder.Expr("two_factor.uid IS NULL")) } return e.Join("LEFT OUTER", "two_factor", "two_factor.uid = `user`.id"). - Join("LEFT OUTER", "webauthn_credential", "webauthn_credential.user_id = `user`.id"). Where(cond) } diff --git a/models/user/user_test.go b/models/user/user_test.go index bc23a5da48..1c734fa926 100644 --- a/models/user/user_test.go +++ b/models/user/user_test.go @@ -222,7 +222,7 @@ func TestSearchUsers(t *testing.T) { []int64{1041, 37}) testUserSuccess(&user_model.SearchUserOptions{ListOptions: db.ListOptions{Page: 1}, IsTwoFactorEnabled: optional.Some(true)}, - []int64{24, 32}) + []int64{24}) } func TestEmailNotificationPreferences(t *testing.T) { diff --git a/modules/markup/file_preview.go b/modules/markup/file_preview.go index 2171f6097b..49a5f1e8ba 100644 --- a/modules/markup/file_preview.go +++ b/modules/markup/file_preview.go @@ -8,7 +8,6 @@ import ( "bytes" "html/template" "io" - "net/url" "regexp" "slices" "strconv" @@ -78,16 +77,6 @@ func newFilePreview(ctx *RenderContext, node *html.Node, locale translation.Loca commitSha := node.Data[m[4]:m[5]] filePath := node.Data[m[6]:m[7]] - urlFullSource := urlFull - if strings.HasSuffix(filePath, "?display=source") { - filePath = strings.TrimSuffix(filePath, "?display=source") - } else if Type(filePath) != "" { - urlFullSource = node.Data[m[0]:m[6]] + filePath + "?display=source#" + node.Data[m[8]:m[1]] - } - filePath, err := url.QueryUnescape(filePath) - if err != nil { - return nil - } hash := node.Data[m[8]:m[9]] preview.start = m[0] @@ -124,7 +113,7 @@ func newFilePreview(ctx *RenderContext, node *html.Node, locale translation.Loca titleBuffer.WriteString(" – ") } - err = html.Render(titleBuffer, createLink(urlFullSource, filePath, "muted")) + err = html.Render(titleBuffer, createLink(urlFull, filePath, "muted")) if err != nil { log.Error("failed to render filepathLink: %v", err) } diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 05ba321548..50ea70905c 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -1026,138 +1026,4 @@ func TestRender_FilePreview(t *testing.T) { localMetas, ) }) - - commitFileURL := util.URLJoin(markup.TestRepoURL, "src", "commit", "c9913120ed2c1e27c1d7752ecdb7a504dc7cf6be", "path", "to", "file.md") - - t.Run("rendered file with ?display=source", func(t *testing.T) { - testRender( - commitFileURL+"?display=source"+"#L1-L2", - `

`+ - `
`+ - `
`+ - `
`+ - `path/to/file.md`+ - `
`+ - ``+ - `Lines 1 to 2 in c991312`+ - ``+ - `
`+ - `
`+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - `
# A`+"\n"+`
B`+"\n"+`
`+ - `
`+ - `
`+ - `

`, - localMetas, - ) - }) - - t.Run("rendered file without ?display=source", func(t *testing.T) { - testRender( - commitFileURL+"#L1-L2", - `

`+ - `
`+ - `
`+ - `
`+ - `path/to/file.md`+ - `
`+ - ``+ - `Lines 1 to 2 in c991312`+ - ``+ - `
`+ - `
`+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - `
# A`+"\n"+`
B`+"\n"+`
`+ - `
`+ - `
`+ - `

`, - localMetas, - ) - }) - - commitFileURL = util.URLJoin(markup.TestRepoURL, "src", "commit", "190d9492934af498c3f669d6a2431dc5459e5b20", "path", "to", "file.go") - - t.Run("normal file with ?display=source", func(t *testing.T) { - testRender( - commitFileURL+"?display=source"+"#L2-L3", - `

`+ - `
`+ - `
`+ - `
`+ - `path/to/file.go`+ - `
`+ - ``+ - `Lines 2 to 3 in 190d949`+ - ``+ - `
`+ - `
`+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - `
B`+"\n"+`
C`+"\n"+`
`+ - `
`+ - `
`+ - `

`, - localMetas, - ) - }) - - commitFileURL = util.URLJoin(markup.TestRepoURL, "src", "commit", "eeb243c3395e1921c5d90e73bd739827251fc99d", "path", "to", "file%20%23.txt") - - t.Run("file with strange characters in name", func(t *testing.T) { - testRender( - commitFileURL+"#L1", - `

`+ - `
`+ - `
`+ - `
`+ - `path/to/file #.txt`+ - `
`+ - ``+ - `Line 1 in eeb243c`+ - ``+ - `
`+ - `
`+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - ``+ - `
A`+"\n"+`
`+ - `
`+ - `
`+ - `

`, - localMetas, - ) - }) } diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/0b/b53b56d70d253ce75c257d3cd6334a41ef2b6c b/modules/markup/tests/repo/repo1_filepreview/objects/0b/b53b56d70d253ce75c257d3cd6334a41ef2b6c deleted file mode 100644 index 1ab268b76c..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/0b/b53b56d70d253ce75c257d3cd6334a41ef2b6c and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/18/9739e1c2a6cdb8ee094ba1ef8a2e40cf65b2ec b/modules/markup/tests/repo/repo1_filepreview/objects/18/9739e1c2a6cdb8ee094ba1ef8a2e40cf65b2ec deleted file mode 100644 index c8b99f906b..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/18/9739e1c2a6cdb8ee094ba1ef8a2e40cf65b2ec and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/2a/4032b49cff56d6d4921133e087d9dc0341a2c5 b/modules/markup/tests/repo/repo1_filepreview/objects/2a/4032b49cff56d6d4921133e087d9dc0341a2c5 deleted file mode 100644 index f799e8a988..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/2a/4032b49cff56d6d4921133e087d9dc0341a2c5 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/2d/2f8eaa17b17359ee1c73222065575d50d9a157 b/modules/markup/tests/repo/repo1_filepreview/objects/2d/2f8eaa17b17359ee1c73222065575d50d9a157 deleted file mode 100644 index 7f4c451d00..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/2d/2f8eaa17b17359ee1c73222065575d50d9a157 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/2f/b9577a8e940a0a84a789cdd4a45d0f172e3fdd b/modules/markup/tests/repo/repo1_filepreview/objects/2f/b9577a8e940a0a84a789cdd4a45d0f172e3fdd deleted file mode 100644 index fc97712911..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/2f/b9577a8e940a0a84a789cdd4a45d0f172e3fdd and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/2f/f8eb63aad050c3f20e9cb27090ab7378267ab2 b/modules/markup/tests/repo/repo1_filepreview/objects/2f/f8eb63aad050c3f20e9cb27090ab7378267ab2 deleted file mode 100644 index e230df1343..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/2f/f8eb63aad050c3f20e9cb27090ab7378267ab2 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/35/75ed7948fe86ab56b0a76f796f7995222bec65 b/modules/markup/tests/repo/repo1_filepreview/objects/35/75ed7948fe86ab56b0a76f796f7995222bec65 deleted file mode 100644 index 1493caa3df..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/35/75ed7948fe86ab56b0a76f796f7995222bec65 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/3c/95f14e5a0ab2c5ba9ee9a47ddc261af4968043 b/modules/markup/tests/repo/repo1_filepreview/objects/3c/95f14e5a0ab2c5ba9ee9a47ddc261af4968043 deleted file mode 100644 index 3e9c0c0d8b..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/3c/95f14e5a0ab2c5ba9ee9a47ddc261af4968043 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/3e/2a4f1b9a15ffa15ea7ffdc06acd302442b3eca b/modules/markup/tests/repo/repo1_filepreview/objects/3e/2a4f1b9a15ffa15ea7ffdc06acd302442b3eca deleted file mode 100644 index 78189a52f6..0000000000 --- a/modules/markup/tests/repo/repo1_filepreview/objects/3e/2a4f1b9a15ffa15ea7ffdc06acd302442b3eca +++ /dev/null @@ -1 +0,0 @@ -xAN0EYGB;a U=D9=&r}7ҌB^yY8:A X}RXks";uF9x EdВ%~**Z3\v9Й>n8fxk=[9K%L>{7s;av4hXOHԓՆ`K \ No newline at end of file diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/72/1f0ce13d83f93d431b849a554a62948b85f573 b/modules/markup/tests/repo/repo1_filepreview/objects/72/1f0ce13d83f93d431b849a554a62948b85f573 deleted file mode 100644 index d781d4d248..0000000000 --- a/modules/markup/tests/repo/repo1_filepreview/objects/72/1f0ce13d83f93d431b849a554a62948b85f573 +++ /dev/null @@ -1 +0,0 @@ -xK1@]$JazJR@w+s۲"@VL&J3%f-GDq2>FjBOEݹ:g\1ꦒkEM6D,Ÿ\Ǹ:\6Olmȩ;ϭ|!GE6ZzYβ mwٛi.x-o"L \ No newline at end of file diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/72/e0a44ea5761c9055995db18019e459576b3b27 b/modules/markup/tests/repo/repo1_filepreview/objects/72/e0a44ea5761c9055995db18019e459576b3b27 deleted file mode 100644 index 7b926dc0d8..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/72/e0a44ea5761c9055995db18019e459576b3b27 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/72/e1c77b65c7baa0e848557089148833fb54705e b/modules/markup/tests/repo/repo1_filepreview/objects/72/e1c77b65c7baa0e848557089148833fb54705e deleted file mode 100644 index 0bbca73af2..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/72/e1c77b65c7baa0e848557089148833fb54705e and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/8a/3b1881b5c4e7dc2be7ee1c0f37f93ffbb5ff77 b/modules/markup/tests/repo/repo1_filepreview/objects/8a/3b1881b5c4e7dc2be7ee1c0f37f93ffbb5ff77 deleted file mode 100644 index 0ea93376dc..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/8a/3b1881b5c4e7dc2be7ee1c0f37f93ffbb5ff77 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/8b/ccd5176c25898b57da2551e076f769054e0d8e b/modules/markup/tests/repo/repo1_filepreview/objects/8b/ccd5176c25898b57da2551e076f769054e0d8e deleted file mode 100644 index 394a7bb50d..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/8b/ccd5176c25898b57da2551e076f769054e0d8e and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/95/31b649823095acf5d79ab9e4f8b8d86046352f b/modules/markup/tests/repo/repo1_filepreview/objects/95/31b649823095acf5d79ab9e4f8b8d86046352f deleted file mode 100644 index ab36311f6f..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/95/31b649823095acf5d79ab9e4f8b8d86046352f and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/ac/769ab4baa91060a4c2f828f53e6c3cc2f708f8 b/modules/markup/tests/repo/repo1_filepreview/objects/ac/769ab4baa91060a4c2f828f53e6c3cc2f708f8 deleted file mode 100644 index 59afaebf4a..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/ac/769ab4baa91060a4c2f828f53e6c3cc2f708f8 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/c5/3110b1957cefc56c4b2d879476ddbe905980bf b/modules/markup/tests/repo/repo1_filepreview/objects/c5/3110b1957cefc56c4b2d879476ddbe905980bf deleted file mode 100644 index 3de089bf6a..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/c5/3110b1957cefc56c4b2d879476ddbe905980bf and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/c9/8762531dd068cd818300a5f5c7dca5da79b510 b/modules/markup/tests/repo/repo1_filepreview/objects/c9/8762531dd068cd818300a5f5c7dca5da79b510 deleted file mode 100644 index af5b784773..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/c9/8762531dd068cd818300a5f5c7dca5da79b510 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/c9/913120ed2c1e27c1d7752ecdb7a504dc7cf6be b/modules/markup/tests/repo/repo1_filepreview/objects/c9/913120ed2c1e27c1d7752ecdb7a504dc7cf6be deleted file mode 100644 index 9fc2b7c312..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/c9/913120ed2c1e27c1d7752ecdb7a504dc7cf6be and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/e7/99b34ea867a0364d0df33f382562db9ff39084 b/modules/markup/tests/repo/repo1_filepreview/objects/e7/99b34ea867a0364d0df33f382562db9ff39084 deleted file mode 100644 index ef73ed1791..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/e7/99b34ea867a0364d0df33f382562db9ff39084 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/ee/b243c3395e1921c5d90e73bd739827251fc99d b/modules/markup/tests/repo/repo1_filepreview/objects/ee/b243c3395e1921c5d90e73bd739827251fc99d deleted file mode 100644 index 5515b07d4a..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/ee/b243c3395e1921c5d90e73bd739827251fc99d and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8 b/modules/markup/tests/repo/repo1_filepreview/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8 deleted file mode 100644 index 2e15b4fb0a..0000000000 Binary files a/modules/markup/tests/repo/repo1_filepreview/objects/f7/0f10e4db19068f79bc43844b49f3eece45c4e8 and /dev/null differ diff --git a/modules/markup/tests/repo/repo1_filepreview/refs/heads/master b/modules/markup/tests/repo/repo1_filepreview/refs/heads/master index 709cffca17..df25bf45f0 100644 --- a/modules/markup/tests/repo/repo1_filepreview/refs/heads/master +++ b/modules/markup/tests/repo/repo1_filepreview/refs/heads/master @@ -1 +1 @@ -eeb243c3395e1921c5d90e73bd739827251fc99d +4c1aaf56bcb9f39dcf65f3f250726850aed13cd6 diff --git a/modules/secret/secret.go b/modules/secret/secret.go index e3557b91b9..e70ae1839c 100644 --- a/modules/secret/secret.go +++ b/modules/secret/secret.go @@ -47,7 +47,7 @@ func AesDecrypt(key, text []byte) ([]byte, error) { cfb.XORKeyStream(text, text) data, err := base64.StdEncoding.DecodeString(string(text)) if err != nil { - return nil, fmt.Errorf("AesDecrypt invalid decrypted base64 string: %w - it can be caused by a change of the [security].SECRET_KEY setting or a database corruption - `forgejo doctor check --run check-db-consistency --fix` will get rid of orphaned rows found in the `two_factor` table and may fix this problem if they are the one with the invalid content", err) + return nil, fmt.Errorf("AesDecrypt invalid decrypted base64 string: %w", err) } return data, nil } diff --git a/modules/setting/service.go b/modules/setting/service.go index 74ed5cd3c9..5a6cc254e0 100644 --- a/modules/setting/service.go +++ b/modules/setting/service.go @@ -138,11 +138,6 @@ func CompileEmailGlobList(sec ConfigSection, keys ...string) (globs []glob.Glob) return globs } -// LoadServiceSetting loads the service settings -func LoadServiceSetting() { - loadServiceFrom(CfgProvider) -} - func loadServiceFrom(rootCfg ConfigProvider) { sec := rootCfg.Section("service") Service.ActiveCodeLives = sec.Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180) diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index 1894aeb81c..e050e0db12 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -4,7 +4,7 @@ dashboard=Přehled explore=Procházet help=Nápověda logo=Logo -sign_in=Přihlásit se +sign_in=Přihlášení sign_in_with_provider = Přihlásit se přes %s sign_in_or=nebo sign_out=Odhlásit se @@ -517,8 +517,8 @@ issue_assigned.issue=@%[1]s vás přiřadil/a k problému %[2]s v repozitáři % issue.x_mentioned_you=@%s vás zmínil/a: issue.action.force_push=%[1]s vynutil/a nahrání %[2]s z %[3]s do %[4]s. -issue.action.push_1=Uživatel @%[1]s nahrál %[3]d revizi do %[2]s -issue.action.push_n=Uživatel @%[1]s nahrál %[3]d revizí do %[2]s +issue.action.push_1=@%[1]s nahrál/a %[3]d commit do %[2]s +issue.action.push_n=@%[1]s nahrál/a %[3]d commity do %[2]s issue.action.close=@%[1]s uzavřel/a #%[2]d. issue.action.reopen=@%[1]s znovu otevřel/a #%[2]d. issue.action.merge=@%[1]s sloučil/a #%[2]d do %[3]s. @@ -590,9 +590,9 @@ AuthName=Název ověření AdminEmail=E-mailová adresa správce NewBranchName=Název nové větve -CommitSummary=Shrnutí revize -CommitMessage=Zpráva revize -CommitChoice=Výběr revize +CommitSummary=Shrnutí commity +CommitMessage=Zpráva commitu +CommitChoice=Výběr commitu TreeName=Cesta k souboru Content=Obsah @@ -681,8 +681,6 @@ To = Název větve Biography = Životopis AccessToken = Přístupový token -email_domain_is_not_allowed = Doména uživatelské e-mailové adresy %s je v rozporu se seznamem EMAIL_DOMAIN_ALLOWLIST nebo EMAIL_DOMAIN_BLOCKLIST. Ujistěte se, že je vaše adresa správně nastavena. - [user] change_avatar=Změnit váš avatar… joined_on=Přidal/a se %s @@ -769,7 +767,7 @@ language=Jazyk ui=Motiv vzhledu hidden_comment_types=Skryté typy komentářů hidden_comment_types_description=Zde zkontrolované typy komentářů nebudou zobrazeny na stránkách problémů. Zaškrtnutí „Štítek“ například odstraní všechny komentáře „ přidal/odstranil