Skip to content

Commit 8a6e43c

Browse files
committed
Merge remote-tracking branch 'origin/main' into usefetch
* origin/main: (53 commits) Search branches (go-gitea#27055) Fix wrong migration for email address (go-gitea#27106) [skip ci] Updated translations via Crowdin Support `.git-blame-ignore-revs` file (go-gitea#26395) Add `RemoteAddress` to mirrors (go-gitea#26952) Upgrading the actions/checkout@4 (go-gitea#27096) Next round of `db.DefaultContext` refactor (go-gitea#27089) Ui correction in mobile view nav bar left aligned items. (go-gitea#27046) Add missing deps to files-changed (go-gitea#27100) Use db.WithTx for AddTeamMember to avoid ctx abuse (go-gitea#27095) Drop Node.js 16 and update js dependencies (go-gitea#27094) Fix NPE when editing OAuth2 applications (go-gitea#27078) Use `print` instead of `printf` (go-gitea#27093) Add tests for db indexer in indexer_test.go (go-gitea#27087) [skip ci] Updated translations via Crowdin Allow empty Conan files (go-gitea#27092) Actions are no longer experimental, so enable them by default (go-gitea#27054) Update brew installation documentation since gitea moved to brew core package (go-gitea#27070) More refactoring of `db.DefaultContext` (go-gitea#27083) [skip ci] Updated translations via Crowdin ...
2 parents 1c1407d + 47b8788 commit 8a6e43c

File tree

472 files changed

+4365
-2869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

472 files changed

+4365
-2869
lines changed

.github/actionlint.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
self-hosted-runner:
2+
labels:
3+
- actuated-4cpu-8gb
4+
- actuated-4cpu-16gb

.github/labeler.yml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ kind/build:
1919

2020
theme/package-registry:
2121
- "modules/packages/**"
22+
- "services/packages/**"
23+
- "routers/api/packages/**"
24+
- "routers/web/shared/packages/**"
2225

2326
kind/cli:
2427
- "cmd/**"

.github/workflows/cron-licenses.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: github.repository == 'go-gitea/gitea'
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- uses: actions/setup-go@v4
1515
with:
1616
go-version: "~1.21"

.github/workflows/cron-translations.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: github.repository == 'go-gitea/gitea'
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: download from crowdin
1515
uses: docker://jonasfranz/crowdin
1616
env:
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
if: github.repository == 'go-gitea/gitea'
3737
steps:
38-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
3939
- name: push translations to crowdin
4040
uses: docker://jonasfranz/crowdin
4141
env:

.github/workflows/files-changed.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
swagger: ${{ steps.changes.outputs.swagger }}
3535
yaml: ${{ steps.changes.outputs.yaml }}
3636
steps:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838
- uses: dorny/paths-filter@v2
3939
id: changes
4040
with:
@@ -64,9 +64,12 @@ jobs:
6464
- "**/*.md"
6565
- "docs/**"
6666
- ".markdownlint.yaml"
67+
- "package.json"
68+
- "package-lock.json"
6769
6870
actions:
6971
- ".github/workflows/*"
72+
- "Makefile"
7073
7174
templates:
7275
- "templates/**/*.tmpl"
@@ -90,3 +93,5 @@ jobs:
9093
- "**/*.yml"
9194
- "**/*.yaml"
9295
- ".yamllint.yaml"
96+
- "pyproject.toml"
97+
- "poetry.lock"

.github/workflows/pull-compliance.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
needs: files-changed
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v4
2121
with:
2222
go-version: "~1.21"
@@ -31,7 +31,7 @@ jobs:
3131
needs: files-changed
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
- uses: actions/setup-python@v4
3636
with:
3737
python-version: "3.11"
@@ -44,7 +44,7 @@ jobs:
4444
needs: files-changed
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4848
- uses: actions/setup-python@v4
4949
with:
5050
python-version: "3.11"
@@ -57,7 +57,7 @@ jobs:
5757
needs: files-changed
5858
runs-on: ubuntu-latest
5959
steps:
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
- uses: actions/setup-node@v3
6262
with:
6363
node-version: 20
@@ -69,7 +69,7 @@ jobs:
6969
needs: files-changed
7070
runs-on: ubuntu-latest
7171
steps:
72-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v4
7373
- uses: actions/setup-go@v4
7474
with:
7575
go-version: "~1.21"
@@ -86,7 +86,7 @@ jobs:
8686
needs: files-changed
8787
runs-on: ubuntu-latest
8888
steps:
89-
- uses: actions/checkout@v3
89+
- uses: actions/checkout@v4
9090
- uses: actions/setup-go@v4
9191
with:
9292
go-version: "~1.21"
@@ -101,7 +101,7 @@ jobs:
101101
needs: files-changed
102102
runs-on: ubuntu-latest
103103
steps:
104-
- uses: actions/checkout@v3
104+
- uses: actions/checkout@v4
105105
- uses: actions/setup-go@v4
106106
with:
107107
go-version: "~1.21"
@@ -114,7 +114,7 @@ jobs:
114114
needs: files-changed
115115
runs-on: ubuntu-latest
116116
steps:
117-
- uses: actions/checkout@v3
117+
- uses: actions/checkout@v4
118118
- uses: actions/setup-node@v3
119119
with:
120120
node-version: 20
@@ -129,7 +129,7 @@ jobs:
129129
needs: files-changed
130130
runs-on: ubuntu-latest
131131
steps:
132-
- uses: actions/checkout@v3
132+
- uses: actions/checkout@v4
133133
- uses: actions/setup-go@v4
134134
with:
135135
go-version: "~1.21"
@@ -161,7 +161,7 @@ jobs:
161161
needs: files-changed
162162
runs-on: ubuntu-latest
163163
steps:
164-
- uses: actions/checkout@v3
164+
- uses: actions/checkout@v4
165165
- uses: actions/setup-node@v3
166166
with:
167167
node-version: 20
@@ -174,6 +174,6 @@ jobs:
174174
needs: files-changed
175175
runs-on: ubuntu-latest
176176
steps:
177-
- uses: actions/checkout@v3
177+
- uses: actions/checkout@v4
178178
- uses: actions/setup-go@v4
179179
- run: make lint-actions

.github/workflows/pull-db-tests.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
ports:
3939
- "9000:9000"
4040
steps:
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
- uses: actions/setup-go@v4
4343
with:
4444
go-version: "~1.21"
@@ -63,7 +63,7 @@ jobs:
6363
needs: files-changed
6464
runs-on: ubuntu-latest
6565
steps:
66-
- uses: actions/checkout@v3
66+
- uses: actions/checkout@v4
6767
- uses: actions/setup-go@v4
6868
with:
6969
go-version: "~1.21"
@@ -128,7 +128,7 @@ jobs:
128128
ports:
129129
- "9000:9000"
130130
steps:
131-
- uses: actions/checkout@v3
131+
- uses: actions/checkout@v4
132132
- uses: actions/setup-go@v4
133133
with:
134134
go-version: "~1.21"
@@ -178,7 +178,7 @@ jobs:
178178
- "587:587"
179179
- "993:993"
180180
steps:
181-
- uses: actions/checkout@v3
181+
- uses: actions/checkout@v4
182182
- uses: actions/setup-go@v4
183183
with:
184184
go-version: "~1.21"
@@ -210,7 +210,7 @@ jobs:
210210
ports:
211211
- "3306:3306"
212212
steps:
213-
- uses: actions/checkout@v3
213+
- uses: actions/checkout@v4
214214
- uses: actions/setup-go@v4
215215
with:
216216
go-version: "~1.21"
@@ -241,7 +241,7 @@ jobs:
241241
ports:
242242
- "1433:1433"
243243
steps:
244-
- uses: actions/checkout@v3
244+
- uses: actions/checkout@v4
245245
- uses: actions/setup-go@v4
246246
with:
247247
go-version: "~1.21"

.github/workflows/pull-e2e-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
needs: files-changed
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v4
2121
with:
2222
go-version: "~1.21"

.github/workflows/release-nightly.yml

+45-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ on:
44
push:
55
branches: [ main, release/v* ]
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
nightly-binary:
9-
runs-on: ubuntu-latest
13+
runs-on: actuated-4cpu-16gb
1014
steps:
11-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1216
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
1317
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
1418
- run: git fetch --unshallow --quiet --tags --force
@@ -51,13 +55,17 @@ jobs:
5155
AWS_REGION: ${{ secrets.AWS_REGION }}
5256
SOURCE_DIR: dist/release
5357
DEST_DIR: gitea/${{ steps.clean_name.outputs.branch }}
54-
nightly-docker:
55-
runs-on: ubuntu-latest
58+
nightly-docker-rootful:
59+
runs-on: actuated-4cpu-16gb
5660
steps:
57-
- uses: actions/checkout@v3
61+
- uses: actions/checkout@v4
5862
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
5963
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
6064
- run: git fetch --unshallow --quiet --tags --force
65+
- uses: actions/setup-go@v4
66+
with:
67+
go-version: "~1.21"
68+
check-latest: true
6169
- uses: docker/setup-qemu-action@v2
6270
- uses: docker/setup-buildx-action@v2
6371
- name: Get cleaned branch name
@@ -75,13 +83,45 @@ jobs:
7583
with:
7684
username: ${{ secrets.DOCKERHUB_USERNAME }}
7785
password: ${{ secrets.DOCKERHUB_TOKEN }}
86+
- name: fetch go modules
87+
run: make vendor
7888
- name: build rootful docker image
7989
uses: docker/build-push-action@v4
8090
with:
8191
context: .
8292
platforms: linux/amd64,linux/arm64
8393
push: true
8494
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
95+
nightly-docker-rootless:
96+
runs-on: actuated-4cpu-16gb
97+
steps:
98+
- uses: actions/checkout@v4
99+
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
100+
# fetch all tags to ensure that "git describe" reports expected Gitea version, eg. v1.21.0-dev-1-g1234567
101+
- run: git fetch --unshallow --quiet --tags --force
102+
- uses: actions/setup-go@v4
103+
with:
104+
go-version: "~1.21"
105+
check-latest: true
106+
- uses: docker/setup-qemu-action@v2
107+
- uses: docker/setup-buildx-action@v2
108+
- name: Get cleaned branch name
109+
id: clean_name
110+
run: |
111+
# if main then say nightly otherwise cleanup name
112+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
113+
echo "branch=nightly" >> "$GITHUB_OUTPUT"
114+
exit 0
115+
fi
116+
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
117+
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
118+
- name: Login to Docker Hub
119+
uses: docker/login-action@v2
120+
with:
121+
username: ${{ secrets.DOCKERHUB_USERNAME }}
122+
password: ${{ secrets.DOCKERHUB_TOKEN }}
123+
- name: fetch go modules
124+
run: make vendor
85125
- name: build rootless docker image
86126
uses: docker/build-push-action@v4
87127
with:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ cpu.out
9595
/.go-licenses
9696

9797
# Snapcraft
98+
/gitea_a*.txt
9899
snap/.snapcraft/
99100
parts/
100101
stage/

MAINTAINERS

+1
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ Denys Konovalov <kontakt@denyskon.de> (@denyskon)
5656
Punit Inani <punitinani1@gmail.com> (@puni9869)
5757
CaiCandong <1290147055@qq.com> (@caicandong)
5858
Rui Chen <rui@chenrui.dev> (@chenrui333)
59+
Nanguan Lin <nanguanlin6@gmail.com> (@lng2020)

cmd/admin_user_create.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func runCreateUser(c *cli.Context) error {
115115

116116
// If this is the first user being created.
117117
// Take it as the admin and don't force a password update.
118-
if n := user_model.CountUsers(nil); n == 0 {
118+
if n := user_model.CountUsers(ctx, nil); n == 0 {
119119
changePassword = false
120120
}
121121

@@ -146,7 +146,7 @@ func runCreateUser(c *cli.Context) error {
146146
IsRestricted: restricted,
147147
}
148148

149-
if err := user_model.CreateUser(u, overwriteDefault); err != nil {
149+
if err := user_model.CreateUser(ctx, u, overwriteDefault); err != nil {
150150
return fmt.Errorf("CreateUser: %w", err)
151151
}
152152

@@ -156,7 +156,7 @@ func runCreateUser(c *cli.Context) error {
156156
UID: u.ID,
157157
}
158158

159-
if err := auth_model.NewAccessToken(t); err != nil {
159+
if err := auth_model.NewAccessToken(ctx, t); err != nil {
160160
return err
161161
}
162162

cmd/admin_user_generate_access_token.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func runGenerateAccessToken(c *cli.Context) error {
6363
UID: user.ID,
6464
}
6565

66-
exist, err := auth_model.AccessTokenByNameExists(t)
66+
exist, err := auth_model.AccessTokenByNameExists(ctx, t)
6767
if err != nil {
6868
return err
6969
}
@@ -79,7 +79,7 @@ func runGenerateAccessToken(c *cli.Context) error {
7979
t.Scope = accessTokenScope
8080

8181
// create the token
82-
if err := auth_model.NewAccessToken(t); err != nil {
82+
if err := auth_model.NewAccessToken(ctx, t); err != nil {
8383
return err
8484
}
8585

cmd/admin_user_list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func runListUsers(c *cli.Context) error {
3333
return err
3434
}
3535

36-
users, err := user_model.GetAllUsers()
36+
users, err := user_model.GetAllUsers(ctx)
3737
if err != nil {
3838
return err
3939
}
@@ -48,7 +48,7 @@ func runListUsers(c *cli.Context) error {
4848
}
4949
}
5050
} else {
51-
twofa := user_model.UserList(users).GetTwoFaStatus()
51+
twofa := user_model.UserList(users).GetTwoFaStatus(ctx)
5252
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\tIsAdmin\t2FA\n")
5353
for _, u := range users {
5454
fmt.Fprintf(w, "%d\t%s\t%s\t%t\t%t\t%t\n", u.ID, u.Name, u.Email, u.IsActive, u.IsAdmin, twofa[u.ID])

0 commit comments

Comments
 (0)