Skip to content

Commit ece200b

Browse files
authored
Merge branch 'main' into theme-meta-info
2 parents e3d10b2 + 6e140b5 commit ece200b

File tree

217 files changed

+5316
-1711
lines changed

Some content is hidden

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

217 files changed

+5316
-1711
lines changed

.eslintrc.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,21 @@ rules:
127127
"@stylistic/js/computed-property-spacing": [2, never]
128128
"@stylistic/js/dot-location": [2, property]
129129
"@stylistic/js/eol-last": [2]
130-
"@stylistic/js/function-call-spacing": [2, never]
131130
"@stylistic/js/function-call-argument-newline": [0]
131+
"@stylistic/js/function-call-spacing": [2, never]
132132
"@stylistic/js/function-paren-newline": [0]
133133
"@stylistic/js/generator-star-spacing": [0]
134134
"@stylistic/js/implicit-arrow-linebreak": [0]
135135
"@stylistic/js/indent": [2, 2, {ignoreComments: true, SwitchCase: 1}]
136136
"@stylistic/js/key-spacing": [2]
137137
"@stylistic/js/keyword-spacing": [2]
138+
"@stylistic/js/line-comment-position": [0]
138139
"@stylistic/js/linebreak-style": [2, unix]
139140
"@stylistic/js/lines-around-comment": [0]
140141
"@stylistic/js/lines-between-class-members": [0]
141142
"@stylistic/js/max-len": [0]
142143
"@stylistic/js/max-statements-per-line": [0]
144+
"@stylistic/js/multiline-comment-style": [0]
143145
"@stylistic/js/multiline-ternary": [0]
144146
"@stylistic/js/new-parens": [2]
145147
"@stylistic/js/newline-per-chained-call": [0]
@@ -705,6 +707,7 @@ rules:
705707
unicorn/better-regex: [0]
706708
unicorn/catch-error-name: [0]
707709
unicorn/consistent-destructuring: [2]
710+
unicorn/consistent-empty-array-spread: [2]
708711
unicorn/consistent-function-scoping: [2]
709712
unicorn/custom-error-definition: [0]
710713
unicorn/empty-brace-spaces: [2]
@@ -731,9 +734,11 @@ rules:
731734
unicorn/no-for-loop: [0]
732735
unicorn/no-hex-escape: [0]
733736
unicorn/no-instanceof-array: [0]
737+
unicorn/no-invalid-fetch-options: [2]
734738
unicorn/no-invalid-remove-event-listener: [2]
735739
unicorn/no-keyword-prefix: [0]
736740
unicorn/no-lonely-if: [2]
741+
unicorn/no-magic-array-flat-depth: [0]
737742
unicorn/no-negated-condition: [0]
738743
unicorn/no-nested-ternary: [0]
739744
unicorn/no-new-array: [0]
@@ -799,10 +804,12 @@ rules:
799804
unicorn/prefer-set-has: [0]
800805
unicorn/prefer-set-size: [2]
801806
unicorn/prefer-spread: [0]
807+
unicorn/prefer-string-raw: [0]
802808
unicorn/prefer-string-replace-all: [0]
803809
unicorn/prefer-string-slice: [0]
804810
unicorn/prefer-string-starts-ends-with: [2]
805811
unicorn/prefer-string-trim-start-end: [2]
812+
unicorn/prefer-structured-clone: [2]
806813
unicorn/prefer-switch: [0]
807814
unicorn/prefer-ternary: [0]
808815
unicorn/prefer-text-content: [2]

.github/workflows/release-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
4949
echo "Cleaned name is ${REF_NAME}"
50-
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
50+
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
5151
- name: configure aws
5252
uses: aws-actions/configure-aws-credentials@v4
5353
with:

.golangci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ run:
2929

3030
output:
3131
sort-results: true
32+
sort-order: [file]
33+
show-stats: true
3234

3335
linters-settings:
3436
stylecheck:
@@ -40,11 +42,7 @@ linters-settings:
4042
- ifElseChain
4143
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
4244
revive:
43-
ignore-generated-header: false
44-
severity: warning
45-
confidence: 0.8
46-
errorCode: 1
47-
warningCode: 1
45+
severity: error
4846
rules:
4947
- name: atomic
5048
- name: bare-return

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -41,7 +41,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
4141
/go/src/code.gitea.io/gitea/environment-to-ini
4242
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4343

44-
FROM docker.io/library/alpine:3.19
44+
FROM docker.io/library/alpine:3.20
4545
LABEL maintainer="[email protected]"
4646

4747
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -39,7 +39,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
3939
/go/src/code.gitea.io/gitea/environment-to-ini
4040
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4141

42-
FROM docker.io/library/alpine:3.19
42+
FROM docker.io/library/alpine:3.20
4343
LABEL maintainer="[email protected]"
4444

4545
EXPOSE 2222 3000

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ifneq ($(GITHUB_REF_TYPE),branch)
8888
GITEA_VERSION ?= $(VERSION)
8989
else
9090
ifneq ($(GITHUB_REF_NAME),)
91-
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
91+
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))-nightly
9292
else
9393
VERSION ?= main
9494
endif

cmd/migrate_storage.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ var CmdMigrateStorage = &cli.Command{
9191
Value: "",
9292
Usage: "Minio checksum algorithm (default/md5)",
9393
},
94+
&cli.StringFlag{
95+
Name: "minio-bucket-lookup-type",
96+
Value: "",
97+
Usage: "Minio bucket lookup type",
98+
},
9499
},
95100
}
96101

@@ -220,6 +225,7 @@ func runMigrateStorage(ctx *cli.Context) error {
220225
UseSSL: ctx.Bool("minio-use-ssl"),
221226
InsecureSkipVerify: ctx.Bool("minio-insecure-skip-verify"),
222227
ChecksumAlgorithm: ctx.String("minio-checksum-algorithm"),
228+
BucketLookUpType: ctx.String("minio-bucket-lookup-type"),
223229
},
224230
})
225231
default:

custom/conf/app.example.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,9 @@ LEVEL = Info
18951895
;;
18961896
;; Minio checksum algorithm: default (for MinIO or AWS S3) or md5 (for Cloudflare or Backblaze)
18971897
;MINIO_CHECKSUM_ALGORITHM = default
1898+
;;
1899+
;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
1900+
;MINIO_BUCKET_LOOKUP_TYPE = auto
18981901

18991902
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19001903
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2033,6 +2036,17 @@ LEVEL = Info
20332036
;; or only create new users if UPDATE_EXISTING is set to false
20342037
;UPDATE_EXISTING = true
20352038

2039+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2040+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2041+
;; Cleanup expired actions assets
2042+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2043+
;[cron.cleanup_actions]
2044+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2045+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2046+
;ENABLED = true
2047+
;RUN_AT_START = true
2048+
;SCHEDULE = @midnight
2049+
20362050
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20372051
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
20382052
;; Clean-up deleted branches
@@ -2576,6 +2590,9 @@ LEVEL = Info
25762590
;;
25772591
;; Minio skip SSL verification available when STORAGE_TYPE is `minio`
25782592
;MINIO_INSECURE_SKIP_VERIFY = false
2593+
;;
2594+
;; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
2595+
;MINIO_BUCKET_LOOKUP_TYPE = auto
25792596

25802597
;[proxy]
25812598
;; Enable the proxy, all requests to external via HTTP will be affected

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ Default templates for project boards:
851851
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when STORAGE_TYPE is `minio`
852852
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
853853
- `MINIO_CHECKSUM_ALGORITHM`: **default**: Minio checksum algorithm: `default` (for MinIO or AWS S3) or `md5` (for Cloudflare or Backblaze)
854+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
854855

855856
## Log (`log`)
856857

@@ -974,12 +975,20 @@ Default templates for project boards:
974975
- `SCHEDULE`: **@midnight** : Interval as a duration between each synchronization, it will always attempt synchronization when the instance starts.
975976
- `UPDATE_EXISTING`: **true**: Create new users, update existing user data and disable users that are not in external source anymore (default) or only create new users if UPDATE_EXISTING is set to false.
976977

977-
## Cron - Cleanup Expired Actions Assets (`cron.cleanup_actions`)
978+
#### Cron - Cleanup Expired Actions Assets (`cron.cleanup_actions`)
978979

979980
- `ENABLED`: **true**: Enable cleanup expired actions assets job.
980981
- `RUN_AT_START`: **true**: Run job at start time (if ENABLED).
981982
- `SCHEDULE`: **@midnight** : Cron syntax for the job.
982983

984+
#### Cron - Cleanup Deleted Branches (`cron.deleted_branches_cleanup`)
985+
986+
- `ENABLED`: **true**: Enable deleted branches cleanup.
987+
- `RUN_AT_START`: **true**: Run job at start time (if ENABLED).
988+
- `NOTICE_ON_SUCCESS`: **false**: Set to true to log a success message.
989+
- `SCHEDULE`: **@midnight**: Cron syntax for scheduling deleted branches cleanup.
990+
- `OLDER_THAN`: **24h**: Branches deleted OLDER_THAN ago will be cleaned up.
991+
983992
### Extended cron tasks (not enabled by default)
984993

985994
#### Cron - Garbage collect all repositories (`cron.git_gc_repos`)
@@ -1272,6 +1281,7 @@ is `data/lfs` and the default of `MINIO_BASE_PATH` is `lfs/`.
12721281
- `MINIO_BASE_PATH`: **lfs/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio`
12731282
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
12741283
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
1284+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
12751285

12761286
## Storage (`storage`)
12771287

@@ -1286,6 +1296,7 @@ Default storage configuration for attachments, lfs, avatars, repo-avatars, repo-
12861296
- `MINIO_LOCATION`: **us-east-1**: Minio location to create bucket only available when `STORAGE_TYPE` is `minio`
12871297
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
12881298
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
1299+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
12891300

12901301
The recommended storage configuration for minio like below:
12911302

@@ -1307,6 +1318,8 @@ MINIO_USE_SSL = false
13071318
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
13081319
MINIO_INSECURE_SKIP_VERIFY = false
13091320
SERVE_DIRECT = true
1321+
; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
1322+
MINIO_BUCKET_LOOKUP_TYPE = auto
13101323
```
13111324

13121325
Defaultly every storage has their default base path like below
@@ -1353,6 +1366,8 @@ MINIO_LOCATION = us-east-1
13531366
MINIO_USE_SSL = false
13541367
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
13551368
MINIO_INSECURE_SKIP_VERIFY = false
1369+
; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
1370+
MINIO_BUCKET_LOOKUP_TYPE = auto
13561371
```
13571372

13581373
## Repository Archive Storage (`storage.repo-archive`)
@@ -1372,6 +1387,7 @@ is `data/repo-archive` and the default of `MINIO_BASE_PATH` is `repo-archive/`.
13721387
- `MINIO_BASE_PATH`: **repo-archive/**: Minio base path on the bucket only available when `STORAGE_TYPE` is `minio`
13731388
- `MINIO_USE_SSL`: **false**: Minio enabled ssl only available when `STORAGE_TYPE` is `minio`
13741389
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio skip SSL verification available when STORAGE_TYPE is `minio`
1390+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
13751391

13761392
## Repository Archives (`repo-archive`)
13771393

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ Gitea 创建以下非唯一队列:
796796
- `MINIO_USE_SSL`: **false**: Minio 启用 SSL,仅当 STORAGE_TYPE 为 `minio` 时可用。
797797
- `MINIO_INSECURE_SKIP_VERIFY`: **false**: Minio 跳过 SSL 验证,仅当 STORAGE_TYPE 为 `minio` 时可用。
798798
- `MINIO_CHECKSUM_ALGORITHM`: **default**: Minio 校验算法:`default`(适用于 MinIO 或 AWS S3)或 `md5`(适用于 Cloudflare 或 Backblaze)
799+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio的bucket查找方式默认为`auto`模式,可将其设置为`dns`(虚拟托管样式)或`path`(路径样式),仅当`STORAGE_TYPE``minio`时可用。
799800

800801
## 日志 (`log`)
801802

@@ -1201,6 +1202,7 @@ ALLOW_DATA_URI_IMAGES = true
12011202
- `MINIO_BASE_PATH`**lfs/**:桶上的 Minio 基本路径,仅在 `STORAGE_TYPE``minio` 时可用。
12021203
- `MINIO_USE_SSL`**false**:Minio 启用 ssl,仅在 `STORAGE_TYPE``minio` 时可用。
12031204
- `MINIO_INSECURE_SKIP_VERIFY`**false**:Minio 跳过 SSL 验证,仅在 `STORAGE_TYPE``minio` 时可用。
1205+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio的bucket查找方式默认为`auto`模式,可将其设置为`dns`(虚拟托管样式)或`path`(路径样式),仅当`STORAGE_TYPE``minio`时可用。
12041206

12051207
## 存储 (`storage`)
12061208

@@ -1215,6 +1217,7 @@ ALLOW_DATA_URI_IMAGES = true
12151217
- `MINIO_LOCATION`**us-east-1**:创建桶的 Minio 位置,仅在 `STORAGE_TYPE``minio` 时可用。
12161218
- `MINIO_USE_SSL`**false**:Minio 启用 ssl,仅在 `STORAGE_TYPE``minio` 时可用。
12171219
- `MINIO_INSECURE_SKIP_VERIFY`**false**:Minio 跳过 SSL 验证,仅在 `STORAGE_TYPE``minio` 时可用。
1220+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio的bucket查找方式默认为`auto`模式,可将其设置为`dns`(虚拟托管样式)或`path`(路径样式),仅当`STORAGE_TYPE``minio`时可用。
12181221

12191222
建议的 minio 存储配置如下:
12201223

@@ -1236,6 +1239,8 @@ MINIO_USE_SSL = false
12361239
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
12371240
MINIO_INSECURE_SKIP_VERIFY = false
12381241
SERVE_DIRECT = true
1242+
; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
1243+
MINIO_BUCKET_LOOKUP_TYPE = auto
12391244
```
12401245

12411246
默认情况下,每个存储都有其默认的基本路径,如下所示:
@@ -1282,6 +1287,8 @@ MINIO_LOCATION = us-east-1
12821287
MINIO_USE_SSL = false
12831288
; Minio skip SSL verification available when STORAGE_TYPE is `minio`
12841289
MINIO_INSECURE_SKIP_VERIFY = false
1290+
; Minio bucket lookup method defaults to auto mode; set it to `dns` for virtual host style or `path` for path style, only available when STORAGE_TYPE is `minio`
1291+
MINIO_BUCKET_LOOKUP_TYPE = auto
12851292
```
12861293

12871294
### 存储库归档存储 (`storage.repo-archive`)
@@ -1299,6 +1306,7 @@ MINIO_INSECURE_SKIP_VERIFY = false
12991306
- `MINIO_BASE_PATH`: **repo-archive/**:存储桶上的Minio基本路径,仅在`STORAGE_TYPE``minio`时可用。
13001307
- `MINIO_USE_SSL`: **false**:启用Minio的SSL,仅在`STORAGE_TYPE``minio`时可用。
13011308
- `MINIO_INSECURE_SKIP_VERIFY`: **false**:跳过Minio的SSL验证,仅在`STORAGE_TYPE``minio`时可用。
1309+
- `MINIO_BUCKET_LOOKUP_TYPE`: **auto**: Minio的bucket查找方式默认为`auto`模式,可将其设置为`dns`(虚拟托管样式)或`path`(路径样式),仅当`STORAGE_TYPE``minio`时可用。
13021310

13031311
### 存储库归档 (`repo-archive`)
13041312

0 commit comments

Comments
 (0)